Debian Codegraph @

comitup_web/templates/js/uikit

raw
1 /*! UIkit 3.7.6 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
2
3 (function (global, factory) {
4 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
5 typeof define === 'function' && define.amd ? define('uikit', factory) :
6 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.UIkit = factory());
7 })(this, (function () { 'use strict';
8
9 var objPrototype = Object.prototype;
10 var hasOwnProperty = objPrototype.hasOwnProperty;
11
12 function hasOwn(obj, key) {
13 return hasOwnProperty.call(obj, key);
14 }
15
16 var hyphenateRe = /\B([A-Z])/g;
17
18 var hyphenate = memoize(function (str) { return str
19 .replace(hyphenateRe, '-$1')
20 .toLowerCase(); }
21 );
22
23 var camelizeRe = /-(\w)/g;
24
25 var camelize = memoize(function (str) { return str.replace(camelizeRe, toUpper); }
26 );
27
28 var ucfirst = memoize(function (str) { return str.length ? toUpper(null, str.charAt(0)) + str.slice(1) : ''; }
29 );
30
31 function toUpper(_, c) {
32 return c ? c.toUpperCase() : '';
33 }
34
35 var strPrototype = String.prototype;
36 var startsWithFn = strPrototype.startsWith || function (search) { return this.lastIndexOf(search, 0) === 0; };
37
38 function startsWith(str, search) {
39 return startsWithFn.call(str, search);
40 }
41
42 var endsWithFn = strPrototype.endsWith || function (search) { return this.substr(-search.length) === search; };
43
44 function endsWith(str, search) {
45 return endsWithFn.call(str, search);
46 }
47
48 var arrPrototype = Array.prototype;
49
50 var includesFn = function (search, i) { return !!~this.indexOf(search, i); };
51 var includesStr = strPrototype.includes || includesFn;
52 var includesArray = arrPrototype.includes || includesFn;
53
54 function includes(obj, search) {
55 return obj && (isString(obj) ? includesStr : includesArray).call(obj, search);
56 }
57
58 var findIndexFn = arrPrototype.findIndex || function (predicate) {
59 var arguments$1 = arguments;
60
61 for (var i = 0; i < this.length; i++) {
62 if (predicate.call(arguments$1[1], this[i], i, this)) {
63 return i;
64 }
65 }
66 return -1;
67 };
68
69 function findIndex(array, predicate) {
70 return findIndexFn.call(array, predicate);
71 }
72
73 var isArray = Array.isArray;
74
75 function isFunction(obj) {
76 return typeof obj === 'function';
77 }
78
79 function isObject(obj) {
80 return obj !== null && typeof obj === 'object';
81 }
82
83 var toString = objPrototype.toString;
84 function isPlainObject(obj) {
85 return toString.call(obj) === '[object Object]';
86 }
87
88 function isWindow(obj) {
89 return isObject(obj) && obj === obj.window;
90 }
91
92 function isDocument(obj) {
93 return nodeType(obj) === 9;
94 }
95
96 function isNode(obj) {
97 return nodeType(obj) >= 1;
98 }
99
100 function isElement(obj) {
101 return nodeType(obj) === 1;
102 }
103
104 function nodeType(obj) {
105 return !isWindow(obj) && isObject(obj) && obj.nodeType;
106 }
107
108 function isBoolean(value) {
109 return typeof value === 'boolean';
110 }
111
112 function isString(value) {
113 return typeof value === 'string';
114 }
115
116 function isNumber(value) {
117 return typeof value === 'number';
118 }
119
120 function isNumeric(value) {
121 return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));
122 }
123
124 function isEmpty(obj) {
125 return !(isArray(obj)
126 ? obj.length
127 : isObject(obj)
128 ? Object.keys(obj).length
129 : false
130 );
131 }
132
133 function isUndefined(value) {
134 return value === void 0;
135 }
136
137 function toBoolean(value) {
138 return isBoolean(value)
139 ? value
140 : value === 'true' || value === '1' || value === ''
141 ? true
142 : value === 'false' || value === '0'
143 ? false
144 : value;
145 }
146
147 function toNumber(value) {
148 var number = Number(value);
149 return !isNaN(number) ? number : false;
150 }
151
152 function toFloat(value) {
153 return parseFloat(value) || 0;
154 }
155
156 var toArray = Array.from || (function (value) { return arrPrototype.slice.call(value); });
157
158 function toNode(element) {
159 return toNodes(element)[0];
160 }
161
162 function toNodes(element) {
163 return element && (isNode(element) ? [element] : toArray(element).filter(isNode)) || [];
164 }
165
166 function toWindow(element) {
167 if (isWindow(element)) {
168 return element;
169 }
170
171 element = toNode(element);
172
173 return element
174 ? (isDocument(element)
175 ? element
176 : element.ownerDocument
177 ).defaultView
178 : window;
179 }
180
181 function toMs(time) {
182 return !time
183 ? 0
184 : endsWith(time, 'ms')
185 ? toFloat(time)
186 : toFloat(time) * 1000;
187 }
188
189 function isEqual(value, other) {
190 return value === other
191 || isObject(value)
192 && isObject(other)
193 && Object.keys(value).length === Object.keys(other).length
194 && each(value, function (val, key) { return val === other[key]; });
195 }
196
197 function swap(value, a, b) {
198 return value.replace(
199 new RegExp((a + "|" + b), 'g'),
200 function (match) { return match === a ? b : a; }
201 );
202 }
203
204 var assign = Object.assign || function (target) {
205 var args = [], len = arguments.length - 1;
206 while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
207
208 target = Object(target);
209 for (var i = 0; i < args.length; i++) {
210 var source = args[i];
211 if (source !== null) {
212 for (var key in source) {
213 if (hasOwn(source, key)) {
214 target[key] = source[key];
215 }
216 }
217 }
218 }
219 return target;
220 };
221
222 function last(array) {
223 return array[array.length - 1];
224 }
225
226 function each(obj, cb) {
227 for (var key in obj) {
228 if (false === cb(obj[key], key)) {
229 return false;
230 }
231 }
232 return true;
233 }
234
235 function sortBy$1(array, prop) {
236 return array.slice().sort(function (ref, ref$1) {
237 var propA = ref[prop]; if ( propA === void 0 ) propA = 0;
238 var propB = ref$1[prop]; if ( propB === void 0 ) propB = 0;
239
240 return propA > propB
241 ? 1
242 : propB > propA
243 ? -1
244 : 0;
245 }
246 );
247 }
248
249 function uniqueBy(array, prop) {
250 var seen = new Set();
251 return array.filter(function (ref) {
252 var check = ref[prop];
253
254 return seen.has(check)
255 ? false
256 : seen.add(check) || true;
257 } // IE 11 does not return the Set object
258 );
259 }
260
261 function clamp(number, min, max) {
262 if ( min === void 0 ) min = 0;
263 if ( max === void 0 ) max = 1;
264
265 return Math.min(Math.max(toNumber(number) || 0, min), max);
266 }
267
268 function noop() {}
269
270 function intersectRect() {
271 var rects = [], len = arguments.length;
272 while ( len-- ) rects[ len ] = arguments[ len ];
273
274 return [['bottom', 'top'], ['right', 'left']].every(function (ref) {
275 var minProp = ref[0];
276 var maxProp = ref[1];
277
278 return Math.min.apply(Math, rects.map(function (ref) {
279 var min = ref[minProp];
280
281 return min;
282 })) - Math.max.apply(Math, rects.map(function (ref) {
283 var max = ref[maxProp];
284
285 return max;
286 })) > 0;
287 }
288 );
289 }
290
291 function pointInRect(point, rect) {
292 return point.x <= rect.right &&
293 point.x >= rect.left &&
294 point.y <= rect.bottom &&
295 point.y >= rect.top;
296 }
297
298 var Dimensions = {
299
300 ratio: function(dimensions, prop, value) {
301 var obj;
302
303
304 var aProp = prop === 'width' ? 'height' : 'width';
305
306 return ( obj = {}, obj[aProp] = dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp], obj[prop] = value, obj );
307 },
308
309 contain: function(dimensions, maxDimensions) {
310 var this$1$1 = this;
311
312 dimensions = assign({}, dimensions);
313
314 each(dimensions, function (_, prop) { return dimensions = dimensions[prop] > maxDimensions[prop]
315 ? this$1$1.ratio(dimensions, prop, maxDimensions[prop])
316 : dimensions; }
317 );
318
319 return dimensions;
320 },
321
322 cover: function(dimensions, maxDimensions) {
323 var this$1$1 = this;
324
325 dimensions = this.contain(dimensions, maxDimensions);
326
327 each(dimensions, function (_, prop) { return dimensions = dimensions[prop] < maxDimensions[prop]
328 ? this$1$1.ratio(dimensions, prop, maxDimensions[prop])
329 : dimensions; }
330 );
331
332 return dimensions;
333 }
334
335 };
336
337 function getIndex(i, elements, current, finite) {
338 if ( current === void 0 ) current = 0;
339 if ( finite === void 0 ) finite = false;
340
341
342 elements = toNodes(elements);
343
344 var length = elements.length;
345
346 i = isNumeric(i)
347 ? toNumber(i)
348 : i === 'next'
349 ? current + 1
350 : i === 'previous'
351 ? current - 1
352 : elements.indexOf(toNode(i));
353
354 if (finite) {
355 return clamp(i, 0, length - 1);
356 }
357
358 i %= length;
359
360 return i < 0 ? i + length : i;
361 }
362
363 function memoize(fn) {
364 var cache = Object.create(null);
365 return function (key) { return cache[key] || (cache[key] = fn(key)); };
366 }
367
368 function attr(element, name, value) {
369
370 if (isObject(name)) {
371 for (var key in name) {
372 attr(element, key, name[key]);
373 }
374 return;
375 }
376
377 if (isUndefined(value)) {
378 element = toNode(element);
379 return element && element.getAttribute(name);
380 } else {
381 toNodes(element).forEach(function (element) {
382
383 if (isFunction(value)) {
384 value = value.call(element, attr(element, name));
385 }
386
387 if (value === null) {
388 removeAttr(element, name);
389 } else {
390 element.setAttribute(name, value);
391 }
392 });
393 }
394
395 }
396
397 function hasAttr(element, name) {
398 return toNodes(element).some(function (element) { return element.hasAttribute(name); });
399 }
400
401 function removeAttr(element, name) {
402 element = toNodes(element);
403 name.split(' ').forEach(function (name) { return element.forEach(function (element) { return element.hasAttribute(name) && element.removeAttribute(name); }
404 ); }
405 );
406 }
407
408 function data(element, attribute) {
409 for (var i = 0, attrs = [attribute, ("data-" + attribute)]; i < attrs.length; i++) {
410 if (hasAttr(element, attrs[i])) {
411 return attr(element, attrs[i]);
412 }
413 }
414 }
415
416 /* global DocumentTouch */
417
418 var inBrowser = typeof window !== 'undefined';
419 var isIE = inBrowser && /msie|trident/i.test(window.navigator.userAgent);
420 var isRtl = inBrowser && attr(document.documentElement, 'dir') === 'rtl';
421
422 var hasTouchEvents = inBrowser && 'ontouchstart' in window;
423 var hasPointerEvents = inBrowser && window.PointerEvent;
424 var hasTouch = inBrowser && (hasTouchEvents
425 || window.DocumentTouch && document instanceof DocumentTouch
426 || navigator.maxTouchPoints); // IE >=11
427
428 var pointerDown = hasPointerEvents ? 'pointerdown' : hasTouchEvents ? 'touchstart' : 'mousedown';
429 var pointerMove = hasPointerEvents ? 'pointermove' : hasTouchEvents ? 'touchmove' : 'mousemove';
430 var pointerUp = hasPointerEvents ? 'pointerup' : hasTouchEvents ? 'touchend' : 'mouseup';
431 var pointerEnter = hasPointerEvents ? 'pointerenter' : hasTouchEvents ? '' : 'mouseenter';
432 var pointerLeave = hasPointerEvents ? 'pointerleave' : hasTouchEvents ? '' : 'mouseleave';
433 var pointerCancel = hasPointerEvents ? 'pointercancel' : 'touchcancel';
434
435 var voidElements = {
436 area: true,
437 base: true,
438 br: true,
439 col: true,
440 embed: true,
441 hr: true,
442 img: true,
443 input: true,
444 keygen: true,
445 link: true,
446 menuitem: true,
447 meta: true,
448 param: true,
449 source: true,
450 track: true,
451 wbr: true
452 };
453 function isVoidElement(element) {
454 return toNodes(element).some(function (element) { return voidElements[element.tagName.toLowerCase()]; });
455 }
456
457 function isVisible(element) {
458 return toNodes(element).some(function (element) { return element.offsetWidth || element.offsetHeight || element.getClientRects().length; });
459 }
460
461 var selInput = 'input,select,textarea,button';
462 function isInput(element) {
463 return toNodes(element).some(function (element) { return matches(element, selInput); });
464 }
465
466 var selFocusable = selInput + ",a[href],[tabindex]";
467 function isFocusable(element) {
468 return matches(element, selFocusable);
469 }
470
471 function parent(element) {
472 element = toNode(element);
473 return element && isElement(element.parentNode) && element.parentNode;
474 }
475
476 function filter$1(element, selector) {
477 return toNodes(element).filter(function (element) { return matches(element, selector); });
478 }
479
480 var elProto = inBrowser ? Element.prototype : {};
481 var matchesFn = elProto.matches || elProto.webkitMatchesSelector || elProto.msMatchesSelector || noop;
482
483 function matches(element, selector) {
484 return toNodes(element).some(function (element) { return matchesFn.call(element, selector); });
485 }
486
487 var closestFn = elProto.closest || function (selector) {
488 var ancestor = this;
489
490 do {
491
492 if (matches(ancestor, selector)) {
493 return ancestor;
494 }
495
496 } while ((ancestor = parent(ancestor)));
497 };
498
499 function closest(element, selector) {
500
501 if (startsWith(selector, '>')) {
502 selector = selector.slice(1);
503 }
504
505 return isElement(element)
506 ? closestFn.call(element, selector)
507 : toNodes(element).map(function (element) { return closest(element, selector); }).filter(Boolean);
508 }
509
510 function within(element, selector) {
511 return !isString(selector)
512 ? element === selector || (isDocument(selector)
513 ? selector.documentElement
514 : toNode(selector)).contains(toNode(element)) // IE 11 document does not implement contains
515 : matches(element, selector) || !!closest(element, selector);
516 }
517
518 function parents(element, selector) {
519 var elements = [];
520
521 while ((element = parent(element))) {
522 if (!selector || matches(element, selector)) {
523 elements.push(element);
524 }
525 }
526
527 return elements;
528 }
529
530 function children(element, selector) {
531 element = toNode(element);
532 var children = element ? toNodes(element.children) : [];
533 return selector ? filter$1(children, selector) : children;
534 }
535
536 function index(element, ref) {
537 return ref
538 ? toNodes(element).indexOf(toNode(ref))
539 : children(parent(element)).indexOf(element);
540 }
541
542 function query(selector, context) {
543 return find(selector, getContext(selector, context));
544 }
545
546 function queryAll(selector, context) {
547 return findAll(selector, getContext(selector, context));
548 }
549
550 function getContext(selector, context) {
551 if ( context === void 0 ) context = document;
552
553 return isString(selector) && isContextSelector(selector) || isDocument(context)
554 ? context
555 : context.ownerDocument;
556 }
557
558 function find(selector, context) {
559 return toNode(_query(selector, context, 'querySelector'));
560 }
561
562 function findAll(selector, context) {
563 return toNodes(_query(selector, context, 'querySelectorAll'));
564 }
565
566 function _query(selector, context, queryFn) {
567 if ( context === void 0 ) context = document;
568
569
570 if (!selector || !isString(selector)) {
571 return selector;
572 }
573
574 selector = selector.replace(contextSanitizeRe, '$1 *');
575
576 if (isContextSelector(selector)) {
577
578 selector = splitSelector(selector).map(function (selector) {
579
580 var ctx = context;
581
582 if (selector[0] === '!') {
583
584 var selectors = selector.substr(1).trim().split(' ');
585 ctx = closest(parent(context), selectors[0]);
586 selector = selectors.slice(1).join(' ').trim();
587
588 }
589
590 if (selector[0] === '-') {
591
592 var selectors$1 = selector.substr(1).trim().split(' ');
593 var prev = (ctx || context).previousElementSibling;
594 ctx = matches(prev, selector.substr(1)) ? prev : null;
595 selector = selectors$1.slice(1).join(' ');
596
597 }
598
599 if (!ctx) {
600 return null;
601 }
602
603 return ((domPath(ctx)) + " " + selector);
604
605 }).filter(Boolean).join(',');
606
607 context = document;
608
609 }
610
611 try {
612
613 return context[queryFn](selector);
614
615 } catch (e) {
616
617 return null;
618
619 }
620
621 }
622
623 var contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
624 var contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
625
626 var isContextSelector = memoize(function (selector) { return selector.match(contextSelectorRe); });
627
628 var selectorRe = /.*?[^\\](?:,|$)/g;
629
630 var splitSelector = memoize(function (selector) { return selector.match(selectorRe).map(function (selector) { return selector.replace(/,$/, '').trim(); }
631 ); }
632 );
633
634 function domPath(element) {
635 var names = [];
636 while (element.parentNode) {
637 if (element.id) {
638 names.unshift(("#" + (escape(element.id))));
639 break;
640 } else {
641 var tagName = element.tagName;
642 if (tagName !== 'HTML') {
643 tagName += ":nth-child(" + (index(element) + 1) + ")";
644 }
645 names.unshift(tagName);
646 element = element.parentNode;
647 }
648 }
649 return names.join(' > ');
650 }
651
652 var escapeFn = inBrowser && window.CSS && CSS.escape || function (css) { return css.replace(/([^\x7f-\uFFFF\w-])/g, function (match) { return ("\\" + match); }); };
653 function escape(css) {
654 return isString(css) ? escapeFn.call(null, css) : '';
655 }
656
657 function on() {
658 var args = [], len = arguments.length;
659 while ( len-- ) args[ len ] = arguments[ len ];
660
661
662 var ref = getArgs(args);
663 var targets = ref[0];
664 var type = ref[1];
665 var selector = ref[2];
666 var listener = ref[3];
667 var useCapture = ref[4];
668
669 targets = toEventTargets(targets);
670
671 if (listener.length > 1) {
672 listener = detail(listener);
673 }
674
675 if (useCapture && useCapture.self) {
676 listener = selfFilter(listener);
677 }
678
679 if (selector) {
680 listener = delegate(selector, listener);
681 }
682
683 useCapture = useCaptureFilter(useCapture);
684
685 type.split(' ').forEach(function (type) { return targets.forEach(function (target) { return target.addEventListener(type, listener, useCapture); }
686 ); }
687 );
688 return function () { return off(targets, type, listener, useCapture); };
689 }
690
691 function off(targets, type, listener, useCapture) {
692 if ( useCapture === void 0 ) useCapture = false;
693
694 useCapture = useCaptureFilter(useCapture);
695 targets = toEventTargets(targets);
696 type.split(' ').forEach(function (type) { return targets.forEach(function (target) { return target.removeEventListener(type, listener, useCapture); }
697 ); }
698 );
699 }
700
701 function once() {
702 var args = [], len = arguments.length;
703 while ( len-- ) args[ len ] = arguments[ len ];
704
705
706 var ref = getArgs(args);
707 var element = ref[0];
708 var type = ref[1];
709 var selector = ref[2];
710 var listener = ref[3];
711 var useCapture = ref[4];
712 var condition = ref[5];
713 var off = on(element, type, selector, function (e) {
714 var result = !condition || condition(e);
715 if (result) {
716 off();
717 listener(e, result);
718 }
719 }, useCapture);
720
721 return off;
722 }
723
724 function trigger(targets, event, detail) {
725 return toEventTargets(targets).reduce(function (notCanceled, target) { return notCanceled && target.dispatchEvent(createEvent(event, true, true, detail)); }
726 , true);
727 }
728
729 function createEvent(e, bubbles, cancelable, detail) {
730 if ( bubbles === void 0 ) bubbles = true;
731 if ( cancelable === void 0 ) cancelable = false;
732
733 if (isString(e)) {
734 var event = document.createEvent('CustomEvent'); // IE 11
735 event.initCustomEvent(e, bubbles, cancelable, detail);
736 e = event;
737 }
738
739 return e;
740 }
741
742 function getArgs(args) {
743 if (isFunction(args[2])) {
744 args.splice(2, 0, false);
745 }
746 return args;
747 }
748
749 function delegate(selector, listener) {
750 var this$1$1 = this;
751
752 return function (e) {
753
754 var current = selector[0] === '>'
755 ? findAll(selector, e.currentTarget).reverse().filter(function (element) { return within(e.target, element); })[0]
756 : closest(e.target, selector);
757
758 if (current) {
759 e.current = current;
760 listener.call(this$1$1, e);
761 }
762
763 };
764 }
765
766 function detail(listener) {
767 return function (e) { return isArray(e.detail) ? listener.apply(void 0, [ e ].concat( e.detail )) : listener(e); };
768 }
769
770 function selfFilter(listener) {
771 return function (e) {
772 if (e.target === e.currentTarget || e.target === e.current) {
773 return listener.call(null, e);
774 }
775 };
776 }
777
778 function useCaptureFilter(options) {
779 return options && isIE && !isBoolean(options)
780 ? !!options.capture
781 : options;
782 }
783
784 function isEventTarget(target) {
785 return target && 'addEventListener' in target;
786 }
787
788 function toEventTarget(target) {
789 return isEventTarget(target) ? target : toNode(target);
790 }
791
792 function toEventTargets(target) {
793 return isArray(target)
794 ? target.map(toEventTarget).filter(Boolean)
795 : isString(target)
796 ? findAll(target)
797 : isEventTarget(target)
798 ? [target]
799 : toNodes(target);
800 }
801
802 function isTouch(e) {
803 return e.pointerType === 'touch' || !!e.touches;
804 }
805
806 function getEventPos(e) {
807 var touches = e.touches;
808 var changedTouches = e.changedTouches;
809 var ref = touches && touches[0] || changedTouches && changedTouches[0] || e;
810 var x = ref.clientX;
811 var y = ref.clientY;
812
813 return {x: x, y: y};
814 }
815
816 /* global setImmediate */
817
818 var Promise$1 = inBrowser && window.Promise || PromiseFn;
819
820 var Deferred = function() {
821 var this$1$1 = this;
822
823 this.promise = new Promise$1(function (resolve, reject) {
824 this$1$1.reject = reject;
825 this$1$1.resolve = resolve;
826 });
827 };
828
829 /**
830 * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
831 */
832
833 var RESOLVED = 0;
834 var REJECTED = 1;
835 var PENDING = 2;
836
837 var async = inBrowser && window.setImmediate || setTimeout;
838
839 function PromiseFn(executor) {
840
841 this.state = PENDING;
842 this.value = undefined;
843 this.deferred = [];
844
845 var promise = this;
846
847 try {
848 executor(
849 function (x) {
850 promise.resolve(x);
851 },
852 function (r) {
853 promise.reject(r);
854 }
855 );
856 } catch (e) {
857 promise.reject(e);
858 }
859 }
860
861 PromiseFn.reject = function (r) {
862 return new PromiseFn(function (resolve, reject) {
863 reject(r);
864 });
865 };
866
867 PromiseFn.resolve = function (x) {
868 return new PromiseFn(function (resolve, reject) {
869 resolve(x);
870 });
871 };
872
873 PromiseFn.all = function all(iterable) {
874 return new PromiseFn(function (resolve, reject) {
875 var result = [];
876 var count = 0;
877
878 if (iterable.length === 0) {
879 resolve(result);
880 }
881
882 function resolver(i) {
883 return function (x) {
884 result[i] = x;
885 count += 1;
886
887 if (count === iterable.length) {
888 resolve(result);
889 }
890 };
891 }
892
893 for (var i = 0; i < iterable.length; i += 1) {
894 PromiseFn.resolve(iterable[i]).then(resolver(i), reject);
895 }
896 });
897 };
898
899 PromiseFn.race = function race(iterable) {
900 return new PromiseFn(function (resolve, reject) {
901 for (var i = 0; i < iterable.length; i += 1) {
902 PromiseFn.resolve(iterable[i]).then(resolve, reject);
903 }
904 });
905 };
906
907 var p = PromiseFn.prototype;
908
909 p.resolve = function resolve(x) {
910 var promise = this;
911
912 if (promise.state === PENDING) {
913 if (x === promise) {
914 throw new TypeError('Promise settled with itself.');
915 }
916
917 var called = false;
918
919 try {
920 var then = x && x.then;
921
922 if (x !== null && isObject(x) && isFunction(then)) {
923 then.call(
924 x,
925 function (x) {
926 if (!called) {
927 promise.resolve(x);
928 }
929 called = true;
930 },
931 function (r) {
932 if (!called) {
933 promise.reject(r);
934 }
935 called = true;
936 }
937 );
938 return;
939 }
940 } catch (e) {
941 if (!called) {
942 promise.reject(e);
943 }
944 return;
945 }
946
947 promise.state = RESOLVED;
948 promise.value = x;
949 promise.notify();
950 }
951 };
952
953 p.reject = function reject(reason) {
954 var promise = this;
955
956 if (promise.state === PENDING) {
957 if (reason === promise) {
958 throw new TypeError('Promise settled with itself.');
959 }
960
961 promise.state = REJECTED;
962 promise.value = reason;
963 promise.notify();
964 }
965 };
966
967 p.notify = function notify() {
968 var this$1$1 = this;
969
970 async(function () {
971 if (this$1$1.state !== PENDING) {
972 while (this$1$1.deferred.length) {
973 var ref = this$1$1.deferred.shift();
974 var onResolved = ref[0];
975 var onRejected = ref[1];
976 var resolve = ref[2];
977 var reject = ref[3];
978
979 try {
980 if (this$1$1.state === RESOLVED) {
981 if (isFunction(onResolved)) {
982 resolve(onResolved.call(undefined, this$1$1.value));
983 } else {
984 resolve(this$1$1.value);
985 }
986 } else if (this$1$1.state === REJECTED) {
987 if (isFunction(onRejected)) {
988 resolve(onRejected.call(undefined, this$1$1.value));
989 } else {
990 reject(this$1$1.value);
991 }
992 }
993 } catch (e) {
994 reject(e);
995 }
996 }
997 }
998 });
999 };
1000
1001 p.then = function then(onResolved, onRejected) {
1002 var this$1$1 = this;
1003
1004 return new PromiseFn(function (resolve, reject) {
1005 this$1$1.deferred.push([onResolved, onRejected, resolve, reject]);
1006 this$1$1.notify();
1007 });
1008 };
1009
1010 p.catch = function (onRejected) {
1011 return this.then(undefined, onRejected);
1012 };
1013
1014 function ajax(url, options) {
1015
1016 var env = assign({
1017 data: null,
1018 method: 'GET',
1019 headers: {},
1020 xhr: new XMLHttpRequest(),
1021 beforeSend: noop,
1022 responseType: ''
1023 }, options);
1024
1025 return Promise$1.resolve()
1026 .then(function () { return env.beforeSend(env); })
1027 .then(function () { return send(url, env); });
1028 }
1029
1030 function send(url, env) {
1031 return new Promise$1(function (resolve, reject) {
1032 var xhr = env.xhr;
1033
1034 for (var prop in env) {
1035 if (prop in xhr) {
1036 try {
1037
1038 xhr[prop] = env[prop];
1039
1040 } catch (e) {}
1041 }
1042 }
1043
1044 xhr.open(env.method.toUpperCase(), url);
1045
1046 for (var header in env.headers) {
1047 xhr.setRequestHeader(header, env.headers[header]);
1048 }
1049
1050 on(xhr, 'load', function () {
1051
1052 if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
1053
1054 // IE 11 does not support responseType 'json'
1055 if (env.responseType === 'json' && isString(xhr.response)) {
1056 xhr = assign(copyXhr(xhr), {response: JSON.parse(xhr.response)});
1057 }
1058
1059 resolve(xhr);
1060
1061 } else {
1062 reject(assign(Error(xhr.statusText), {
1063 xhr: xhr,
1064 status: xhr.status
1065 }));
1066 }
1067
1068 });
1069
1070 on(xhr, 'error', function () { return reject(assign(Error('Network Error'), {xhr: xhr})); });
1071 on(xhr, 'timeout', function () { return reject(assign(Error('Network Timeout'), {xhr: xhr})); });
1072
1073 xhr.send(env.data);
1074 });
1075 }
1076
1077 function getImage(src, srcset, sizes) {
1078
1079 return new Promise$1(function (resolve, reject) {
1080 var img = new Image();
1081
1082 img.onerror = function (e) { return reject(e); };
1083 img.onload = function () { return resolve(img); };
1084
1085 sizes && (img.sizes = sizes);
1086 srcset && (img.srcset = srcset);
1087 img.src = src;
1088 });
1089
1090 }
1091
1092 function copyXhr(source) {
1093 var target = {};
1094 for (var key in source) {
1095 target[key] = source[key];
1096 }
1097 return target;
1098 }
1099
1100 function ready(fn) {
1101
1102 if (document.readyState !== 'loading') {
1103 fn();
1104 return;
1105 }
1106
1107 var unbind = on(document, 'DOMContentLoaded', function () {
1108 unbind();
1109 fn();
1110 });
1111 }
1112
1113 function empty(element) {
1114 element = $(element);
1115 element.innerHTML = '';
1116 return element;
1117 }
1118
1119 function html(parent, html) {
1120 parent = $(parent);
1121 return isUndefined(html)
1122 ? parent.innerHTML
1123 : append(parent.hasChildNodes() ? empty(parent) : parent, html);
1124 }
1125
1126 function prepend(parent, element) {
1127
1128 parent = $(parent);
1129
1130 if (!parent.hasChildNodes()) {
1131 return append(parent, element);
1132 } else {
1133 return insertNodes(element, function (element) { return parent.insertBefore(element, parent.firstChild); });
1134 }
1135 }
1136
1137 function append(parent, element) {
1138 parent = $(parent);
1139 return insertNodes(element, function (element) { return parent.appendChild(element); });
1140 }
1141
1142 function before(ref, element) {
1143 ref = $(ref);
1144 return insertNodes(element, function (element) { return ref.parentNode.insertBefore(element, ref); });
1145 }
1146
1147 function after(ref, element) {
1148 ref = $(ref);
1149 return insertNodes(element, function (element) { return ref.nextSibling
1150 ? before(ref.nextSibling, element)
1151 : append(ref.parentNode, element); }
1152 );
1153 }
1154
1155 function insertNodes(element, fn) {
1156 element = isString(element) ? fragment(element) : element;
1157 return element
1158 ? 'length' in element
1159 ? toNodes(element).map(fn)
1160 : fn(element)
1161 : null;
1162 }
1163
1164 function remove$1(element) {
1165 toNodes(element).forEach(function (element) { return element.parentNode && element.parentNode.removeChild(element); });
1166 }
1167
1168 function wrapAll(element, structure) {
1169
1170 structure = toNode(before(element, structure));
1171
1172 while (structure.firstChild) {
1173 structure = structure.firstChild;
1174 }
1175
1176 append(structure, element);
1177
1178 return structure;
1179 }
1180
1181 function wrapInner(element, structure) {
1182 return toNodes(toNodes(element).map(function (element) { return element.hasChildNodes ? wrapAll(toNodes(element.childNodes), structure) : append(element, structure); }
1183 ));
1184 }
1185
1186 function unwrap(element) {
1187 toNodes(element)
1188 .map(parent)
1189 .filter(function (value, index, self) { return self.indexOf(value) === index; })
1190 .forEach(function (parent) {
1191 before(parent, parent.childNodes);
1192 remove$1(parent);
1193 });
1194 }
1195
1196 var fragmentRe = /^\s*<(\w+|!)[^>]*>/;
1197 var singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
1198
1199 function fragment(html) {
1200
1201 var matches = singleTagRe.exec(html);
1202 if (matches) {
1203 return document.createElement(matches[1]);
1204 }
1205
1206 var container = document.createElement('div');
1207 if (fragmentRe.test(html)) {
1208 container.insertAdjacentHTML('beforeend', html.trim());
1209 } else {
1210 container.textContent = html;
1211 }
1212
1213 return container.childNodes.length > 1 ? toNodes(container.childNodes) : container.firstChild;
1214
1215 }
1216
1217 function apply$1(node, fn) {
1218
1219 if (!isElement(node)) {
1220 return;
1221 }
1222
1223 fn(node);
1224 node = node.firstElementChild;
1225 while (node) {
1226 var next = node.nextElementSibling;
1227 apply$1(node, fn);
1228 node = next;
1229 }
1230 }
1231
1232 function $(selector, context) {
1233 return isHtml(selector)
1234 ? toNode(fragment(selector))
1235 : find(selector, context);
1236 }
1237
1238 function $$(selector, context) {
1239 return isHtml(selector)
1240 ? toNodes(fragment(selector))
1241 : findAll(selector, context);
1242 }
1243
1244 function isHtml(str) {
1245 return isString(str) && (str[0] === '<' || str.match(/^\s*</));
1246 }
1247
1248 function addClass(element) {
1249 var args = [], len = arguments.length - 1;
1250 while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
1251
1252 apply(element, args, 'add');
1253 }
1254
1255 function removeClass(element) {
1256 var args = [], len = arguments.length - 1;
1257 while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
1258
1259 apply(element, args, 'remove');
1260 }
1261
1262 function removeClasses(element, cls) {
1263 attr(element, 'class', function (value) { return (value || '').replace(new RegExp(("\\b" + cls + "\\b"), 'g'), ''); });
1264 }
1265
1266 function replaceClass(element) {
1267 var args = [], len = arguments.length - 1;
1268 while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ];
1269
1270 args[0] && removeClass(element, args[0]);
1271 args[1] && addClass(element, args[1]);
1272 }
1273
1274 function hasClass(element, cls) {
1275 var assign;
1276
1277 (assign = getClasses(cls), cls = assign[0]);
1278 var nodes = toNodes(element);
1279 for (var n = 0; n < nodes.length; n++) {
1280 if (cls && nodes[n].classList.contains(cls)) {
1281 return true;
1282 }
1283 }
1284 return false;
1285 }
1286
1287 function toggleClass(element, cls, force) {
1288
1289 cls = getClasses(cls);
1290
1291 var nodes = toNodes(element);
1292 for (var n = 0; n < nodes.length; n++) {
1293 var list = nodes[n].classList;
1294 for (var i = 0; i < cls.length; i++) {
1295 if (isUndefined(force)) {
1296 list.toggle(cls[i]);
1297 } else if (supports.Force) {
1298 list.toggle(cls[i], !!force);
1299 } else {
1300 list[force ? 'add' : 'remove'](cls[i]);
1301 }
1302 }
1303 }
1304 }
1305
1306 function apply(element, args, fn) {
1307 var ref;
1308
1309
1310 args = args.reduce(function (args, arg) { return args.concat(getClasses(arg)); }, []);
1311
1312 var nodes = toNodes(element);
1313 var loop = function ( n ) {
1314 if (supports.Multiple) {
1315 (ref = nodes[n].classList)[fn].apply(ref, args);
1316 } else {
1317 args.forEach(function (cls) { return nodes[n].classList[fn](cls); });
1318 }
1319 };
1320
1321 for (var n = 0; n < nodes.length; n++) loop( n );
1322 }
1323
1324 function getClasses(str) {
1325 return String(str).split(/\s|,/).filter(Boolean);
1326 }
1327
1328 // IE 11
1329 var supports = {
1330
1331 get Multiple() {
1332 return this.get('Multiple');
1333 },
1334
1335 get Force() {
1336 return this.get('Force');
1337 },
1338
1339 get: function(key) {
1340
1341 var ref = document.createElement('_');
1342 var classList = ref.classList;
1343 classList.add('a', 'b');
1344 classList.toggle('c', false);
1345 supports = {
1346 Multiple: classList.contains('b'),
1347 Force: !classList.contains('c')
1348 };
1349
1350 return supports[key];
1351 }
1352
1353 };
1354
1355 var cssNumber = {
1356 'animation-iteration-count': true,
1357 'column-count': true,
1358 'fill-opacity': true,
1359 'flex-grow': true,
1360 'flex-shrink': true,
1361 'font-weight': true,
1362 'line-height': true,
1363 'opacity': true,
1364 'order': true,
1365 'orphans': true,
1366 'stroke-dasharray': true,
1367 'stroke-dashoffset': true,
1368 'widows': true,
1369 'z-index': true,
1370 'zoom': true
1371 };
1372
1373 function css(element, property, value, priority) {
1374 if ( priority === void 0 ) priority = '';
1375
1376
1377 return toNodes(element).map(function (element) {
1378
1379 if (isString(property)) {
1380
1381 property = propName(property);
1382
1383 if (isUndefined(value)) {
1384 return getStyle(element, property);
1385 } else if (!value && !isNumber(value)) {
1386 element.style.removeProperty(property);
1387 } else {
1388 element.style.setProperty(property, isNumeric(value) && !cssNumber[property] ? (value + "px") : value, priority);
1389 }
1390
1391 } else if (isArray(property)) {
1392
1393 var styles = getStyles(element);
1394
1395 return property.reduce(function (props, property) {
1396 props[property] = styles[propName(property)];
1397 return props;
1398 }, {});
1399
1400 } else if (isObject(property)) {
1401 priority = value;
1402 each(property, function (value, property) { return css(element, property, value, priority); });
1403 }
1404
1405 return element;
1406
1407 })[0];
1408
1409 }
1410
1411 function getStyles(element, pseudoElt) {
1412 return toWindow(element).getComputedStyle(element, pseudoElt);
1413 }
1414
1415 function getStyle(element, property, pseudoElt) {
1416 return getStyles(element, pseudoElt)[property];
1417 }
1418
1419 var parseCssVar = memoize(function (name) {
1420 /* usage in css: .uk-name:before { content:"xyz" } */
1421
1422 var element = append(document.documentElement, document.createElement('div'));
1423
1424 addClass(element, ("uk-" + name));
1425
1426 name = getStyle(element, 'content', ':before').replace(/^["'](.*)["']$/, '$1');
1427
1428 remove$1(element);
1429
1430 return name;
1431 });
1432
1433 function getCssVar(name) {
1434 return !isIE
1435 ? getStyles(document.documentElement).getPropertyValue(("--uk-" + name))
1436 : parseCssVar(name);
1437 }
1438
1439 // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
1440 var propName = memoize(function (name) { return vendorPropName(name); });
1441
1442 var cssPrefixes = ['webkit', 'moz', 'ms'];
1443
1444 function vendorPropName(name) {
1445
1446 name = hyphenate(name);
1447
1448 var ref = document.documentElement;
1449 var style = ref.style;
1450
1451 if (name in style) {
1452 return name;
1453 }
1454
1455 var i = cssPrefixes.length, prefixedName;
1456
1457 while (i--) {
1458 prefixedName = "-" + (cssPrefixes[i]) + "-" + name;
1459 if (prefixedName in style) {
1460 return prefixedName;
1461 }
1462 }
1463 }
1464
1465 function transition(element, props, duration, timing) {
1466 if ( duration === void 0 ) duration = 400;
1467 if ( timing === void 0 ) timing = 'linear';
1468
1469
1470 return Promise$1.all(toNodes(element).map(function (element) { return new Promise$1(function (resolve, reject) {
1471
1472 for (var name in props) {
1473 var value = css(element, name);
1474 if (value === '') {
1475 css(element, name, value);
1476 }
1477 }
1478
1479 var timer = setTimeout(function () { return trigger(element, 'transitionend'); }, duration);
1480
1481 once(element, 'transitionend transitioncanceled', function (ref) {
1482 var type = ref.type;
1483
1484 clearTimeout(timer);
1485 removeClass(element, 'uk-transition');
1486 css(element, {
1487 transitionProperty: '',
1488 transitionDuration: '',
1489 transitionTimingFunction: ''
1490 });
1491 type === 'transitioncanceled' ? reject() : resolve(element);
1492 }, {self: true});
1493
1494 addClass(element, 'uk-transition');
1495 css(element, assign({
1496 transitionProperty: Object.keys(props).map(propName).join(','),
1497 transitionDuration: (duration + "ms"),
1498 transitionTimingFunction: timing
1499 }, props));
1500
1501 }); }
1502 ));
1503
1504 }
1505
1506 var Transition = {
1507
1508 start: transition,
1509
1510 stop: function(element) {
1511 trigger(element, 'transitionend');
1512 return Promise$1.resolve();
1513 },
1514
1515 cancel: function(element) {
1516 trigger(element, 'transitioncanceled');
1517 },
1518
1519 inProgress: function(element) {
1520 return hasClass(element, 'uk-transition');
1521 }
1522
1523 };
1524
1525 var animationPrefix = 'uk-animation-';
1526
1527 function animate$1(element, animation, duration, origin, out) {
1528 if ( duration === void 0 ) duration = 200;
1529
1530
1531 return Promise$1.all(toNodes(element).map(function (element) { return new Promise$1(function (resolve, reject) {
1532
1533 trigger(element, 'animationcanceled');
1534 var timer = setTimeout(function () { return trigger(element, 'animationend'); }, duration);
1535
1536 once(element, 'animationend animationcanceled', function (ref) {
1537 var type = ref.type;
1538
1539
1540 clearTimeout(timer);
1541
1542 type === 'animationcanceled' ? reject() : resolve(element);
1543
1544 css(element, 'animationDuration', '');
1545 removeClasses(element, (animationPrefix + "\\S*"));
1546
1547 }, {self: true});
1548
1549 css(element, 'animationDuration', (duration + "ms"));
1550 addClass(element, animation, animationPrefix + (out ? 'leave' : 'enter'));
1551
1552 if (startsWith(animation, animationPrefix)) {
1553 origin && addClass(element, ("uk-transform-origin-" + origin));
1554 out && addClass(element, (animationPrefix + "reverse"));
1555 }
1556
1557 }); }
1558 ));
1559
1560 }
1561
1562 var inProgress = new RegExp((animationPrefix + "(enter|leave)"));
1563 var Animation = {
1564
1565 in: animate$1,
1566
1567 out: function(element, animation, duration, origin) {
1568 return animate$1(element, animation, duration, origin, true);
1569 },
1570
1571 inProgress: function(element) {
1572 return inProgress.test(attr(element, 'class'));
1573 },
1574
1575 cancel: function(element) {
1576 trigger(element, 'animationcanceled');
1577 }
1578
1579 };
1580
1581 var dirs$1 = {
1582 width: ['left', 'right'],
1583 height: ['top', 'bottom']
1584 };
1585
1586 function dimensions(element) {
1587
1588 var rect = isElement(element)
1589 ? toNode(element).getBoundingClientRect()
1590 : {height: height(element), width: width(element), top: 0, left: 0};
1591
1592 return {
1593 height: rect.height,
1594 width: rect.width,
1595 top: rect.top,
1596 left: rect.left,
1597 bottom: rect.top + rect.height,
1598 right: rect.left + rect.width
1599 };
1600 }
1601
1602 function offset(element, coordinates) {
1603
1604 var currentOffset = dimensions(element);
1605 var ref = toWindow(element);
1606 var pageYOffset = ref.pageYOffset;
1607 var pageXOffset = ref.pageXOffset;
1608 var offsetBy = {height: pageYOffset, width: pageXOffset};
1609
1610 for (var dir in dirs$1) {
1611 for (var i in dirs$1[dir]) {
1612 currentOffset[dirs$1[dir][i]] += offsetBy[dir];
1613 }
1614 }
1615
1616 if (!coordinates) {
1617 return currentOffset;
1618 }
1619
1620 var pos = css(element, 'position');
1621
1622 each(css(element, ['left', 'top']), function (value, prop) { return css(element, prop, coordinates[prop]
1623 - currentOffset[prop]
1624 + toFloat(pos === 'absolute' && value === 'auto'
1625 ? position(element)[prop]
1626 : value)
1627 ); }
1628 );
1629 }
1630
1631 function position(element) {
1632
1633 var ref = offset(element);
1634 var top = ref.top;
1635 var left = ref.left;
1636
1637 var ref$1 = toNode(element);
1638 var ref$1_ownerDocument = ref$1.ownerDocument;
1639 var body = ref$1_ownerDocument.body;
1640 var documentElement = ref$1_ownerDocument.documentElement;
1641 var offsetParent = ref$1.offsetParent;
1642 var parent = offsetParent || documentElement;
1643
1644 while (parent && (parent === body || parent === documentElement) && css(parent, 'position') === 'static') {
1645 parent = parent.parentNode;
1646 }
1647
1648 if (isElement(parent)) {
1649 var parentOffset = offset(parent);
1650 top -= parentOffset.top + toFloat(css(parent, 'borderTopWidth'));
1651 left -= parentOffset.left + toFloat(css(parent, 'borderLeftWidth'));
1652 }
1653
1654 return {
1655 top: top - toFloat(css(element, 'marginTop')),
1656 left: left - toFloat(css(element, 'marginLeft'))
1657 };
1658 }
1659
1660 function offsetPosition(element) {
1661 var offset = [0, 0];
1662
1663 element = toNode(element);
1664
1665 do {
1666
1667 offset[0] += element.offsetTop;
1668 offset[1] += element.offsetLeft;
1669
1670 if (css(element, 'position') === 'fixed') {
1671 var win = toWindow(element);
1672 offset[0] += win.pageYOffset;
1673 offset[1] += win.pageXOffset;
1674 return offset;
1675 }
1676
1677 } while ((element = element.offsetParent));
1678
1679 return offset;
1680 }
1681
1682 var height = dimension('height');
1683 var width = dimension('width');
1684
1685 function dimension(prop) {
1686 var propName = ucfirst(prop);
1687 return function (element, value) {
1688
1689 if (isUndefined(value)) {
1690
1691 if (isWindow(element)) {
1692 return element[("inner" + propName)];
1693 }
1694
1695 if (isDocument(element)) {
1696 var doc = element.documentElement;
1697 return Math.max(doc[("offset" + propName)], doc[("scroll" + propName)]);
1698 }
1699
1700 element = toNode(element);
1701
1702 value = css(element, prop);
1703 value = value === 'auto' ? element[("offset" + propName)] : toFloat(value) || 0;
1704
1705 return value - boxModelAdjust(element, prop);
1706
1707 } else {
1708
1709 return css(element, prop, !value && value !== 0
1710 ? ''
1711 : +value + boxModelAdjust(element, prop) + 'px'
1712 );
1713
1714 }
1715
1716 };
1717 }
1718
1719 function boxModelAdjust(element, prop, sizing) {
1720 if ( sizing === void 0 ) sizing = 'border-box';
1721
1722 return css(element, 'boxSizing') === sizing
1723 ? dirs$1[prop].map(ucfirst).reduce(function (value, prop) { return value
1724 + toFloat(css(element, ("padding" + prop)))
1725 + toFloat(css(element, ("border" + prop + "Width"))); }
1726 , 0)
1727 : 0;
1728 }
1729
1730 function flipPosition(pos) {
1731 for (var dir in dirs$1) {
1732 for (var i in dirs$1[dir]) {
1733 if (dirs$1[dir][i] === pos) {
1734 return dirs$1[dir][1 - i];
1735 }
1736 }
1737 }
1738 return pos;
1739 }
1740
1741 function toPx(value, property, element) {
1742 if ( property === void 0 ) property = 'width';
1743 if ( element === void 0 ) element = window;
1744
1745 return isNumeric(value)
1746 ? +value
1747 : endsWith(value, 'vh')
1748 ? percent(height(toWindow(element)), value)
1749 : endsWith(value, 'vw')
1750 ? percent(width(toWindow(element)), value)
1751 : endsWith(value, '%')
1752 ? percent(dimensions(element)[property], value)
1753 : toFloat(value);
1754 }
1755
1756 function percent(base, value) {
1757 return base * toFloat(value) / 100;
1758 }
1759
1760 /*
1761 Based on:
1762 Copyright (c) 2016 Wilson Page [email protected]
1763 https://github.com/wilsonpage/fastdom
1764 */
1765
1766 var fastdom = {
1767
1768 reads: [],
1769 writes: [],
1770
1771 read: function(task) {
1772 this.reads.push(task);
1773 scheduleFlush();
1774 return task;
1775 },
1776
1777 write: function(task) {
1778 this.writes.push(task);
1779 scheduleFlush();
1780 return task;
1781 },
1782
1783 clear: function(task) {
1784 remove(this.reads, task);
1785 remove(this.writes, task);
1786 },
1787
1788 flush: flush
1789
1790 };
1791
1792 function flush(recursion) {
1793 if ( recursion === void 0 ) recursion = 1;
1794
1795 runTasks(fastdom.reads);
1796 runTasks(fastdom.writes.splice(0));
1797
1798 fastdom.scheduled = false;
1799
1800 if (fastdom.reads.length || fastdom.writes.length) {
1801 scheduleFlush(recursion + 1);
1802 }
1803 }
1804
1805 var RECURSION_LIMIT = 4;
1806 function scheduleFlush(recursion) {
1807
1808 if (fastdom.scheduled) {
1809 return;
1810 }
1811
1812 fastdom.scheduled = true;
1813 if (recursion && recursion < RECURSION_LIMIT) {
1814 Promise$1.resolve().then(function () { return flush(recursion); });
1815 } else {
1816 requestAnimationFrame(function () { return flush(); });
1817 }
1818
1819 }
1820
1821 function runTasks(tasks) {
1822 var task;
1823 while ((task = tasks.shift())) {
1824 try {
1825 task();
1826 } catch (e) {
1827 console.error(e);
1828 }
1829 }
1830 }
1831
1832 function remove(array, item) {
1833 var index = array.indexOf(item);
1834 return ~index && array.splice(index, 1);
1835 }
1836
1837 function MouseTracker() {}
1838
1839 MouseTracker.prototype = {
1840
1841 positions: [],
1842
1843 init: function() {
1844 var this$1$1 = this;
1845
1846
1847 this.positions = [];
1848
1849 var position;
1850 this.unbind = on(document, 'mousemove', function (e) { return position = getEventPos(e); });
1851 this.interval = setInterval(function () {
1852
1853 if (!position) {
1854 return;
1855 }
1856
1857 this$1$1.positions.push(position);
1858
1859 if (this$1$1.positions.length > 5) {
1860 this$1$1.positions.shift();
1861 }
1862 }, 50);
1863
1864 },
1865
1866 cancel: function() {
1867 this.unbind && this.unbind();
1868 this.interval && clearInterval(this.interval);
1869 },
1870
1871 movesTo: function(target) {
1872
1873 if (this.positions.length < 2) {
1874 return false;
1875 }
1876
1877 var p = target.getBoundingClientRect();
1878 var left = p.left;
1879 var right = p.right;
1880 var top = p.top;
1881 var bottom = p.bottom;
1882
1883 var ref = this.positions;
1884 var prevPosition = ref[0];
1885 var position = last(this.positions);
1886 var path = [prevPosition, position];
1887
1888 if (pointInRect(position, p)) {
1889 return false;
1890 }
1891
1892 var diagonals = [[{x: left, y: top}, {x: right, y: bottom}], [{x: left, y: bottom}, {x: right, y: top}]];
1893
1894 return diagonals.some(function (diagonal) {
1895 var intersection = intersect(path, diagonal);
1896 return intersection && pointInRect(intersection, p);
1897 });
1898 }
1899
1900 };
1901
1902 // Inspired by http://paulbourke.net/geometry/pointlineplane/
1903 function intersect(ref, ref$1) {
1904 var ref_0 = ref[0];
1905 var x1 = ref_0.x;
1906 var y1 = ref_0.y;
1907 var ref_1 = ref[1];
1908 var x2 = ref_1.x;
1909 var y2 = ref_1.y;
1910 var ref$1_0 = ref$1[0];
1911 var x3 = ref$1_0.x;
1912 var y3 = ref$1_0.y;
1913 var ref$1_1 = ref$1[1];
1914 var x4 = ref$1_1.x;
1915 var y4 = ref$1_1.y;
1916
1917
1918 var denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
1919
1920 // Lines are parallel
1921 if (denominator === 0) {
1922 return false;
1923 }
1924
1925 var ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;
1926
1927 if (ua < 0) {
1928 return false;
1929 }
1930
1931 // Return an object with the x and y coordinates of the intersection
1932 return {x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1)};
1933 }
1934
1935 var strats = {};
1936
1937 strats.events =
1938 strats.created =
1939 strats.beforeConnect =
1940 strats.connected =
1941 strats.beforeDisconnect =
1942 strats.disconnected =
1943 strats.destroy = concatStrat;
1944
1945 // args strategy
1946 strats.args = function (parentVal, childVal) {
1947 return childVal !== false && concatStrat(childVal || parentVal);
1948 };
1949
1950 // update strategy
1951 strats.update = function (parentVal, childVal) {
1952 return sortBy$1(concatStrat(parentVal, isFunction(childVal) ? {read: childVal} : childVal), 'order');
1953 };
1954
1955 // property strategy
1956 strats.props = function (parentVal, childVal) {
1957
1958 if (isArray(childVal)) {
1959 childVal = childVal.reduce(function (value, key) {
1960 value[key] = String;
1961 return value;
1962 }, {});
1963 }
1964
1965 return strats.methods(parentVal, childVal);
1966 };
1967
1968 // extend strategy
1969 strats.computed =
1970 strats.methods = function (parentVal, childVal) {
1971 return childVal
1972 ? parentVal
1973 ? assign({}, parentVal, childVal)
1974 : childVal
1975 : parentVal;
1976 };
1977
1978 // data strategy
1979 strats.data = function (parentVal, childVal, vm) {
1980
1981 if (!vm) {
1982
1983 if (!childVal) {
1984 return parentVal;
1985 }
1986
1987 if (!parentVal) {
1988 return childVal;
1989 }
1990
1991 return function (vm) {
1992 return mergeFnData(parentVal, childVal, vm);
1993 };
1994
1995 }
1996
1997 return mergeFnData(parentVal, childVal, vm);
1998 };
1999
2000 function mergeFnData(parentVal, childVal, vm) {
2001 return strats.computed(
2002 isFunction(parentVal)
2003 ? parentVal.call(vm, vm)
2004 : parentVal,
2005 isFunction(childVal)
2006 ? childVal.call(vm, vm)
2007 : childVal
2008 );
2009 }
2010
2011 // concat strategy
2012 function concatStrat(parentVal, childVal) {
2013
2014 parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
2015
2016 return childVal
2017 ? parentVal
2018 ? parentVal.concat(childVal)
2019 : isArray(childVal)
2020 ? childVal
2021 : [childVal]
2022 : parentVal;
2023 }
2024
2025 // default strategy
2026 function defaultStrat(parentVal, childVal) {
2027 return isUndefined(childVal) ? parentVal : childVal;
2028 }
2029
2030 function mergeOptions(parent, child, vm) {
2031
2032 var options = {};
2033
2034 if (isFunction(child)) {
2035 child = child.options;
2036 }
2037
2038 if (child.extends) {
2039 parent = mergeOptions(parent, child.extends, vm);
2040 }
2041
2042 if (child.mixins) {
2043 for (var i = 0, l = child.mixins.length; i < l; i++) {
2044 parent = mergeOptions(parent, child.mixins[i], vm);
2045 }
2046 }
2047
2048 for (var key in parent) {
2049 mergeKey(key);
2050 }
2051
2052 for (var key$1 in child) {
2053 if (!hasOwn(parent, key$1)) {
2054 mergeKey(key$1);
2055 }
2056 }
2057
2058 function mergeKey(key) {
2059 options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);
2060 }
2061
2062 return options;
2063 }
2064
2065 function parseOptions(options, args) {
2066 var obj;
2067
2068 if ( args === void 0 ) args = [];
2069
2070 try {
2071
2072 return !options
2073 ? {}
2074 : startsWith(options, '{')
2075 ? JSON.parse(options)
2076 : args.length && !includes(options, ':')
2077 ? (( obj = {}, obj[args[0]] = options, obj ))
2078 : options.split(';').reduce(function (options, option) {
2079 var ref = option.split(/:(.*)/);
2080 var key = ref[0];
2081 var value = ref[1];
2082 if (key && !isUndefined(value)) {
2083 options[key.trim()] = value.trim();
2084 }
2085 return options;
2086 }, {});
2087
2088 } catch (e) {
2089 return {};
2090 }
2091
2092 }
2093
2094 function play(el) {
2095
2096 if (isIFrame(el)) {
2097 call(el, {func: 'playVideo', method: 'play'});
2098 }
2099
2100 if (isHTML5(el)) {
2101 try {
2102 el.play().catch(noop);
2103 } catch (e) {}
2104 }
2105
2106 }
2107
2108 function pause(el) {
2109
2110 if (isIFrame(el)) {
2111 call(el, {func: 'pauseVideo', method: 'pause'});
2112 }
2113
2114 if (isHTML5(el)) {
2115 el.pause();
2116 }
2117
2118 }
2119
2120 function mute(el) {
2121
2122 if (isIFrame(el)) {
2123 call(el, {func: 'mute', method: 'setVolume', value: 0});
2124 }
2125
2126 if (isHTML5(el)) {
2127 el.muted = true;
2128 }
2129
2130 }
2131
2132 function isVideo(el) {
2133 return isHTML5(el) || isIFrame(el);
2134 }
2135
2136 function isHTML5(el) {
2137 return el && el.tagName === 'VIDEO';
2138 }
2139
2140 function isIFrame(el) {
2141 return el && el.tagName === 'IFRAME' && (isYoutube(el) || isVimeo(el));
2142 }
2143
2144 function isYoutube(el) {
2145 return !!el.src.match(/\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/);
2146 }
2147
2148 function isVimeo(el) {
2149 return !!el.src.match(/vimeo\.com\/video\/.*/);
2150 }
2151
2152 function call(el, cmd) {
2153 enableApi(el).then(function () { return post(el, cmd); });
2154 }
2155
2156 function post(el, cmd) {
2157 try {
2158 el.contentWindow.postMessage(JSON.stringify(assign({event: 'command'}, cmd)), '*');
2159 } catch (e) {}
2160 }
2161
2162 var stateKey$1 = '_ukPlayer';
2163 var counter = 0;
2164 function enableApi(el) {
2165
2166 if (el[stateKey$1]) {
2167 return el[stateKey$1];
2168 }
2169
2170 var youtube = isYoutube(el);
2171 var vimeo = isVimeo(el);
2172
2173 var id = ++counter;
2174 var poller;
2175
2176 return el[stateKey$1] = new Promise$1(function (resolve) {
2177
2178 youtube && once(el, 'load', function () {
2179 var listener = function () { return post(el, {event: 'listening', id: id}); };
2180 poller = setInterval(listener, 100);
2181 listener();
2182 });
2183
2184 once(window, 'message', resolve, false, function (ref) {
2185 var data = ref.data;
2186
2187
2188 try {
2189 data = JSON.parse(data);
2190 return data && (youtube && data.id === id && data.event === 'onReady' || vimeo && Number(data.player_id) === id);
2191 } catch (e) {}
2192
2193 });
2194
2195 el.src = "" + (el.src) + (includes(el.src, '?') ? '&' : '?') + (youtube ? 'enablejsapi=1' : ("api=1&player_id=" + id));
2196
2197 }).then(function () { return clearInterval(poller); });
2198 }
2199
2200 function isInView(element, offsetTop, offsetLeft) {
2201 if ( offsetTop === void 0 ) offsetTop = 0;
2202 if ( offsetLeft === void 0 ) offsetLeft = 0;
2203
2204
2205 if (!isVisible(element)) {
2206 return false;
2207 }
2208
2209 return intersectRect.apply(void 0, scrollParents(element).map(function (parent) {
2210
2211 var ref = offset(getViewport$1(parent));
2212 var top = ref.top;
2213 var left = ref.left;
2214 var bottom = ref.bottom;
2215 var right = ref.right;
2216
2217 return {
2218 top: top - offsetTop,
2219 left: left - offsetLeft,
2220 bottom: bottom + offsetTop,
2221 right: right + offsetLeft
2222 };
2223 }).concat(offset(element)));
2224 }
2225
2226 function scrollTop(element, top) {
2227
2228 if (isWindow(element) || isDocument(element)) {
2229 element = getScrollingElement(element);
2230 } else {
2231 element = toNode(element);
2232 }
2233
2234 element.scrollTop = top;
2235 }
2236
2237 function scrollIntoView(element, ref) {
2238 if ( ref === void 0 ) ref = {};
2239 var offsetBy = ref.offset; if ( offsetBy === void 0 ) offsetBy = 0;
2240
2241
2242 var parents = isVisible(element) ? scrollParents(element) : [];
2243 var diff = 0;
2244 return parents.reduce(function (fn, scrollElement, i) {
2245
2246 var scrollTop = scrollElement.scrollTop;
2247 var scrollHeight = scrollElement.scrollHeight;
2248 var maxScroll = scrollHeight - getViewportClientHeight(scrollElement);
2249
2250 var top = Math.ceil(
2251 offset(parents[i - 1] || element).top
2252 - offset(getViewport$1(scrollElement)).top
2253 - offsetBy
2254 + diff
2255 + scrollTop
2256 );
2257
2258 if (top > maxScroll) {
2259 diff = top - maxScroll;
2260 top = maxScroll;
2261 } else {
2262 diff = 0;
2263 }
2264
2265 return function () { return scrollTo(scrollElement, top - scrollTop).then(fn); };
2266
2267 }, function () { return Promise$1.resolve(); })();
2268
2269 function scrollTo(element, top) {
2270 return new Promise$1(function (resolve) {
2271
2272 var scroll = element.scrollTop;
2273 var duration = getDuration(Math.abs(top));
2274 var start = Date.now();
2275
2276 (function step() {
2277
2278 var percent = ease(clamp((Date.now() - start) / duration));
2279
2280 scrollTop(element, scroll + top * percent);
2281
2282 // scroll more if we have not reached our destination
2283 if (percent !== 1) {
2284 requestAnimationFrame(step);
2285 } else {
2286 resolve();
2287 }
2288
2289 })();
2290 });
2291 }
2292
2293 function getDuration(dist) {
2294 return 40 * Math.pow(dist, .375);
2295 }
2296
2297 function ease(k) {
2298 return 0.5 * (1 - Math.cos(Math.PI * k));
2299 }
2300
2301 }
2302
2303 function scrolledOver(element, heightOffset) {
2304 if ( heightOffset === void 0 ) heightOffset = 0;
2305
2306
2307 if (!isVisible(element)) {
2308 return 0;
2309 }
2310
2311 var ref = scrollParents(element, /auto|scroll/, true);
2312 var scrollElement = ref[0];
2313 var scrollHeight = scrollElement.scrollHeight;
2314 var scrollTop = scrollElement.scrollTop;
2315 var clientHeight = getViewportClientHeight(scrollElement);
2316 var viewportTop = offsetPosition(element)[0] - scrollTop - offsetPosition(scrollElement)[0];
2317 var viewportDist = Math.min(clientHeight, viewportTop + scrollTop);
2318
2319 var top = viewportTop - viewportDist;
2320 var dist = Math.min(
2321 element.offsetHeight + heightOffset + viewportDist,
2322 scrollHeight - (viewportTop + scrollTop),
2323 scrollHeight - clientHeight
2324 );
2325
2326 return clamp(-1 * top / dist);
2327 }
2328
2329 function scrollParents(element, overflowRe, scrollable) {
2330 if ( overflowRe === void 0 ) overflowRe = /auto|scroll|hidden/;
2331 if ( scrollable === void 0 ) scrollable = false;
2332
2333 var scrollEl = getScrollingElement(element);
2334
2335 var ancestors = parents(element).reverse();
2336 ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
2337
2338 var fixedIndex = findIndex(ancestors, function (el) { return css(el, 'position') === 'fixed'; });
2339 if (~fixedIndex) {
2340 ancestors = ancestors.slice(fixedIndex);
2341 }
2342
2343 return [scrollEl].concat(ancestors.filter(function (parent) { return overflowRe.test(css(parent, 'overflow')) && (!scrollable || parent.scrollHeight > getViewportClientHeight(parent)); })
2344 ).reverse();
2345 }
2346
2347 function getViewport$1(scrollElement) {
2348 return scrollElement === getScrollingElement(scrollElement) ? window : scrollElement;
2349 }
2350
2351 // iOS 12 returns <body> as scrollingElement
2352 function getViewportClientHeight(scrollElement) {
2353 return (scrollElement === getScrollingElement(scrollElement) ? document.documentElement : scrollElement).clientHeight;
2354 }
2355
2356 function getScrollingElement(element) {
2357 var ref = toWindow(element);
2358 var document = ref.document;
2359 return document.scrollingElement || document.documentElement;
2360 }
2361
2362 var dirs = {
2363 width: ['x', 'left', 'right'],
2364 height: ['y', 'top', 'bottom']
2365 };
2366
2367 function positionAt(element, target, elAttach, targetAttach, elOffset, targetOffset, flip, boundary) {
2368
2369 elAttach = getPos(elAttach);
2370 targetAttach = getPos(targetAttach);
2371
2372 var flipped = {element: elAttach, target: targetAttach};
2373
2374 if (!element || !target) {
2375 return flipped;
2376 }
2377
2378 var dim = offset(element);
2379 var targetDim = offset(target);
2380 var position = targetDim;
2381
2382 moveTo(position, elAttach, dim, -1);
2383 moveTo(position, targetAttach, targetDim, 1);
2384
2385 elOffset = getOffsets(elOffset, dim.width, dim.height);
2386 targetOffset = getOffsets(targetOffset, targetDim.width, targetDim.height);
2387
2388 elOffset['x'] += targetOffset['x'];
2389 elOffset['y'] += targetOffset['y'];
2390
2391 position.left += elOffset['x'];
2392 position.top += elOffset['y'];
2393
2394 if (flip) {
2395
2396 var boundaries = scrollParents(element).map(getViewport$1);
2397
2398 if (boundary && !includes(boundaries, boundary)) {
2399 boundaries.unshift(boundary);
2400 }
2401
2402 boundaries = boundaries.map(function (el) { return offset(el); });
2403
2404 each(dirs, function (ref, prop) {
2405 var dir = ref[0];
2406 var align = ref[1];
2407 var alignFlip = ref[2];
2408
2409
2410 if (!(flip === true || includes(flip, dir))) {
2411 return;
2412 }
2413
2414 boundaries.some(function (boundary) {
2415
2416 var elemOffset = elAttach[dir] === align
2417 ? -dim[prop]
2418 : elAttach[dir] === alignFlip
2419 ? dim[prop]
2420 : 0;
2421
2422 var targetOffset = targetAttach[dir] === align
2423 ? targetDim[prop]
2424 : targetAttach[dir] === alignFlip
2425 ? -targetDim[prop]
2426 : 0;
2427
2428 if (position[align] < boundary[align] || position[align] + dim[prop] > boundary[alignFlip]) {
2429
2430 var centerOffset = dim[prop] / 2;
2431 var centerTargetOffset = targetAttach[dir] === 'center' ? -targetDim[prop] / 2 : 0;
2432
2433 return elAttach[dir] === 'center' && (
2434 apply(centerOffset, centerTargetOffset)
2435 || apply(-centerOffset, -centerTargetOffset)
2436 ) || apply(elemOffset, targetOffset);
2437
2438 }
2439
2440 function apply(elemOffset, targetOffset) {
2441
2442 var newVal = toFloat((position[align] + elemOffset + targetOffset - elOffset[dir] * 2).toFixed(4));
2443
2444 if (newVal >= boundary[align] && newVal + dim[prop] <= boundary[alignFlip]) {
2445 position[align] = newVal;
2446
2447 ['element', 'target'].forEach(function (el) {
2448 flipped[el][dir] = !elemOffset
2449 ? flipped[el][dir]
2450 : flipped[el][dir] === dirs[prop][1]
2451 ? dirs[prop][2]
2452 : dirs[prop][1];
2453 });
2454
2455 return true;
2456 }
2457
2458 }
2459
2460 });
2461
2462 });
2463 }
2464
2465 offset(element, position);
2466
2467 return flipped;
2468 }
2469
2470 function moveTo(position, attach, dim, factor) {
2471 each(dirs, function (ref, prop) {
2472 var dir = ref[0];
2473 var align = ref[1];
2474 var alignFlip = ref[2];
2475
2476 if (attach[dir] === alignFlip) {
2477 position[align] += dim[prop] * factor;
2478 } else if (attach[dir] === 'center') {
2479 position[align] += dim[prop] * factor / 2;
2480 }
2481 });
2482 }
2483
2484 function getPos(pos) {
2485
2486 var x = /left|center|right/;
2487 var y = /top|center|bottom/;
2488
2489 pos = (pos || '').split(' ');
2490
2491 if (pos.length === 1) {
2492 pos = x.test(pos[0])
2493 ? pos.concat('center')
2494 : y.test(pos[0])
2495 ? ['center'].concat(pos)
2496 : ['center', 'center'];
2497 }
2498
2499 return {
2500 x: x.test(pos[0]) ? pos[0] : 'center',
2501 y: y.test(pos[1]) ? pos[1] : 'center'
2502 };
2503 }
2504
2505 function getOffsets(offsets, width, height) {
2506
2507 var ref = (offsets || '').split(' ');
2508 var x = ref[0];
2509 var y = ref[1];
2510
2511 return {
2512 x: x ? toFloat(x) * (endsWith(x, '%') ? width / 100 : 1) : 0,
2513 y: y ? toFloat(y) * (endsWith(y, '%') ? height / 100 : 1) : 0
2514 };
2515 }
2516
2517 var util = /*#__PURE__*/Object.freeze({
2518 __proto__: null,
2519 ajax: ajax,
2520 getImage: getImage,
2521 transition: transition,
2522 Transition: Transition,
2523 animate: animate$1,
2524 Animation: Animation,
2525 attr: attr,
2526 hasAttr: hasAttr,
2527 removeAttr: removeAttr,
2528 data: data,
2529 addClass: addClass,
2530 removeClass: removeClass,
2531 removeClasses: removeClasses,
2532 replaceClass: replaceClass,
2533 hasClass: hasClass,
2534 toggleClass: toggleClass,
2535 dimensions: dimensions,
2536 offset: offset,
2537 position: position,
2538 offsetPosition: offsetPosition,
2539 height: height,
2540 width: width,
2541 boxModelAdjust: boxModelAdjust,
2542 flipPosition: flipPosition,
2543 toPx: toPx,
2544 ready: ready,
2545 empty: empty,
2546 html: html,
2547 prepend: prepend,
2548 append: append,
2549 before: before,
2550 after: after,
2551 remove: remove$1,
2552 wrapAll: wrapAll,
2553 wrapInner: wrapInner,
2554 unwrap: unwrap,
2555 fragment: fragment,
2556 apply: apply$1,
2557 $: $,
2558 $$: $$,
2559 inBrowser: inBrowser,
2560 isIE: isIE,
2561 isRtl: isRtl,
2562 hasTouch: hasTouch,
2563 pointerDown: pointerDown,
2564 pointerMove: pointerMove,
2565 pointerUp: pointerUp,
2566 pointerEnter: pointerEnter,
2567 pointerLeave: pointerLeave,
2568 pointerCancel: pointerCancel,
2569 on: on,
2570 off: off,
2571 once: once,
2572 trigger: trigger,
2573 createEvent: createEvent,
2574 toEventTargets: toEventTargets,
2575 isTouch: isTouch,
2576 getEventPos: getEventPos,
2577 fastdom: fastdom,
2578 isVoidElement: isVoidElement,
2579 isVisible: isVisible,
2580 selInput: selInput,
2581 isInput: isInput,
2582 selFocusable: selFocusable,
2583 isFocusable: isFocusable,
2584 parent: parent,
2585 filter: filter$1,
2586 matches: matches,
2587 closest: closest,
2588 within: within,
2589 parents: parents,
2590 children: children,
2591 index: index,
2592 hasOwn: hasOwn,
2593 hyphenate: hyphenate,
2594 camelize: camelize,
2595 ucfirst: ucfirst,
2596 startsWith: startsWith,
2597 endsWith: endsWith,
2598 includes: includes,
2599 findIndex: findIndex,
2600 isArray: isArray,
2601 isFunction: isFunction,
2602 isObject: isObject,
2603 isPlainObject: isPlainObject,
2604 isWindow: isWindow,
2605 isDocument: isDocument,
2606 isNode: isNode,
2607 isElement: isElement,
2608 isBoolean: isBoolean,
2609 isString: isString,
2610 isNumber: isNumber,
2611 isNumeric: isNumeric,
2612 isEmpty: isEmpty,
2613 isUndefined: isUndefined,
2614 toBoolean: toBoolean,
2615 toNumber: toNumber,
2616 toFloat: toFloat,
2617 toArray: toArray,
2618 toNode: toNode,
2619 toNodes: toNodes,
2620 toWindow: toWindow,
2621 toMs: toMs,
2622 isEqual: isEqual,
2623 swap: swap,
2624 assign: assign,
2625 last: last,
2626 each: each,
2627 sortBy: sortBy$1,
2628 uniqueBy: uniqueBy,
2629 clamp: clamp,
2630 noop: noop,
2631 intersectRect: intersectRect,
2632 pointInRect: pointInRect,
2633 Dimensions: Dimensions,
2634 getIndex: getIndex,
2635 memoize: memoize,
2636 MouseTracker: MouseTracker,
2637 mergeOptions: mergeOptions,
2638 parseOptions: parseOptions,
2639 play: play,
2640 pause: pause,
2641 mute: mute,
2642 isVideo: isVideo,
2643 positionAt: positionAt,
2644 Promise: Promise$1,
2645 Deferred: Deferred,
2646 query: query,
2647 queryAll: queryAll,
2648 find: find,
2649 findAll: findAll,
2650 escape: escape,
2651 css: css,
2652 getCssVar: getCssVar,
2653 propName: propName,
2654 isInView: isInView,
2655 scrollTop: scrollTop,
2656 scrollIntoView: scrollIntoView,
2657 scrolledOver: scrolledOver,
2658 scrollParents: scrollParents,
2659 getViewport: getViewport$1,
2660 getViewportClientHeight: getViewportClientHeight
2661 });
2662
2663 function globalAPI (UIkit) {
2664
2665 var DATA = UIkit.data;
2666
2667 UIkit.use = function (plugin) {
2668
2669 if (plugin.installed) {
2670 return;
2671 }
2672
2673 plugin.call(null, this);
2674 plugin.installed = true;
2675
2676 return this;
2677 };
2678
2679 UIkit.mixin = function (mixin, component) {
2680 component = (isString(component) ? UIkit.component(component) : component) || this;
2681 component.options = mergeOptions(component.options, mixin);
2682 };
2683
2684 UIkit.extend = function (options) {
2685
2686 options = options || {};
2687
2688 var Super = this;
2689 var Sub = function UIkitComponent(options) {
2690 this._init(options);
2691 };
2692
2693 Sub.prototype = Object.create(Super.prototype);
2694 Sub.prototype.constructor = Sub;
2695 Sub.options = mergeOptions(Super.options, options);
2696
2697 Sub.super = Super;
2698 Sub.extend = Super.extend;
2699
2700 return Sub;
2701 };
2702
2703 UIkit.update = function (element, e) {
2704
2705 element = element ? toNode(element) : document.body;
2706
2707 parents(element).reverse().forEach(function (element) { return update(element[DATA], e); });
2708 apply$1(element, function (element) { return update(element[DATA], e); });
2709
2710 };
2711
2712 var container;
2713 Object.defineProperty(UIkit, 'container', {
2714
2715 get: function() {
2716 return container || document.body;
2717 },
2718
2719 set: function(element) {
2720 container = $(element);
2721 }
2722
2723 });
2724
2725 function update(data, e) {
2726
2727 if (!data) {
2728 return;
2729 }
2730
2731 for (var name in data) {
2732 if (data[name]._connected) {
2733 data[name]._callUpdate(e);
2734 }
2735 }
2736
2737 }
2738 }
2739
2740 function hooksAPI (UIkit) {
2741
2742 UIkit.prototype._callHook = function (hook) {
2743 var this$1$1 = this;
2744
2745
2746 var handlers = this.$options[hook];
2747
2748 if (handlers) {
2749 handlers.forEach(function (handler) { return handler.call(this$1$1); });
2750 }
2751 };
2752
2753 UIkit.prototype._callConnected = function () {
2754
2755 if (this._connected) {
2756 return;
2757 }
2758
2759 this._data = {};
2760 this._computeds = {};
2761
2762 this._initProps();
2763
2764 this._callHook('beforeConnect');
2765 this._connected = true;
2766
2767 this._initEvents();
2768 this._initObservers();
2769
2770 this._callHook('connected');
2771 this._callUpdate();
2772 };
2773
2774 UIkit.prototype._callDisconnected = function () {
2775
2776 if (!this._connected) {
2777 return;
2778 }
2779
2780 this._callHook('beforeDisconnect');
2781 this._disconnectObservers();
2782 this._unbindEvents();
2783 this._callHook('disconnected');
2784
2785 this._connected = false;
2786 delete this._watch;
2787
2788 };
2789
2790 UIkit.prototype._callUpdate = function (e) {
2791 var this$1$1 = this;
2792 if ( e === void 0 ) e = 'update';
2793
2794
2795 if (!this._connected) {
2796 return;
2797 }
2798
2799 if (e === 'update' || e === 'resize') {
2800 this._callWatches();
2801 }
2802
2803 if (!this.$options.update) {
2804 return;
2805 }
2806
2807 if (!this._updates) {
2808 this._updates = new Set();
2809 fastdom.read(function () {
2810 if (this$1$1._connected) {
2811 runUpdates.call(this$1$1, this$1$1._updates);
2812 }
2813 delete this$1$1._updates;
2814 });
2815 }
2816
2817 this._updates.add(e.type || e);
2818 };
2819
2820 UIkit.prototype._callWatches = function () {
2821 var this$1$1 = this;
2822
2823
2824 if (this._watch) {
2825 return;
2826 }
2827
2828 var initial = !hasOwn(this, '_watch');
2829
2830 this._watch = fastdom.read(function () {
2831 if (this$1$1._connected) {
2832 runWatches.call(this$1$1, initial);
2833 }
2834 this$1$1._watch = null;
2835
2836 });
2837
2838 };
2839
2840 function runUpdates(types) {
2841 var this$1$1 = this;
2842
2843
2844 var updates = this.$options.update;
2845
2846 var loop = function ( i ) {
2847 var ref = updates[i];
2848 var read = ref.read;
2849 var write = ref.write;
2850 var events = ref.events;
2851
2852 if (!types.has('update') && (!events || !events.some(function (type) { return types.has(type); }))) {
2853 return;
2854 }
2855
2856 var result = (void 0);
2857 if (read) {
2858
2859 result = read.call(this$1$1, this$1$1._data, types);
2860
2861 if (result && isPlainObject(result)) {
2862 assign(this$1$1._data, result);
2863 }
2864 }
2865
2866 if (write && result !== false) {
2867 fastdom.write(function () { return write.call(this$1$1, this$1$1._data, types); });
2868 }
2869
2870 };
2871
2872 for (var i = 0; i < updates.length; i++) loop( i );
2873 }
2874
2875 function runWatches(initial) {
2876
2877 var ref = this;
2878 var computed = ref.$options.computed;
2879 var _computeds = ref._computeds;
2880
2881 for (var key in computed) {
2882
2883 var hasPrev = hasOwn(_computeds, key);
2884 var prev = _computeds[key];
2885
2886 delete _computeds[key];
2887
2888 var ref$1 = computed[key];
2889 var watch = ref$1.watch;
2890 var immediate = ref$1.immediate;
2891 if (watch && (
2892 initial && immediate
2893 || hasPrev && !isEqual(prev, this[key])
2894 )) {
2895 watch.call(this, this[key], prev);
2896 }
2897
2898 }
2899 }
2900 }
2901
2902 function stateAPI (UIkit) {
2903
2904 var uid = 0;
2905
2906 UIkit.prototype._init = function (options) {
2907
2908 options = options || {};
2909 options.data = normalizeData(options, this.constructor.options);
2910
2911 this.$options = mergeOptions(this.constructor.options, options, this);
2912 this.$el = null;
2913 this.$props = {};
2914
2915 this._uid = uid++;
2916 this._initData();
2917 this._initMethods();
2918 this._initComputeds();
2919 this._callHook('created');
2920
2921 if (options.el) {
2922 this.$mount(options.el);
2923 }
2924 };
2925
2926 UIkit.prototype._initData = function () {
2927
2928 var ref = this.$options;
2929 var data = ref.data; if ( data === void 0 ) data = {};
2930
2931 for (var key in data) {
2932 this.$props[key] = this[key] = data[key];
2933 }
2934 };
2935
2936 UIkit.prototype._initMethods = function () {
2937
2938 var ref = this.$options;
2939 var methods = ref.methods;
2940
2941 if (methods) {
2942 for (var key in methods) {
2943 this[key] = methods[key].bind(this);
2944 }
2945 }
2946 };
2947
2948 UIkit.prototype._initComputeds = function () {
2949
2950 var ref = this.$options;
2951 var computed = ref.computed;
2952
2953 this._computeds = {};
2954
2955 if (computed) {
2956 for (var key in computed) {
2957 registerComputed(this, key, computed[key]);
2958 }
2959 }
2960 };
2961
2962 UIkit.prototype._initProps = function (props) {
2963
2964 var key;
2965
2966 props = props || getProps(this.$options, this.$name);
2967
2968 for (key in props) {
2969 if (!isUndefined(props[key])) {
2970 this.$props[key] = props[key];
2971 }
2972 }
2973
2974 var exclude = [this.$options.computed, this.$options.methods];
2975 for (key in this.$props) {
2976 if (key in props && notIn(exclude, key)) {
2977 this[key] = this.$props[key];
2978 }
2979 }
2980 };
2981
2982 UIkit.prototype._initEvents = function () {
2983 var this$1$1 = this;
2984
2985
2986 this._events = [];
2987
2988 var ref = this.$options;
2989 var events = ref.events;
2990
2991 if (events) {
2992
2993 events.forEach(function (event) {
2994
2995 if (!hasOwn(event, 'handler')) {
2996 for (var key in event) {
2997 registerEvent(this$1$1, event[key], key);
2998 }
2999 } else {
3000 registerEvent(this$1$1, event);
3001 }
3002
3003 });
3004 }
3005 };
3006
3007 UIkit.prototype._unbindEvents = function () {
3008 this._events.forEach(function (unbind) { return unbind(); });
3009 delete this._events;
3010 };
3011
3012 UIkit.prototype._initObservers = function () {
3013 this._observers = [
3014 initChildListObserver(this),
3015 initPropsObserver(this)
3016 ];
3017 };
3018
3019 UIkit.prototype._disconnectObservers = function () {
3020 this._observers.forEach(function (observer) { return observer && observer.disconnect(); }
3021 );
3022 };
3023
3024 function getProps(opts, name) {
3025
3026 var data$1 = {};
3027 var args = opts.args; if ( args === void 0 ) args = [];
3028 var props = opts.props; if ( props === void 0 ) props = {};
3029 var el = opts.el;
3030
3031 if (!props) {
3032 return data$1;
3033 }
3034
3035 for (var key in props) {
3036 var prop = hyphenate(key);
3037 var value = data(el, prop);
3038
3039 if (isUndefined(value)) {
3040 continue;
3041 }
3042
3043 value = props[key] === Boolean && value === ''
3044 ? true
3045 : coerce(props[key], value);
3046
3047 if (prop === 'target' && (!value || startsWith(value, '_'))) {
3048 continue;
3049 }
3050
3051 data$1[key] = value;
3052 }
3053
3054 var options = parseOptions(data(el, name), args);
3055
3056 for (var key$1 in options) {
3057 var prop$1 = camelize(key$1);
3058 if (props[prop$1] !== undefined) {
3059 data$1[prop$1] = coerce(props[prop$1], options[key$1]);
3060 }
3061 }
3062
3063 return data$1;
3064 }
3065
3066 function registerComputed(component, key, cb) {
3067 Object.defineProperty(component, key, {
3068
3069 enumerable: true,
3070
3071 get: function() {
3072
3073 var _computeds = component._computeds;
3074 var $props = component.$props;
3075 var $el = component.$el;
3076
3077 if (!hasOwn(_computeds, key)) {
3078 _computeds[key] = (cb.get || cb).call(component, $props, $el);
3079 }
3080
3081 return _computeds[key];
3082 },
3083
3084 set: function(value) {
3085
3086 var _computeds = component._computeds;
3087
3088 _computeds[key] = cb.set ? cb.set.call(component, value) : value;
3089
3090 if (isUndefined(_computeds[key])) {
3091 delete _computeds[key];
3092 }
3093 }
3094
3095 });
3096 }
3097
3098 function registerEvent(component, event, key) {
3099
3100 if (!isPlainObject(event)) {
3101 event = ({name: key, handler: event});
3102 }
3103
3104 var name = event.name;
3105 var el = event.el;
3106 var handler = event.handler;
3107 var capture = event.capture;
3108 var passive = event.passive;
3109 var delegate = event.delegate;
3110 var filter = event.filter;
3111 var self = event.self;
3112 el = isFunction(el)
3113 ? el.call(component)
3114 : el || component.$el;
3115
3116 if (isArray(el)) {
3117 el.forEach(function (el) { return registerEvent(component, assign({}, event, {el: el}), key); });
3118 return;
3119 }
3120
3121 if (!el || filter && !filter.call(component)) {
3122 return;
3123 }
3124
3125 component._events.push(
3126 on(
3127 el,
3128 name,
3129 !delegate
3130 ? null
3131 : isString(delegate)
3132 ? delegate
3133 : delegate.call(component),
3134 isString(handler) ? component[handler] : handler.bind(component),
3135 {passive: passive, capture: capture, self: self}
3136 )
3137 );
3138
3139 }
3140
3141 function notIn(options, key) {
3142 return options.every(function (arr) { return !arr || !hasOwn(arr, key); });
3143 }
3144
3145 function coerce(type, value) {
3146
3147 if (type === Boolean) {
3148 return toBoolean(value);
3149 } else if (type === Number) {
3150 return toNumber(value);
3151 } else if (type === 'list') {
3152 return toList(value);
3153 }
3154
3155 return type ? type(value) : value;
3156 }
3157
3158 function toList(value) {
3159 return isArray(value)
3160 ? value
3161 : isString(value)
3162 ? value.split(/,(?![^(]*\))/).map(function (value) { return isNumeric(value)
3163 ? toNumber(value)
3164 : toBoolean(value.trim()); })
3165 : [value];
3166 }
3167
3168 function normalizeData(ref, ref$1) {
3169 var data = ref.data;
3170 var args = ref$1.args;
3171 var props = ref$1.props; if ( props === void 0 ) props = {};
3172
3173 data = isArray(data)
3174 ? !isEmpty(args)
3175 ? data.slice(0, args.length).reduce(function (data, value, index) {
3176 if (isPlainObject(value)) {
3177 assign(data, value);
3178 } else {
3179 data[args[index]] = value;
3180 }
3181 return data;
3182 }, {})
3183 : undefined
3184 : data;
3185
3186 if (data) {
3187 for (var key in data) {
3188 if (isUndefined(data[key])) {
3189 delete data[key];
3190 } else {
3191 data[key] = props[key] ? coerce(props[key], data[key]) : data[key];
3192 }
3193 }
3194 }
3195
3196 return data;
3197 }
3198
3199 function initChildListObserver(component) {
3200 var ref = component.$options;
3201 var el = ref.el;
3202
3203 var observer = new MutationObserver(function () { return component.$emit(); });
3204 observer.observe(el, {
3205 childList: true,
3206 subtree: true
3207 });
3208
3209 return observer;
3210 }
3211
3212 function initPropsObserver(component) {
3213
3214 var $name = component.$name;
3215 var $options = component.$options;
3216 var $props = component.$props;
3217 var attrs = $options.attrs;
3218 var props = $options.props;
3219 var el = $options.el;
3220
3221 if (!props || attrs === false) {
3222 return;
3223 }
3224
3225 var attributes = isArray(attrs) ? attrs : Object.keys(props);
3226 var filter = attributes.map(function (key) { return hyphenate(key); }).concat($name);
3227
3228 var observer = new MutationObserver(function (records) {
3229 var data = getProps($options, $name);
3230 if (records.some(function (ref) {
3231 var attributeName = ref.attributeName;
3232
3233 var prop = attributeName.replace('data-', '');
3234 return (prop === $name ? attributes : [camelize(prop), camelize(attributeName)]).some(function (prop) { return !isUndefined(data[prop]) && data[prop] !== $props[prop]; }
3235 );
3236 })) {
3237 component.$reset();
3238 }
3239 });
3240
3241 observer.observe(el, {
3242 attributes: true,
3243 attributeFilter: filter.concat(filter.map(function (key) { return ("data-" + key); }))
3244 });
3245
3246 return observer;
3247 }
3248 }
3249
3250 function instanceAPI (UIkit) {
3251
3252 var DATA = UIkit.data;
3253
3254 UIkit.prototype.$create = function (component, element, data) {
3255 return UIkit[component](element, data);
3256 };
3257
3258 UIkit.prototype.$mount = function (el) {
3259
3260 var ref = this.$options;
3261 var name = ref.name;
3262
3263 if (!el[DATA]) {
3264 el[DATA] = {};
3265 }
3266
3267 if (el[DATA][name]) {
3268 return;
3269 }
3270
3271 el[DATA][name] = this;
3272
3273 this.$el = this.$options.el = this.$options.el || el;
3274
3275 if (within(el, document)) {
3276 this._callConnected();
3277 }
3278 };
3279
3280 UIkit.prototype.$reset = function () {
3281 this._callDisconnected();
3282 this._callConnected();
3283 };
3284
3285 UIkit.prototype.$destroy = function (removeEl) {
3286 if ( removeEl === void 0 ) removeEl = false;
3287
3288
3289 var ref = this.$options;
3290 var el = ref.el;
3291 var name = ref.name;
3292
3293 if (el) {
3294 this._callDisconnected();
3295 }
3296
3297 this._callHook('destroy');
3298
3299 if (!el || !el[DATA]) {
3300 return;
3301 }
3302
3303 delete el[DATA][name];
3304
3305 if (!isEmpty(el[DATA])) {
3306 delete el[DATA];
3307 }
3308
3309 if (removeEl) {
3310 remove$1(this.$el);
3311 }
3312 };
3313
3314 UIkit.prototype.$emit = function (e) {
3315 this._callUpdate(e);
3316 };
3317
3318 UIkit.prototype.$update = function (element, e) {
3319 if ( element === void 0 ) element = this.$el;
3320
3321 UIkit.update(element, e);
3322 };
3323
3324 UIkit.prototype.$getComponent = UIkit.getComponent;
3325
3326 var componentName = memoize(function (name) { return UIkit.prefix + hyphenate(name); });
3327 Object.defineProperties(UIkit.prototype, {
3328
3329 $container: Object.getOwnPropertyDescriptor(UIkit, 'container'),
3330
3331 $name: {
3332
3333 get: function() {
3334 return componentName(this.$options.name);
3335 }
3336
3337 }
3338
3339 });
3340
3341 }
3342
3343 function componentAPI (UIkit) {
3344
3345 var DATA = UIkit.data;
3346
3347 var components = {};
3348
3349 UIkit.component = function (name, options) {
3350
3351 var id = hyphenate(name);
3352
3353 name = camelize(id);
3354
3355 if (!options) {
3356
3357 if (isPlainObject(components[name])) {
3358 components[name] = UIkit.extend(components[name]);
3359 }
3360
3361 return components[name];
3362
3363 }
3364
3365 UIkit[name] = function (element, data) {
3366 var i = arguments.length, argsArray = Array(i);
3367 while ( i-- ) argsArray[i] = arguments[i];
3368
3369
3370 var component = UIkit.component(name);
3371
3372 return component.options.functional
3373 ? new component({data: isPlainObject(element) ? element : [].concat( argsArray )})
3374 : !element ? init(element) : $$(element).map(init)[0];
3375
3376 function init(element) {
3377
3378 var instance = UIkit.getComponent(element, name);
3379
3380 if (instance) {
3381 if (!data) {
3382 return instance;
3383 } else {
3384 instance.$destroy();
3385 }
3386 }
3387
3388 return new component({el: element, data: data});
3389
3390 }
3391
3392 };
3393
3394 var opt = isPlainObject(options) ? assign({}, options) : options.options;
3395
3396 opt.name = name;
3397
3398 if (opt.install) {
3399 opt.install(UIkit, opt, name);
3400 }
3401
3402 if (UIkit._initialized && !opt.functional) {
3403 fastdom.read(function () { return UIkit[name](("[uk-" + id + "],[data-uk-" + id + "]")); });
3404 }
3405
3406 return components[name] = isPlainObject(options) ? opt : options;
3407 };
3408
3409 UIkit.getComponents = function (element) { return element && element[DATA] || {}; };
3410 UIkit.getComponent = function (element, name) { return UIkit.getComponents(element)[name]; };
3411
3412 UIkit.connect = function (node) {
3413
3414 if (node[DATA]) {
3415 for (var name in node[DATA]) {
3416 node[DATA][name]._callConnected();
3417 }
3418 }
3419
3420 for (var i = 0; i < node.attributes.length; i++) {
3421
3422 var name$1 = getComponentName(node.attributes[i].name);
3423
3424 if (name$1 && name$1 in components) {
3425 UIkit[name$1](node);
3426 }
3427
3428 }
3429
3430 };
3431
3432 UIkit.disconnect = function (node) {
3433 for (var name in node[DATA]) {
3434 node[DATA][name]._callDisconnected();
3435 }
3436 };
3437
3438 }
3439
3440 var getComponentName = memoize(function (attribute) {
3441 return startsWith(attribute, 'uk-') || startsWith(attribute, 'data-uk-')
3442 ? camelize(attribute.replace('data-uk-', '').replace('uk-', ''))
3443 : false;
3444 });
3445
3446 var UIkit = function (options) {
3447 this._init(options);
3448 };
3449
3450 UIkit.util = util;
3451 UIkit.data = '__uikit__';
3452 UIkit.prefix = 'uk-';
3453 UIkit.options = {};
3454 UIkit.version = '3.7.6';
3455
3456 globalAPI(UIkit);
3457 hooksAPI(UIkit);
3458 stateAPI(UIkit);
3459 componentAPI(UIkit);
3460 instanceAPI(UIkit);
3461
3462 function Core (UIkit) {
3463
3464 if (!inBrowser) {
3465 return;
3466 }
3467
3468 // throttle 'resize'
3469 var pendingResize;
3470 var handleResize = function () {
3471 if (pendingResize) {
3472 return;
3473 }
3474 pendingResize = true;
3475 fastdom.write(function () { return pendingResize = false; });
3476 UIkit.update(null, 'resize');
3477 };
3478
3479 on(window, 'load resize', handleResize);
3480 on(document, 'loadedmetadata load', handleResize, true);
3481
3482 if ('ResizeObserver' in window) {
3483 (new ResizeObserver(handleResize)).observe(document.documentElement);
3484 }
3485
3486 // throttle `scroll` event (Safari triggers multiple `scroll` events per frame)
3487 var pending;
3488 on(window, 'scroll', function (e) {
3489
3490 if (pending) {
3491 return;
3492 }
3493 pending = true;
3494 fastdom.write(function () { return pending = false; });
3495
3496 UIkit.update(null, e.type);
3497
3498 }, {passive: true, capture: true});
3499
3500 var started = 0;
3501 on(document, 'animationstart', function (ref) {
3502 var target = ref.target;
3503
3504 if ((css(target, 'animationName') || '').match(/^uk-.*(left|right)/)) {
3505
3506 started++;
3507 css(document.documentElement, 'overflowX', 'hidden');
3508 setTimeout(function () {
3509 if (!--started) {
3510 css(document.documentElement, 'overflowX', '');
3511 }
3512 }, toMs(css(target, 'animationDuration')) + 100);
3513 }
3514 }, true);
3515
3516 on(document, pointerDown, function (e) {
3517
3518 if (!isTouch(e)) {
3519 return;
3520 }
3521
3522 // Handle Swipe Gesture
3523 var pos = getEventPos(e);
3524 var target = 'tagName' in e.target ? e.target : parent(e.target);
3525 once(document, (pointerUp + " " + pointerCancel + " scroll"), function (e) {
3526
3527 var ref = getEventPos(e);
3528 var x = ref.x;
3529 var y = ref.y;
3530
3531 // swipe
3532 if (e.type !== 'scroll' && target && x && Math.abs(pos.x - x) > 100 || y && Math.abs(pos.y - y) > 100) {
3533
3534 setTimeout(function () {
3535 trigger(target, 'swipe');
3536 trigger(target, ("swipe" + (swipeDirection(pos.x, pos.y, x, y))));
3537 });
3538
3539 }
3540
3541 });
3542
3543 }, {passive: true});
3544
3545 }
3546
3547 function swipeDirection(x1, y1, x2, y2) {
3548 return Math.abs(x1 - x2) >= Math.abs(y1 - y2)
3549 ? x1 - x2 > 0
3550 ? 'Left'
3551 : 'Right'
3552 : y1 - y2 > 0
3553 ? 'Up'
3554 : 'Down';
3555 }
3556
3557 function boot (UIkit) {
3558
3559 var connect = UIkit.connect;
3560 var disconnect = UIkit.disconnect;
3561
3562 if (!inBrowser || !window.MutationObserver) {
3563 return;
3564 }
3565
3566 fastdom.read(function () {
3567
3568 if (document.body) {
3569 apply$1(document.body, connect);
3570 }
3571
3572 new MutationObserver(function (records) { return records.forEach(applyChildListMutation); }
3573 ).observe(document, {
3574 childList: true,
3575 subtree: true
3576 });
3577
3578 new MutationObserver(function (records) { return records.forEach(applyAttributeMutation); }
3579 ).observe(document, {
3580 attributes: true,
3581 subtree: true
3582 });
3583
3584 UIkit._initialized = true;
3585 });
3586
3587 function applyChildListMutation(ref) {
3588 var addedNodes = ref.addedNodes;
3589 var removedNodes = ref.removedNodes;
3590
3591 for (var i = 0; i < addedNodes.length; i++) {
3592 apply$1(addedNodes[i], connect);
3593 }
3594
3595 for (var i$1 = 0; i$1 < removedNodes.length; i$1++) {
3596 apply$1(removedNodes[i$1], disconnect);
3597 }
3598 }
3599
3600 function applyAttributeMutation(ref) {
3601 var target = ref.target;
3602 var attributeName = ref.attributeName;
3603
3604
3605 var name = getComponentName(attributeName);
3606
3607 if (!name || !(name in UIkit)) {
3608 return;
3609 }
3610
3611 if (hasAttr(target, attributeName)) {
3612 UIkit[name](target);
3613 return;
3614 }
3615
3616 var component = UIkit.getComponent(target, name);
3617
3618 if (component) {
3619 component.$destroy();
3620 }
3621
3622 }
3623
3624 }
3625
3626 var Class = {
3627
3628 connected: function() {
3629 !hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
3630 }
3631
3632 };
3633
3634 var Togglable = {
3635
3636 props: {
3637 cls: Boolean,
3638 animation: 'list',
3639 duration: Number,
3640 origin: String,
3641 transition: String
3642 },
3643
3644 data: {
3645 cls: false,
3646 animation: [false],
3647 duration: 200,
3648 origin: false,
3649 transition: 'linear',
3650 clsEnter: 'uk-togglabe-enter',
3651 clsLeave: 'uk-togglabe-leave',
3652
3653 initProps: {
3654 overflow: '',
3655 height: '',
3656 paddingTop: '',
3657 paddingBottom: '',
3658 marginTop: '',
3659 marginBottom: ''
3660 },
3661
3662 hideProps: {
3663 overflow: 'hidden',
3664 height: 0,
3665 paddingTop: 0,
3666 paddingBottom: 0,
3667 marginTop: 0,
3668 marginBottom: 0
3669 }
3670
3671 },
3672
3673 computed: {
3674
3675 hasAnimation: function(ref) {
3676 var animation = ref.animation;
3677
3678 return !!animation[0];
3679 },
3680
3681 hasTransition: function(ref) {
3682 var animation = ref.animation;
3683
3684 return this.hasAnimation && animation[0] === true;
3685 }
3686
3687 },
3688
3689 methods: {
3690
3691 toggleElement: function(targets, toggle, animate) {
3692 var this$1$1 = this;
3693
3694 return new Promise$1(function (resolve) { return Promise$1.all(toNodes(targets).map(function (el) {
3695
3696 var show = isBoolean(toggle) ? toggle : !this$1$1.isToggled(el);
3697
3698 if (!trigger(el, ("before" + (show ? 'show' : 'hide')), [this$1$1])) {
3699 return Promise$1.reject();
3700 }
3701
3702 var promise = (
3703 isFunction(animate)
3704 ? animate
3705 : animate === false || !this$1$1.hasAnimation
3706 ? this$1$1._toggle
3707 : this$1$1.hasTransition
3708 ? toggleHeight(this$1$1)
3709 : toggleAnimation(this$1$1)
3710 )(el, show);
3711
3712 var cls = show ? this$1$1.clsEnter : this$1$1.clsLeave;
3713
3714 addClass(el, cls);
3715
3716 trigger(el, show ? 'show' : 'hide', [this$1$1]);
3717
3718 var done = function () {
3719 removeClass(el, cls);
3720 trigger(el, show ? 'shown' : 'hidden', [this$1$1]);
3721 this$1$1.$update(el);
3722 };
3723
3724 return promise ? promise.then(done, function () {
3725 removeClass(el, cls);
3726 return Promise$1.reject();
3727 }) : done();
3728
3729 })).then(resolve, noop); }
3730 );
3731 },
3732
3733 isToggled: function(el) {
3734 var assign;
3735
3736 if ( el === void 0 ) el = this.$el;
3737 (assign = toNodes(el), el = assign[0]);
3738 return hasClass(el, this.clsEnter)
3739 ? true
3740 : hasClass(el, this.clsLeave)
3741 ? false
3742 : this.cls
3743 ? hasClass(el, this.cls.split(' ')[0])
3744 : isVisible(el);
3745 },
3746
3747 _toggle: function(el, toggled) {
3748
3749 if (!el) {
3750 return;
3751 }
3752
3753 toggled = Boolean(toggled);
3754
3755 var changed;
3756 if (this.cls) {
3757 changed = includes(this.cls, ' ') || toggled !== hasClass(el, this.cls);
3758 changed && toggleClass(el, this.cls, includes(this.cls, ' ') ? undefined : toggled);
3759 } else {
3760 changed = toggled === el.hidden;
3761 changed && (el.hidden = !toggled);
3762 }
3763
3764 $$('[autofocus]', el).some(function (el) { return isVisible(el) ? el.focus() || true : el.blur(); });
3765
3766 if (changed) {
3767 trigger(el, 'toggled', [toggled, this]);
3768 this.$update(el);
3769 }
3770 }
3771
3772 }
3773
3774 };
3775
3776 function toggleHeight(ref) {
3777 var isToggled = ref.isToggled;
3778 var duration = ref.duration;
3779 var initProps = ref.initProps;
3780 var hideProps = ref.hideProps;
3781 var transition = ref.transition;
3782 var _toggle = ref._toggle;
3783
3784 return function (el, show) {
3785
3786 var inProgress = Transition.inProgress(el);
3787 var inner = el.hasChildNodes ? toFloat(css(el.firstElementChild, 'marginTop')) + toFloat(css(el.lastElementChild, 'marginBottom')) : 0;
3788 var currentHeight = isVisible(el) ? height(el) + (inProgress ? 0 : inner) : 0;
3789
3790 Transition.cancel(el);
3791
3792 if (!isToggled(el)) {
3793 _toggle(el, true);
3794 }
3795
3796 height(el, '');
3797
3798 // Update child components first
3799 fastdom.flush();
3800
3801 var endHeight = height(el) + (inProgress ? 0 : inner);
3802 height(el, currentHeight);
3803
3804 return (show
3805 ? Transition.start(el, assign({}, initProps, {overflow: 'hidden', height: endHeight}), Math.round(duration * (1 - currentHeight / endHeight)), transition)
3806 : Transition.start(el, hideProps, Math.round(duration * (currentHeight / endHeight)), transition).then(function () { return _toggle(el, false); })
3807 ).then(function () { return css(el, initProps); });
3808
3809 };
3810 }
3811
3812 function toggleAnimation(cmp) {
3813 return function (el, show) {
3814
3815 Animation.cancel(el);
3816
3817 var animation = cmp.animation;
3818 var duration = cmp.duration;
3819 var _toggle = cmp._toggle;
3820
3821 if (show) {
3822 _toggle(el, true);
3823 return Animation.in(el, animation[0], duration, cmp.origin);
3824 }
3825
3826 return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(function () { return _toggle(el, false); });
3827 };
3828 }
3829
3830 var Accordion = {
3831
3832 mixins: [Class, Togglable],
3833
3834 props: {
3835 targets: String,
3836 active: null,
3837 collapsible: Boolean,
3838 multiple: Boolean,
3839 toggle: String,
3840 content: String,
3841 transition: String,
3842 offset: Number
3843 },
3844
3845 data: {
3846 targets: '> *',
3847 active: false,
3848 animation: [true],
3849 collapsible: true,
3850 multiple: false,
3851 clsOpen: 'uk-open',
3852 toggle: '> .uk-accordion-title',
3853 content: '> .uk-accordion-content',
3854 transition: 'ease',
3855 offset: 0
3856 },
3857
3858 computed: {
3859
3860 items: {
3861
3862 get: function(ref, $el) {
3863 var targets = ref.targets;
3864
3865 return $$(targets, $el);
3866 },
3867
3868 watch: function(items, prev) {
3869 var this$1$1 = this;
3870
3871
3872 items.forEach(function (el) { return hide($(this$1$1.content, el), !hasClass(el, this$1$1.clsOpen)); });
3873
3874 if (prev || hasClass(items, this.clsOpen)) {
3875 return;
3876 }
3877
3878 var active = this.active !== false && items[Number(this.active)]
3879 || !this.collapsible && items[0];
3880
3881 if (active) {
3882 this.toggle(active, false);
3883 }
3884
3885 },
3886
3887 immediate: true
3888
3889 },
3890
3891 toggles: function(ref) {
3892 var toggle = ref.toggle;
3893
3894 return this.items.map(function (item) { return $(toggle, item); });
3895 }
3896
3897 },
3898
3899 events: [
3900
3901 {
3902
3903 name: 'click',
3904
3905 delegate: function() {
3906 return ((this.targets) + " " + (this.$props.toggle));
3907 },
3908
3909 handler: function(e) {
3910 e.preventDefault();
3911 this.toggle(index(this.toggles, e.current));
3912 }
3913
3914 }
3915
3916 ],
3917
3918 methods: {
3919
3920 toggle: function(item, animate) {
3921 var this$1$1 = this;
3922
3923
3924 var items = [this.items[getIndex(item, this.items)]];
3925 var activeItems = filter$1(this.items, ("." + (this.clsOpen)));
3926
3927 if (!this.multiple && !includes(activeItems, items[0])) {
3928 items = items.concat(activeItems);
3929 }
3930
3931 if (!this.collapsible && activeItems.length < 2 && !filter$1(items, (":not(." + (this.clsOpen) + ")")).length) {
3932 return;
3933 }
3934
3935 items.forEach(function (el) { return this$1$1.toggleElement(el, !hasClass(el, this$1$1.clsOpen), function (el, show) {
3936
3937 toggleClass(el, this$1$1.clsOpen, show);
3938 attr($(this$1$1.$props.toggle, el), 'aria-expanded', show);
3939
3940 var content = $(("" + (el._wrapper ? '> * ' : '') + (this$1$1.content)), el);
3941
3942 if (animate === false || !this$1$1.hasTransition) {
3943 hide(content, !show);
3944 return;
3945 }
3946
3947 if (!el._wrapper) {
3948 el._wrapper = wrapAll(content, ("<div" + (show ? ' hidden' : '') + ">"));
3949 }
3950
3951 hide(content, false);
3952 return toggleHeight(this$1$1)(el._wrapper, show).then(function () {
3953 hide(content, !show);
3954 delete el._wrapper;
3955 unwrap(content);
3956
3957 if (show) {
3958 var toggle = $(this$1$1.$props.toggle, el);
3959 if (!isInView(toggle)) {
3960 scrollIntoView(toggle, {offset: this$1$1.offset});
3961 }
3962 }
3963 });
3964 }); });
3965 }
3966
3967 }
3968
3969 };
3970
3971 function hide(el, hide) {
3972 el && (el.hidden = hide);
3973 }
3974
3975 var alert = {
3976
3977 mixins: [Class, Togglable],
3978
3979 args: 'animation',
3980
3981 props: {
3982 close: String
3983 },
3984
3985 data: {
3986 animation: [true],
3987 selClose: '.uk-alert-close',
3988 duration: 150,
3989 hideProps: assign({opacity: 0}, Togglable.data.hideProps)
3990 },
3991
3992 events: [
3993
3994 {
3995
3996 name: 'click',
3997
3998 delegate: function() {
3999 return this.selClose;
4000 },
4001
4002 handler: function(e) {
4003 e.preventDefault();
4004 this.close();
4005 }
4006
4007 }
4008
4009 ],
4010
4011 methods: {
4012
4013 close: function() {
4014 var this$1$1 = this;
4015
4016 this.toggleElement(this.$el).then(function () { return this$1$1.$destroy(true); });
4017 }
4018
4019 }
4020
4021 };
4022
4023 var Video = {
4024
4025 args: 'autoplay',
4026
4027 props: {
4028 automute: Boolean,
4029 autoplay: Boolean
4030 },
4031
4032 data: {
4033 automute: false,
4034 autoplay: true
4035 },
4036
4037 computed: {
4038
4039 inView: function(ref) {
4040 var autoplay = ref.autoplay;
4041
4042 return autoplay === 'inview';
4043 }
4044
4045 },
4046
4047 connected: function() {
4048
4049 if (this.inView && !hasAttr(this.$el, 'preload')) {
4050 this.$el.preload = 'none';
4051 }
4052
4053 if (this.automute) {
4054 mute(this.$el);
4055 }
4056
4057 },
4058
4059 update: {
4060
4061 read: function() {
4062
4063 if (!isVideo(this.$el)) {
4064 return false;
4065 }
4066
4067 return {
4068 visible: isVisible(this.$el) && css(this.$el, 'visibility') !== 'hidden',
4069 inView: this.inView && isInView(this.$el)
4070 };
4071 },
4072
4073 write: function(ref) {
4074 var visible = ref.visible;
4075 var inView = ref.inView;
4076
4077
4078 if (!visible || this.inView && !inView) {
4079 pause(this.$el);
4080 } else if (this.autoplay === true || this.inView && inView) {
4081 play(this.$el);
4082 }
4083
4084 },
4085
4086 events: ['resize', 'scroll']
4087
4088 }
4089
4090 };
4091
4092 var cover = {
4093
4094 mixins: [Class, Video],
4095
4096 props: {
4097 width: Number,
4098 height: Number
4099 },
4100
4101 data: {
4102 automute: true
4103 },
4104
4105 update: {
4106
4107 read: function() {
4108
4109 var el = this.$el;
4110 var ref = getPositionedParent(el) || parent(el);
4111 var height = ref.offsetHeight;
4112 var width = ref.offsetWidth;
4113 var dim = Dimensions.cover(
4114 {
4115 width: this.width || el.naturalWidth || el.videoWidth || el.clientWidth,
4116 height: this.height || el.naturalHeight || el.videoHeight || el.clientHeight
4117 },
4118 {
4119 width: width + (width % 2 ? 1 : 0),
4120 height: height + (height % 2 ? 1 : 0)
4121 }
4122 );
4123
4124 if (!dim.width || !dim.height) {
4125 return false;
4126 }
4127
4128 return dim;
4129 },
4130
4131 write: function(ref) {
4132 var height = ref.height;
4133 var width = ref.width;
4134
4135 css(this.$el, {height: height, width: width});
4136 },
4137
4138 events: ['resize']
4139
4140 }
4141
4142 };
4143
4144 function getPositionedParent(el) {
4145 while ((el = parent(el))) {
4146 if (css(el, 'position') !== 'static') {
4147 return el;
4148 }
4149 }
4150 }
4151
4152 var Container = {
4153
4154 props: {
4155 container: Boolean
4156 },
4157
4158 data: {
4159 container: true
4160 },
4161
4162 computed: {
4163
4164 container: function(ref) {
4165 var container = ref.container;
4166
4167 return container === true && this.$container || container && $(container);
4168 }
4169
4170 }
4171
4172 };
4173
4174 var Position = {
4175
4176 props: {
4177 pos: String,
4178 offset: null,
4179 flip: Boolean,
4180 clsPos: String
4181 },
4182
4183 data: {
4184 pos: ("bottom-" + (!isRtl ? 'left' : 'right')),
4185 flip: true,
4186 offset: false,
4187 clsPos: ''
4188 },
4189
4190 computed: {
4191
4192 pos: function(ref) {
4193 var pos = ref.pos;
4194
4195 return (pos + (!includes(pos, '-') ? '-center' : '')).split('-');
4196 },
4197
4198 dir: function() {
4199 return this.pos[0];
4200 },
4201
4202 align: function() {
4203 return this.pos[1];
4204 }
4205
4206 },
4207
4208 methods: {
4209
4210 positionAt: function(element, target, boundary) {
4211
4212 removeClasses(element, ((this.clsPos) + "-(top|bottom|left|right)(-[a-z]+)?"));
4213
4214 var ref = this;
4215 var offset$1 = ref.offset;
4216 var axis = this.getAxis();
4217
4218 if (!isNumeric(offset$1)) {
4219 var node = $(offset$1);
4220 offset$1 = node
4221 ? offset(node)[axis === 'x' ? 'left' : 'top'] - offset(target)[axis === 'x' ? 'right' : 'bottom']
4222 : 0;
4223 }
4224
4225 var ref$1 = positionAt(
4226 element,
4227 target,
4228 axis === 'x' ? ((flipPosition(this.dir)) + " " + (this.align)) : ((this.align) + " " + (flipPosition(this.dir))),
4229 axis === 'x' ? ((this.dir) + " " + (this.align)) : ((this.align) + " " + (this.dir)),
4230 axis === 'x' ? ("" + (this.dir === 'left' ? -offset$1 : offset$1)) : (" " + (this.dir === 'top' ? -offset$1 : offset$1)),
4231 null,
4232 this.flip,
4233 boundary
4234 ).target;
4235 var x = ref$1.x;
4236 var y = ref$1.y;
4237
4238 this.dir = axis === 'x' ? x : y;
4239 this.align = axis === 'x' ? y : x;
4240
4241 toggleClass(element, ((this.clsPos) + "-" + (this.dir) + "-" + (this.align)), this.offset === false);
4242
4243 },
4244
4245 getAxis: function() {
4246 return this.dir === 'top' || this.dir === 'bottom' ? 'y' : 'x';
4247 }
4248
4249 }
4250
4251 };
4252
4253 var active$1;
4254
4255 var drop = {
4256
4257 mixins: [Container, Position, Togglable],
4258
4259 args: 'pos',
4260
4261 props: {
4262 mode: 'list',
4263 toggle: Boolean,
4264 boundary: Boolean,
4265 boundaryAlign: Boolean,
4266 delayShow: Number,
4267 delayHide: Number,
4268 clsDrop: String
4269 },
4270
4271 data: {
4272 mode: ['click', 'hover'],
4273 toggle: '- *',
4274 boundary: true,
4275 boundaryAlign: false,
4276 delayShow: 0,
4277 delayHide: 800,
4278 clsDrop: false,
4279 animation: ['uk-animation-fade'],
4280 cls: 'uk-open',
4281 container: false
4282 },
4283
4284 computed: {
4285
4286 boundary: function(ref, $el) {
4287 var boundary = ref.boundary;
4288
4289 return boundary === true ? window : query(boundary, $el);
4290 },
4291
4292 clsDrop: function(ref) {
4293 var clsDrop = ref.clsDrop;
4294
4295 return clsDrop || ("uk-" + (this.$options.name));
4296 },
4297
4298 clsPos: function() {
4299 return this.clsDrop;
4300 }
4301
4302 },
4303
4304 created: function() {
4305 this.tracker = new MouseTracker();
4306 },
4307
4308 connected: function() {
4309
4310 addClass(this.$el, this.clsDrop);
4311
4312 if (this.toggle && !this.target) {
4313 this.target = this.$create('toggle', query(this.toggle, this.$el), {
4314 target: this.$el,
4315 mode: this.mode
4316 });
4317 }
4318
4319 },
4320
4321 disconnected: function() {
4322 if (this.isActive()) {
4323 active$1 = null;
4324 }
4325 },
4326
4327 events: [
4328
4329 {
4330
4331 name: 'click',
4332
4333 delegate: function() {
4334 return ("." + (this.clsDrop) + "-close");
4335 },
4336
4337 handler: function(e) {
4338 e.preventDefault();
4339 this.hide(false);
4340 }
4341
4342 },
4343
4344 {
4345
4346 name: 'click',
4347
4348 delegate: function() {
4349 return 'a[href^="#"]';
4350 },
4351
4352 handler: function(ref) {
4353 var defaultPrevented = ref.defaultPrevented;
4354 var hash = ref.current.hash;
4355
4356 if (!defaultPrevented && hash && !within(hash, this.$el)) {
4357 this.hide(false);
4358 }
4359 }
4360
4361 },
4362
4363 {
4364
4365 name: 'beforescroll',
4366
4367 handler: function() {
4368 this.hide(false);
4369 }
4370
4371 },
4372
4373 {
4374
4375 name: 'toggle',
4376
4377 self: true,
4378
4379 handler: function(e, toggle) {
4380
4381 e.preventDefault();
4382
4383 if (this.isToggled()) {
4384 this.hide(false);
4385 } else {
4386 this.show(toggle.$el, false);
4387 }
4388 }
4389
4390 },
4391
4392 {
4393
4394 name: 'toggleshow',
4395
4396 self: true,
4397
4398 handler: function(e, toggle) {
4399 e.preventDefault();
4400 this.show(toggle.$el);
4401 }
4402
4403 },
4404
4405 {
4406
4407 name: 'togglehide',
4408
4409 self: true,
4410
4411 handler: function(e) {
4412 e.preventDefault();
4413 if (!matches(this.$el, ':focus,:hover')) {
4414 this.hide();
4415 }
4416 }
4417
4418 },
4419
4420 {
4421
4422 name: (pointerEnter + " focusin"),
4423
4424 filter: function() {
4425 return includes(this.mode, 'hover');
4426 },
4427
4428 handler: function(e) {
4429 if (!isTouch(e)) {
4430 this.clearTimers();
4431 }
4432 }
4433
4434 },
4435
4436 {
4437
4438 name: (pointerLeave + " focusout"),
4439
4440 filter: function() {
4441 return includes(this.mode, 'hover');
4442 },
4443
4444 handler: function(e) {
4445 if (!isTouch(e) && e.relatedTarget) {
4446 this.hide();
4447 }
4448 }
4449
4450 },
4451
4452 {
4453
4454 name: 'toggled',
4455
4456 self: true,
4457
4458 handler: function(e, toggled) {
4459
4460 if (!toggled) {
4461 return;
4462 }
4463
4464 this.clearTimers();
4465 this.position();
4466 }
4467
4468 },
4469
4470 {
4471
4472 name: 'show',
4473
4474 self: true,
4475
4476 handler: function() {
4477 var this$1$1 = this;
4478
4479
4480 active$1 = this;
4481
4482 this.tracker.init();
4483
4484 once(this.$el, 'hide', on(document, pointerDown, function (ref) {
4485 var target = ref.target;
4486
4487 return !within(target, this$1$1.$el) && once(document, (pointerUp + " " + pointerCancel + " scroll"), function (ref) {
4488 var defaultPrevented = ref.defaultPrevented;
4489 var type = ref.type;
4490 var newTarget = ref.target;
4491
4492 if (!defaultPrevented && type === pointerUp && target === newTarget && !(this$1$1.target && within(target, this$1$1.target))) {
4493 this$1$1.hide(false);
4494 }
4495 }, true);
4496 }
4497 ), {self: true});
4498
4499 once(this.$el, 'hide', on(document, 'keydown', function (e) {
4500 if (e.keyCode === 27) {
4501 this$1$1.hide(false);
4502 }
4503 }), {self: true});
4504
4505 }
4506
4507 },
4508
4509 {
4510
4511 name: 'beforehide',
4512
4513 self: true,
4514
4515 handler: function() {
4516 this.clearTimers();
4517 }
4518
4519 },
4520
4521 {
4522
4523 name: 'hide',
4524
4525 handler: function(ref) {
4526 var target = ref.target;
4527
4528
4529 if (this.$el !== target) {
4530 active$1 = active$1 === null && within(target, this.$el) && this.isToggled() ? this : active$1;
4531 return;
4532 }
4533
4534 active$1 = this.isActive() ? null : active$1;
4535 this.tracker.cancel();
4536 }
4537
4538 }
4539
4540 ],
4541
4542 update: {
4543
4544 write: function() {
4545
4546 if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
4547 this.position();
4548 }
4549
4550 },
4551
4552 events: ['resize']
4553
4554 },
4555
4556 methods: {
4557
4558 show: function(target, delay) {
4559 var this$1$1 = this;
4560 if ( target === void 0 ) target = this.target;
4561 if ( delay === void 0 ) delay = true;
4562
4563
4564 if (this.isToggled() && target && this.target && target !== this.target) {
4565 this.hide(false);
4566 }
4567
4568 this.target = target;
4569
4570 this.clearTimers();
4571
4572 if (this.isActive()) {
4573 return;
4574 }
4575
4576 if (active$1) {
4577
4578 if (delay && active$1.isDelaying) {
4579 this.showTimer = setTimeout(this.show, 10);
4580 return;
4581 }
4582
4583 var prev;
4584 while (active$1 && prev !== active$1 && !within(this.$el, active$1.$el)) {
4585 prev = active$1;
4586 active$1.hide(false);
4587 }
4588
4589 }
4590
4591 if (this.container && parent(this.$el) !== this.container) {
4592 append(this.container, this.$el);
4593 }
4594
4595 this.showTimer = setTimeout(function () { return this$1$1.toggleElement(this$1$1.$el, true); }, delay && this.delayShow || 0);
4596
4597 },
4598
4599 hide: function(delay) {
4600 var this$1$1 = this;
4601 if ( delay === void 0 ) delay = true;
4602
4603
4604 var hide = function () { return this$1$1.toggleElement(this$1$1.$el, false, false); };
4605
4606 this.clearTimers();
4607
4608 this.isDelaying = getPositionedElements(this.$el).some(function (el) { return this$1$1.tracker.movesTo(el); });
4609
4610 if (delay && this.isDelaying) {
4611 this.hideTimer = setTimeout(this.hide, 50);
4612 } else if (delay && this.delayHide) {
4613 this.hideTimer = setTimeout(hide, this.delayHide);
4614 } else {
4615 hide();
4616 }
4617 },
4618
4619 clearTimers: function() {
4620 clearTimeout(this.showTimer);
4621 clearTimeout(this.hideTimer);
4622 this.showTimer = null;
4623 this.hideTimer = null;
4624 this.isDelaying = false;
4625 },
4626
4627 isActive: function() {
4628 return active$1 === this;
4629 },
4630
4631 position: function() {
4632
4633 removeClass(this.$el, ((this.clsDrop) + "-stack"));
4634 toggleClass(this.$el, ((this.clsDrop) + "-boundary"), this.boundaryAlign);
4635
4636 var boundary = offset(this.boundary);
4637 var alignTo = this.boundaryAlign ? boundary : offset(this.target);
4638
4639 if (this.align === 'justify') {
4640 var prop = this.getAxis() === 'y' ? 'width' : 'height';
4641 css(this.$el, prop, alignTo[prop]);
4642 } else if (this.boundary && this.$el.offsetWidth > Math.max(boundary.right - alignTo.left, alignTo.right - boundary.left)) {
4643 addClass(this.$el, ((this.clsDrop) + "-stack"));
4644 }
4645
4646 this.positionAt(this.$el, this.boundaryAlign ? this.boundary : this.target, this.boundary);
4647
4648 }
4649
4650 }
4651
4652 };
4653
4654 function getPositionedElements(el) {
4655 var result = [];
4656 apply$1(el, function (el) { return css(el, 'position') !== 'static' && result.push(el); });
4657 return result;
4658 }
4659
4660 var formCustom = {
4661
4662 mixins: [Class],
4663
4664 args: 'target',
4665
4666 props: {
4667 target: Boolean
4668 },
4669
4670 data: {
4671 target: false
4672 },
4673
4674 computed: {
4675
4676 input: function(_, $el) {
4677 return $(selInput, $el);
4678 },
4679
4680 state: function() {
4681 return this.input.nextElementSibling;
4682 },
4683
4684 target: function(ref, $el) {
4685 var target = ref.target;
4686
4687 return target && (target === true
4688 && parent(this.input) === $el
4689 && this.input.nextElementSibling
4690 || query(target, $el));
4691 }
4692
4693 },
4694
4695 update: function() {
4696
4697 var ref = this;
4698 var target = ref.target;
4699 var input = ref.input;
4700
4701 if (!target) {
4702 return;
4703 }
4704
4705 var option;
4706 var prop = isInput(target) ? 'value' : 'textContent';
4707 var prev = target[prop];
4708 var value = input.files && input.files[0]
4709 ? input.files[0].name
4710 : matches(input, 'select') && (option = $$('option', input).filter(function (el) { return el.selected; })[0]) // eslint-disable-line prefer-destructuring
4711 ? option.textContent
4712 : input.value;
4713
4714 if (prev !== value) {
4715 target[prop] = value;
4716 }
4717
4718 },
4719
4720 events: [
4721
4722 {
4723 name: 'change',
4724
4725 handler: function() {
4726 this.$update();
4727 }
4728 },
4729
4730 {
4731 name: 'reset',
4732
4733 el: function() {
4734 return closest(this.$el, 'form');
4735 },
4736
4737 handler: function() {
4738 this.$update();
4739 }
4740 }
4741
4742 ]
4743
4744 };
4745
4746 // Deprecated
4747 var gif = {
4748
4749 update: {
4750
4751 read: function(data) {
4752
4753 var inview = isInView(this.$el);
4754
4755 if (!inview || data.isInView === inview) {
4756 return false;
4757 }
4758
4759 data.isInView = inview;
4760 },
4761
4762 write: function() {
4763 this.$el.src = '' + this.$el.src; // force self-assign
4764 },
4765
4766 events: ['scroll', 'resize']
4767 }
4768
4769 };
4770
4771 var Margin = {
4772
4773 props: {
4774 margin: String,
4775 firstColumn: Boolean
4776 },
4777
4778 data: {
4779 margin: 'uk-margin-small-top',
4780 firstColumn: 'uk-first-column'
4781 },
4782
4783 update: {
4784
4785 read: function() {
4786
4787 var rows = getRows(this.$el.children);
4788
4789 return {
4790 rows: rows,
4791 columns: getColumns(rows)
4792 };
4793 },
4794
4795 write: function(ref) {
4796 var columns = ref.columns;
4797 var rows = ref.rows;
4798
4799 for (var i = 0; i < rows.length; i++) {
4800 for (var j = 0; j < rows[i].length; j++) {
4801 toggleClass(rows[i][j], this.margin, i !== 0);
4802 toggleClass(rows[i][j], this.firstColumn, !!~columns[0].indexOf(rows[i][j]));
4803 }
4804 }
4805 },
4806
4807 events: ['resize']
4808
4809 }
4810
4811 };
4812
4813 function getRows(items) {
4814 return sortBy(items, 'top', 'bottom');
4815 }
4816
4817 function getColumns(rows) {
4818
4819 var columns = [];
4820
4821 for (var i = 0; i < rows.length; i++) {
4822 var sorted = sortBy(rows[i], 'left', 'right');
4823 for (var j = 0; j < sorted.length; j++) {
4824 columns[j] = !columns[j] ? sorted[j] : columns[j].concat(sorted[j]);
4825 }
4826 }
4827
4828 return isRtl
4829 ? columns.reverse()
4830 : columns;
4831 }
4832
4833 function sortBy(items, startProp, endProp) {
4834
4835 var sorted = [[]];
4836
4837 for (var i = 0; i < items.length; i++) {
4838
4839 var el = items[i];
4840
4841 if (!isVisible(el)) {
4842 continue;
4843 }
4844
4845 var dim = getOffset(el);
4846
4847 for (var j = sorted.length - 1; j >= 0; j--) {
4848
4849 var current = sorted[j];
4850
4851 if (!current[0]) {
4852 current.push(el);
4853 break;
4854 }
4855
4856 var startDim = (void 0);
4857 if (current[0].offsetParent === el.offsetParent) {
4858 startDim = getOffset(current[0]);
4859 } else {
4860 dim = getOffset(el, true);
4861 startDim = getOffset(current[0], true);
4862 }
4863
4864 if (dim[startProp] >= startDim[endProp] - 1 && dim[startProp] !== startDim[startProp]) {
4865 sorted.push([el]);
4866 break;
4867 }
4868
4869 if (dim[endProp] - 1 > startDim[startProp] || dim[startProp] === startDim[startProp]) {
4870 current.push(el);
4871 break;
4872 }
4873
4874 if (j === 0) {
4875 sorted.unshift([el]);
4876 break;
4877 }
4878
4879 }
4880
4881 }
4882
4883 return sorted;
4884 }
4885
4886 function getOffset(element, offset) {
4887 var assign;
4888
4889 if ( offset === void 0 ) offset = false;
4890
4891 var offsetTop = element.offsetTop;
4892 var offsetLeft = element.offsetLeft;
4893 var offsetHeight = element.offsetHeight;
4894 var offsetWidth = element.offsetWidth;
4895
4896 if (offset) {
4897 (assign = offsetPosition(element), offsetTop = assign[0], offsetLeft = assign[1]);
4898 }
4899
4900 return {
4901 top: offsetTop,
4902 left: offsetLeft,
4903 bottom: offsetTop + offsetHeight,
4904 right: offsetLeft + offsetWidth
4905 };
4906 }
4907
4908 var grid = {
4909
4910 extends: Margin,
4911
4912 mixins: [Class],
4913
4914 name: 'grid',
4915
4916 props: {
4917 masonry: Boolean,
4918 parallax: Number
4919 },
4920
4921 data: {
4922 margin: 'uk-grid-margin',
4923 clsStack: 'uk-grid-stack',
4924 masonry: false,
4925 parallax: 0
4926 },
4927
4928 connected: function() {
4929 this.masonry && addClass(this.$el, 'uk-flex-top uk-flex-wrap-top');
4930 },
4931
4932 update: [
4933
4934 {
4935
4936 write: function(ref) {
4937 var columns = ref.columns;
4938
4939 toggleClass(this.$el, this.clsStack, columns.length < 2);
4940 },
4941
4942 events: ['resize']
4943
4944 },
4945
4946 {
4947
4948 read: function(data) {
4949
4950 var columns = data.columns;
4951 var rows = data.rows;
4952
4953 // Filter component makes elements positioned absolute
4954 if (!columns.length || !this.masonry && !this.parallax || positionedAbsolute(this.$el)) {
4955 data.translates = false;
4956 return false;
4957 }
4958
4959 var translates = false;
4960
4961 var nodes = children(this.$el);
4962 var columnHeights = getColumnHeights(columns);
4963 var margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
4964 var elHeight = Math.max.apply(Math, columnHeights) + margin;
4965
4966 if (this.masonry) {
4967 columns = columns.map(function (column) { return sortBy$1(column, 'offsetTop'); });
4968 translates = getTranslates(rows, columns);
4969 }
4970
4971 var padding = Math.abs(this.parallax);
4972 if (padding) {
4973 padding = columnHeights.reduce(function (newPadding, hgt, i) { return Math.max(newPadding, hgt + margin + (i % 2 ? padding : padding / 8) - elHeight); }
4974 , 0);
4975 }
4976
4977 return {padding: padding, columns: columns, translates: translates, height: translates ? elHeight : ''};
4978
4979 },
4980
4981 write: function(ref) {
4982 var height = ref.height;
4983 var padding = ref.padding;
4984
4985
4986 css(this.$el, 'paddingBottom', padding || '');
4987 height !== false && css(this.$el, 'height', height);
4988
4989 },
4990
4991 events: ['resize']
4992
4993 },
4994
4995 {
4996
4997 read: function(ref) {
4998 var height$1 = ref.height;
4999
5000
5001 if (positionedAbsolute(this.$el)) {
5002 return false;
5003 }
5004
5005 return {
5006 scrolled: this.parallax
5007 ? scrolledOver(this.$el, height$1 ? height$1 - height(this.$el) : 0) * Math.abs(this.parallax)
5008 : false
5009 };
5010 },
5011
5012 write: function(ref) {
5013 var columns = ref.columns;
5014 var scrolled = ref.scrolled;
5015 var translates = ref.translates;
5016
5017
5018 if (scrolled === false && !translates) {
5019 return;
5020 }
5021
5022 columns.forEach(function (column, i) { return column.forEach(function (el, j) { return css(el, 'transform', !scrolled && !translates ? '' : ("translateY(" + ((translates && -translates[i][j]) + (scrolled ? i % 2 ? scrolled : scrolled / 8 : 0)) + "px)")); }
5023 ); }
5024 );
5025
5026 },
5027
5028 events: ['scroll', 'resize']
5029
5030 }
5031
5032 ]
5033
5034 };
5035
5036 function positionedAbsolute(el) {
5037 return children(el).some(function (el) { return css(el, 'position') === 'absolute'; });
5038 }
5039
5040 function getTranslates(rows, columns) {
5041
5042 var rowHeights = rows.map(function (row) { return Math.max.apply(Math, row.map(function (el) { return el.offsetHeight; })); }
5043 );
5044
5045 return columns.map(function (elements) {
5046 var prev = 0;
5047 return elements.map(function (element, row) { return prev += row
5048 ? rowHeights[row - 1] - elements[row - 1].offsetHeight
5049 : 0; }
5050 );
5051 });
5052 }
5053
5054 function getMarginTop(nodes, cls) {
5055
5056 var ref = nodes.filter(function (el) { return hasClass(el, cls); });
5057 var node = ref[0];
5058
5059 return toFloat(node
5060 ? css(node, 'marginTop')
5061 : css(nodes[0], 'paddingLeft'));
5062 }
5063
5064 function getColumnHeights(columns) {
5065 return columns.map(function (column) { return column.reduce(function (sum, el) { return sum + el.offsetHeight; }, 0); }
5066 );
5067 }
5068
5069 // IE 11 fix (min-height on a flex container won't apply to its flex items)
5070 var FlexBug = isIE ? {
5071
5072 props: {
5073 selMinHeight: String
5074 },
5075
5076 data: {
5077 selMinHeight: false,
5078 forceHeight: false
5079 },
5080
5081 computed: {
5082
5083 elements: function(ref, $el) {
5084 var selMinHeight = ref.selMinHeight;
5085
5086 return selMinHeight ? $$(selMinHeight, $el) : [$el];
5087 }
5088
5089 },
5090
5091 update: [
5092
5093 {
5094
5095 read: function() {
5096 css(this.elements, 'height', '');
5097 },
5098
5099 order: -5,
5100
5101 events: ['resize']
5102
5103 },
5104
5105 {
5106
5107 write: function() {
5108 var this$1$1 = this;
5109
5110 this.elements.forEach(function (el) {
5111 var height = toFloat(css(el, 'minHeight'));
5112 if (height && (this$1$1.forceHeight || Math.round(height + boxModelAdjust(el, 'height', 'content-box')) >= el.offsetHeight)) {
5113 css(el, 'height', height);
5114 }
5115 });
5116 },
5117
5118 order: 5,
5119
5120 events: ['resize']
5121
5122 }
5123
5124 ]
5125
5126 } : {};
5127
5128 var heightMatch = {
5129
5130 mixins: [FlexBug],
5131
5132 args: 'target',
5133
5134 props: {
5135 target: String,
5136 row: Boolean
5137 },
5138
5139 data: {
5140 target: '> *',
5141 row: true,
5142 forceHeight: true
5143 },
5144
5145 computed: {
5146
5147 elements: function(ref, $el) {
5148 var target = ref.target;
5149
5150 return $$(target, $el);
5151 }
5152
5153 },
5154
5155 update: {
5156
5157 read: function() {
5158 return {
5159 rows: (this.row ? getRows(this.elements) : [this.elements]).map(match$1)
5160 };
5161 },
5162
5163 write: function(ref) {
5164 var rows = ref.rows;
5165
5166 rows.forEach(function (ref) {
5167 var heights = ref.heights;
5168 var elements = ref.elements;
5169
5170 return elements.forEach(function (el, i) { return css(el, 'minHeight', heights[i]); }
5171 );
5172 }
5173 );
5174 },
5175
5176 events: ['resize']
5177
5178 }
5179
5180 };
5181
5182 function match$1(elements) {
5183
5184 if (elements.length < 2) {
5185 return {heights: [''], elements: elements};
5186 }
5187
5188 var heights = elements.map(getHeight);
5189 var max = Math.max.apply(Math, heights);
5190 var hasMinHeight = elements.some(function (el) { return el.style.minHeight; });
5191 var hasShrunk = elements.some(function (el, i) { return !el.style.minHeight && heights[i] < max; });
5192
5193 if (hasMinHeight && hasShrunk) {
5194 css(elements, 'minHeight', '');
5195 heights = elements.map(getHeight);
5196 max = Math.max.apply(Math, heights);
5197 }
5198
5199 heights = elements.map(function (el, i) { return heights[i] === max && toFloat(el.style.minHeight).toFixed(2) !== max.toFixed(2) ? '' : max; }
5200 );
5201
5202 return {heights: heights, elements: elements};
5203 }
5204
5205 function getHeight(element) {
5206
5207 var style = false;
5208 if (!isVisible(element)) {
5209 style = element.style.display;
5210 css(element, 'display', 'block', 'important');
5211 }
5212
5213 var height = dimensions(element).height - boxModelAdjust(element, 'height', 'content-box');
5214
5215 if (style !== false) {
5216 css(element, 'display', style);
5217 }
5218
5219 return height;
5220 }
5221
5222 var heightViewport = {
5223
5224 mixins: [FlexBug],
5225
5226 props: {
5227 expand: Boolean,
5228 offsetTop: Boolean,
5229 offsetBottom: Boolean,
5230 minHeight: Number
5231 },
5232
5233 data: {
5234 expand: false,
5235 offsetTop: false,
5236 offsetBottom: false,
5237 minHeight: 0
5238 },
5239
5240 update: {
5241
5242 read: function(ref) {
5243 var prev = ref.minHeight;
5244
5245
5246 if (!isVisible(this.$el)) {
5247 return false;
5248 }
5249
5250 var minHeight = '';
5251 var box = boxModelAdjust(this.$el, 'height', 'content-box');
5252
5253 if (this.expand) {
5254
5255 minHeight = height(window) - (dimensions(document.documentElement).height - dimensions(this.$el).height) - box || '';
5256
5257 } else {
5258
5259 // on mobile devices (iOS and Android) window.innerHeight !== 100vh
5260 minHeight = 'calc(100vh';
5261
5262 if (this.offsetTop) {
5263
5264 var ref$1 = offset(this.$el);
5265 var top = ref$1.top;
5266 minHeight += top > 0 && top < height(window) / 2 ? (" - " + top + "px") : '';
5267
5268 }
5269
5270 if (this.offsetBottom === true) {
5271
5272 minHeight += " - " + (dimensions(this.$el.nextElementSibling).height) + "px";
5273
5274 } else if (isNumeric(this.offsetBottom)) {
5275
5276 minHeight += " - " + (this.offsetBottom) + "vh";
5277
5278 } else if (this.offsetBottom && endsWith(this.offsetBottom, 'px')) {
5279
5280 minHeight += " - " + (toFloat(this.offsetBottom)) + "px";
5281
5282 } else if (isString(this.offsetBottom)) {
5283
5284 minHeight += " - " + (dimensions(query(this.offsetBottom, this.$el)).height) + "px";
5285
5286 }
5287
5288 minHeight += (box ? (" - " + box + "px") : '') + ")";
5289
5290 }
5291
5292 return {minHeight: minHeight, prev: prev};
5293 },
5294
5295 write: function(ref) {
5296 var minHeight = ref.minHeight;
5297 var prev = ref.prev;
5298
5299
5300 css(this.$el, {minHeight: minHeight});
5301
5302 if (minHeight !== prev) {
5303 this.$update(this.$el, 'resize');
5304 }
5305
5306 if (this.minHeight && toFloat(css(this.$el, 'minHeight')) < this.minHeight) {
5307 css(this.$el, 'minHeight', this.minHeight);
5308 }
5309
5310 },
5311
5312 events: ['resize']
5313
5314 }
5315
5316 };
5317
5318 var SVG = {
5319
5320 args: 'src',
5321
5322 props: {
5323 id: Boolean,
5324 icon: String,
5325 src: String,
5326 style: String,
5327 width: Number,
5328 height: Number,
5329 ratio: Number,
5330 class: String,
5331 strokeAnimation: Boolean,
5332 focusable: Boolean, // IE 11
5333 attributes: 'list'
5334 },
5335
5336 data: {
5337 ratio: 1,
5338 include: ['style', 'class', 'focusable'],
5339 class: '',
5340 strokeAnimation: false
5341 },
5342
5343 beforeConnect: function() {
5344 this.class += ' uk-svg';
5345 },
5346
5347 connected: function() {
5348 var this$1$1 = this;
5349 var assign;
5350
5351
5352 if (!this.icon && includes(this.src, '#')) {
5353 (assign = this.src.split('#'), this.src = assign[0], this.icon = assign[1]);
5354 }
5355
5356 this.svg = this.getSvg().then(function (el) {
5357
5358 if (this$1$1._connected) {
5359
5360 var svg = insertSVG(el, this$1$1.$el);
5361
5362 if (this$1$1.svgEl && svg !== this$1$1.svgEl) {
5363 remove$1(this$1$1.svgEl);
5364 }
5365
5366 this$1$1.applyAttributes(svg, el);
5367 this$1$1.$emit();
5368 return this$1$1.svgEl = svg;
5369 }
5370
5371 }, noop);
5372
5373 },
5374
5375 disconnected: function() {
5376 var this$1$1 = this;
5377
5378
5379 this.svg.then(function (svg) {
5380 if (!this$1$1._connected) {
5381
5382 if (isVoidElement(this$1$1.$el)) {
5383 this$1$1.$el.hidden = false;
5384 }
5385
5386 remove$1(svg);
5387 this$1$1.svgEl = null;
5388 }
5389 });
5390
5391 this.svg = null;
5392
5393 },
5394
5395 update: {
5396
5397 read: function() {
5398 return !!(this.strokeAnimation && this.svgEl && isVisible(this.svgEl));
5399 },
5400
5401 write: function() {
5402 applyAnimation(this.svgEl);
5403 },
5404
5405 type: ['resize']
5406
5407 },
5408
5409 methods: {
5410
5411 getSvg: function() {
5412 var this$1$1 = this;
5413
5414 return loadSVG(this.src).then(function (svg) { return parseSVG(svg, this$1$1.icon) || Promise$1.reject('SVG not found.'); }
5415 );
5416 },
5417
5418 applyAttributes: function(el, ref) {
5419 var this$1$1 = this;
5420
5421
5422 for (var prop in this.$options.props) {
5423 if (includes(this.include, prop) && (prop in this)) {
5424 attr(el, prop, this[prop]);
5425 }
5426 }
5427
5428 for (var attribute in this.attributes) {
5429 var ref$1 = this.attributes[attribute].split(':', 2);
5430 var prop$1 = ref$1[0];
5431 var value = ref$1[1];
5432 attr(el, prop$1, value);
5433 }
5434
5435 if (!this.id) {
5436 removeAttr(el, 'id');
5437 }
5438
5439 var props = ['width', 'height'];
5440 var dimensions = props.map(function (prop) { return this$1$1[prop]; });
5441
5442 if (!dimensions.some(function (val) { return val; })) {
5443 dimensions = props.map(function (prop) { return attr(ref, prop); });
5444 }
5445
5446 var viewBox = attr(ref, 'viewBox');
5447 if (viewBox && !dimensions.some(function (val) { return val; })) {
5448 dimensions = viewBox.split(' ').slice(2);
5449 }
5450
5451 dimensions.forEach(function (val, i) { return attr(el, props[i], toFloat(val) * this$1$1.ratio || null); }
5452 );
5453
5454 }
5455
5456 }
5457
5458 };
5459
5460 var loadSVG = memoize(function (src) { return new Promise$1(function (resolve, reject) {
5461
5462 if (!src) {
5463 reject();
5464 return;
5465 }
5466
5467 if (startsWith(src, 'data:')) {
5468 resolve(decodeURIComponent(src.split(',')[1]));
5469 } else {
5470
5471 ajax(src).then(
5472 function (xhr) { return resolve(xhr.response); },
5473 function () { return reject('SVG not found.'); }
5474 );
5475
5476 }
5477 }); }
5478 );
5479
5480 function parseSVG(svg, icon) {
5481
5482 if (icon && includes(svg, '<symbol')) {
5483 svg = parseSymbols(svg, icon) || svg;
5484 }
5485
5486 svg = $(svg.substr(svg.indexOf('<svg')));
5487 return svg && svg.hasChildNodes() && svg;
5488 }
5489
5490 var symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
5491 var symbols = {};
5492
5493 function parseSymbols(svg, icon) {
5494
5495 if (!symbols[svg]) {
5496
5497 symbols[svg] = {};
5498
5499 symbolRe.lastIndex = 0;
5500
5501 var match;
5502 while ((match = symbolRe.exec(svg))) {
5503 symbols[svg][match[3]] = "<svg xmlns=\"http://www.w3.org/2000/svg\"" + (match[1]) + "svg>";
5504 }
5505
5506 }
5507
5508 return symbols[svg][icon];
5509 }
5510
5511 function applyAnimation(el) {
5512
5513 var length = getMaxPathLength(el);
5514
5515 if (length) {
5516 el.style.setProperty('--uk-animation-stroke', length);
5517 }
5518
5519 }
5520
5521 function getMaxPathLength(el) {
5522 return Math.ceil(Math.max.apply(Math, [ 0 ].concat( $$('[stroke]', el).map(function (stroke) {
5523 try {
5524 return stroke.getTotalLength();
5525 } catch (e) {
5526 return 0;
5527 }
5528 }) )));
5529 }
5530
5531 function insertSVG(el, root) {
5532
5533 if (isVoidElement(root) || root.tagName === 'CANVAS') {
5534
5535 root.hidden = true;
5536
5537 var next = root.nextElementSibling;
5538 return equals(el, next)
5539 ? next
5540 : after(root, el);
5541
5542 }
5543
5544 var last = root.lastElementChild;
5545 return equals(el, last)
5546 ? last
5547 : append(root, el);
5548 }
5549
5550 function equals(el, other) {
5551 return isSVG(el) && isSVG(other) && innerHTML(el) === innerHTML(other);
5552 }
5553
5554 function isSVG(el) {
5555 return el && el.tagName === 'svg';
5556 }
5557
5558 function innerHTML(el) {
5559 return (el.innerHTML || (new XMLSerializer()).serializeToString(el).replace(/<svg.*?>(.*?)<\/svg>/g, '$1')).replace(/\s/g, '');
5560 }
5561
5562 var closeIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"1\" y1=\"1\" x2=\"13\" y2=\"13\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"13\" y1=\"1\" x2=\"1\" y2=\"13\"/></svg>";
5563
5564 var closeLarge = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"1\" y1=\"1\" x2=\"19\" y2=\"19\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" x1=\"19\" y1=\"1\" x2=\"1\" y2=\"19\"/></svg>";
5565
5566 var marker = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"9\" y=\"4\" width=\"1\" height=\"11\"/><rect x=\"4\" y=\"9\" width=\"11\" height=\"1\"/></svg>";
5567
5568 var navbarToggleIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><rect y=\"9\" width=\"20\" height=\"2\"/><rect y=\"3\" width=\"20\" height=\"2\"/><rect y=\"15\" width=\"20\" height=\"2\"/></svg>";
5569
5570 var overlayIcon = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><rect x=\"19\" y=\"0\" width=\"1\" height=\"40\"/><rect x=\"0\" y=\"19\" width=\"40\" height=\"1\"/></svg>";
5571
5572 var paginationNext = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 1 6 6 1 11\"/></svg>";
5573
5574 var paginationPrevious = "<svg width=\"7\" height=\"12\" viewBox=\"0 0 7 12\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"6 1 1 6 6 11\"/></svg>";
5575
5576 var searchIcon = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"9\" cy=\"9\" r=\"7\"/><path fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" d=\"M14,14 L18,18 L14,14 Z\"/></svg>";
5577
5578 var searchLarge = "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" cx=\"17.5\" cy=\"17.5\" r=\"16.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.8\" x1=\"38\" y1=\"39\" x2=\"29\" y2=\"30\"/></svg>";
5579
5580 var searchNavbar = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" cx=\"10.5\" cy=\"10.5\" r=\"9.5\"/><line fill=\"none\" stroke=\"#000\" stroke-width=\"1.1\" x1=\"23\" y1=\"23\" x2=\"17\" y2=\"17\"/></svg>";
5581
5582 var slidenavNext = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"1.225,23 12.775,12 1.225,1 \"/></svg>";
5583
5584 var slidenavNextLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"4.002,38.547 22.527,20.024 4,1.5 \"/></svg>";
5585
5586 var slidenavPrevious = "<svg width=\"14\" height=\"24\" viewBox=\"0 0 14 24\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.4\" points=\"12.775,1 1.225,12 12.775,23 \"/></svg>";
5587
5588 var slidenavPreviousLarge = "<svg width=\"25\" height=\"40\" viewBox=\"0 0 25 40\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"2\" points=\"20.527,1.5 2,20.024 20.525,38.547 \"/></svg>";
5589
5590 var spinner = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" xmlns=\"http://www.w3.org/2000/svg\"><circle fill=\"none\" stroke=\"#000\" cx=\"15\" cy=\"15\" r=\"14\"/></svg>";
5591
5592 var totop = "<svg width=\"18\" height=\"10\" viewBox=\"0 0 18 10\" xmlns=\"http://www.w3.org/2000/svg\"><polyline fill=\"none\" stroke=\"#000\" stroke-width=\"1.2\" points=\"1 9 9 1 17 9 \"/></svg>";
5593
5594 var icons = {
5595 spinner: spinner,
5596 totop: totop,
5597 marker: marker,
5598 'close-icon': closeIcon,
5599 'close-large': closeLarge,
5600 'navbar-toggle-icon': navbarToggleIcon,
5601 'overlay-icon': overlayIcon,
5602 'pagination-next': paginationNext,
5603 'pagination-previous': paginationPrevious,
5604 'search-icon': searchIcon,
5605 'search-large': searchLarge,
5606 'search-navbar': searchNavbar,
5607 'slidenav-next': slidenavNext,
5608 'slidenav-next-large': slidenavNextLarge,
5609 'slidenav-previous': slidenavPrevious,
5610 'slidenav-previous-large': slidenavPreviousLarge
5611 };
5612
5613 var Icon = {
5614
5615 install: install$3,
5616
5617 extends: SVG,
5618
5619 args: 'icon',
5620
5621 props: ['icon'],
5622
5623 data: {
5624 include: ['focusable']
5625 },
5626
5627 isIcon: true,
5628
5629 beforeConnect: function() {
5630 addClass(this.$el, 'uk-icon');
5631 },
5632
5633 methods: {
5634
5635 getSvg: function() {
5636
5637 var icon = getIcon(this.icon);
5638
5639 if (!icon) {
5640 return Promise$1.reject('Icon not found.');
5641 }
5642
5643 return Promise$1.resolve(icon);
5644 }
5645
5646 }
5647
5648 };
5649
5650 var IconComponent = {
5651
5652 args: false,
5653
5654 extends: Icon,
5655
5656 data: function (vm) { return ({
5657 icon: hyphenate(vm.constructor.options.name)
5658 }); },
5659
5660 beforeConnect: function() {
5661 addClass(this.$el, this.$name);
5662 }
5663
5664 };
5665
5666 var Slidenav = {
5667
5668 extends: IconComponent,
5669
5670 beforeConnect: function() {
5671 addClass(this.$el, 'uk-slidenav');
5672 },
5673
5674 computed: {
5675
5676 icon: function(ref, $el) {
5677 var icon = ref.icon;
5678
5679 return hasClass($el, 'uk-slidenav-large')
5680 ? (icon + "-large")
5681 : icon;
5682 }
5683
5684 }
5685
5686 };
5687
5688 var Search = {
5689
5690 extends: IconComponent,
5691
5692 computed: {
5693
5694 icon: function(ref, $el) {
5695 var icon = ref.icon;
5696
5697 return hasClass($el, 'uk-search-icon') && parents($el, '.uk-search-large').length
5698 ? 'search-large'
5699 : parents($el, '.uk-search-navbar').length
5700 ? 'search-navbar'
5701 : icon;
5702 }
5703
5704 }
5705
5706 };
5707
5708 var Close = {
5709
5710 extends: IconComponent,
5711
5712 computed: {
5713
5714 icon: function() {
5715 return ("close-" + (hasClass(this.$el, 'uk-close-large') ? 'large' : 'icon'));
5716 }
5717
5718 }
5719
5720 };
5721
5722 var Spinner = {
5723
5724 extends: IconComponent,
5725
5726 connected: function() {
5727 var this$1$1 = this;
5728
5729 this.svg.then(function (svg) { return svg && this$1$1.ratio !== 1 && css($('circle', svg), 'strokeWidth', 1 / this$1$1.ratio); });
5730 }
5731
5732 };
5733
5734 var parsed = {};
5735 function install$3(UIkit) {
5736 UIkit.icon.add = function (name, svg) {
5737 var obj;
5738
5739
5740 var added = isString(name) ? (( obj = {}, obj[name] = svg, obj )) : name;
5741 each(added, function (svg, name) {
5742 icons[name] = svg;
5743 delete parsed[name];
5744 });
5745
5746 if (UIkit._initialized) {
5747 apply$1(document.body, function (el) { return each(UIkit.getComponents(el), function (cmp) {
5748 cmp.$options.isIcon && cmp.icon in added && cmp.$reset();
5749 }); }
5750 );
5751 }
5752 };
5753 }
5754
5755 function getIcon(icon) {
5756
5757 if (!icons[icon]) {
5758 return null;
5759 }
5760
5761 if (!parsed[icon]) {
5762 parsed[icon] = $((icons[applyRtl(icon)] || icons[icon]).trim());
5763 }
5764
5765 return parsed[icon].cloneNode(true);
5766 }
5767
5768 function applyRtl(icon) {
5769 return isRtl ? swap(swap(icon, 'left', 'right'), 'previous', 'next') : icon;
5770 }
5771
5772 var img = {
5773
5774 args: 'dataSrc',
5775
5776 props: {
5777 dataSrc: String,
5778 dataSrcset: Boolean,
5779 sizes: String,
5780 width: Number,
5781 height: Number,
5782 offsetTop: String,
5783 offsetLeft: String,
5784 target: String
5785 },
5786
5787 data: {
5788 dataSrc: '',
5789 dataSrcset: false,
5790 sizes: false,
5791 width: false,
5792 height: false,
5793 offsetTop: '50vh',
5794 offsetLeft: '50vw',
5795 target: false
5796 },
5797
5798 computed: {
5799
5800 cacheKey: function(ref) {
5801 var dataSrc = ref.dataSrc;
5802
5803 return ((this.$name) + "." + dataSrc);
5804 },
5805
5806 width: function(ref) {
5807 var width = ref.width;
5808 var dataWidth = ref.dataWidth;
5809
5810 return width || dataWidth;
5811 },
5812
5813 height: function(ref) {
5814 var height = ref.height;
5815 var dataHeight = ref.dataHeight;
5816
5817 return height || dataHeight;
5818 },
5819
5820 sizes: function(ref) {
5821 var sizes = ref.sizes;
5822 var dataSizes = ref.dataSizes;
5823
5824 return sizes || dataSizes;
5825 },
5826
5827 isImg: function(_, $el) {
5828 return isImg($el);
5829 },
5830
5831 target: {
5832
5833 get: function(ref) {
5834 var target = ref.target;
5835
5836 return [this.$el ].concat( queryAll(target, this.$el));
5837 },
5838
5839 watch: function() {
5840 this.observe();
5841 }
5842
5843 },
5844
5845 offsetTop: function(ref) {
5846 var offsetTop = ref.offsetTop;
5847
5848 return toPx(offsetTop, 'height');
5849 },
5850
5851 offsetLeft: function(ref) {
5852 var offsetLeft = ref.offsetLeft;
5853
5854 return toPx(offsetLeft, 'width');
5855 }
5856
5857 },
5858
5859 connected: function() {
5860
5861 if (!window.IntersectionObserver) {
5862 setSrcAttrs(this.$el, this.dataSrc, this.dataSrcset, this.sizes);
5863 return;
5864 }
5865
5866 if (storage[this.cacheKey]) {
5867 setSrcAttrs(this.$el, storage[this.cacheKey], this.dataSrcset, this.sizes);
5868 } else if (this.isImg && this.width && this.height) {
5869 setSrcAttrs(this.$el, getPlaceholderImage(this.width, this.height, this.sizes));
5870 }
5871
5872 this.observer = new IntersectionObserver(this.load, {
5873 rootMargin: ((this.offsetTop) + "px " + (this.offsetLeft) + "px")
5874 });
5875
5876 requestAnimationFrame(this.observe);
5877
5878 },
5879
5880 disconnected: function() {
5881 this.observer && this.observer.disconnect();
5882 },
5883
5884 update: {
5885
5886 read: function(ref) {
5887 var this$1$1 = this;
5888 var image = ref.image;
5889
5890
5891 if (!this.observer) {
5892 return false;
5893 }
5894
5895 if (!image && document.readyState === 'complete') {
5896 this.load(this.observer.takeRecords());
5897 }
5898
5899 if (this.isImg) {
5900 return false;
5901 }
5902
5903 image && image.then(function (img) { return img && img.currentSrc !== '' && setSrcAttrs(this$1$1.$el, currentSrc(img)); });
5904
5905 },
5906
5907 write: function(data) {
5908
5909 if (this.dataSrcset && window.devicePixelRatio !== 1) {
5910
5911 var bgSize = css(this.$el, 'backgroundSize');
5912 if (bgSize.match(/^(auto\s?)+$/) || toFloat(bgSize) === data.bgSize) {
5913 data.bgSize = getSourceSize(this.dataSrcset, this.sizes);
5914 css(this.$el, 'backgroundSize', ((data.bgSize) + "px"));
5915 }
5916
5917 }
5918
5919 },
5920
5921 events: ['resize']
5922
5923 },
5924
5925 methods: {
5926
5927 load: function(entries) {
5928 var this$1$1 = this;
5929
5930
5931 // Old chromium based browsers (UC Browser) did not implement `isIntersecting`
5932 if (!entries.some(function (entry) { return isUndefined(entry.isIntersecting) || entry.isIntersecting; })) {
5933 return;
5934 }
5935
5936 this._data.image = getImage(this.dataSrc, this.dataSrcset, this.sizes).then(function (img) {
5937
5938 setSrcAttrs(this$1$1.$el, currentSrc(img), img.srcset, img.sizes);
5939 storage[this$1$1.cacheKey] = currentSrc(img);
5940 return img;
5941
5942 }, function (e) { return trigger(this$1$1.$el, new e.constructor(e.type, e)); });
5943
5944 this.observer.disconnect();
5945 },
5946
5947 observe: function() {
5948 var this$1$1 = this;
5949
5950 if (this._connected && !this._data.image) {
5951 this.target.forEach(function (el) { return this$1$1.observer.observe(el); });
5952 }
5953 }
5954
5955 }
5956
5957 };
5958
5959 function setSrcAttrs(el, src, srcset, sizes) {
5960
5961 if (isImg(el)) {
5962 var set = function (prop, val) { return val && val !== el[prop] && (el[prop] = val); };
5963 set('sizes', sizes);
5964 set('srcset', srcset);
5965 set('src', src);
5966 } else if (src) {
5967
5968 var change = !includes(el.style.backgroundImage, src);
5969 if (change) {
5970 css(el, 'backgroundImage', ("url(" + (escape(src)) + ")"));
5971 trigger(el, createEvent('load', false));
5972 }
5973
5974 }
5975
5976 }
5977
5978 function getPlaceholderImage(width, height, sizes) {
5979 var assign;
5980
5981
5982 if (sizes) {
5983 ((assign = Dimensions.ratio({width: width, height: height}, 'width', toPx(sizesToPixel(sizes))), width = assign.width, height = assign.height));
5984 }
5985
5986 return ("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"" + width + "\" height=\"" + height + "\"></svg>");
5987 }
5988
5989 var sizesRe = /\s*(.*?)\s*(\w+|calc\(.*?\))\s*(?:,|$)/g;
5990 function sizesToPixel(sizes) {
5991 var matches;
5992
5993 sizesRe.lastIndex = 0;
5994
5995 while ((matches = sizesRe.exec(sizes))) {
5996 if (!matches[1] || window.matchMedia(matches[1]).matches) {
5997 matches = evaluateSize(matches[2]);
5998 break;
5999 }
6000 }
6001
6002 return matches || '100vw';
6003 }
6004
6005 var sizeRe = /\d+(?:\w+|%)/g;
6006 var additionRe = /[+-]?(\d+)/g;
6007 function evaluateSize(size) {
6008 return startsWith(size, 'calc')
6009 ? size
6010 .slice(5, -1)
6011 .replace(sizeRe, function (size) { return toPx(size); })
6012 .replace(/ /g, '')
6013 .match(additionRe)
6014 .reduce(function (a, b) { return a + +b; }, 0)
6015 : size;
6016 }
6017
6018 var srcSetRe = /\s+\d+w\s*(?:,|$)/g;
6019 function getSourceSize(srcset, sizes) {
6020 var srcSize = toPx(sizesToPixel(sizes));
6021 var descriptors = (srcset.match(srcSetRe) || []).map(toFloat).sort(function (a, b) { return a - b; });
6022
6023 return descriptors.filter(function (size) { return size >= srcSize; })[0] || descriptors.pop() || '';
6024 }
6025
6026 function isImg(el) {
6027 return el.tagName === 'IMG';
6028 }
6029
6030 function currentSrc(el) {
6031 return el.currentSrc || el.src;
6032 }
6033
6034 var key = '__test__';
6035 var storage;
6036
6037 // workaround for Safari's private browsing mode and accessing sessionStorage in Blink
6038 try {
6039 storage = window.sessionStorage || {};
6040 storage[key] = 1;
6041 delete storage[key];
6042 } catch (e) {
6043 storage = {};
6044 }
6045
6046 var Media = {
6047
6048 props: {
6049 media: Boolean
6050 },
6051
6052 data: {
6053 media: false
6054 },
6055
6056 computed: {
6057
6058 matchMedia: function() {
6059 var media = toMedia(this.media);
6060 return !media || window.matchMedia(media).matches;
6061 }
6062
6063 }
6064
6065 };
6066
6067 function toMedia(value) {
6068
6069 if (isString(value)) {
6070 if (value[0] === '@') {
6071 var name = "breakpoint-" + (value.substr(1));
6072 value = toFloat(getCssVar(name));
6073 } else if (isNaN(value)) {
6074 return value;
6075 }
6076 }
6077
6078 return value && !isNaN(value) ? ("(min-width: " + value + "px)") : false;
6079 }
6080
6081 var leader = {
6082
6083 mixins: [Class, Media],
6084
6085 props: {
6086 fill: String
6087 },
6088
6089 data: {
6090 fill: '',
6091 clsWrapper: 'uk-leader-fill',
6092 clsHide: 'uk-leader-hide',
6093 attrFill: 'data-fill'
6094 },
6095
6096 computed: {
6097
6098 fill: function(ref) {
6099 var fill = ref.fill;
6100
6101 return fill || getCssVar('leader-fill-content');
6102 }
6103
6104 },
6105
6106 connected: function() {
6107 var assign;
6108
6109 (assign = wrapInner(this.$el, ("<span class=\"" + (this.clsWrapper) + "\">")), this.wrapper = assign[0]);
6110 },
6111
6112 disconnected: function() {
6113 unwrap(this.wrapper.childNodes);
6114 },
6115
6116 update: {
6117
6118 read: function(ref) {
6119 var changed = ref.changed;
6120 var width = ref.width;
6121
6122
6123 var prev = width;
6124
6125 width = Math.floor(this.$el.offsetWidth / 2);
6126
6127 return {
6128 width: width,
6129 fill: this.fill,
6130 changed: changed || prev !== width,
6131 hide: !this.matchMedia
6132 };
6133 },
6134
6135 write: function(data) {
6136
6137 toggleClass(this.wrapper, this.clsHide, data.hide);
6138
6139 if (data.changed) {
6140 data.changed = false;
6141 attr(this.wrapper, this.attrFill, new Array(data.width).join(data.fill));
6142 }
6143
6144 },
6145
6146 events: ['resize']
6147
6148 }
6149
6150 };
6151
6152 var active = [];
6153
6154 var Modal = {
6155
6156 mixins: [Class, Container, Togglable],
6157
6158 props: {
6159 selPanel: String,
6160 selClose: String,
6161 escClose: Boolean,
6162 bgClose: Boolean,
6163 stack: Boolean
6164 },
6165
6166 data: {
6167 cls: 'uk-open',
6168 escClose: true,
6169 bgClose: true,
6170 overlay: true,
6171 stack: false
6172 },
6173
6174 computed: {
6175
6176 panel: function(ref, $el) {
6177 var selPanel = ref.selPanel;
6178
6179 return $(selPanel, $el);
6180 },
6181
6182 transitionElement: function() {
6183 return this.panel;
6184 },
6185
6186 bgClose: function(ref) {
6187 var bgClose = ref.bgClose;
6188
6189 return bgClose && this.panel;
6190 }
6191
6192 },
6193
6194 beforeDisconnect: function() {
6195 if (includes(active, this)) {
6196 this.toggleElement(this.$el, false, false);
6197 }
6198 },
6199
6200 events: [
6201
6202 {
6203
6204 name: 'click',
6205
6206 delegate: function() {
6207 return this.selClose;
6208 },
6209
6210 handler: function(e) {
6211 e.preventDefault();
6212 this.hide();
6213 }
6214
6215 },
6216
6217 {
6218
6219 name: 'toggle',
6220
6221 self: true,
6222
6223 handler: function(e, toggle) {
6224
6225 if (e.defaultPrevented) {
6226 return;
6227 }
6228
6229 e.preventDefault();
6230
6231 this.target = toggle.$el;
6232 if (this.isToggled() === includes(active, this)) {
6233 this.toggle();
6234 }
6235 }
6236
6237 },
6238
6239 {
6240 name: 'beforeshow',
6241
6242 self: true,
6243
6244 handler: function(e) {
6245
6246 if (includes(active, this)) {
6247 return false;
6248 }
6249
6250 if (!this.stack && active.length) {
6251 Promise$1.all(active.map(function (modal) { return modal.hide(); })).then(this.show);
6252 e.preventDefault();
6253 } else {
6254 active.push(this);
6255 }
6256 }
6257
6258 },
6259
6260 {
6261
6262 name: 'show',
6263
6264 self: true,
6265
6266 handler: function() {
6267 var this$1$1 = this;
6268
6269
6270 var docEl = document.documentElement;
6271
6272 if (width(window) > docEl.clientWidth && this.overlay) {
6273 css(document.body, 'overflowY', 'scroll');
6274 }
6275
6276 if (this.stack) {
6277 css(this.$el, 'zIndex', toFloat(css(this.$el, 'zIndex')) + active.length);
6278 }
6279
6280 addClass(docEl, this.clsPage);
6281
6282 if (this.bgClose) {
6283 once(this.$el, 'hide', on(document, pointerDown, function (ref) {
6284 var target = ref.target;
6285
6286
6287 if (last(active) !== this$1$1 || this$1$1.overlay && !within(target, this$1$1.$el) || within(target, this$1$1.panel)) {
6288 return;
6289 }
6290
6291 once(document, (pointerUp + " " + pointerCancel + " scroll"), function (ref) {
6292 var defaultPrevented = ref.defaultPrevented;
6293 var type = ref.type;
6294 var newTarget = ref.target;
6295
6296 if (!defaultPrevented && type === pointerUp && target === newTarget) {
6297 this$1$1.hide();
6298 }
6299 }, true);
6300
6301 }), {self: true});
6302 }
6303
6304 if (this.escClose) {
6305 once(this.$el, 'hide', on(document, 'keydown', function (e) {
6306 if (e.keyCode === 27 && last(active) === this$1$1) {
6307 this$1$1.hide();
6308 }
6309 }), {self: true});
6310 }
6311 }
6312
6313 },
6314
6315 {
6316 name: 'shown',
6317
6318 self: true,
6319
6320 handler: function() {
6321 if (!isFocusable(this.$el)) {
6322 attr(this.$el, 'tabindex', '0');
6323 }
6324
6325 if (!$(':focus', this.$el)) {
6326 this.$el.focus();
6327 }
6328 }
6329 },
6330
6331 {
6332
6333 name: 'hide',
6334
6335 self: true,
6336
6337 handler: function() {
6338 if (isFocusable(this.target)) {
6339 this.target.focus();
6340 this.target = null;
6341 }
6342 }
6343
6344 },
6345
6346 {
6347
6348 name: 'hidden',
6349
6350 self: true,
6351
6352 handler: function() {
6353 var this$1$1 = this;
6354
6355
6356 if (includes(active, this)) {
6357 active.splice(active.indexOf(this), 1);
6358 }
6359
6360 if (!active.length) {
6361 css(document.body, 'overflowY', '');
6362 }
6363
6364 css(this.$el, 'zIndex', '');
6365
6366 if (!active.some(function (modal) { return modal.clsPage === this$1$1.clsPage; })) {
6367 removeClass(document.documentElement, this.clsPage);
6368 }
6369
6370 }
6371
6372 }
6373
6374 ],
6375
6376 methods: {
6377
6378 toggle: function() {
6379 return this.isToggled() ? this.hide() : this.show();
6380 },
6381
6382 show: function() {
6383 var this$1$1 = this;
6384
6385 if (this.container && parent(this.$el) !== this.container) {
6386 append(this.container, this.$el);
6387 return new Promise$1(function (resolve) { return requestAnimationFrame(function () { return this$1$1.show().then(resolve); }
6388 ); }
6389 );
6390 }
6391
6392 return this.toggleElement(this.$el, true, animate(this));
6393 },
6394
6395 hide: function() {
6396 return this.toggleElement(this.$el, false, animate(this));
6397 }
6398
6399 }
6400
6401 };
6402
6403 function animate(ref) {
6404 var transitionElement = ref.transitionElement;
6405 var _toggle = ref._toggle;
6406
6407 return function (el, show) { return new Promise$1(function (resolve, reject) { return once(el, 'show hide', function () {
6408 el._reject && el._reject();
6409 el._reject = reject;
6410
6411 _toggle(el, show);
6412
6413 var off = once(transitionElement, 'transitionstart', function () {
6414 once(transitionElement, 'transitionend transitioncancel', resolve, {self: true});
6415 clearTimeout(timer);
6416 }, {self: true});
6417
6418 var timer = setTimeout(function () {
6419 off();
6420 resolve();
6421 }, toMs(css(transitionElement, 'transitionDuration')));
6422
6423 }); }
6424 ).then(function () { return delete el._reject; }); };
6425 }
6426
6427 var modal = {
6428
6429 install: install$2,
6430
6431 mixins: [Modal],
6432
6433 data: {
6434 clsPage: 'uk-modal-page',
6435 selPanel: '.uk-modal-dialog',
6436 selClose: '.uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full'
6437 },
6438
6439 events: [
6440
6441 {
6442 name: 'show',
6443
6444 self: true,
6445
6446 handler: function() {
6447
6448 if (hasClass(this.panel, 'uk-margin-auto-vertical')) {
6449 addClass(this.$el, 'uk-flex');
6450 } else {
6451 css(this.$el, 'display', 'block');
6452 }
6453
6454 height(this.$el); // force reflow
6455 }
6456 },
6457
6458 {
6459 name: 'hidden',
6460
6461 self: true,
6462
6463 handler: function() {
6464
6465 css(this.$el, 'display', '');
6466 removeClass(this.$el, 'uk-flex');
6467
6468 }
6469 }
6470
6471 ]
6472
6473 };
6474
6475 function install$2(ref) {
6476 var modal = ref.modal;
6477
6478
6479 modal.dialog = function (content, options) {
6480
6481 var dialog = modal(
6482 ("<div class=\"uk-modal\"> <div class=\"uk-modal-dialog\">" + content + "</div> </div>"),
6483 options
6484 );
6485
6486 dialog.show();
6487
6488 on(dialog.$el, 'hidden', function () { return Promise$1.resolve().then(function () { return dialog.$destroy(true); }
6489 ); }, {self: true}
6490 );
6491
6492 return dialog;
6493 };
6494
6495 modal.alert = function (message, options) {
6496 return openDialog(
6497 function (ref) {
6498 var labels = ref.labels;
6499
6500 return ("<div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-primary uk-modal-close\" autofocus>" + (labels.ok) + "</button> </div>");
6501 },
6502 options,
6503 function (deferred) { return deferred.resolve(); }
6504 );
6505 };
6506
6507 modal.confirm = function (message, options) {
6508 return openDialog(
6509 function (ref) {
6510 var labels = ref.labels;
6511
6512 return ("<form> <div class=\"uk-modal-body\">" + (isString(message) ? message : html(message)) + "</div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\" autofocus>" + (labels.ok) + "</button> </div> </form>");
6513 },
6514 options,
6515 function (deferred) { return deferred.reject(); }
6516 );
6517 };
6518
6519 modal.prompt = function (message, value, options) {
6520 return openDialog(
6521 function (ref) {
6522 var labels = ref.labels;
6523
6524 return ("<form class=\"uk-form-stacked\"> <div class=\"uk-modal-body\"> <label>" + (isString(message) ? message : html(message)) + "</label> <input class=\"uk-input\" value=\"" + (value || '') + "\" autofocus> </div> <div class=\"uk-modal-footer uk-text-right\"> <button class=\"uk-button uk-button-default uk-modal-close\" type=\"button\">" + (labels.cancel) + "</button> <button class=\"uk-button uk-button-primary\">" + (labels.ok) + "</button> </div> </form>");
6525 },
6526 options,
6527 function (deferred) { return deferred.resolve(null); },
6528 function (dialog) { return $('input', dialog.$el).value; }
6529 );
6530 };
6531
6532 modal.labels = {
6533 ok: 'Ok',
6534 cancel: 'Cancel'
6535 };
6536
6537 function openDialog(tmpl, options, hideFn, submitFn) {
6538
6539 options = assign({bgClose: false, escClose: true, labels: modal.labels}, options);
6540
6541 var dialog = modal.dialog(tmpl(options), options);
6542 var deferred = new Deferred();
6543
6544 var resolved = false;
6545
6546 on(dialog.$el, 'submit', 'form', function (e) {
6547 e.preventDefault();
6548 deferred.resolve(submitFn && submitFn(dialog));
6549 resolved = true;
6550 dialog.hide();
6551 });
6552
6553 on(dialog.$el, 'hide', function () { return !resolved && hideFn(deferred); });
6554
6555 deferred.promise.dialog = dialog;
6556
6557 return deferred.promise;
6558 }
6559
6560 }
6561
6562 var nav = {
6563
6564 extends: Accordion,
6565
6566 data: {
6567 targets: '> .uk-parent',
6568 toggle: '> a',
6569 content: '> ul'
6570 }
6571
6572 };
6573
6574 var navItem = '.uk-navbar-nav > li > a, .uk-navbar-item, .uk-navbar-toggle';
6575
6576 var navbar = {
6577
6578 mixins: [Class, Container, FlexBug],
6579
6580 props: {
6581 dropdown: String,
6582 mode: 'list',
6583 align: String,
6584 offset: Number,
6585 boundary: Boolean,
6586 boundaryAlign: Boolean,
6587 clsDrop: String,
6588 delayShow: Number,
6589 delayHide: Number,
6590 dropbar: Boolean,
6591 dropbarMode: String,
6592 dropbarAnchor: Boolean,
6593 duration: Number
6594 },
6595
6596 data: {
6597 dropdown: navItem,
6598 align: !isRtl ? 'left' : 'right',
6599 clsDrop: 'uk-navbar-dropdown',
6600 mode: undefined,
6601 offset: undefined,
6602 delayShow: undefined,
6603 delayHide: undefined,
6604 boundaryAlign: undefined,
6605 flip: 'x',
6606 boundary: true,
6607 dropbar: false,
6608 dropbarMode: 'slide',
6609 dropbarAnchor: false,
6610 duration: 200,
6611 forceHeight: true,
6612 selMinHeight: navItem,
6613 container: false
6614 },
6615
6616 computed: {
6617
6618 boundary: function(ref, $el) {
6619 var boundary = ref.boundary;
6620 var boundaryAlign = ref.boundaryAlign;
6621
6622 return boundary === true || boundaryAlign ? $el : boundary;
6623 },
6624
6625 dropbarAnchor: function(ref, $el) {
6626 var dropbarAnchor = ref.dropbarAnchor;
6627
6628 return query(dropbarAnchor, $el);
6629 },
6630
6631 pos: function(ref) {
6632 var align = ref.align;
6633
6634 return ("bottom-" + align);
6635 },
6636
6637 dropbar: {
6638
6639 get: function(ref) {
6640 var dropbar = ref.dropbar;
6641
6642
6643 if (!dropbar) {
6644 return null;
6645 }
6646
6647 dropbar = this._dropbar || query(dropbar, this.$el) || $('+ .uk-navbar-dropbar', this.$el);
6648
6649 return dropbar ? dropbar : (this._dropbar = $('<div></div>'));
6650
6651 },
6652
6653 watch: function(dropbar) {
6654 addClass(dropbar, 'uk-navbar-dropbar');
6655 },
6656
6657 immediate: true
6658
6659 },
6660
6661 dropContainer: function(_, $el) {
6662 return this.container || $el;
6663 },
6664
6665 dropdowns: {
6666
6667 get: function(ref, $el) {
6668 var this$1$1 = this;
6669 var clsDrop = ref.clsDrop;
6670
6671 var dropdowns = $$(("." + clsDrop), $el);
6672
6673 if (this.dropContainer !== $el) {
6674 $$(("." + clsDrop), this.dropContainer).forEach(function (el) {
6675 var dropdown = this$1$1.getDropdown(el);
6676 if (!includes(dropdowns, el) && dropdown && dropdown.target && within(dropdown.target, this$1$1.$el)) {
6677 dropdowns.push(el);
6678 }
6679 });
6680 }
6681
6682 return dropdowns;
6683 },
6684
6685 watch: function(dropdowns) {
6686 var this$1$1 = this;
6687
6688 this.$create(
6689 'drop',
6690 dropdowns.filter(function (el) { return !this$1$1.getDropdown(el); }),
6691 assign({}, this.$props, {boundary: this.boundary, pos: this.pos, offset: this.dropbar || this.offset})
6692 );
6693 },
6694
6695 immediate: true
6696
6697 },
6698
6699 toggles: function(ref, $el) {
6700 var dropdown = ref.dropdown;
6701
6702 return $$(dropdown, $el);
6703 }
6704
6705 },
6706
6707 disconnected: function() {
6708 this.dropbar && remove$1(this.dropbar);
6709 delete this._dropbar;
6710 },
6711
6712 events: [
6713
6714 {
6715 name: 'mouseover focusin',
6716
6717 delegate: function() {
6718 return this.dropdown;
6719 },
6720
6721 handler: function(ref) {
6722 var current = ref.current;
6723
6724 var active = this.getActive();
6725 if (active && includes(active.mode, 'hover') && active.target && !within(active.target, current) && !active.tracker.movesTo(active.$el)) {
6726 active.hide(false);
6727 }
6728 }
6729
6730 },
6731
6732 {
6733 name: 'keydown',
6734
6735 delegate: function() {
6736 return this.dropdown;
6737 },
6738
6739 handler: function(e) {
6740
6741 var current = e.current;
6742 var keyCode = e.keyCode;
6743 var active = this.getActive();
6744
6745 if (keyCode === keyMap.DOWN && hasAttr(current, 'aria-expanded')) {
6746
6747 e.preventDefault();
6748
6749 if (!active || active.target !== current) {
6750 current.click();
6751 once(this.dropContainer, 'show', function (ref) {
6752 var target = ref.target;
6753
6754 return focusFirstFocusableElement(target);
6755 });
6756 } else {
6757 focusFirstFocusableElement(active.$el);
6758 }
6759
6760 }
6761
6762 handleNavItemNavigation(e, this.toggles, active);
6763 }
6764 },
6765
6766 {
6767 name: 'keydown',
6768
6769 el: function() {
6770 return this.dropContainer;
6771 },
6772
6773 delegate: function() {
6774 return ("." + (this.clsDrop));
6775 },
6776
6777 handler: function(e) {
6778
6779 var current = e.current;
6780 var keyCode = e.keyCode;
6781
6782 if (!includes(this.dropdowns, current)) {
6783 return;
6784 }
6785
6786 var active = this.getActive();
6787 var elements = $$(selFocusable, current);
6788 var i = findIndex(elements, function (el) { return matches(el, ':focus'); });
6789
6790 if (keyCode === keyMap.UP) {
6791 e.preventDefault();
6792 if (i > 0) {
6793 elements[i - 1].focus();
6794 }
6795 }
6796
6797 if (keyCode === keyMap.DOWN) {
6798 e.preventDefault();
6799 if (i < elements.length - 1) {
6800 elements[i + 1].focus();
6801 }
6802 }
6803
6804 if (keyCode === keyMap.ESC) {
6805 active && active.target && active.target.focus();
6806 }
6807
6808 handleNavItemNavigation(e, this.toggles, active);
6809 }
6810 },
6811
6812 {
6813 name: 'mouseleave',
6814
6815 el: function() {
6816 return this.dropbar;
6817 },
6818
6819 filter: function() {
6820 return this.dropbar;
6821 },
6822
6823 handler: function() {
6824 var active = this.getActive();
6825
6826 if (active && includes(active.mode, 'hover') && !this.dropdowns.some(function (el) { return matches(el, ':hover'); })) {
6827 active.hide();
6828 }
6829 }
6830 },
6831
6832 {
6833 name: 'beforeshow',
6834
6835 el: function() {
6836 return this.dropContainer;
6837 },
6838
6839 filter: function() {
6840 return this.dropbar;
6841 },
6842
6843 handler: function() {
6844
6845 if (!parent(this.dropbar)) {
6846 after(this.dropbarAnchor || this.$el, this.dropbar);
6847 }
6848
6849 }
6850 },
6851
6852 {
6853 name: 'show',
6854
6855 el: function() {
6856 return this.dropContainer;
6857 },
6858
6859 filter: function() {
6860 return this.dropbar;
6861 },
6862
6863 handler: function(_, ref) {
6864 var $el = ref.$el;
6865 var dir = ref.dir;
6866
6867 if (!hasClass($el, this.clsDrop)) {
6868 return;
6869 }
6870
6871 if (this.dropbarMode === 'slide') {
6872 addClass(this.dropbar, 'uk-navbar-dropbar-slide');
6873 }
6874
6875 this.clsDrop && addClass($el, ((this.clsDrop) + "-dropbar"));
6876
6877 if (dir === 'bottom') {
6878 this.transitionTo($el.offsetHeight + toFloat(css($el, 'marginTop')) + toFloat(css($el, 'marginBottom')), $el);
6879 }
6880 }
6881 },
6882
6883 {
6884 name: 'beforehide',
6885
6886 el: function() {
6887 return this.dropContainer;
6888 },
6889
6890 filter: function() {
6891 return this.dropbar;
6892 },
6893
6894 handler: function(e, ref) {
6895 var $el = ref.$el;
6896
6897
6898 var active = this.getActive();
6899
6900 if (matches(this.dropbar, ':hover') && active && active.$el === $el) {
6901 e.preventDefault();
6902 }
6903 }
6904 },
6905
6906 {
6907 name: 'hide',
6908
6909 el: function() {
6910 return this.dropContainer;
6911 },
6912
6913 filter: function() {
6914 return this.dropbar;
6915 },
6916
6917 handler: function(_, ref) {
6918 var $el = ref.$el;
6919
6920 if (!hasClass($el, this.clsDrop)) {
6921 return;
6922 }
6923
6924 var active = this.getActive();
6925
6926 if (!active || active && active.$el === $el) {
6927 this.transitionTo(0);
6928 }
6929 }
6930 }
6931
6932 ],
6933
6934 methods: {
6935
6936 getActive: function() {
6937 return active$1 && within(active$1.target, this.$el) && active$1;
6938 },
6939
6940 transitionTo: function(newHeight, el) {
6941 var this$1$1 = this;
6942
6943
6944 var ref = this;
6945 var dropbar = ref.dropbar;
6946 var oldHeight = isVisible(dropbar) ? height(dropbar) : 0;
6947
6948 el = oldHeight < newHeight && el;
6949
6950 css(el, 'clip', ("rect(0," + (el.offsetWidth) + "px," + oldHeight + "px,0)"));
6951
6952 height(dropbar, oldHeight);
6953
6954 Transition.cancel([el, dropbar]);
6955 return Promise$1.all([
6956 Transition.start(dropbar, {height: newHeight}, this.duration),
6957 Transition.start(el, {clip: ("rect(0," + (el.offsetWidth) + "px," + newHeight + "px,0)")}, this.duration)
6958 ])
6959 .catch(noop)
6960 .then(function () {
6961 css(el, {clip: ''});
6962 this$1$1.$update(dropbar);
6963 });
6964 },
6965
6966 getDropdown: function(el) {
6967 return this.$getComponent(el, 'drop') || this.$getComponent(el, 'dropdown');
6968 }
6969
6970 }
6971
6972 };
6973
6974 function handleNavItemNavigation(e, toggles, active) {
6975
6976 var current = e.current;
6977 var keyCode = e.keyCode;
6978 var target = active && active.target || current;
6979 var i = toggles.indexOf(target);
6980
6981 // Left
6982 if (keyCode === keyMap.LEFT && i > 0) {
6983 active && active.hide(false);
6984 toggles[i - 1].focus();
6985 }
6986
6987 // Right
6988 if (keyCode === keyMap.RIGHT && i < toggles.length - 1) {
6989 active && active.hide(false);
6990 toggles[i + 1].focus();
6991 }
6992
6993 if (keyCode === keyMap.TAB) {
6994 target.focus();
6995 active && active.hide(false);
6996 }
6997 }
6998
6999 function focusFirstFocusableElement(el) {
7000 if (!$(':focus', el)) {
7001 var focusEl = $(selFocusable, el);
7002 if (focusEl) {
7003 focusEl.focus();
7004 }
7005 }
7006 }
7007
7008 var keyMap = {
7009 TAB: 9,
7010 ESC: 27,
7011 LEFT: 37,
7012 UP: 38,
7013 RIGHT: 39,
7014 DOWN: 40
7015 };
7016
7017 var offcanvas = {
7018
7019 mixins: [Modal],
7020
7021 args: 'mode',
7022
7023 props: {
7024 mode: String,
7025 flip: Boolean,
7026 overlay: Boolean
7027 },
7028
7029 data: {
7030 mode: 'slide',
7031 flip: false,
7032 overlay: false,
7033 clsPage: 'uk-offcanvas-page',
7034 clsContainer: 'uk-offcanvas-container',
7035 selPanel: '.uk-offcanvas-bar',
7036 clsFlip: 'uk-offcanvas-flip',
7037 clsContainerAnimation: 'uk-offcanvas-container-animation',
7038 clsSidebarAnimation: 'uk-offcanvas-bar-animation',
7039 clsMode: 'uk-offcanvas',
7040 clsOverlay: 'uk-offcanvas-overlay',
7041 selClose: '.uk-offcanvas-close',
7042 container: false
7043 },
7044
7045 computed: {
7046
7047 clsFlip: function(ref) {
7048 var flip = ref.flip;
7049 var clsFlip = ref.clsFlip;
7050
7051 return flip ? clsFlip : '';
7052 },
7053
7054 clsOverlay: function(ref) {
7055 var overlay = ref.overlay;
7056 var clsOverlay = ref.clsOverlay;
7057
7058 return overlay ? clsOverlay : '';
7059 },
7060
7061 clsMode: function(ref) {
7062 var mode = ref.mode;
7063 var clsMode = ref.clsMode;
7064
7065 return (clsMode + "-" + mode);
7066 },
7067
7068 clsSidebarAnimation: function(ref) {
7069 var mode = ref.mode;
7070 var clsSidebarAnimation = ref.clsSidebarAnimation;
7071
7072 return mode === 'none' || mode === 'reveal' ? '' : clsSidebarAnimation;
7073 },
7074
7075 clsContainerAnimation: function(ref) {
7076 var mode = ref.mode;
7077 var clsContainerAnimation = ref.clsContainerAnimation;
7078
7079 return mode !== 'push' && mode !== 'reveal' ? '' : clsContainerAnimation;
7080 },
7081
7082 transitionElement: function(ref) {
7083 var mode = ref.mode;
7084
7085 return mode === 'reveal' ? parent(this.panel) : this.panel;
7086 }
7087
7088 },
7089
7090 update: {
7091
7092 read: function() {
7093 if (this.isToggled() && !isVisible(this.$el)) {
7094 this.hide();
7095 }
7096 },
7097
7098 events: ['resize']
7099
7100 },
7101
7102 events: [
7103
7104 {
7105
7106 name: 'click',
7107
7108 delegate: function() {
7109 return 'a[href^="#"]';
7110 },
7111
7112 handler: function(ref) {
7113 var hash = ref.current.hash;
7114 var defaultPrevented = ref.defaultPrevented;
7115
7116 if (!defaultPrevented && hash && $(hash, document.body)) {
7117 this.hide();
7118 }
7119 }
7120
7121 },
7122
7123 {
7124 name: 'touchstart',
7125
7126 passive: true,
7127
7128 el: function() {
7129 return this.panel;
7130 },
7131
7132 handler: function(ref) {
7133 var targetTouches = ref.targetTouches;
7134
7135
7136 if (targetTouches.length === 1) {
7137 this.clientY = targetTouches[0].clientY;
7138 }
7139
7140 }
7141
7142 },
7143
7144 {
7145 name: 'touchmove',
7146
7147 self: true,
7148 passive: false,
7149
7150 filter: function() {
7151 return this.overlay;
7152 },
7153
7154 handler: function(e) {
7155 e.cancelable && e.preventDefault();
7156 }
7157
7158 },
7159
7160 {
7161 name: 'touchmove',
7162
7163 passive: false,
7164
7165 el: function() {
7166 return this.panel;
7167 },
7168
7169 handler: function(e) {
7170
7171 if (e.targetTouches.length !== 1) {
7172 return;
7173 }
7174
7175 var clientY = e.targetTouches[0].clientY - this.clientY;
7176 var ref = this.panel;
7177 var scrollTop = ref.scrollTop;
7178 var scrollHeight = ref.scrollHeight;
7179 var clientHeight = ref.clientHeight;
7180
7181 if (clientHeight >= scrollHeight
7182 || scrollTop === 0 && clientY > 0
7183 || scrollHeight - scrollTop <= clientHeight && clientY < 0
7184 ) {
7185 e.cancelable && e.preventDefault();
7186 }
7187
7188 }
7189
7190 },
7191
7192 {
7193 name: 'show',
7194
7195 self: true,
7196
7197 handler: function() {
7198
7199 if (this.mode === 'reveal' && !hasClass(parent(this.panel), this.clsMode)) {
7200 wrapAll(this.panel, '<div>');
7201 addClass(parent(this.panel), this.clsMode);
7202 }
7203
7204 css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
7205 addClass(document.body, this.clsContainer, this.clsFlip);
7206 css(document.body, 'touch-action', 'pan-y pinch-zoom');
7207 css(this.$el, 'display', 'block');
7208 addClass(this.$el, this.clsOverlay);
7209 addClass(this.panel, this.clsSidebarAnimation, this.mode !== 'reveal' ? this.clsMode : '');
7210
7211 height(document.body); // force reflow
7212 addClass(document.body, this.clsContainerAnimation);
7213
7214 this.clsContainerAnimation && suppressUserScale();
7215
7216
7217 }
7218 },
7219
7220 {
7221 name: 'hide',
7222
7223 self: true,
7224
7225 handler: function() {
7226 removeClass(document.body, this.clsContainerAnimation);
7227 css(document.body, 'touch-action', '');
7228 }
7229 },
7230
7231 {
7232 name: 'hidden',
7233
7234 self: true,
7235
7236 handler: function() {
7237
7238 this.clsContainerAnimation && resumeUserScale();
7239
7240 if (this.mode === 'reveal') {
7241 unwrap(this.panel);
7242 }
7243
7244 removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
7245 removeClass(this.$el, this.clsOverlay);
7246 css(this.$el, 'display', '');
7247 removeClass(document.body, this.clsContainer, this.clsFlip);
7248
7249 css(document.documentElement, 'overflowY', '');
7250
7251 }
7252 },
7253
7254 {
7255 name: 'swipeLeft swipeRight',
7256
7257 handler: function(e) {
7258
7259 if (this.isToggled() && endsWith(e.type, 'Left') ^ this.flip) {
7260 this.hide();
7261 }
7262
7263 }
7264 }
7265
7266 ]
7267
7268 };
7269
7270 // Chrome in responsive mode zooms page upon opening offcanvas
7271 function suppressUserScale() {
7272 getViewport().content += ',user-scalable=0';
7273 }
7274
7275 function resumeUserScale() {
7276 var viewport = getViewport();
7277 viewport.content = viewport.content.replace(/,user-scalable=0$/, '');
7278 }
7279
7280 function getViewport() {
7281 return $('meta[name="viewport"]', document.head) || append(document.head, '<meta name="viewport">');
7282 }
7283
7284 var overflowAuto = {
7285
7286 mixins: [Class],
7287
7288 props: {
7289 selContainer: String,
7290 selContent: String,
7291 minHeight: Number
7292 },
7293
7294 data: {
7295 selContainer: '.uk-modal',
7296 selContent: '.uk-modal-dialog',
7297 minHeight: 150
7298 },
7299
7300 computed: {
7301
7302 container: function(ref, $el) {
7303 var selContainer = ref.selContainer;
7304
7305 return closest($el, selContainer);
7306 },
7307
7308 content: function(ref, $el) {
7309 var selContent = ref.selContent;
7310
7311 return closest($el, selContent);
7312 }
7313
7314 },
7315
7316 connected: function() {
7317 css(this.$el, 'minHeight', this.minHeight);
7318 },
7319
7320 update: {
7321
7322 read: function() {
7323
7324 if (!this.content || !this.container || !isVisible(this.$el)) {
7325 return false;
7326 }
7327
7328 return {
7329 current: toFloat(css(this.$el, 'maxHeight')),
7330 max: Math.max(this.minHeight, height(this.container) - (dimensions(this.content).height - height(this.$el)))
7331 };
7332 },
7333
7334 write: function(ref) {
7335 var current = ref.current;
7336 var max = ref.max;
7337
7338 css(this.$el, 'maxHeight', max);
7339 if (Math.round(current) !== Math.round(max)) {
7340 trigger(this.$el, 'resize');
7341 }
7342 },
7343
7344 events: ['resize']
7345
7346 }
7347
7348 };
7349
7350 var responsive = {
7351
7352 props: ['width', 'height'],
7353
7354 connected: function() {
7355 addClass(this.$el, 'uk-responsive-width');
7356 },
7357
7358 update: {
7359
7360 read: function() {
7361 return isVisible(this.$el) && this.width && this.height
7362 ? {width: width(parent(this.$el)), height: this.height}
7363 : false;
7364 },
7365
7366 write: function(dim) {
7367 height(this.$el, Dimensions.contain({
7368 height: this.height,
7369 width: this.width
7370 }, dim).height);
7371 },
7372
7373 events: ['resize']
7374
7375 }
7376
7377 };
7378
7379 var scroll = {
7380
7381 props: {
7382 offset: Number
7383 },
7384
7385 data: {
7386 offset: 0
7387 },
7388
7389 methods: {
7390
7391 scrollTo: function(el) {
7392 var this$1$1 = this;
7393
7394
7395 el = el && $(el) || document.body;
7396
7397 if (trigger(this.$el, 'beforescroll', [this, el])) {
7398 scrollIntoView(el, {offset: this.offset}).then(function () { return trigger(this$1$1.$el, 'scrolled', [this$1$1, el]); }
7399 );
7400 }
7401
7402 }
7403
7404 },
7405
7406 events: {
7407
7408 click: function(e) {
7409
7410 if (e.defaultPrevented) {
7411 return;
7412 }
7413
7414 e.preventDefault();
7415 this.scrollTo(("#" + (escape(decodeURIComponent((this.$el.hash || '').substr(1))))));
7416 }
7417
7418 }
7419
7420 };
7421
7422 var stateKey = '_ukScrollspy';
7423 var scrollspy = {
7424
7425 args: 'cls',
7426
7427 props: {
7428 cls: String,
7429 target: String,
7430 hidden: Boolean,
7431 offsetTop: Number,
7432 offsetLeft: Number,
7433 repeat: Boolean,
7434 delay: Number
7435 },
7436
7437 data: function () { return ({
7438 cls: false,
7439 target: false,
7440 hidden: true,
7441 offsetTop: 0,
7442 offsetLeft: 0,
7443 repeat: false,
7444 delay: 0,
7445 inViewClass: 'uk-scrollspy-inview'
7446 }); },
7447
7448 computed: {
7449
7450 elements: {
7451
7452 get: function(ref, $el) {
7453 var target = ref.target;
7454
7455 return target ? $$(target, $el) : [$el];
7456 },
7457
7458 watch: function(elements) {
7459 if (this.hidden) {
7460 css(filter$1(elements, (":not(." + (this.inViewClass) + ")")), 'visibility', 'hidden');
7461 }
7462 },
7463
7464 immediate: true
7465
7466 }
7467
7468 },
7469
7470 disconnected: function() {
7471 var this$1$1 = this;
7472
7473 this.elements.forEach(function (el) {
7474 removeClass(el, this$1$1.inViewClass, el[stateKey] ? el[stateKey].cls : '');
7475 delete el[stateKey];
7476 });
7477 },
7478
7479 update: [
7480
7481 {
7482
7483 read: function(data$1) {
7484 var this$1$1 = this;
7485
7486
7487 // Let child components be applied at least once first
7488 if (!data$1.update) {
7489 Promise$1.resolve().then(function () {
7490 this$1$1.$emit();
7491 data$1.update = true;
7492 });
7493 return false;
7494 }
7495
7496 this.elements.forEach(function (el) {
7497
7498 if (!el[stateKey]) {
7499 el[stateKey] = {cls: data(el, 'uk-scrollspy-class') || this$1$1.cls};
7500 }
7501
7502 el[stateKey].show = isInView(el, this$1$1.offsetTop, this$1$1.offsetLeft);
7503
7504 });
7505
7506 },
7507
7508 write: function(data) {
7509 var this$1$1 = this;
7510
7511
7512 this.elements.forEach(function (el) {
7513
7514 var state = el[stateKey];
7515
7516 if (state.show && !state.inview && !state.queued) {
7517
7518 state.queued = true;
7519
7520 data.promise = (data.promise || Promise$1.resolve()).then(function () { return new Promise$1(function (resolve) { return setTimeout(resolve, this$1$1.delay); }
7521 ); }
7522 ).then(function () {
7523 this$1$1.toggle(el, true);
7524 setTimeout(function () {
7525 state.queued = false;
7526 this$1$1.$emit();
7527 }, 300);
7528 });
7529
7530 } else if (!state.show && state.inview && !state.queued && this$1$1.repeat) {
7531
7532 this$1$1.toggle(el, false);
7533
7534 }
7535
7536 });
7537
7538 },
7539
7540 events: ['scroll', 'resize']
7541
7542 }
7543
7544 ],
7545
7546 methods: {
7547
7548 toggle: function(el, inview) {
7549
7550 var state = el[stateKey];
7551
7552 state.off && state.off();
7553
7554 css(el, 'visibility', !inview && this.hidden ? 'hidden' : '');
7555
7556 toggleClass(el, this.inViewClass, inview);
7557 toggleClass(el, state.cls);
7558
7559 if (/\buk-animation-/.test(state.cls)) {
7560 state.off = once(el, 'animationcancel animationend', function () { return removeClasses(el, 'uk-animation-[\\w-]+'); }
7561 );
7562 }
7563
7564 trigger(el, inview ? 'inview' : 'outview');
7565
7566 state.inview = inview;
7567
7568 this.$update(el);
7569 }
7570
7571 }
7572
7573 };
7574
7575 var scrollspyNav = {
7576
7577 props: {
7578 cls: String,
7579 closest: String,
7580 scroll: Boolean,
7581 overflow: Boolean,
7582 offset: Number
7583 },
7584
7585 data: {
7586 cls: 'uk-active',
7587 closest: false,
7588 scroll: false,
7589 overflow: true,
7590 offset: 0
7591 },
7592
7593 computed: {
7594
7595 links: {
7596
7597 get: function(_, $el) {
7598 return $$('a[href^="#"]', $el).filter(function (el) { return el.hash; });
7599 },
7600
7601 watch: function(links) {
7602 if (this.scroll) {
7603 this.$create('scroll', links, {offset: this.offset || 0});
7604 }
7605 },
7606
7607 immediate: true
7608
7609 },
7610
7611 targets: function() {
7612 return $$(this.links.map(function (el) { return escape(el.hash).substr(1); }).join(','));
7613 },
7614
7615 elements: function(ref) {
7616 var selector = ref.closest;
7617
7618 return closest(this.links, selector || '*');
7619 }
7620
7621 },
7622
7623 update: [
7624
7625 {
7626
7627 read: function() {
7628 var this$1$1 = this;
7629
7630
7631 var ref = this.targets;
7632 var length = ref.length;
7633
7634 if (!length || !isVisible(this.$el)) {
7635 return false;
7636 }
7637
7638 var ref$1 = scrollParents(this.targets, /auto|scroll/, true);
7639 var scrollElement = ref$1[0];
7640 var scrollTop = scrollElement.scrollTop;
7641 var scrollHeight = scrollElement.scrollHeight;
7642 var max = scrollHeight - getViewportClientHeight(scrollElement);
7643 var active = false;
7644
7645 if (scrollTop === max) {
7646 active = length - 1;
7647 } else {
7648
7649 this.targets.every(function (el, i) {
7650 if (offset(el).top - offset(getViewport$1(scrollElement)).top - this$1$1.offset <= 0) {
7651 active = i;
7652 return true;
7653 }
7654 });
7655
7656 if (active === false && this.overflow) {
7657 active = 0;
7658 }
7659 }
7660
7661 return {active: active};
7662 },
7663
7664 write: function(ref) {
7665 var active = ref.active;
7666
7667
7668 var changed = active !== false && !hasClass(this.elements[active], this.cls);
7669
7670 this.links.forEach(function (el) { return el.blur(); });
7671 removeClass(this.elements, this.cls);
7672 addClass(this.elements[active], this.cls);
7673
7674 if (changed) {
7675 trigger(this.$el, 'active', [active, this.elements[active]]);
7676 }
7677 },
7678
7679 events: ['scroll', 'resize']
7680
7681 }
7682
7683 ]
7684
7685 };
7686
7687 var sticky = {
7688
7689 mixins: [Class, Media],
7690
7691 props: {
7692 top: null,
7693 bottom: Boolean,
7694 offset: String,
7695 animation: String,
7696 clsActive: String,
7697 clsInactive: String,
7698 clsFixed: String,
7699 clsBelow: String,
7700 selTarget: String,
7701 widthElement: Boolean,
7702 showOnUp: Boolean,
7703 targetOffset: Number
7704 },
7705
7706 data: {
7707 top: 0,
7708 bottom: false,
7709 offset: 0,
7710 animation: '',
7711 clsActive: 'uk-active',
7712 clsInactive: '',
7713 clsFixed: 'uk-sticky-fixed',
7714 clsBelow: 'uk-sticky-below',
7715 selTarget: '',
7716 widthElement: false,
7717 showOnUp: false,
7718 targetOffset: false
7719 },
7720
7721 computed: {
7722
7723 offset: function(ref) {
7724 var offset = ref.offset;
7725
7726 return toPx(offset);
7727 },
7728
7729 selTarget: function(ref, $el) {
7730 var selTarget = ref.selTarget;
7731
7732 return selTarget && $(selTarget, $el) || $el;
7733 },
7734
7735 widthElement: function(ref, $el) {
7736 var widthElement = ref.widthElement;
7737
7738 return query(widthElement, $el) || this.placeholder;
7739 },
7740
7741 isActive: {
7742
7743 get: function() {
7744 return hasClass(this.selTarget, this.clsActive);
7745 },
7746
7747 set: function(value) {
7748 if (value && !this.isActive) {
7749 replaceClass(this.selTarget, this.clsInactive, this.clsActive);
7750 trigger(this.$el, 'active');
7751 } else if (!value && !hasClass(this.selTarget, this.clsInactive)) {
7752 replaceClass(this.selTarget, this.clsActive, this.clsInactive);
7753 trigger(this.$el, 'inactive');
7754 }
7755 }
7756
7757 }
7758
7759 },
7760
7761 connected: function() {
7762 this.placeholder = $('+ .uk-sticky-placeholder', this.$el) || $('<div class="uk-sticky-placeholder"></div>');
7763 this.isFixed = false;
7764 this.isActive = false;
7765 },
7766
7767 disconnected: function() {
7768
7769 if (this.isFixed) {
7770 this.hide();
7771 removeClass(this.selTarget, this.clsInactive);
7772 }
7773
7774 remove$1(this.placeholder);
7775 this.placeholder = null;
7776 this.widthElement = null;
7777 },
7778
7779 events: [
7780
7781 {
7782
7783 name: 'load hashchange popstate',
7784
7785 el: function() {
7786 return window;
7787 },
7788
7789 handler: function() {
7790 var this$1$1 = this;
7791
7792
7793 if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
7794 return;
7795 }
7796
7797 var target = $(location.hash);
7798
7799 if (target) {
7800 fastdom.read(function () {
7801
7802 var ref = offset(target);
7803 var top = ref.top;
7804 var elTop = offset(this$1$1.$el).top;
7805 var elHeight = this$1$1.$el.offsetHeight;
7806
7807 if (this$1$1.isFixed && elTop + elHeight >= top && elTop <= top + target.offsetHeight) {
7808 scrollTop(window, top - elHeight - (isNumeric(this$1$1.targetOffset) ? this$1$1.targetOffset : 0) - this$1$1.offset);
7809 }
7810
7811 });
7812 }
7813
7814 }
7815
7816 }
7817
7818 ],
7819
7820 update: [
7821
7822 {
7823
7824 read: function(ref, types) {
7825 var height = ref.height;
7826
7827
7828 this.inactive = !this.matchMedia || !isVisible(this.$el);
7829
7830 if (this.inactive) {
7831 return false;
7832 }
7833
7834 if (this.isActive && types.has('resize')) {
7835 this.hide();
7836 height = this.$el.offsetHeight;
7837 this.show();
7838 }
7839
7840 height = !this.isActive ? this.$el.offsetHeight : height;
7841
7842 this.topOffset = offset(this.isFixed ? this.placeholder : this.$el).top;
7843 this.bottomOffset = this.topOffset + height;
7844
7845 var bottom = parseProp('bottom', this);
7846
7847 this.top = Math.max(toFloat(parseProp('top', this)), this.topOffset) - this.offset;
7848 this.bottom = bottom && bottom - this.$el.offsetHeight;
7849 this.width = dimensions(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
7850
7851 return {
7852 height: height,
7853 top: offsetPosition(this.placeholder)[0],
7854 margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
7855 };
7856 },
7857
7858 write: function(ref) {
7859 var height = ref.height;
7860 var margins = ref.margins;
7861
7862
7863 var ref$1 = this;
7864 var placeholder = ref$1.placeholder;
7865
7866 css(placeholder, assign({height: height}, margins));
7867
7868 if (!within(placeholder, document)) {
7869 after(this.$el, placeholder);
7870 placeholder.hidden = true;
7871 }
7872
7873 this.isActive = !!this.isActive; // force self-assign
7874
7875 },
7876
7877 events: ['resize']
7878
7879 },
7880
7881 {
7882
7883 read: function(ref) {
7884 var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
7885
7886
7887 this.scroll = window.pageYOffset;
7888
7889 return {
7890 dir: scroll <= this.scroll ? 'down' : 'up',
7891 scroll: this.scroll
7892 };
7893 },
7894
7895 write: function(data, types) {
7896 var this$1$1 = this;
7897
7898
7899 var now = Date.now();
7900 var isScrollUpdate = types.has('scroll');
7901 var initTimestamp = data.initTimestamp; if ( initTimestamp === void 0 ) initTimestamp = 0;
7902 var dir = data.dir;
7903 var lastDir = data.lastDir;
7904 var lastScroll = data.lastScroll;
7905 var scroll = data.scroll;
7906 var top = data.top;
7907
7908 data.lastScroll = scroll;
7909
7910 if (scroll < 0 || scroll === lastScroll && isScrollUpdate || this.showOnUp && !isScrollUpdate && !this.isFixed) {
7911 return;
7912 }
7913
7914 if (now - initTimestamp > 300 || dir !== lastDir) {
7915 data.initScroll = scroll;
7916 data.initTimestamp = now;
7917 }
7918
7919 data.lastDir = dir;
7920
7921 if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
7922 return;
7923 }
7924
7925 if (this.inactive
7926 || scroll < this.top
7927 || this.showOnUp && (scroll <= this.top || dir === 'down' && isScrollUpdate || dir === 'up' && !this.isFixed && scroll <= this.bottomOffset)
7928 ) {
7929
7930 if (!this.isFixed) {
7931
7932 if (Animation.inProgress(this.$el) && top > scroll) {
7933 Animation.cancel(this.$el);
7934 this.hide();
7935 }
7936
7937 return;
7938 }
7939
7940 this.isFixed = false;
7941
7942 if (this.animation && scroll > this.topOffset) {
7943 Animation.cancel(this.$el);
7944 Animation.out(this.$el, this.animation).then(function () { return this$1$1.hide(); }, noop);
7945 } else {
7946 this.hide();
7947 }
7948
7949 } else if (this.isFixed) {
7950
7951 this.update();
7952
7953 } else if (this.animation) {
7954
7955 Animation.cancel(this.$el);
7956 this.show();
7957 Animation.in(this.$el, this.animation).catch(noop);
7958
7959 } else {
7960 this.show();
7961 }
7962
7963 },
7964
7965 events: ['resize', 'scroll']
7966
7967 }
7968
7969 ],
7970
7971 methods: {
7972
7973 show: function() {
7974
7975 this.isFixed = true;
7976 this.update();
7977 this.placeholder.hidden = false;
7978
7979 },
7980
7981 hide: function() {
7982
7983 this.isActive = false;
7984 removeClass(this.$el, this.clsFixed, this.clsBelow);
7985 css(this.$el, {position: '', top: '', width: ''});
7986 this.placeholder.hidden = true;
7987
7988 },
7989
7990 update: function() {
7991
7992 var active = this.top !== 0 || this.scroll > this.top;
7993 var top = Math.max(0, this.offset);
7994
7995 if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
7996 top = this.bottom - this.scroll;
7997 }
7998
7999 css(this.$el, {
8000 position: 'fixed',
8001 top: (top + "px"),
8002 width: this.width
8003 });
8004
8005 this.isActive = active;
8006 toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
8007 addClass(this.$el, this.clsFixed);
8008
8009 }
8010
8011 }
8012
8013 };
8014
8015 function parseProp(prop, ref) {
8016 var $props = ref.$props;
8017 var $el = ref.$el;
8018 var propOffset = ref[(prop + "Offset")];
8019
8020
8021 var value = $props[prop];
8022
8023 if (!value) {
8024 return;
8025 }
8026
8027 if (isString(value) && value.match(/^-?\d/)) {
8028
8029 return propOffset + toPx(value);
8030
8031 } else {
8032
8033 return offset(value === true ? parent($el) : query(value, $el)).bottom;
8034
8035 }
8036 }
8037
8038 var Switcher = {
8039
8040 mixins: [Togglable],
8041
8042 args: 'connect',
8043
8044 props: {
8045 connect: String,
8046 toggle: String,
8047 itemNav: String,
8048 active: Number,
8049 swiping: Boolean
8050 },
8051
8052 data: {
8053 connect: '~.uk-switcher',
8054 toggle: '> * > :first-child',
8055 itemNav: false,
8056 active: 0,
8057 swiping: true,
8058 cls: 'uk-active',
8059 attrItem: 'uk-switcher-item'
8060 },
8061
8062 computed: {
8063
8064 connects: {
8065
8066 get: function(ref, $el) {
8067 var connect = ref.connect;
8068
8069 return queryAll(connect, $el);
8070 },
8071
8072 watch: function(connects) {
8073 var this$1$1 = this;
8074
8075
8076 if (this.swiping) {
8077 css(connects, 'touch-action', 'pan-y pinch-zoom');
8078 }
8079
8080 var index = this.index();
8081 this.connects.forEach(function (el) { return children(el).forEach(function (child, i) { return toggleClass(child, this$1$1.cls, i === index); }
8082 ); }
8083 );
8084
8085 },
8086
8087 immediate: true
8088
8089 },
8090
8091 toggles: {
8092
8093 get: function(ref, $el) {
8094 var toggle = ref.toggle;
8095
8096 return $$(toggle, $el).filter(function (el) { return !matches(el, '.uk-disabled *, .uk-disabled, [disabled]'); });
8097 },
8098
8099 watch: function(toggles) {
8100 var active = this.index();
8101 this.show(~active ? active : toggles[this.active] || toggles[0]);
8102 },
8103
8104 immediate: true
8105
8106 },
8107
8108 children: function() {
8109 var this$1$1 = this;
8110
8111 return children(this.$el).filter(function (child) { return this$1$1.toggles.some(function (toggle) { return within(toggle, child); }); });
8112 }
8113
8114 },
8115
8116 events: [
8117
8118 {
8119
8120 name: 'click',
8121
8122 delegate: function() {
8123 return this.toggle;
8124 },
8125
8126 handler: function(e) {
8127 e.preventDefault();
8128 this.show(e.current);
8129 }
8130
8131 },
8132
8133 {
8134 name: 'click',
8135
8136 el: function() {
8137 return this.connects.concat(this.itemNav ? queryAll(this.itemNav, this.$el) : []);
8138 },
8139
8140 delegate: function() {
8141 return ("[" + (this.attrItem) + "],[data-" + (this.attrItem) + "]");
8142 },
8143
8144 handler: function(e) {
8145 e.preventDefault();
8146 this.show(data(e.current, this.attrItem));
8147 }
8148 },
8149
8150 {
8151 name: 'swipeRight swipeLeft',
8152
8153 filter: function() {
8154 return this.swiping;
8155 },
8156
8157 el: function() {
8158 return this.connects;
8159 },
8160
8161 handler: function(ref) {
8162 var type = ref.type;
8163
8164 this.show(endsWith(type, 'Left') ? 'next' : 'previous');
8165 }
8166 }
8167
8168 ],
8169
8170 methods: {
8171
8172 index: function() {
8173 var this$1$1 = this;
8174
8175 return findIndex(this.children, function (el) { return hasClass(el, this$1$1.cls); });
8176 },
8177
8178 show: function(item) {
8179 var this$1$1 = this;
8180
8181
8182 var prev = this.index();
8183 var next = getIndex(
8184 this.children[getIndex(item, this.toggles, prev)],
8185 children(this.$el)
8186 );
8187
8188 if (prev === next) {
8189 return;
8190 }
8191
8192 this.children.forEach(function (child, i) {
8193 toggleClass(child, this$1$1.cls, next === i);
8194 attr(this$1$1.toggles[i], 'aria-expanded', next === i);
8195 });
8196
8197 this.connects.forEach(function (ref) {
8198 var children = ref.children;
8199
8200 return this$1$1.toggleElement(toNodes(children).filter(function (child) { return hasClass(child, this$1$1.cls); }
8201 ), false, prev >= 0).then(function () { return this$1$1.toggleElement(children[next], true, prev >= 0); }
8202 );
8203 }
8204 );
8205 }
8206
8207 }
8208
8209 };
8210
8211 var tab = {
8212
8213 mixins: [Class],
8214
8215 extends: Switcher,
8216
8217 props: {
8218 media: Boolean
8219 },
8220
8221 data: {
8222 media: 960,
8223 attrItem: 'uk-tab-item'
8224 },
8225
8226 connected: function() {
8227
8228 var cls = hasClass(this.$el, 'uk-tab-left')
8229 ? 'uk-tab-left'
8230 : hasClass(this.$el, 'uk-tab-right')
8231 ? 'uk-tab-right'
8232 : false;
8233
8234 if (cls) {
8235 this.$create('toggle', this.$el, {cls: cls, mode: 'media', media: this.media});
8236 }
8237 }
8238
8239 };
8240
8241 var toggle = {
8242
8243 mixins: [Media, Togglable],
8244
8245 args: 'target',
8246
8247 props: {
8248 href: String,
8249 target: null,
8250 mode: 'list',
8251 queued: Boolean
8252 },
8253
8254 data: {
8255 href: false,
8256 target: false,
8257 mode: 'click',
8258 queued: true
8259 },
8260
8261 connected: function() {
8262 if (!includes(this.mode, 'media') && !isFocusable(this.$el)) {
8263 attr(this.$el, 'tabindex', '0');
8264 }
8265 },
8266
8267 computed: {
8268
8269 target: {
8270
8271 get: function(ref, $el) {
8272 var href = ref.href;
8273 var target = ref.target;
8274
8275 target = queryAll(target || href, $el);
8276 return target.length && target || [$el];
8277 },
8278
8279 watch: function() {
8280 this.updateAria();
8281 },
8282
8283 immediate: true
8284
8285 }
8286
8287 },
8288
8289 events: [
8290
8291 {
8292 name: pointerDown,
8293
8294 filter: function() {
8295 return includes(this.mode, 'hover');
8296 },
8297
8298 handler: function(e) {
8299 var this$1$1 = this;
8300
8301
8302 if (!isTouch(e) || this._showState) {
8303 return;
8304 }
8305
8306 // Clicking a button does not give it focus on all browsers and platforms
8307 // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
8308 trigger(this.$el, 'focus');
8309 once(document, pointerDown, function () { return trigger(this$1$1.$el, 'blur'); }, true, function (e) { return !within(e.target, this$1$1.$el); });
8310
8311 // Prevent initial click to prevent double toggle through focus + click
8312 if (includes(this.mode, 'click')) {
8313 this._preventClick = true;
8314 }
8315 }
8316 },
8317
8318 {
8319
8320 name: (pointerEnter + " " + pointerLeave + " focus blur"),
8321
8322 filter: function() {
8323 return includes(this.mode, 'hover');
8324 },
8325
8326 handler: function(e) {
8327 if (isTouch(e)) {
8328 return;
8329 }
8330
8331 var show = includes([pointerEnter, 'focus'], e.type);
8332 var expanded = attr(this.$el, 'aria-expanded');
8333
8334 // Skip hide if still hovered or focused
8335 if (!show && (
8336 e.type === pointerLeave && matches(this.$el, ':focus')
8337 || e.type === 'blur' && matches(this.$el, ':hover')
8338 )) {
8339 return;
8340 }
8341
8342 // Skip if state does not change e.g. hover + focus received
8343 if (this._showState && show === (expanded !== this._showState)) {
8344
8345 // Ensure reset if state has changed through click
8346 if (!show) {
8347 this._showState = null;
8348 }
8349 return;
8350 }
8351
8352 this._showState = show ? expanded : null;
8353
8354 this.toggle(("toggle" + (show ? 'show' : 'hide')));
8355 }
8356
8357 },
8358
8359 {
8360 name: 'keydown',
8361
8362 filter: function() {
8363 return includes(this.mode, 'click');
8364 },
8365
8366 handler: function(e) {
8367 // Space
8368 if (e.keyCode === 32) {
8369 e.preventDefault();
8370 this.$el.click();
8371 }
8372 }
8373 },
8374
8375 {
8376
8377 name: 'click',
8378
8379 filter: function() {
8380 return includes(this.mode, 'click');
8381 },
8382
8383 handler: function(e) {
8384
8385 if (this._preventClick) {
8386 return this._preventClick = null;
8387 }
8388
8389 var link;
8390 if (closest(e.target, 'a[href="#"], a[href=""]')
8391 || (link = closest(e.target, 'a[href]')) && (
8392 attr(this.$el, 'aria-expanded') !== 'true'
8393 || link.hash && matches(this.target, link.hash)
8394 )
8395 ) {
8396 e.preventDefault();
8397 }
8398
8399 this.toggle();
8400 }
8401
8402 },
8403
8404 {
8405
8406 name: 'toggled',
8407
8408 self: true,
8409
8410 el: function() {
8411 return this.target;
8412 },
8413
8414 handler: function(e, toggled) {
8415 if (e.target === this.target[0]) {
8416 this.updateAria(toggled);
8417 }
8418 }
8419 }
8420
8421 ],
8422
8423 update: {
8424
8425 read: function() {
8426 return includes(this.mode, 'media') && this.media
8427 ? {match: this.matchMedia}
8428 : false;
8429 },
8430
8431 write: function(ref) {
8432 var match = ref.match;
8433
8434
8435 var toggled = this.isToggled(this.target);
8436 if (match ? !toggled : toggled) {
8437 this.toggle();
8438 }
8439
8440 },
8441
8442 events: ['resize']
8443
8444 },
8445
8446 methods: {
8447
8448 toggle: function(type) {
8449 var this$1$1 = this;
8450
8451
8452 if (!trigger(this.target, type || 'toggle', [this])) {
8453 return;
8454 }
8455
8456 if (!this.queued) {
8457 return this.toggleElement(this.target);
8458 }
8459
8460 var leaving = this.target.filter(function (el) { return hasClass(el, this$1$1.clsLeave); });
8461
8462 if (leaving.length) {
8463 this.target.forEach(function (el) {
8464 var isLeaving = includes(leaving, el);
8465 this$1$1.toggleElement(el, isLeaving, isLeaving);
8466 });
8467 return;
8468 }
8469
8470 var toggled = this.target.filter(this.isToggled);
8471 this.toggleElement(toggled, false).then(function () { return this$1$1.toggleElement(this$1$1.target.filter(function (el) { return !includes(toggled, el); }
8472 ), true); }
8473 );
8474
8475 },
8476
8477 updateAria: function(toggled) {
8478 if (includes(this.mode, 'media')) {
8479 return;
8480 }
8481
8482 attr(this.$el, 'aria-expanded', isBoolean(toggled)
8483 ? toggled
8484 : this.isToggled(this.target)
8485 );
8486 }
8487
8488 }
8489
8490 };
8491
8492 var components$1 = /*#__PURE__*/Object.freeze({
8493 __proto__: null,
8494 Accordion: Accordion,
8495 Alert: alert,
8496 Cover: cover,
8497 Drop: drop,
8498 Dropdown: drop,
8499 FormCustom: formCustom,
8500 Gif: gif,
8501 Grid: grid,
8502 HeightMatch: heightMatch,
8503 HeightViewport: heightViewport,
8504 Icon: Icon,
8505 Img: img,
8506 Leader: leader,
8507 Margin: Margin,
8508 Modal: modal,
8509 Nav: nav,
8510 Navbar: navbar,
8511 Offcanvas: offcanvas,
8512 OverflowAuto: overflowAuto,
8513 Responsive: responsive,
8514 Scroll: scroll,
8515 Scrollspy: scrollspy,
8516 ScrollspyNav: scrollspyNav,
8517 Sticky: sticky,
8518 Svg: SVG,
8519 Switcher: Switcher,
8520 Tab: tab,
8521 Toggle: toggle,
8522 Video: Video,
8523 Close: Close,
8524 Spinner: Spinner,
8525 SlidenavNext: Slidenav,
8526 SlidenavPrevious: Slidenav,
8527 SearchIcon: Search,
8528 Marker: IconComponent,
8529 NavbarToggleIcon: IconComponent,
8530 OverlayIcon: IconComponent,
8531 PaginationNext: IconComponent,
8532 PaginationPrevious: IconComponent,
8533 Totop: IconComponent
8534 });
8535
8536 // register components
8537 each(components$1, function (component, name) { return UIkit.component(name, component); }
8538 );
8539
8540 // core functionality
8541 UIkit.use(Core);
8542
8543 boot(UIkit);
8544
8545 var countdown = {
8546
8547 mixins: [Class],
8548
8549 props: {
8550 date: String,
8551 clsWrapper: String
8552 },
8553
8554 data: {
8555 date: '',
8556 clsWrapper: '.uk-countdown-%unit%'
8557 },
8558
8559 computed: {
8560
8561 date: function(ref) {
8562 var date = ref.date;
8563
8564 return Date.parse(date);
8565 },
8566
8567 days: function(ref, $el) {
8568 var clsWrapper = ref.clsWrapper;
8569
8570 return $(clsWrapper.replace('%unit%', 'days'), $el);
8571 },
8572
8573 hours: function(ref, $el) {
8574 var clsWrapper = ref.clsWrapper;
8575
8576 return $(clsWrapper.replace('%unit%', 'hours'), $el);
8577 },
8578
8579 minutes: function(ref, $el) {
8580 var clsWrapper = ref.clsWrapper;
8581
8582 return $(clsWrapper.replace('%unit%', 'minutes'), $el);
8583 },
8584
8585 seconds: function(ref, $el) {
8586 var clsWrapper = ref.clsWrapper;
8587
8588 return $(clsWrapper.replace('%unit%', 'seconds'), $el);
8589 },
8590
8591 units: function() {
8592 var this$1$1 = this;
8593
8594 return ['days', 'hours', 'minutes', 'seconds'].filter(function (unit) { return this$1$1[unit]; });
8595 }
8596
8597 },
8598
8599 connected: function() {
8600 this.start();
8601 },
8602
8603 disconnected: function() {
8604 var this$1$1 = this;
8605
8606 this.stop();
8607 this.units.forEach(function (unit) { return empty(this$1$1[unit]); });
8608 },
8609
8610 events: [
8611
8612 {
8613
8614 name: 'visibilitychange',
8615
8616 el: function() {
8617 return document;
8618 },
8619
8620 handler: function() {
8621 if (document.hidden) {
8622 this.stop();
8623 } else {
8624 this.start();
8625 }
8626 }
8627
8628 }
8629
8630 ],
8631
8632 update: {
8633
8634 write: function() {
8635 var this$1$1 = this;
8636
8637
8638 var timespan = getTimeSpan(this.date);
8639
8640 if (timespan.total <= 0) {
8641
8642 this.stop();
8643
8644 timespan.days
8645 = timespan.hours
8646 = timespan.minutes
8647 = timespan.seconds
8648 = 0;
8649 }
8650
8651 this.units.forEach(function (unit) {
8652
8653 var digits = String(Math.floor(timespan[unit]));
8654
8655 digits = digits.length < 2 ? ("0" + digits) : digits;
8656
8657 var el = this$1$1[unit];
8658 if (el.textContent !== digits) {
8659 digits = digits.split('');
8660
8661 if (digits.length !== el.children.length) {
8662 html(el, digits.map(function () { return '<span></span>'; }).join(''));
8663 }
8664
8665 digits.forEach(function (digit, i) { return el.children[i].textContent = digit; });
8666 }
8667
8668 });
8669
8670 }
8671
8672 },
8673
8674 methods: {
8675
8676 start: function() {
8677
8678 this.stop();
8679
8680 if (this.date && this.units.length) {
8681 this.$update();
8682 this.timer = setInterval(this.$update, 1000);
8683 }
8684
8685 },
8686
8687 stop: function() {
8688
8689 if (this.timer) {
8690 clearInterval(this.timer);
8691 this.timer = null;
8692 }
8693
8694 }
8695
8696 }
8697
8698 };
8699
8700 function getTimeSpan(date) {
8701
8702 var total = date - Date.now();
8703
8704 return {
8705 total: total,
8706 seconds: total / 1000 % 60,
8707 minutes: total / 1000 / 60 % 60,
8708 hours: total / 1000 / 60 / 60 % 24,
8709 days: total / 1000 / 60 / 60 / 24
8710 };
8711 }
8712
8713 var clsLeave = 'uk-transition-leave';
8714 var clsEnter = 'uk-transition-enter';
8715
8716 function fade(action, target, duration, stagger) {
8717 if ( stagger === void 0 ) stagger = 0;
8718
8719
8720 var index = transitionIndex(target, true);
8721 var propsIn = {opacity: 1};
8722 var propsOut = {opacity: 0};
8723
8724 var wrapIndexFn = function (fn) { return function () { return index === transitionIndex(target) ? fn() : Promise$1.reject(); }; };
8725
8726 var leaveFn = wrapIndexFn(function () {
8727
8728 addClass(target, clsLeave);
8729
8730 return Promise$1.all(getTransitionNodes(target).map(function (child, i) { return new Promise$1(function (resolve) { return setTimeout(function () { return Transition.start(child, propsOut, duration / 2, 'ease').then(resolve); }, i * stagger); }
8731 ); }
8732 )).then(function () { return removeClass(target, clsLeave); });
8733
8734 });
8735
8736 var enterFn = wrapIndexFn(function () {
8737
8738 var oldHeight = height(target);
8739
8740 addClass(target, clsEnter);
8741 action();
8742
8743 css(children(target), {opacity: 0});
8744
8745 // Ensure UIkit updates have propagated
8746 return new Promise$1(function (resolve) { return requestAnimationFrame(function () {
8747
8748 var nodes = children(target);
8749 var newHeight = height(target);
8750
8751 // Ensure Grid cells do not stretch when height is applied
8752 css(target, 'alignContent', 'flex-start');
8753 height(target, oldHeight);
8754
8755 var transitionNodes = getTransitionNodes(target);
8756 css(nodes, propsOut);
8757
8758 var transitions = transitionNodes.map(function (child, i) { return new Promise$1(function (resolve) { return setTimeout(function () { return Transition.start(child, propsIn, duration / 2, 'ease').then(resolve); }, i * stagger); }
8759 ); }
8760 );
8761
8762 if (oldHeight !== newHeight) {
8763 transitions.push(Transition.start(target, {height: newHeight}, duration / 2 + transitionNodes.length * stagger, 'ease'));
8764 }
8765
8766 Promise$1.all(transitions).then(function () {
8767 removeClass(target, clsEnter);
8768 if (index === transitionIndex(target)) {
8769 css(target, {height: '', alignContent: ''});
8770 css(nodes, {opacity: ''});
8771 delete target.dataset.transition;
8772 }
8773 resolve();
8774 });
8775 }); }
8776 );
8777 });
8778
8779 return hasClass(target, clsLeave)
8780 ? waitTransitionend(target).then(enterFn)
8781 : hasClass(target, clsEnter)
8782 ? waitTransitionend(target).then(leaveFn).then(enterFn)
8783 : leaveFn().then(enterFn);
8784 }
8785
8786 function transitionIndex(target, next) {
8787 if (next) {
8788 target.dataset.transition = 1 + transitionIndex(target);
8789 }
8790
8791 return toNumber(target.dataset.transition) || 0;
8792 }
8793
8794 function waitTransitionend(target) {
8795 return Promise$1.all(children(target).filter(Transition.inProgress).map(function (el) { return new Promise$1(function (resolve) { return once(el, 'transitionend transitioncanceled', resolve); }); }
8796 ));
8797 }
8798
8799 function getTransitionNodes(target) {
8800 return getRows(children(target)).reduce(function (nodes, row) { return nodes.concat(sortBy$1(row.filter(function (el) { return isInView(el); }), 'offsetLeft')); }, []);
8801 }
8802
8803 function slide (action, target, duration) {
8804
8805 return new Promise$1(function (resolve) { return requestAnimationFrame(function () {
8806
8807 var nodes = children(target);
8808
8809 // Get current state
8810 var currentProps = nodes.map(function (el) { return getProps(el, true); });
8811 var targetProps = css(target, ['height', 'padding']);
8812
8813 // Cancel previous animations
8814 Transition.cancel(target);
8815 nodes.forEach(Transition.cancel);
8816 reset(target);
8817
8818 // Adding, sorting, removing nodes
8819 action();
8820
8821 // Find new nodes
8822 nodes = nodes.concat(children(target).filter(function (el) { return !includes(nodes, el); }));
8823
8824 // Wait for update to propagate
8825 Promise$1.resolve().then(function () {
8826
8827 // Force update
8828 fastdom.flush();
8829
8830 // Get new state
8831 var targetPropsTo = css(target, ['height', 'padding']);
8832 var ref = getTransitionProps(target, nodes, currentProps);
8833 var propsTo = ref[0];
8834 var propsFrom = ref[1];
8835
8836 // Reset to previous state
8837 nodes.forEach(function (el, i) { return propsFrom[i] && css(el, propsFrom[i]); });
8838 css(target, assign({display: 'block'}, targetProps));
8839
8840 // Start transitions on next frame
8841 requestAnimationFrame(function () {
8842
8843 var transitions = nodes.map(function (el, i) { return parent(el) === target && Transition.start(el, propsTo[i], duration, 'ease'); }
8844 ).concat(Transition.start(target, targetPropsTo, duration, 'ease'));
8845
8846 Promise$1.all(transitions).then(function () {
8847 nodes.forEach(function (el, i) { return parent(el) === target && css(el, 'display', propsTo[i].opacity === 0 ? 'none' : ''); });
8848 reset(target);
8849 }, noop).then(resolve);
8850
8851 });
8852 });
8853 }); });
8854 }
8855
8856 function getProps(el, opacity) {
8857
8858 var zIndex = css(el, 'zIndex');
8859
8860 return isVisible(el)
8861 ? assign({
8862 display: '',
8863 opacity: opacity ? css(el, 'opacity') : '0',
8864 pointerEvents: 'none',
8865 position: 'absolute',
8866 zIndex: zIndex === 'auto' ? index(el) : zIndex
8867 }, getPositionWithMargin(el))
8868 : false;
8869 }
8870
8871 function getTransitionProps(target, nodes, currentProps) {
8872
8873 var propsTo = nodes.map(function (el, i) { return parent(el) && i in currentProps
8874 ? currentProps[i]
8875 ? isVisible(el)
8876 ? getPositionWithMargin(el)
8877 : {opacity: 0}
8878 : {opacity: isVisible(el) ? 1 : 0}
8879 : false; });
8880
8881 var propsFrom = propsTo.map(function (props, i) {
8882
8883 var from = parent(nodes[i]) === target && (currentProps[i] || getProps(nodes[i]));
8884
8885 if (!from) {
8886 return false;
8887 }
8888
8889 if (!props) {
8890 delete from.opacity;
8891 } else if (!('opacity' in props)) {
8892 var opacity = from.opacity;
8893
8894 if (opacity % 1) {
8895 props.opacity = 1;
8896 } else {
8897 delete from.opacity;
8898 }
8899 }
8900
8901 return from;
8902 });
8903
8904 return [propsTo, propsFrom];
8905 }
8906
8907 function reset(el) {
8908 css(el.children, {
8909 height: '',
8910 left: '',
8911 opacity: '',
8912 pointerEvents: '',
8913 position: '',
8914 top: '',
8915 marginTop: '',
8916 marginLeft: '',
8917 transform: '',
8918 width: '',
8919 zIndex: ''
8920 });
8921 css(el, {height: '', display: '', padding: ''});
8922 }
8923
8924 function getPositionWithMargin(el) {
8925 var ref = offset(el);
8926 var height = ref.height;
8927 var width = ref.width;
8928 var ref$1 = position(el);
8929 var top = ref$1.top;
8930 var left = ref$1.left;
8931 var ref$2 = css(el, ['marginTop', 'marginLeft']);
8932 var marginLeft = ref$2.marginLeft;
8933 var marginTop = ref$2.marginTop;
8934
8935 return {top: top, left: left, height: height, width: width, marginLeft: marginLeft, marginTop: marginTop, transform: ''};
8936 }
8937
8938 var Animate = {
8939
8940 props: {
8941 duration: Number,
8942 animation: Boolean
8943 },
8944
8945 data: {
8946 duration: 150,
8947 animation: 'slide'
8948 },
8949
8950 methods: {
8951
8952 animate: function(action, target) {
8953 var this$1$1 = this;
8954 if ( target === void 0 ) target = this.$el;
8955
8956
8957 var name = this.animation;
8958 var animationFn = name === 'fade'
8959 ? fade
8960 : name === 'delayed-fade'
8961 ? function () {
8962 var args = [], len = arguments.length;
8963 while ( len-- ) args[ len ] = arguments[ len ];
8964
8965 return fade.apply(void 0, args.concat( [40] ));
8966 }
8967 : !name
8968 ? function () {
8969 action();
8970 return Promise$1.resolve();
8971 }
8972 : slide;
8973
8974 return animationFn(action, target, this.duration)
8975 .then(function () { return this$1$1.$update(target, 'resize'); }, noop);
8976 }
8977
8978 }
8979 };
8980
8981 var filter = {
8982
8983 mixins: [Animate],
8984
8985 args: 'target',
8986
8987 props: {
8988 target: Boolean,
8989 selActive: Boolean
8990 },
8991
8992 data: {
8993 target: null,
8994 selActive: false,
8995 attrItem: 'uk-filter-control',
8996 cls: 'uk-active',
8997 duration: 250
8998 },
8999
9000 computed: {
9001
9002 toggles: {
9003
9004 get: function(ref, $el) {
9005 var attrItem = ref.attrItem;
9006
9007 return $$(("[" + attrItem + "],[data-" + attrItem + "]"), $el);
9008 },
9009
9010 watch: function() {
9011 var this$1$1 = this;
9012
9013
9014 this.updateState();
9015
9016 if (this.selActive !== false) {
9017 var actives = $$(this.selActive, this.$el);
9018 this.toggles.forEach(function (el) { return toggleClass(el, this$1$1.cls, includes(actives, el)); });
9019 }
9020
9021 },
9022
9023 immediate: true
9024
9025 },
9026
9027 children: {
9028
9029 get: function(ref, $el) {
9030 var target = ref.target;
9031
9032 return $$((target + " > *"), $el);
9033 },
9034
9035 watch: function(list, old) {
9036 if (old && !isEqualList(list, old)) {
9037 this.updateState();
9038 }
9039 },
9040
9041 immediate: true
9042
9043 }
9044
9045 },
9046
9047 events: [
9048
9049 {
9050
9051 name: 'click',
9052
9053 delegate: function() {
9054 return ("[" + (this.attrItem) + "],[data-" + (this.attrItem) + "]");
9055 },
9056
9057 handler: function(e) {
9058
9059 e.preventDefault();
9060 this.apply(e.current);
9061
9062 }
9063
9064 }
9065
9066 ],
9067
9068 methods: {
9069
9070 apply: function(el) {
9071 var prevState = this.getState();
9072 var newState = mergeState(el, this.attrItem, this.getState());
9073
9074 if (!isEqualState(prevState, newState)) {
9075 this.setState(newState);
9076 }
9077 },
9078
9079 getState: function() {
9080 var this$1$1 = this;
9081
9082 return this.toggles
9083 .filter(function (item) { return hasClass(item, this$1$1.cls); })
9084 .reduce(function (state, el) { return mergeState(el, this$1$1.attrItem, state); }, {filter: {'': ''}, sort: []});
9085 },
9086
9087 setState: function(state, animate) {
9088 var this$1$1 = this;
9089 if ( animate === void 0 ) animate = true;
9090
9091
9092 state = assign({filter: {'': ''}, sort: []}, state);
9093
9094 trigger(this.$el, 'beforeFilter', [this, state]);
9095
9096 this.toggles.forEach(function (el) { return toggleClass(el, this$1$1.cls, !!matchFilter(el, this$1$1.attrItem, state)); });
9097
9098 Promise$1.all($$(this.target, this.$el).map(function (target) {
9099 var filterFn = function () {
9100 applyState(state, target, children(target));
9101 this$1$1.$update(this$1$1.$el);
9102 };
9103 return animate ? this$1$1.animate(filterFn, target) : filterFn();
9104 })).then(function () { return trigger(this$1$1.$el, 'afterFilter', [this$1$1]); });
9105
9106 },
9107
9108 updateState: function() {
9109 var this$1$1 = this;
9110
9111 fastdom.write(function () { return this$1$1.setState(this$1$1.getState(), false); });
9112 }
9113
9114 }
9115
9116 };
9117
9118 function getFilter(el, attr) {
9119 return parseOptions(data(el, attr), ['filter']);
9120 }
9121
9122 function isEqualState(stateA, stateB) {
9123 return ['filter', 'sort'].every(function (prop) { return isEqual(stateA[prop], stateB[prop]); });
9124 }
9125
9126 function applyState(state, target, children) {
9127 var selector = getSelector(state);
9128
9129 children.forEach(function (el) { return css(el, 'display', selector && !matches(el, selector) ? 'none' : ''); });
9130
9131 var ref = state.sort;
9132 var sort = ref[0];
9133 var order = ref[1];
9134
9135 if (sort) {
9136 var sorted = sortItems(children, sort, order);
9137 if (!isEqual(sorted, children)) {
9138 append(target, sorted);
9139 }
9140 }
9141 }
9142
9143 function mergeState(el, attr, state) {
9144
9145 var filterBy = getFilter(el, attr);
9146 var filter = filterBy.filter;
9147 var group = filterBy.group;
9148 var sort = filterBy.sort;
9149 var order = filterBy.order; if ( order === void 0 ) order = 'asc';
9150
9151 if (filter || isUndefined(sort)) {
9152
9153 if (group) {
9154
9155 if (filter) {
9156 delete state.filter[''];
9157 state.filter[group] = filter;
9158 } else {
9159 delete state.filter[group];
9160
9161 if (isEmpty(state.filter) || '' in state.filter) {
9162 state.filter = {'': filter || ''};
9163 }
9164
9165 }
9166
9167 } else {
9168 state.filter = {'': filter || ''};
9169 }
9170
9171 }
9172
9173 if (!isUndefined(sort)) {
9174 state.sort = [sort, order];
9175 }
9176
9177 return state;
9178 }
9179
9180 function matchFilter(el, attr, ref) {
9181 var stateFilter = ref.filter; if ( stateFilter === void 0 ) stateFilter = {'': ''};
9182 var ref_sort = ref.sort;
9183 var stateSort = ref_sort[0];
9184 var stateOrder = ref_sort[1];
9185
9186
9187 var ref$1 = getFilter(el, attr);
9188 var filter = ref$1.filter; if ( filter === void 0 ) filter = '';
9189 var group = ref$1.group; if ( group === void 0 ) group = '';
9190 var sort = ref$1.sort;
9191 var order = ref$1.order; if ( order === void 0 ) order = 'asc';
9192
9193 return isUndefined(sort)
9194 ? group in stateFilter && filter === stateFilter[group]
9195 || !filter && group && !(group in stateFilter) && !stateFilter['']
9196 : stateSort === sort && stateOrder === order;
9197 }
9198
9199 function isEqualList(listA, listB) {
9200 return listA.length === listB.length
9201 && listA.every(function (el) { return ~listB.indexOf(el); });
9202 }
9203
9204 function getSelector(ref) {
9205 var filter = ref.filter;
9206
9207 var selector = '';
9208 each(filter, function (value) { return selector += value || ''; });
9209 return selector;
9210 }
9211
9212 function sortItems(nodes, sort, order) {
9213 return assign([], nodes).sort(function (a, b) { return data(a, sort).localeCompare(data(b, sort), undefined, {numeric: true}) * (order === 'asc' || -1); });
9214 }
9215
9216 var Animations$2 = {
9217
9218 slide: {
9219
9220 show: function(dir) {
9221 return [
9222 {transform: translate(dir * -100)},
9223 {transform: translate()}
9224 ];
9225 },
9226
9227 percent: function(current) {
9228 return translated(current);
9229 },
9230
9231 translate: function(percent, dir) {
9232 return [
9233 {transform: translate(dir * -100 * percent)},
9234 {transform: translate(dir * 100 * (1 - percent))}
9235 ];
9236 }
9237
9238 }
9239
9240 };
9241
9242 function translated(el) {
9243 return Math.abs(css(el, 'transform').split(',')[4] / el.offsetWidth) || 0;
9244 }
9245
9246 function translate(value, unit) {
9247 if ( value === void 0 ) value = 0;
9248 if ( unit === void 0 ) unit = '%';
9249
9250 value += value ? unit : '';
9251 return isIE ? ("translateX(" + value + ")") : ("translate3d(" + value + ", 0, 0)"); // currently not translate3d in IE, translate3d within translate3d does not work while transitioning
9252 }
9253
9254 function scale3d(value) {
9255 return ("scale3d(" + value + ", " + value + ", 1)");
9256 }
9257
9258 var Animations$1 = assign({}, Animations$2, {
9259
9260 fade: {
9261
9262 show: function() {
9263 return [
9264 {opacity: 0},
9265 {opacity: 1}
9266 ];
9267 },
9268
9269 percent: function(current) {
9270 return 1 - css(current, 'opacity');
9271 },
9272
9273 translate: function(percent) {
9274 return [
9275 {opacity: 1 - percent},
9276 {opacity: percent}
9277 ];
9278 }
9279
9280 },
9281
9282 scale: {
9283
9284 show: function() {
9285 return [
9286 {opacity: 0, transform: scale3d(1 - .2)},
9287 {opacity: 1, transform: scale3d(1)}
9288 ];
9289 },
9290
9291 percent: function(current) {
9292 return 1 - css(current, 'opacity');
9293 },
9294
9295 translate: function(percent) {
9296 return [
9297 {opacity: 1 - percent, transform: scale3d(1 - .2 * percent)},
9298 {opacity: percent, transform: scale3d(1 - .2 + .2 * percent)}
9299 ];
9300 }
9301
9302 }
9303
9304 });
9305
9306 function Transitioner$1(prev, next, dir, ref) {
9307 var animation = ref.animation;
9308 var easing = ref.easing;
9309
9310
9311 var percent = animation.percent;
9312 var translate = animation.translate;
9313 var show = animation.show; if ( show === void 0 ) show = noop;
9314 var props = show(dir);
9315 var deferred = new Deferred();
9316
9317 return {
9318
9319 dir: dir,
9320
9321 show: function(duration, percent, linear) {
9322 var this$1$1 = this;
9323 if ( percent === void 0 ) percent = 0;
9324
9325
9326 var timing = linear ? 'linear' : easing;
9327 duration -= Math.round(duration * clamp(percent, -1, 1));
9328
9329 this.translate(percent);
9330
9331 triggerUpdate$1(next, 'itemin', {percent: percent, duration: duration, timing: timing, dir: dir});
9332 triggerUpdate$1(prev, 'itemout', {percent: 1 - percent, duration: duration, timing: timing, dir: dir});
9333
9334 Promise$1.all([
9335 Transition.start(next, props[1], duration, timing),
9336 Transition.start(prev, props[0], duration, timing)
9337 ]).then(function () {
9338 this$1$1.reset();
9339 deferred.resolve();
9340 }, noop);
9341
9342 return deferred.promise;
9343 },
9344
9345 cancel: function() {
9346 Transition.cancel([next, prev]);
9347 },
9348
9349 reset: function() {
9350 for (var prop in props[0]) {
9351 css([next, prev], prop, '');
9352 }
9353 },
9354
9355 forward: function(duration, percent) {
9356 if ( percent === void 0 ) percent = this.percent();
9357
9358 Transition.cancel([next, prev]);
9359 return this.show(duration, percent, true);
9360 },
9361
9362 translate: function(percent) {
9363
9364 this.reset();
9365
9366 var props = translate(percent, dir);
9367 css(next, props[1]);
9368 css(prev, props[0]);
9369 triggerUpdate$1(next, 'itemtranslatein', {percent: percent, dir: dir});
9370 triggerUpdate$1(prev, 'itemtranslateout', {percent: 1 - percent, dir: dir});
9371
9372 },
9373
9374 percent: function() {
9375 return percent(prev || next, next, dir);
9376 },
9377
9378 getDistance: function() {
9379 return prev && prev.offsetWidth;
9380 }
9381
9382 };
9383
9384 }
9385
9386 function triggerUpdate$1(el, type, data) {
9387 trigger(el, createEvent(type, false, false, data));
9388 }
9389
9390 var SliderAutoplay = {
9391
9392 props: {
9393 autoplay: Boolean,
9394 autoplayInterval: Number,
9395 pauseOnHover: Boolean
9396 },
9397
9398 data: {
9399 autoplay: false,
9400 autoplayInterval: 7000,
9401 pauseOnHover: true
9402 },
9403
9404 connected: function() {
9405 this.autoplay && this.startAutoplay();
9406 },
9407
9408 disconnected: function() {
9409 this.stopAutoplay();
9410 },
9411
9412 update: function() {
9413 attr(this.slides, 'tabindex', '-1');
9414 },
9415
9416 events: [
9417
9418 {
9419
9420 name: 'visibilitychange',
9421
9422 el: function() {
9423 return document;
9424 },
9425
9426 filter: function() {
9427 return this.autoplay;
9428 },
9429
9430 handler: function() {
9431 if (document.hidden) {
9432 this.stopAutoplay();
9433 } else {
9434 this.startAutoplay();
9435 }
9436 }
9437
9438 }
9439
9440 ],
9441
9442 methods: {
9443
9444 startAutoplay: function() {
9445 var this$1$1 = this;
9446
9447
9448 this.stopAutoplay();
9449
9450 this.interval = setInterval(
9451 function () { return (!this$1$1.draggable || !$(':focus', this$1$1.$el))
9452 && (!this$1$1.pauseOnHover || !matches(this$1$1.$el, ':hover'))
9453 && !this$1$1.stack.length
9454 && this$1$1.show('next'); },
9455 this.autoplayInterval
9456 );
9457
9458 },
9459
9460 stopAutoplay: function() {
9461 this.interval && clearInterval(this.interval);
9462 }
9463
9464 }
9465
9466 };
9467
9468 var SliderDrag = {
9469
9470 props: {
9471 draggable: Boolean
9472 },
9473
9474 data: {
9475 draggable: true,
9476 threshold: 10
9477 },
9478
9479 created: function() {
9480 var this$1$1 = this;
9481
9482
9483 ['start', 'move', 'end'].forEach(function (key) {
9484
9485 var fn = this$1$1[key];
9486 this$1$1[key] = function (e) {
9487
9488 var pos = getEventPos(e).x * (isRtl ? -1 : 1);
9489
9490 this$1$1.prevPos = pos !== this$1$1.pos ? this$1$1.pos : this$1$1.prevPos;
9491 this$1$1.pos = pos;
9492
9493 fn(e);
9494 };
9495
9496 });
9497
9498 },
9499
9500 events: [
9501
9502 {
9503
9504 name: pointerDown,
9505
9506 delegate: function() {
9507 return this.selSlides;
9508 },
9509
9510 handler: function(e) {
9511
9512 if (!this.draggable
9513 || !isTouch(e) && hasTextNodesOnly(e.target)
9514 || closest(e.target, selInput)
9515 || e.button > 0
9516 || this.length < 2
9517 ) {
9518 return;
9519 }
9520
9521 this.start(e);
9522 }
9523
9524 },
9525
9526 {
9527 name: 'dragstart',
9528
9529 handler: function(e) {
9530 e.preventDefault();
9531 }
9532 }
9533
9534 ],
9535
9536 methods: {
9537
9538 start: function() {
9539
9540 this.drag = this.pos;
9541
9542 if (this._transitioner) {
9543
9544 this.percent = this._transitioner.percent();
9545 this.drag += this._transitioner.getDistance() * this.percent * this.dir;
9546
9547 this._transitioner.cancel();
9548 this._transitioner.translate(this.percent);
9549
9550 this.dragging = true;
9551
9552 this.stack = [];
9553
9554 } else {
9555 this.prevIndex = this.index;
9556 }
9557
9558 on(document, pointerMove, this.move, {passive: false});
9559
9560 // 'input' event is triggered by video controls
9561 on(document, (pointerUp + " " + pointerCancel + " input"), this.end, true);
9562
9563 css(this.list, 'userSelect', 'none');
9564
9565 },
9566
9567 move: function(e) {
9568 var this$1$1 = this;
9569
9570
9571 var distance = this.pos - this.drag;
9572
9573 if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
9574 return;
9575 }
9576
9577 // prevent click event
9578 css(this.list, 'pointerEvents', 'none');
9579
9580 e.cancelable && e.preventDefault();
9581
9582 this.dragging = true;
9583 this.dir = (distance < 0 ? 1 : -1);
9584
9585 var ref = this;
9586 var slides = ref.slides;
9587 var ref$1 = this;
9588 var prevIndex = ref$1.prevIndex;
9589 var dis = Math.abs(distance);
9590 var nextIndex = this.getIndex(prevIndex + this.dir, prevIndex);
9591 var width = this._getDistance(prevIndex, nextIndex) || slides[prevIndex].offsetWidth;
9592
9593 while (nextIndex !== prevIndex && dis > width) {
9594
9595 this.drag -= width * this.dir;
9596
9597 prevIndex = nextIndex;
9598 dis -= width;
9599 nextIndex = this.getIndex(prevIndex + this.dir, prevIndex);
9600 width = this._getDistance(prevIndex, nextIndex) || slides[prevIndex].offsetWidth;
9601
9602 }
9603
9604 this.percent = dis / width;
9605
9606 var prev = slides[prevIndex];
9607 var next = slides[nextIndex];
9608 var changed = this.index !== nextIndex;
9609 var edge = prevIndex === nextIndex;
9610
9611 var itemShown;
9612
9613 [this.index, this.prevIndex].filter(function (i) { return !includes([nextIndex, prevIndex], i); }).forEach(function (i) {
9614 trigger(slides[i], 'itemhidden', [this$1$1]);
9615
9616 if (edge) {
9617 itemShown = true;
9618 this$1$1.prevIndex = prevIndex;
9619 }
9620
9621 });
9622
9623 if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {
9624 trigger(slides[this.index], 'itemshown', [this]);
9625 }
9626
9627 if (changed) {
9628 this.prevIndex = prevIndex;
9629 this.index = nextIndex;
9630
9631 !edge && trigger(prev, 'beforeitemhide', [this]);
9632 trigger(next, 'beforeitemshow', [this]);
9633 }
9634
9635 this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);
9636
9637 if (changed) {
9638 !edge && trigger(prev, 'itemhide', [this]);
9639 trigger(next, 'itemshow', [this]);
9640 }
9641
9642 },
9643
9644 end: function() {
9645
9646 off(document, pointerMove, this.move, {passive: false});
9647 off(document, (pointerUp + " " + pointerCancel + " input"), this.end, true);
9648
9649 if (this.dragging) {
9650
9651 this.dragging = null;
9652
9653 if (this.index === this.prevIndex) {
9654 this.percent = 1 - this.percent;
9655 this.dir *= -1;
9656 this._show(false, this.index, true);
9657 this._transitioner = null;
9658 } else {
9659
9660 var dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;
9661 this.index = dirChange ? this.index : this.prevIndex;
9662
9663 if (dirChange) {
9664 this.percent = 1 - this.percent;
9665 }
9666
9667 this.show(this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? 'next' : 'previous', true);
9668 }
9669
9670 }
9671
9672 css(this.list, {userSelect: '', pointerEvents: ''});
9673
9674 this.drag
9675 = this.percent
9676 = null;
9677
9678 }
9679
9680 }
9681
9682 };
9683
9684 function hasTextNodesOnly(el) {
9685 return !el.children.length && el.childNodes.length;
9686 }
9687
9688 var SliderNav = {
9689
9690 data: {
9691 selNav: false
9692 },
9693
9694 computed: {
9695
9696 nav: function(ref, $el) {
9697 var selNav = ref.selNav;
9698
9699 return $(selNav, $el);
9700 },
9701
9702 selNavItem: function(ref) {
9703 var attrItem = ref.attrItem;
9704
9705 return ("[" + attrItem + "],[data-" + attrItem + "]");
9706 },
9707
9708 navItems: function(_, $el) {
9709 return $$(this.selNavItem, $el);
9710 }
9711
9712 },
9713
9714 update: {
9715
9716 write: function() {
9717 var this$1$1 = this;
9718
9719
9720 if (this.nav && this.length !== this.nav.children.length) {
9721 html(this.nav, this.slides.map(function (_, i) { return ("<li " + (this$1$1.attrItem) + "=\"" + i + "\"><a href></a></li>"); }).join(''));
9722 }
9723
9724 this.navItems.concat(this.nav).forEach(function (el) { return el && (el.hidden = !this$1$1.maxIndex); });
9725
9726 this.updateNav();
9727
9728 },
9729
9730 events: ['resize']
9731
9732 },
9733
9734 events: [
9735
9736 {
9737
9738 name: 'click',
9739
9740 delegate: function() {
9741 return this.selNavItem;
9742 },
9743
9744 handler: function(e) {
9745 e.preventDefault();
9746 this.show(data(e.current, this.attrItem));
9747 }
9748
9749 },
9750
9751 {
9752
9753 name: 'itemshow',
9754 handler: 'updateNav'
9755
9756 }
9757
9758 ],
9759
9760 methods: {
9761
9762 updateNav: function() {
9763 var this$1$1 = this;
9764
9765
9766 var i = this.getValidIndex();
9767 this.navItems.forEach(function (el) {
9768
9769 var cmd = data(el, this$1$1.attrItem);
9770
9771 toggleClass(el, this$1$1.clsActive, toNumber(cmd) === i);
9772 toggleClass(el, 'uk-invisible', this$1$1.finite && (cmd === 'previous' && i === 0 || cmd === 'next' && i >= this$1$1.maxIndex));
9773 });
9774
9775 }
9776
9777 }
9778
9779 };
9780
9781 var Slider = {
9782
9783 mixins: [SliderAutoplay, SliderDrag, SliderNav],
9784
9785 props: {
9786 clsActivated: Boolean,
9787 easing: String,
9788 index: Number,
9789 finite: Boolean,
9790 velocity: Number,
9791 selSlides: String
9792 },
9793
9794 data: function () { return ({
9795 easing: 'ease',
9796 finite: false,
9797 velocity: 1,
9798 index: 0,
9799 prevIndex: -1,
9800 stack: [],
9801 percent: 0,
9802 clsActive: 'uk-active',
9803 clsActivated: false,
9804 Transitioner: false,
9805 transitionOptions: {}
9806 }); },
9807
9808 connected: function() {
9809 this.prevIndex = -1;
9810 this.index = this.getValidIndex(this.$props.index);
9811 this.stack = [];
9812 },
9813
9814 disconnected: function() {
9815 removeClass(this.slides, this.clsActive);
9816 },
9817
9818 computed: {
9819
9820 duration: function(ref, $el) {
9821 var velocity = ref.velocity;
9822
9823 return speedUp($el.offsetWidth / velocity);
9824 },
9825
9826 list: function(ref, $el) {
9827 var selList = ref.selList;
9828
9829 return $(selList, $el);
9830 },
9831
9832 maxIndex: function() {
9833 return this.length - 1;
9834 },
9835
9836 selSlides: function(ref) {
9837 var selList = ref.selList;
9838 var selSlides = ref.selSlides;
9839
9840 return (selList + " " + (selSlides || '> *'));
9841 },
9842
9843 slides: {
9844
9845 get: function() {
9846 return $$(this.selSlides, this.$el);
9847 },
9848
9849 watch: function() {
9850 this.$reset();
9851 }
9852
9853 },
9854
9855 length: function() {
9856 return this.slides.length;
9857 }
9858
9859 },
9860
9861 events: {
9862
9863 itemshown: function() {
9864 this.$update(this.list);
9865 }
9866
9867 },
9868
9869 methods: {
9870
9871 show: function(index, force) {
9872 var this$1$1 = this;
9873 if ( force === void 0 ) force = false;
9874
9875
9876 if (this.dragging || !this.length) {
9877 return;
9878 }
9879
9880 var ref = this;
9881 var stack = ref.stack;
9882 var queueIndex = force ? 0 : stack.length;
9883 var reset = function () {
9884 stack.splice(queueIndex, 1);
9885
9886 if (stack.length) {
9887 this$1$1.show(stack.shift(), true);
9888 }
9889 };
9890
9891 stack[force ? 'unshift' : 'push'](index);
9892
9893 if (!force && stack.length > 1) {
9894
9895 if (stack.length === 2) {
9896 this._transitioner.forward(Math.min(this.duration, 200));
9897 }
9898
9899 return;
9900 }
9901
9902 var prevIndex = this.getIndex(this.index);
9903 var prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];
9904 var nextIndex = this.getIndex(index, this.index);
9905 var next = this.slides[nextIndex];
9906
9907 if (prev === next) {
9908 reset();
9909 return;
9910 }
9911
9912 this.dir = getDirection(index, prevIndex);
9913 this.prevIndex = prevIndex;
9914 this.index = nextIndex;
9915
9916 if (prev && !trigger(prev, 'beforeitemhide', [this])
9917 || !trigger(next, 'beforeitemshow', [this, prev])
9918 ) {
9919 this.index = this.prevIndex;
9920 reset();
9921 return;
9922 }
9923
9924 var promise = this._show(prev, next, force).then(function () {
9925
9926 prev && trigger(prev, 'itemhidden', [this$1$1]);
9927 trigger(next, 'itemshown', [this$1$1]);
9928
9929 return new Promise$1(function (resolve) {
9930 fastdom.write(function () {
9931 stack.shift();
9932 if (stack.length) {
9933 this$1$1.show(stack.shift(), true);
9934 } else {
9935 this$1$1._transitioner = null;
9936 }
9937 resolve();
9938 });
9939 });
9940
9941 });
9942
9943 prev && trigger(prev, 'itemhide', [this]);
9944 trigger(next, 'itemshow', [this]);
9945
9946 return promise;
9947
9948 },
9949
9950 getIndex: function(index, prev) {
9951 if ( index === void 0 ) index = this.index;
9952 if ( prev === void 0 ) prev = this.index;
9953
9954 return clamp(getIndex(index, this.slides, prev, this.finite), 0, this.maxIndex);
9955 },
9956
9957 getValidIndex: function(index, prevIndex) {
9958 if ( index === void 0 ) index = this.index;
9959 if ( prevIndex === void 0 ) prevIndex = this.prevIndex;
9960
9961 return this.getIndex(index, prevIndex);
9962 },
9963
9964 _show: function(prev, next, force) {
9965
9966 this._transitioner = this._getTransitioner(
9967 prev,
9968 next,
9969 this.dir,
9970 assign({
9971 easing: force
9972 ? next.offsetWidth < 600
9973 ? 'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */
9974 : 'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */
9975 : this.easing
9976 }, this.transitionOptions)
9977 );
9978
9979 if (!force && !prev) {
9980 this._translate(1);
9981 return Promise$1.resolve();
9982 }
9983
9984 var ref = this.stack;
9985 var length = ref.length;
9986 return this._transitioner[length > 1 ? 'forward' : 'show'](length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration, this.percent);
9987
9988 },
9989
9990 _getDistance: function(prev, next) {
9991 return this._getTransitioner(prev, prev !== next && next).getDistance();
9992 },
9993
9994 _translate: function(percent, prev, next) {
9995 if ( prev === void 0 ) prev = this.prevIndex;
9996 if ( next === void 0 ) next = this.index;
9997
9998 var transitioner = this._getTransitioner(prev !== next ? prev : false, next);
9999 transitioner.translate(percent);
10000 return transitioner;
10001 },
10002
10003 _getTransitioner: function(prev, next, dir, options) {
10004 if ( prev === void 0 ) prev = this.prevIndex;
10005 if ( next === void 0 ) next = this.index;
10006 if ( dir === void 0 ) dir = this.dir || 1;
10007 if ( options === void 0 ) options = this.transitionOptions;
10008
10009 return new this.Transitioner(
10010 isNumber(prev) ? this.slides[prev] : prev,
10011 isNumber(next) ? this.slides[next] : next,
10012 dir * (isRtl ? -1 : 1),
10013 options
10014 );
10015 }
10016
10017 }
10018
10019 };
10020
10021 function getDirection(index, prevIndex) {
10022 return index === 'next'
10023 ? 1
10024 : index === 'previous'
10025 ? -1
10026 : index < prevIndex
10027 ? -1
10028 : 1;
10029 }
10030
10031 function speedUp(x) {
10032 return .5 * x + 300; // parabola through (400,500; 600,600; 1800,1200)
10033 }
10034
10035 var Slideshow = {
10036
10037 mixins: [Slider],
10038
10039 props: {
10040 animation: String
10041 },
10042
10043 data: {
10044 animation: 'slide',
10045 clsActivated: 'uk-transition-active',
10046 Animations: Animations$2,
10047 Transitioner: Transitioner$1
10048 },
10049
10050 computed: {
10051
10052 animation: function(ref) {
10053 var animation = ref.animation;
10054 var Animations = ref.Animations;
10055
10056 return assign(Animations[animation] || Animations.slide, {name: animation});
10057 },
10058
10059 transitionOptions: function() {
10060 return {animation: this.animation};
10061 }
10062
10063 },
10064
10065 events: {
10066
10067 'itemshow itemhide itemshown itemhidden': function(ref) {
10068 var target = ref.target;
10069
10070 this.$update(target);
10071 },
10072
10073 beforeitemshow: function(ref) {
10074 var target = ref.target;
10075
10076 addClass(target, this.clsActive);
10077 },
10078
10079 itemshown: function(ref) {
10080 var target = ref.target;
10081
10082 addClass(target, this.clsActivated);
10083 },
10084
10085 itemhidden: function(ref) {
10086 var target = ref.target;
10087
10088 removeClass(target, this.clsActive, this.clsActivated);
10089 }
10090
10091 }
10092
10093 };
10094
10095 var LightboxPanel = {
10096
10097 mixins: [Container, Modal, Togglable, Slideshow],
10098
10099 functional: true,
10100
10101 props: {
10102 delayControls: Number,
10103 preload: Number,
10104 videoAutoplay: Boolean,
10105 template: String
10106 },
10107
10108 data: function () { return ({
10109 preload: 1,
10110 videoAutoplay: false,
10111 delayControls: 3000,
10112 items: [],
10113 cls: 'uk-open',
10114 clsPage: 'uk-lightbox-page',
10115 selList: '.uk-lightbox-items',
10116 attrItem: 'uk-lightbox-item',
10117 selClose: '.uk-close-large',
10118 selCaption: '.uk-lightbox-caption',
10119 pauseOnHover: false,
10120 velocity: 2,
10121 Animations: Animations$1,
10122 template: "<div class=\"uk-lightbox uk-overflow-hidden\"> <ul class=\"uk-lightbox-items\"></ul> <div class=\"uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque\"> <button class=\"uk-lightbox-toolbar-icon uk-close-large\" type=\"button\" uk-close></button> </div> <a class=\"uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade\" href uk-slidenav-previous uk-lightbox-item=\"previous\"></a> <a class=\"uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade\" href uk-slidenav-next uk-lightbox-item=\"next\"></a> <div class=\"uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque\"></div> </div>"
10123 }); },
10124
10125 created: function() {
10126
10127 var $el = $(this.template);
10128 var list = $(this.selList, $el);
10129 this.items.forEach(function () { return append(list, '<li>'); });
10130
10131 this.$mount(append(this.container, $el));
10132
10133 },
10134
10135 computed: {
10136
10137 caption: function(ref, $el) {
10138 var selCaption = ref.selCaption;
10139
10140 return $(selCaption, $el);
10141 }
10142
10143 },
10144
10145 events: [
10146
10147 {
10148
10149 name: (pointerMove + " " + pointerDown + " keydown"),
10150
10151 handler: 'showControls'
10152
10153 },
10154
10155 {
10156
10157 name: 'click',
10158
10159 self: true,
10160
10161 delegate: function() {
10162 return this.selSlides;
10163 },
10164
10165 handler: function(e) {
10166
10167 if (e.defaultPrevented) {
10168 return;
10169 }
10170
10171 this.hide();
10172 }
10173
10174 },
10175
10176 {
10177
10178 name: 'shown',
10179
10180 self: true,
10181
10182 handler: function() {
10183 this.showControls();
10184 }
10185
10186 },
10187
10188 {
10189
10190 name: 'hide',
10191
10192 self: true,
10193
10194 handler: function() {
10195
10196 this.hideControls();
10197
10198 removeClass(this.slides, this.clsActive);
10199 Transition.stop(this.slides);
10200
10201 }
10202 },
10203
10204 {
10205
10206 name: 'hidden',
10207
10208 self: true,
10209
10210 handler: function() {
10211 this.$destroy(true);
10212 }
10213
10214 },
10215
10216 {
10217
10218 name: 'keyup',
10219
10220 el: function() {
10221 return document;
10222 },
10223
10224 handler: function(e) {
10225
10226 if (!this.isToggled(this.$el) || !this.draggable) {
10227 return;
10228 }
10229
10230 switch (e.keyCode) {
10231 case 37:
10232 this.show('previous');
10233 break;
10234 case 39:
10235 this.show('next');
10236 break;
10237 }
10238 }
10239 },
10240
10241 {
10242
10243 name: 'beforeitemshow',
10244
10245 handler: function(e) {
10246
10247 if (this.isToggled()) {
10248 return;
10249 }
10250
10251 this.draggable = false;
10252
10253 e.preventDefault();
10254
10255 this.toggleElement(this.$el, true, false);
10256
10257 this.animation = Animations$1['scale'];
10258 removeClass(e.target, this.clsActive);
10259 this.stack.splice(1, 0, this.index);
10260
10261 }
10262
10263 },
10264
10265 {
10266
10267 name: 'itemshow',
10268
10269 handler: function() {
10270
10271 html(this.caption, this.getItem().caption || '');
10272
10273 for (var j = -this.preload; j <= this.preload; j++) {
10274 this.loadItem(this.index + j);
10275 }
10276
10277 }
10278
10279 },
10280
10281 {
10282
10283 name: 'itemshown',
10284
10285 handler: function() {
10286 this.draggable = this.$props.draggable;
10287 }
10288
10289 },
10290
10291 {
10292
10293 name: 'itemload',
10294
10295 handler: function(_, item) {
10296 var this$1$1 = this;
10297
10298
10299 var src = item.source;
10300 var type = item.type;
10301 var alt = item.alt; if ( alt === void 0 ) alt = '';
10302 var poster = item.poster;
10303 var attrs = item.attrs; if ( attrs === void 0 ) attrs = {};
10304
10305 this.setItem(item, '<span uk-spinner></span>');
10306
10307 if (!src) {
10308 return;
10309 }
10310
10311 var matches;
10312 var iframeAttrs = {
10313 frameborder: '0',
10314 allow: 'autoplay',
10315 allowfullscreen: '',
10316 style: 'max-width: 100%; box-sizing: border-box;',
10317 'uk-responsive': '',
10318 'uk-video': ("" + (this.videoAutoplay))
10319 };
10320
10321 // Image
10322 if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
10323
10324 getImage(src, attrs.srcset, attrs.size).then(
10325 function (ref) {
10326 var width = ref.width;
10327 var height = ref.height;
10328
10329 return this$1$1.setItem(item, createEl('img', assign({src: src, width: width, height: height, alt: alt}, attrs)));
10330 },
10331 function () { return this$1$1.setError(item); }
10332 );
10333
10334 // Video
10335 } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
10336
10337 var video = createEl('video', assign({
10338 src: src,
10339 poster: poster,
10340 controls: '',
10341 playsinline: '',
10342 'uk-video': ("" + (this.videoAutoplay))
10343 }, attrs));
10344
10345 on(video, 'loadedmetadata', function () {
10346 attr(video, {width: video.videoWidth, height: video.videoHeight});
10347 this$1$1.setItem(item, video);
10348 });
10349 on(video, 'error', function () { return this$1$1.setError(item); });
10350
10351 // Iframe
10352 } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
10353
10354 this.setItem(item, createEl('iframe', assign({
10355 src: src,
10356 frameborder: '0',
10357 allowfullscreen: '',
10358 class: 'uk-lightbox-iframe'
10359 }, attrs)));
10360
10361 // YouTube
10362 } else if ((matches = src.match(/\/\/(?:.*?youtube(-nocookie)?\..*?[?&]v=|youtu\.be\/)([\w-]{11})[&?]?(.*)?/))) {
10363
10364 this.setItem(item, createEl('iframe', assign({
10365 src: ("https://www.youtube" + (matches[1] || '') + ".com/embed/" + (matches[2]) + (matches[3] ? ("?" + (matches[3])) : '')),
10366 width: 1920,
10367 height: 1080
10368 }, iframeAttrs, attrs)));
10369
10370 // Vimeo
10371 } else if ((matches = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/))) {
10372
10373 ajax(("https://vimeo.com/api/oembed.json?maxwidth=1920&url=" + (encodeURI(src))), {
10374 responseType: 'json',
10375 withCredentials: false
10376 }).then(
10377 function (ref) {
10378 var ref_response = ref.response;
10379 var height = ref_response.height;
10380 var width = ref_response.width;
10381
10382 return this$1$1.setItem(item, createEl('iframe', assign({
10383 src: ("https://player.vimeo.com/video/" + (matches[1]) + (matches[2] ? ("?" + (matches[2])) : '')),
10384 width: width,
10385 height: height
10386 }, iframeAttrs, attrs)));
10387 },
10388 function () { return this$1$1.setError(item); }
10389 );
10390
10391 }
10392
10393 }
10394
10395 }
10396
10397 ],
10398
10399 methods: {
10400
10401 loadItem: function(index) {
10402 if ( index === void 0 ) index = this.index;
10403
10404
10405 var item = this.getItem(index);
10406
10407 if (!this.getSlide(item).childElementCount) {
10408 trigger(this.$el, 'itemload', [item]);
10409 }
10410 },
10411
10412 getItem: function(index) {
10413 if ( index === void 0 ) index = this.index;
10414
10415 return this.items[getIndex(index, this.slides)];
10416 },
10417
10418 setItem: function(item, content) {
10419 trigger(this.$el, 'itemloaded', [this, html(this.getSlide(item), content) ]);
10420 },
10421
10422 getSlide: function(item) {
10423 return this.slides[this.items.indexOf(item)];
10424 },
10425
10426 setError: function(item) {
10427 this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
10428 },
10429
10430 showControls: function() {
10431
10432 clearTimeout(this.controlsTimer);
10433 this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
10434
10435 addClass(this.$el, 'uk-active', 'uk-transition-active');
10436
10437 },
10438
10439 hideControls: function() {
10440 removeClass(this.$el, 'uk-active', 'uk-transition-active');
10441 }
10442
10443 }
10444
10445 };
10446
10447 function createEl(tag, attrs) {
10448 var el = fragment(("<" + tag + ">"));
10449 attr(el, attrs);
10450 return el;
10451 }
10452
10453 var lightbox = {
10454
10455 install: install$1,
10456
10457 props: {toggle: String},
10458
10459 data: {toggle: 'a'},
10460
10461 computed: {
10462
10463 toggles: {
10464
10465 get: function(ref, $el) {
10466 var toggle = ref.toggle;
10467
10468 return $$(toggle, $el);
10469 },
10470
10471 watch: function() {
10472 this.hide();
10473 }
10474
10475 }
10476
10477 },
10478
10479 disconnected: function() {
10480 this.hide();
10481 },
10482
10483 events: [
10484
10485 {
10486
10487 name: 'click',
10488
10489 delegate: function() {
10490 return ((this.toggle) + ":not(.uk-disabled)");
10491 },
10492
10493 handler: function(e) {
10494 e.preventDefault();
10495 this.show(e.current);
10496 }
10497
10498 }
10499
10500 ],
10501
10502 methods: {
10503
10504 show: function(index) {
10505 var this$1$1 = this;
10506
10507
10508 var items = uniqueBy(this.toggles.map(toItem), 'source');
10509
10510 if (isElement(index)) {
10511 var ref = toItem(index);
10512 var source = ref.source;
10513 index = findIndex(items, function (ref) {
10514 var src = ref.source;
10515
10516 return source === src;
10517 });
10518 }
10519
10520 this.panel = this.panel || this.$create('lightboxPanel', assign({}, this.$props, {items: items}));
10521
10522 on(this.panel.$el, 'hidden', function () { return this$1$1.panel = false; });
10523
10524 return this.panel.show(index);
10525
10526 },
10527
10528 hide: function() {
10529
10530 return this.panel && this.panel.hide();
10531
10532 }
10533
10534 }
10535
10536 };
10537
10538 function install$1(UIkit, Lightbox) {
10539
10540 if (!UIkit.lightboxPanel) {
10541 UIkit.component('lightboxPanel', LightboxPanel);
10542 }
10543
10544 assign(
10545 Lightbox.props,
10546 UIkit.component('lightboxPanel').options.props
10547 );
10548
10549 }
10550
10551 function toItem(el) {
10552
10553 var item = {};
10554
10555 ['href', 'caption', 'type', 'poster', 'alt', 'attrs'].forEach(function (attr) {
10556 item[attr === 'href' ? 'source' : attr] = data(el, attr);
10557 });
10558
10559 item.attrs = parseOptions(item.attrs);
10560
10561 return item;
10562 }
10563
10564 var obj$1;
10565
10566 var notification = {
10567
10568 mixins: [Container],
10569
10570 functional: true,
10571
10572 args: ['message', 'status'],
10573
10574 data: {
10575 message: '',
10576 status: '',
10577 timeout: 5000,
10578 group: null,
10579 pos: 'top-center',
10580 clsContainer: 'uk-notification',
10581 clsClose: 'uk-notification-close',
10582 clsMsg: 'uk-notification-message'
10583 },
10584
10585 install: install,
10586
10587 computed: {
10588
10589 marginProp: function(ref) {
10590 var pos = ref.pos;
10591
10592 return ("margin" + (startsWith(pos, 'top') ? 'Top' : 'Bottom'));
10593 },
10594
10595 startProps: function() {
10596 var obj;
10597
10598 return ( obj = {opacity: 0}, obj[this.marginProp] = -this.$el.offsetHeight, obj );
10599 }
10600
10601 },
10602
10603 created: function() {
10604
10605 var container = $(("." + (this.clsContainer) + "-" + (this.pos)), this.container)
10606 || append(this.container, ("<div class=\"" + (this.clsContainer) + " " + (this.clsContainer) + "-" + (this.pos) + "\" style=\"display: block\"></div>"));
10607
10608 this.$mount(append(container,
10609 ("<div class=\"" + (this.clsMsg) + (this.status ? (" " + (this.clsMsg) + "-" + (this.status)) : '') + "\"> <a href class=\"" + (this.clsClose) + "\" data-uk-close></a> <div>" + (this.message) + "</div> </div>")
10610 ));
10611
10612 },
10613
10614 connected: function() {
10615 var this$1$1 = this;
10616 var obj;
10617
10618
10619 var margin = toFloat(css(this.$el, this.marginProp));
10620 Transition.start(
10621 css(this.$el, this.startProps),
10622 ( obj = {opacity: 1}, obj[this.marginProp] = margin, obj )
10623 ).then(function () {
10624 if (this$1$1.timeout) {
10625 this$1$1.timer = setTimeout(this$1$1.close, this$1$1.timeout);
10626 }
10627 });
10628
10629 },
10630
10631 events: ( obj$1 = {
10632
10633 click: function(e) {
10634 if (closest(e.target, 'a[href="#"],a[href=""]')) {
10635 e.preventDefault();
10636 }
10637 this.close();
10638 }
10639
10640 }, obj$1[pointerEnter] = function () {
10641 if (this.timer) {
10642 clearTimeout(this.timer);
10643 }
10644 }, obj$1[pointerLeave] = function () {
10645 if (this.timeout) {
10646 this.timer = setTimeout(this.close, this.timeout);
10647 }
10648 }, obj$1 ),
10649
10650 methods: {
10651
10652 close: function(immediate) {
10653 var this$1$1 = this;
10654
10655
10656 var removeFn = function (el) {
10657
10658 var container = parent(el);
10659
10660 trigger(el, 'close', [this$1$1]);
10661 remove$1(el);
10662
10663 if (container && !container.hasChildNodes()) {
10664 remove$1(container);
10665 }
10666
10667 };
10668
10669 if (this.timer) {
10670 clearTimeout(this.timer);
10671 }
10672
10673 if (immediate) {
10674 removeFn(this.$el);
10675 } else {
10676 Transition.start(this.$el, this.startProps).then(removeFn);
10677 }
10678 }
10679
10680 }
10681
10682 };
10683
10684 function install(UIkit) {
10685 UIkit.notification.closeAll = function (group, immediate) {
10686 apply$1(document.body, function (el) {
10687 var notification = UIkit.getComponent(el, 'notification');
10688 if (notification && (!group || group === notification.group)) {
10689 notification.close(immediate);
10690 }
10691 });
10692 };
10693 }
10694
10695 var props = ['x', 'y', 'bgx', 'bgy', 'rotate', 'scale', 'color', 'backgroundColor', 'borderColor', 'opacity', 'blur', 'hue', 'grayscale', 'invert', 'saturate', 'sepia', 'fopacity', 'stroke'];
10696
10697 var Parallax = {
10698
10699 mixins: [Media],
10700
10701 props: props.reduce(function (props, prop) {
10702 props[prop] = 'list';
10703 return props;
10704 }, {}),
10705
10706 data: props.reduce(function (data, prop) {
10707 data[prop] = undefined;
10708 return data;
10709 }, {}),
10710
10711 computed: {
10712
10713 props: function(properties, $el) {
10714 var this$1$1 = this;
10715
10716
10717 return props.reduce(function (props, prop) {
10718
10719 if (isUndefined(properties[prop])) {
10720 return props;
10721 }
10722
10723 var isColor = prop.match(/color/i);
10724 var isCssProp = isColor || prop === 'opacity';
10725
10726 var pos, bgPos, diff;
10727 var steps = properties[prop].slice();
10728
10729 if (isCssProp) {
10730 css($el, prop, '');
10731 }
10732
10733 if (steps.length < 2) {
10734 steps.unshift((prop === 'scale'
10735 ? 1
10736 : isCssProp
10737 ? css($el, prop)
10738 : 0) || 0);
10739 }
10740
10741 var unit = getUnit(steps);
10742
10743 if (isColor) {
10744
10745 var ref = $el.style;
10746 var color = ref.color;
10747 steps = steps.map(function (step) { return parseColor($el, step); });
10748 $el.style.color = color;
10749
10750 } else if (startsWith(prop, 'bg')) {
10751
10752 var attr = prop === 'bgy' ? 'height' : 'width';
10753 steps = steps.map(function (step) { return toPx(step, attr, this$1$1.$el); });
10754
10755 css($el, ("background-position-" + (prop[2])), '');
10756 bgPos = css($el, 'backgroundPosition').split(' ')[prop[2] === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
10757
10758 if (this$1$1.covers) {
10759
10760 var min = Math.min.apply(Math, steps);
10761 var max = Math.max.apply(Math, steps);
10762 var down = steps.indexOf(min) < steps.indexOf(max);
10763
10764 diff = max - min;
10765
10766 steps = steps.map(function (step) { return step - (down ? min : max); });
10767 pos = (down ? -diff : 0) + "px";
10768
10769 } else {
10770
10771 pos = bgPos;
10772
10773 }
10774
10775 } else {
10776
10777 steps = steps.map(toFloat);
10778
10779 }
10780
10781 if (prop === 'stroke') {
10782
10783 if (!steps.some(function (step) { return step; })) {
10784 return props;
10785 }
10786
10787 var length = getMaxPathLength(this$1$1.$el);
10788 css($el, 'strokeDasharray', length);
10789
10790 if (unit === '%') {
10791 steps = steps.map(function (step) { return step * length / 100; });
10792 }
10793
10794 steps = steps.reverse();
10795
10796 prop = 'strokeDashoffset';
10797 }
10798
10799 props[prop] = {steps: steps, unit: unit, pos: pos, bgPos: bgPos, diff: diff};
10800
10801 return props;
10802
10803 }, {});
10804
10805 },
10806
10807 bgProps: function() {
10808 var this$1$1 = this;
10809
10810 return ['bgx', 'bgy'].filter(function (bg) { return bg in this$1$1.props; });
10811 },
10812
10813 covers: function(_, $el) {
10814 return covers($el);
10815 }
10816
10817 },
10818
10819 disconnected: function() {
10820 delete this._image;
10821 },
10822
10823 update: {
10824
10825 read: function(data) {
10826 var this$1$1 = this;
10827
10828
10829 if (!this.matchMedia) {
10830 return;
10831 }
10832
10833 if (!data.image && this.covers && this.bgProps.length) {
10834 var src = css(this.$el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
10835
10836 if (src) {
10837 var img = new Image();
10838 img.src = src;
10839 data.image = img;
10840
10841 if (!img.naturalWidth) {
10842 img.onload = function () { return this$1$1.$update(); };
10843 }
10844 }
10845
10846 }
10847
10848 var image = data.image;
10849
10850 if (!image || !image.naturalWidth) {
10851 return;
10852 }
10853
10854 var dimEl = {
10855 width: this.$el.offsetWidth,
10856 height: this.$el.offsetHeight
10857 };
10858 var dimImage = {
10859 width: image.naturalWidth,
10860 height: image.naturalHeight
10861 };
10862
10863 var dim = Dimensions.cover(dimImage, dimEl);
10864
10865 this.bgProps.forEach(function (prop) {
10866
10867 var ref = this$1$1.props[prop];
10868 var diff = ref.diff;
10869 var bgPos = ref.bgPos;
10870 var steps = ref.steps;
10871 var attr = prop === 'bgy' ? 'height' : 'width';
10872 var span = dim[attr] - dimEl[attr];
10873
10874 if (span < diff) {
10875 dimEl[attr] = dim[attr] + diff - span;
10876 } else if (span > diff) {
10877
10878 var posPercentage = dimEl[attr] / toPx(bgPos, attr, this$1$1.$el);
10879
10880 if (posPercentage) {
10881 this$1$1.props[prop].steps = steps.map(function (step) { return step - (span - diff) / posPercentage; });
10882 }
10883 }
10884
10885 dim = Dimensions.cover(dimImage, dimEl);
10886 });
10887
10888 data.dim = dim;
10889 },
10890
10891 write: function(ref) {
10892 var dim = ref.dim;
10893
10894
10895 if (!this.matchMedia) {
10896 css(this.$el, {backgroundSize: '', backgroundRepeat: ''});
10897 return;
10898 }
10899
10900 dim && css(this.$el, {
10901 backgroundSize: ((dim.width) + "px " + (dim.height) + "px"),
10902 backgroundRepeat: 'no-repeat'
10903 });
10904
10905 },
10906
10907 events: ['resize']
10908
10909 },
10910
10911 methods: {
10912
10913 reset: function() {
10914 var this$1$1 = this;
10915
10916 each(this.getCss(0), function (_, prop) { return css(this$1$1.$el, prop, ''); });
10917 },
10918
10919 getCss: function(percent) {
10920
10921 var ref = this;
10922 var props = ref.props;
10923 return Object.keys(props).reduce(function (css, prop) {
10924
10925 var ref = props[prop];
10926 var steps = ref.steps;
10927 var unit = ref.unit;
10928 var pos = ref.pos;
10929 var value = getValue(steps, percent);
10930
10931 switch (prop) {
10932
10933 // transforms
10934 case 'x':
10935 case 'y': {
10936 unit = unit || 'px';
10937 css.transform += " translate" + (ucfirst(prop)) + "(" + (toFloat(value).toFixed(unit === 'px' ? 0 : 2)) + unit + ")";
10938 break;
10939 }
10940 case 'rotate':
10941 unit = unit || 'deg';
10942 css.transform += " rotate(" + (value + unit) + ")";
10943 break;
10944 case 'scale':
10945 css.transform += " scale(" + value + ")";
10946 break;
10947
10948 // bg image
10949 case 'bgy':
10950 case 'bgx':
10951 css[("background-position-" + (prop[2]))] = "calc(" + pos + " + " + value + "px)";
10952 break;
10953
10954 // color
10955 case 'color':
10956 case 'backgroundColor':
10957 case 'borderColor': {
10958
10959 var ref$1 = getStep(steps, percent);
10960 var start = ref$1[0];
10961 var end = ref$1[1];
10962 var p = ref$1[2];
10963
10964 css[prop] = "rgba(" + (start.map(function (value, i) {
10965 value = value + p * (end[i] - value);
10966 return i === 3 ? toFloat(value) : parseInt(value, 10);
10967 }).join(',')) + ")";
10968 break;
10969 }
10970 // CSS Filter
10971 case 'blur':
10972 unit = unit || 'px';
10973 css.filter += " blur(" + (value + unit) + ")";
10974 break;
10975 case 'hue':
10976 unit = unit || 'deg';
10977 css.filter += " hue-rotate(" + (value + unit) + ")";
10978 break;
10979 case 'fopacity':
10980 unit = unit || '%';
10981 css.filter += " opacity(" + (value + unit) + ")";
10982 break;
10983 case 'grayscale':
10984 case 'invert':
10985 case 'saturate':
10986 case 'sepia':
10987 unit = unit || '%';
10988 css.filter += " " + prop + "(" + (value + unit) + ")";
10989 break;
10990 default:
10991 css[prop] = value;
10992 }
10993
10994 return css;
10995
10996 }, {transform: '', filter: ''});
10997
10998 }
10999
11000 }
11001
11002 };
11003
11004 function parseColor(el, color) {
11005 return css(css(el, 'color', color), 'color')
11006 .split(/[(),]/g)
11007 .slice(1, -1)
11008 .concat(1)
11009 .slice(0, 4)
11010 .map(toFloat);
11011 }
11012
11013 function getStep(steps, percent) {
11014 var count = steps.length - 1;
11015 var index = Math.min(Math.floor(count * percent), count - 1);
11016 var step = steps.slice(index, index + 2);
11017
11018 step.push(percent === 1 ? 1 : percent % (1 / count) * count);
11019
11020 return step;
11021 }
11022
11023 function getValue(steps, percent, digits) {
11024 if ( digits === void 0 ) digits = 2;
11025
11026 var ref = getStep(steps, percent);
11027 var start = ref[0];
11028 var end = ref[1];
11029 var p = ref[2];
11030 return (isNumber(start)
11031 ? start + Math.abs(start - end) * p * (start < end ? 1 : -1)
11032 : +end
11033 ).toFixed(digits);
11034 }
11035
11036 function getUnit(steps) {
11037 return steps.reduce(function (unit, step) { return isString(step) && step.replace(/-|\d/g, '').trim() || unit; }, '');
11038 }
11039
11040 function covers(el) {
11041 var ref = el.style;
11042 var backgroundSize = ref.backgroundSize;
11043 var covers = css(css(el, 'backgroundSize', ''), 'backgroundSize') === 'cover';
11044 el.style.backgroundSize = backgroundSize;
11045 return covers;
11046 }
11047
11048 var parallax = {
11049
11050 mixins: [Parallax],
11051
11052 props: {
11053 target: String,
11054 viewport: Number,
11055 easing: Number
11056 },
11057
11058 data: {
11059 target: false,
11060 viewport: 1,
11061 easing: 1
11062 },
11063
11064 computed: {
11065
11066 target: function(ref, $el) {
11067 var target = ref.target;
11068
11069 return getOffsetElement(target && query(target, $el) || $el);
11070 }
11071
11072 },
11073
11074 update: {
11075
11076 read: function(ref, types) {
11077 var percent = ref.percent;
11078
11079
11080 if (!types.has('scroll')) {
11081 percent = false;
11082 }
11083
11084 if (!this.matchMedia) {
11085 return;
11086 }
11087
11088 var prev = percent;
11089 percent = ease(scrolledOver(this.target) / (this.viewport || 1), this.easing);
11090
11091 return {
11092 percent: percent,
11093 style: prev !== percent ? this.getCss(percent) : false
11094 };
11095 },
11096
11097 write: function(ref) {
11098 var style = ref.style;
11099
11100
11101 if (!this.matchMedia) {
11102 this.reset();
11103 return;
11104 }
11105
11106 style && css(this.$el, style);
11107
11108 },
11109
11110 events: ['scroll', 'resize']
11111 }
11112
11113 };
11114
11115 function ease(percent, easing) {
11116 return clamp(percent * (1 - (easing - easing * percent)));
11117 }
11118
11119 // SVG elements do not inherit from HTMLElement
11120 function getOffsetElement(el) {
11121 return el
11122 ? 'offsetTop' in el
11123 ? el
11124 : getOffsetElement(parent(el))
11125 : document.body;
11126 }
11127
11128 var SliderReactive = {
11129
11130 update: {
11131
11132 write: function() {
11133
11134 if (this.stack.length || this.dragging) {
11135 return;
11136 }
11137
11138 var index = this.getValidIndex(this.index);
11139
11140 if (!~this.prevIndex || this.index !== index) {
11141 this.show(index);
11142 }
11143
11144 },
11145
11146 events: ['resize']
11147
11148 }
11149
11150 };
11151
11152 function Transitioner (prev, next, dir, ref) {
11153 var center = ref.center;
11154 var easing = ref.easing;
11155 var list = ref.list;
11156
11157
11158 var deferred = new Deferred();
11159
11160 var from = prev
11161 ? getLeft(prev, list, center)
11162 : getLeft(next, list, center) + dimensions(next).width * dir;
11163 var to = next
11164 ? getLeft(next, list, center)
11165 : from + dimensions(prev).width * dir * (isRtl ? -1 : 1);
11166
11167 return {
11168
11169 dir: dir,
11170
11171 show: function(duration, percent, linear) {
11172 if ( percent === void 0 ) percent = 0;
11173
11174
11175 var timing = linear ? 'linear' : easing;
11176 duration -= Math.round(duration * clamp(percent, -1, 1));
11177
11178 this.translate(percent);
11179
11180 percent = prev ? percent : clamp(percent, 0, 1);
11181 triggerUpdate(this.getItemIn(), 'itemin', {percent: percent, duration: duration, timing: timing, dir: dir});
11182 prev && triggerUpdate(this.getItemIn(true), 'itemout', {percent: 1 - percent, duration: duration, timing: timing, dir: dir});
11183
11184 Transition
11185 .start(list, {transform: translate(-to * (isRtl ? -1 : 1), 'px')}, duration, timing)
11186 .then(deferred.resolve, noop);
11187
11188 return deferred.promise;
11189
11190 },
11191
11192 cancel: function() {
11193 Transition.cancel(list);
11194 },
11195
11196 reset: function() {
11197 css(list, 'transform', '');
11198 },
11199
11200 forward: function(duration, percent) {
11201 if ( percent === void 0 ) percent = this.percent();
11202
11203 Transition.cancel(list);
11204 return this.show(duration, percent, true);
11205 },
11206
11207 translate: function(percent) {
11208
11209 var distance = this.getDistance() * dir * (isRtl ? -1 : 1);
11210
11211 css(list, 'transform', translate(clamp(
11212 -to + (distance - distance * percent),
11213 -getWidth(list),
11214 dimensions(list).width
11215 ) * (isRtl ? -1 : 1), 'px'));
11216
11217 var actives = this.getActives();
11218 var itemIn = this.getItemIn();
11219 var itemOut = this.getItemIn(true);
11220
11221 percent = prev ? clamp(percent, -1, 1) : 0;
11222
11223 children(list).forEach(function (slide) {
11224 var isActive = includes(actives, slide);
11225 var isIn = slide === itemIn;
11226 var isOut = slide === itemOut;
11227 var translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));
11228
11229 triggerUpdate(slide, ("itemtranslate" + (translateIn ? 'in' : 'out')), {
11230 dir: dir,
11231 percent: isOut
11232 ? 1 - percent
11233 : isIn
11234 ? percent
11235 : isActive
11236 ? 1
11237 : 0
11238 });
11239 });
11240
11241 },
11242
11243 percent: function() {
11244 return Math.abs((css(list, 'transform').split(',')[4] * (isRtl ? -1 : 1) + from) / (to - from));
11245 },
11246
11247 getDistance: function() {
11248 return Math.abs(to - from);
11249 },
11250
11251 getItemIn: function(out) {
11252 if ( out === void 0 ) out = false;
11253
11254
11255 var actives = this.getActives();
11256 var nextActives = inView(list, getLeft(next || prev, list, center));
11257
11258 if (out) {
11259 var temp = actives;
11260 actives = nextActives;
11261 nextActives = temp;
11262 }
11263
11264 return nextActives[findIndex(nextActives, function (el) { return !includes(actives, el); })];
11265
11266 },
11267
11268 getActives: function() {
11269 return inView(list, getLeft(prev || next, list, center));
11270 }
11271
11272 };
11273
11274 }
11275
11276 function getLeft(el, list, center) {
11277
11278 var left = getElLeft(el, list);
11279
11280 return center
11281 ? left - centerEl(el, list)
11282 : Math.min(left, getMax(list));
11283
11284 }
11285
11286 function getMax(list) {
11287 return Math.max(0, getWidth(list) - dimensions(list).width);
11288 }
11289
11290 function getWidth(list) {
11291 return children(list).reduce(function (right, el) { return dimensions(el).width + right; }, 0);
11292 }
11293
11294 function centerEl(el, list) {
11295 return dimensions(list).width / 2 - dimensions(el).width / 2;
11296 }
11297
11298 function getElLeft(el, list) {
11299 return el && (position(el).left + (isRtl ? dimensions(el).width - dimensions(list).width : 0)) * (isRtl ? -1 : 1) || 0;
11300 }
11301
11302 function inView(list, listLeft) {
11303
11304 listLeft -= 1;
11305 var listWidth = dimensions(list).width;
11306 var listRight = listLeft + listWidth + 2;
11307
11308 return children(list).filter(function (slide) {
11309 var slideLeft = getElLeft(slide, list);
11310 var slideRight = slideLeft + Math.min(dimensions(slide).width, listWidth);
11311
11312 return slideLeft >= listLeft && slideRight <= listRight;
11313 });
11314 }
11315
11316 function triggerUpdate(el, type, data) {
11317 trigger(el, createEvent(type, false, false, data));
11318 }
11319
11320 var slider = {
11321
11322 mixins: [Class, Slider, SliderReactive],
11323
11324 props: {
11325 center: Boolean,
11326 sets: Boolean
11327 },
11328
11329 data: {
11330 center: false,
11331 sets: false,
11332 attrItem: 'uk-slider-item',
11333 selList: '.uk-slider-items',
11334 selNav: '.uk-slider-nav',
11335 clsContainer: 'uk-slider-container',
11336 Transitioner: Transitioner
11337 },
11338
11339 computed: {
11340
11341 avgWidth: function() {
11342 return getWidth(this.list) / this.length;
11343 },
11344
11345 finite: function(ref) {
11346 var finite = ref.finite;
11347
11348 return finite || Math.ceil(getWidth(this.list)) < dimensions(this.list).width + getMaxElWidth(this.list) + this.center;
11349 },
11350
11351 maxIndex: function() {
11352
11353 if (!this.finite || this.center && !this.sets) {
11354 return this.length - 1;
11355 }
11356
11357 if (this.center) {
11358 return last(this.sets);
11359 }
11360
11361 var lft = 0;
11362 var max = getMax(this.list);
11363 var index = findIndex(this.slides, function (el) {
11364
11365 if (lft >= max) {
11366 return true;
11367 }
11368
11369 lft += dimensions(el).width;
11370
11371 });
11372
11373 return ~index ? index : this.length - 1;
11374 },
11375
11376 sets: function(ref) {
11377 var this$1$1 = this;
11378 var sets = ref.sets;
11379
11380
11381 if (!sets) {
11382 return;
11383 }
11384
11385 var width = dimensions(this.list).width / (this.center ? 2 : 1);
11386
11387 var left = 0;
11388 var leftCenter = width;
11389 var slideLeft = 0;
11390
11391 sets = sortBy$1(this.slides, 'offsetLeft').reduce(function (sets, slide, i) {
11392
11393 var slideWidth = dimensions(slide).width;
11394 var slideRight = slideLeft + slideWidth;
11395
11396 if (slideRight > left) {
11397
11398 if (!this$1$1.center && i > this$1$1.maxIndex) {
11399 i = this$1$1.maxIndex;
11400 }
11401
11402 if (!includes(sets, i)) {
11403
11404 var cmp = this$1$1.slides[i + 1];
11405 if (this$1$1.center && cmp && slideWidth < leftCenter - dimensions(cmp).width / 2) {
11406 leftCenter -= slideWidth;
11407 } else {
11408 leftCenter = width;
11409 sets.push(i);
11410 left = slideLeft + width + (this$1$1.center ? slideWidth / 2 : 0);
11411 }
11412
11413 }
11414 }
11415
11416 slideLeft += slideWidth;
11417
11418 return sets;
11419
11420 }, []);
11421
11422 return !isEmpty(sets) && sets;
11423
11424 },
11425
11426 transitionOptions: function() {
11427 return {
11428 center: this.center,
11429 list: this.list
11430 };
11431 }
11432
11433 },
11434
11435 connected: function() {
11436 toggleClass(this.$el, this.clsContainer, !$(("." + (this.clsContainer)), this.$el));
11437 },
11438
11439 update: {
11440
11441 write: function() {
11442 var this$1$1 = this;
11443
11444 this.navItems.forEach(function (el) {
11445 var index = toNumber(data(el, this$1$1.attrItem));
11446 if (index !== false) {
11447 el.hidden = !this$1$1.maxIndex || index > this$1$1.maxIndex || this$1$1.sets && !includes(this$1$1.sets, index);
11448 }
11449 });
11450
11451 if (this.length && !this.dragging && !this.stack.length) {
11452 this.reorder();
11453 this._translate(1);
11454 }
11455
11456 var actives = this._getTransitioner(this.index).getActives();
11457 this.slides.forEach(function (slide) { return toggleClass(slide, this$1$1.clsActive, includes(actives, slide)); });
11458
11459 if (this.clsActivated && (!this.sets || includes(this.sets, toFloat(this.index)))) {
11460 this.slides.forEach(function (slide) { return toggleClass(slide, this$1$1.clsActivated || '', includes(actives, slide)); });
11461 }
11462 },
11463
11464 events: ['resize']
11465
11466 },
11467
11468 events: {
11469
11470 beforeitemshow: function(e) {
11471
11472 if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {
11473 this.index = this.getValidIndex();
11474 }
11475
11476 var diff = Math.abs(
11477 this.index
11478 - this.prevIndex
11479 + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)
11480 );
11481
11482 if (!this.dragging && diff > 1) {
11483
11484 for (var i = 0; i < diff; i++) {
11485 this.stack.splice(1, 0, this.dir > 0 ? 'next' : 'previous');
11486 }
11487
11488 e.preventDefault();
11489 return;
11490 }
11491
11492 var index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;
11493 this.duration = speedUp(this.avgWidth / this.velocity) * (dimensions(this.slides[index]).width / this.avgWidth);
11494
11495 this.reorder();
11496
11497 },
11498
11499 itemshow: function() {
11500 if (~this.prevIndex) {
11501 addClass(this._getTransitioner().getItemIn(), this.clsActive);
11502 }
11503 }
11504
11505 },
11506
11507 methods: {
11508
11509 reorder: function() {
11510 var this$1$1 = this;
11511
11512
11513 if (this.finite) {
11514 css(this.slides, 'order', '');
11515 return;
11516 }
11517
11518 var index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;
11519
11520 this.slides.forEach(function (slide, i) { return css(slide, 'order', this$1$1.dir > 0 && i < index
11521 ? 1
11522 : this$1$1.dir < 0 && i >= this$1$1.index
11523 ? -1
11524 : ''
11525 ); }
11526 );
11527
11528 if (!this.center) {
11529 return;
11530 }
11531
11532 var next = this.slides[index];
11533 var width = dimensions(this.list).width / 2 - dimensions(next).width / 2;
11534 var j = 0;
11535
11536 while (width > 0) {
11537 var slideIndex = this.getIndex(--j + index, index);
11538 var slide = this.slides[slideIndex];
11539
11540 css(slide, 'order', slideIndex > index ? -2 : -1);
11541 width -= dimensions(slide).width;
11542 }
11543
11544 },
11545
11546 getValidIndex: function(index, prevIndex) {
11547 if ( index === void 0 ) index = this.index;
11548 if ( prevIndex === void 0 ) prevIndex = this.prevIndex;
11549
11550
11551 index = this.getIndex(index, prevIndex);
11552
11553 if (!this.sets) {
11554 return index;
11555 }
11556
11557 var prev;
11558
11559 do {
11560
11561 if (includes(this.sets, index)) {
11562 return index;
11563 }
11564
11565 prev = index;
11566 index = this.getIndex(index + this.dir, prevIndex);
11567
11568 } while (index !== prev);
11569
11570 return index;
11571 }
11572
11573 }
11574
11575 };
11576
11577 function getMaxElWidth(list) {
11578 return Math.max.apply(Math, [ 0 ].concat( children(list).map(function (el) { return dimensions(el).width; }) ));
11579 }
11580
11581 var sliderParallax = {
11582
11583 mixins: [Parallax],
11584
11585 data: {
11586 selItem: '!li'
11587 },
11588
11589 computed: {
11590
11591 item: function(ref, $el) {
11592 var selItem = ref.selItem;
11593
11594 return query(selItem, $el);
11595 }
11596
11597 },
11598
11599 events: [
11600
11601 {
11602 name: 'itemin itemout',
11603
11604 self: true,
11605
11606 el: function() {
11607 return this.item;
11608 },
11609
11610 handler: function(ref) {
11611 var this$1$1 = this;
11612 var type = ref.type;
11613 var ref_detail = ref.detail;
11614 var percent = ref_detail.percent;
11615 var duration = ref_detail.duration;
11616 var timing = ref_detail.timing;
11617 var dir = ref_detail.dir;
11618
11619
11620 fastdom.read(function () {
11621 var propsFrom = this$1$1.getCss(getCurrentPercent(type, dir, percent));
11622 var propsTo = this$1$1.getCss(isIn(type) ? .5 : dir > 0 ? 1 : 0);
11623 fastdom.write(function () {
11624 css(this$1$1.$el, propsFrom);
11625 Transition.start(this$1$1.$el, propsTo, duration, timing).catch(noop);
11626 });
11627 });
11628
11629 }
11630 },
11631
11632 {
11633 name: 'transitioncanceled transitionend',
11634
11635 self: true,
11636
11637 el: function() {
11638 return this.item;
11639 },
11640
11641 handler: function() {
11642 Transition.cancel(this.$el);
11643 }
11644
11645 },
11646
11647 {
11648 name: 'itemtranslatein itemtranslateout',
11649
11650 self: true,
11651
11652 el: function() {
11653 return this.item;
11654 },
11655
11656 handler: function(ref) {
11657 var this$1$1 = this;
11658 var type = ref.type;
11659 var ref_detail = ref.detail;
11660 var percent = ref_detail.percent;
11661 var dir = ref_detail.dir;
11662
11663 fastdom.read(function () {
11664 var props = this$1$1.getCss(getCurrentPercent(type, dir, percent));
11665 fastdom.write(function () { return css(this$1$1.$el, props); });
11666 });
11667 }
11668 }
11669
11670 ]
11671
11672 };
11673
11674 function isIn(type) {
11675 return endsWith(type, 'in');
11676 }
11677
11678 function getCurrentPercent(type, dir, percent) {
11679
11680 percent /= 2;
11681
11682 return !isIn(type)
11683 ? dir < 0
11684 ? percent
11685 : 1 - percent
11686 : dir < 0
11687 ? 1 - percent
11688 : percent;
11689 }
11690
11691 var Animations = assign({}, Animations$2, {
11692
11693 fade: {
11694
11695 show: function() {
11696 return [
11697 {opacity: 0, zIndex: 0},
11698 {zIndex: -1}
11699 ];
11700 },
11701
11702 percent: function(current) {
11703 return 1 - css(current, 'opacity');
11704 },
11705
11706 translate: function(percent) {
11707 return [
11708 {opacity: 1 - percent, zIndex: 0},
11709 {zIndex: -1}
11710 ];
11711 }
11712
11713 },
11714
11715 scale: {
11716
11717 show: function() {
11718 return [
11719 {opacity: 0, transform: scale3d(1 + .5), zIndex: 0},
11720 {zIndex: -1}
11721 ];
11722 },
11723
11724 percent: function(current) {
11725 return 1 - css(current, 'opacity');
11726 },
11727
11728 translate: function(percent) {
11729 return [
11730 {opacity: 1 - percent, transform: scale3d(1 + .5 * percent), zIndex: 0},
11731 {zIndex: -1}
11732 ];
11733 }
11734
11735 },
11736
11737 pull: {
11738
11739 show: function(dir) {
11740 return dir < 0
11741 ? [
11742 {transform: translate(30), zIndex: -1},
11743 {transform: translate(), zIndex: 0}
11744 ]
11745 : [
11746 {transform: translate(-100), zIndex: 0},
11747 {transform: translate(), zIndex: -1}
11748 ];
11749 },
11750
11751 percent: function(current, next, dir) {
11752 return dir < 0
11753 ? 1 - translated(next)
11754 : translated(current);
11755 },
11756
11757 translate: function(percent, dir) {
11758 return dir < 0
11759 ? [
11760 {transform: translate(30 * percent), zIndex: -1},
11761 {transform: translate(-100 * (1 - percent)), zIndex: 0}
11762 ]
11763 : [
11764 {transform: translate(-percent * 100), zIndex: 0},
11765 {transform: translate(30 * (1 - percent)), zIndex: -1}
11766 ];
11767 }
11768
11769 },
11770
11771 push: {
11772
11773 show: function(dir) {
11774 return dir < 0
11775 ? [
11776 {transform: translate(100), zIndex: 0},
11777 {transform: translate(), zIndex: -1}
11778 ]
11779 : [
11780 {transform: translate(-30), zIndex: -1},
11781 {transform: translate(), zIndex: 0}
11782 ];
11783 },
11784
11785 percent: function(current, next, dir) {
11786 return dir > 0
11787 ? 1 - translated(next)
11788 : translated(current);
11789 },
11790
11791 translate: function(percent, dir) {
11792 return dir < 0
11793 ? [
11794 {transform: translate(percent * 100), zIndex: 0},
11795 {transform: translate(-30 * (1 - percent)), zIndex: -1}
11796 ]
11797 : [
11798 {transform: translate(-30 * percent), zIndex: -1},
11799 {transform: translate(100 * (1 - percent)), zIndex: 0}
11800 ];
11801 }
11802
11803 }
11804
11805 });
11806
11807 var slideshow = {
11808
11809 mixins: [Class, Slideshow, SliderReactive],
11810
11811 props: {
11812 ratio: String,
11813 minHeight: Number,
11814 maxHeight: Number
11815 },
11816
11817 data: {
11818 ratio: '16:9',
11819 minHeight: false,
11820 maxHeight: false,
11821 selList: '.uk-slideshow-items',
11822 attrItem: 'uk-slideshow-item',
11823 selNav: '.uk-slideshow-nav',
11824 Animations: Animations
11825 },
11826
11827 update: {
11828
11829 read: function() {
11830
11831 var ref = this.ratio.split(':').map(Number);
11832 var width = ref[0];
11833 var height = ref[1];
11834
11835 height = height * this.list.offsetWidth / width || 0;
11836
11837 if (this.minHeight) {
11838 height = Math.max(this.minHeight, height);
11839 }
11840
11841 if (this.maxHeight) {
11842 height = Math.min(this.maxHeight, height);
11843 }
11844
11845 return {height: height - boxModelAdjust(this.list, 'height', 'content-box')};
11846 },
11847
11848 write: function(ref) {
11849 var height = ref.height;
11850
11851 height > 0 && css(this.list, 'minHeight', height);
11852 },
11853
11854 events: ['resize']
11855
11856 }
11857
11858 };
11859
11860 var sortable = {
11861
11862 mixins: [Class, Animate],
11863
11864 props: {
11865 group: String,
11866 threshold: Number,
11867 clsItem: String,
11868 clsPlaceholder: String,
11869 clsDrag: String,
11870 clsDragState: String,
11871 clsBase: String,
11872 clsNoDrag: String,
11873 clsEmpty: String,
11874 clsCustom: String,
11875 handle: String
11876 },
11877
11878 data: {
11879 group: false,
11880 threshold: 5,
11881 clsItem: 'uk-sortable-item',
11882 clsPlaceholder: 'uk-sortable-placeholder',
11883 clsDrag: 'uk-sortable-drag',
11884 clsDragState: 'uk-drag',
11885 clsBase: 'uk-sortable',
11886 clsNoDrag: 'uk-sortable-nodrag',
11887 clsEmpty: 'uk-sortable-empty',
11888 clsCustom: '',
11889 handle: false,
11890 pos: {}
11891 },
11892
11893 created: function() {
11894 var this$1$1 = this;
11895
11896 ['init', 'start', 'move', 'end'].forEach(function (key) {
11897 var fn = this$1$1[key];
11898 this$1$1[key] = function (e) {
11899 assign(this$1$1.pos, getEventPos(e));
11900 fn(e);
11901 };
11902 });
11903 },
11904
11905 events: {
11906
11907 name: pointerDown,
11908 passive: false,
11909 handler: 'init'
11910
11911 },
11912
11913 computed: {
11914
11915 target: function() {
11916 return (this.$el.tBodies || [this.$el])[0];
11917 },
11918
11919 items: function() {
11920 return children(this.target);
11921 },
11922
11923 isEmpty: {
11924
11925 get: function() {
11926 return isEmpty(this.items);
11927 },
11928
11929 watch: function(empty) {
11930 toggleClass(this.target, this.clsEmpty, empty);
11931 },
11932
11933 immediate: true
11934
11935 },
11936
11937 handles: {
11938
11939 get: function(ref, el) {
11940 var handle = ref.handle;
11941
11942 return handle ? $$(handle, el) : this.items;
11943 },
11944
11945 watch: function(handles, prev) {
11946 css(prev, {touchAction: '', userSelect: ''});
11947 css(handles, {touchAction: hasTouch ? 'none' : '', userSelect: 'none'}); // touchAction set to 'none' causes a performance drop in Chrome 80
11948 },
11949
11950 immediate: true
11951
11952 }
11953
11954 },
11955
11956 update: {
11957
11958 write: function(data) {
11959
11960 if (!this.drag || !parent(this.placeholder)) {
11961 return;
11962 }
11963
11964 var ref = this;
11965 var ref_pos = ref.pos;
11966 var x = ref_pos.x;
11967 var y = ref_pos.y;
11968 var ref_origin = ref.origin;
11969 var offsetTop = ref_origin.offsetTop;
11970 var offsetLeft = ref_origin.offsetLeft;
11971 var placeholder = ref.placeholder;
11972
11973 css(this.drag, {
11974 top: y - offsetTop,
11975 left: x - offsetLeft
11976 });
11977
11978 var sortable = this.getSortable(document.elementFromPoint(x, y));
11979
11980 if (!sortable) {
11981 return;
11982 }
11983
11984 var items = sortable.items;
11985
11986 if (items.some(Transition.inProgress)) {
11987 return;
11988 }
11989
11990 var target = findTarget(items, {x: x, y: y});
11991
11992 if (items.length && (!target || target === placeholder)) {
11993 return;
11994 }
11995
11996 var previous = this.getSortable(placeholder);
11997 var insertTarget = findInsertTarget(sortable.target, target, placeholder, x, y, sortable === previous && data.moved !== target);
11998
11999 if (insertTarget === false) {
12000 return;
12001 }
12002
12003 if (insertTarget && placeholder === insertTarget) {
12004 return;
12005 }
12006
12007 if (sortable !== previous) {
12008 previous.remove(placeholder);
12009 data.moved = target;
12010 } else {
12011 delete data.moved;
12012 }
12013
12014 sortable.insert(placeholder, insertTarget);
12015
12016 this.touched.add(sortable);
12017 },
12018
12019 events: ['move']
12020
12021 },
12022
12023 methods: {
12024
12025 init: function(e) {
12026
12027 var target = e.target;
12028 var button = e.button;
12029 var defaultPrevented = e.defaultPrevented;
12030 var ref = this.items.filter(function (el) { return within(target, el); });
12031 var placeholder = ref[0];
12032
12033 if (!placeholder
12034 || defaultPrevented
12035 || button > 0
12036 || isInput(target)
12037 || within(target, ("." + (this.clsNoDrag)))
12038 || this.handle && !within(target, this.handle)
12039 ) {
12040 return;
12041 }
12042
12043 e.preventDefault();
12044
12045 this.touched = new Set([this]);
12046 this.placeholder = placeholder;
12047 this.origin = assign({target: target, index: index(placeholder)}, this.pos);
12048
12049 on(document, pointerMove, this.move);
12050 on(document, pointerUp, this.end);
12051
12052 if (!this.threshold) {
12053 this.start(e);
12054 }
12055
12056 },
12057
12058 start: function(e) {
12059
12060 this.drag = appendDrag(this.$container, this.placeholder);
12061 var ref = this.placeholder.getBoundingClientRect();
12062 var left = ref.left;
12063 var top = ref.top;
12064 assign(this.origin, {offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top});
12065
12066 addClass(this.drag, this.clsDrag, this.clsCustom);
12067 addClass(this.placeholder, this.clsPlaceholder);
12068 addClass(this.items, this.clsItem);
12069 addClass(document.documentElement, this.clsDragState);
12070
12071 trigger(this.$el, 'start', [this, this.placeholder]);
12072
12073 trackScroll(this.pos);
12074
12075 this.move(e);
12076 },
12077
12078 move: function(e) {
12079
12080 if (this.drag) {
12081 this.$emit('move');
12082 } else if (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold) {
12083 this.start(e);
12084 }
12085
12086 },
12087
12088 end: function() {
12089 var this$1$1 = this;
12090
12091
12092 off(document, pointerMove, this.move);
12093 off(document, pointerUp, this.end);
12094 off(window, 'scroll', this.scroll);
12095
12096 if (!this.drag) {
12097 return;
12098 }
12099
12100 untrackScroll();
12101
12102 var sortable = this.getSortable(this.placeholder);
12103
12104 if (this === sortable) {
12105 if (this.origin.index !== index(this.placeholder)) {
12106 trigger(this.$el, 'moved', [this, this.placeholder]);
12107 }
12108 } else {
12109 trigger(sortable.$el, 'added', [sortable, this.placeholder]);
12110 trigger(this.$el, 'removed', [this, this.placeholder]);
12111 }
12112
12113 trigger(this.$el, 'stop', [this, this.placeholder]);
12114
12115 remove$1(this.drag);
12116 this.drag = null;
12117
12118 this.touched.forEach(function (ref) {
12119 var clsPlaceholder = ref.clsPlaceholder;
12120 var clsItem = ref.clsItem;
12121
12122 return this$1$1.touched.forEach(function (sortable) { return removeClass(sortable.items, clsPlaceholder, clsItem); }
12123 );
12124 }
12125 );
12126 this.touched = null;
12127 removeClass(document.documentElement, this.clsDragState);
12128
12129 },
12130
12131 insert: function(element, target) {
12132 var this$1$1 = this;
12133
12134
12135 addClass(this.items, this.clsItem);
12136
12137 var insert = function () { return target
12138 ? before(target, element)
12139 : append(this$1$1.target, element); };
12140
12141 this.animate(insert);
12142
12143 },
12144
12145 remove: function(element) {
12146
12147 if (!within(element, this.target)) {
12148 return;
12149 }
12150
12151 this.animate(function () { return remove$1(element); });
12152
12153 },
12154
12155 getSortable: function(element) {
12156 do {
12157 var sortable = this.$getComponent(element, 'sortable');
12158
12159 if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {
12160 return sortable;
12161 }
12162 } while ((element = parent(element)));
12163 }
12164
12165 }
12166
12167 };
12168
12169 var trackTimer;
12170 function trackScroll(pos) {
12171
12172 var last = Date.now();
12173 trackTimer = setInterval(function () {
12174
12175 var x = pos.x;
12176 var y = pos.y;
12177 y += window.pageYOffset;
12178
12179 var dist = (Date.now() - last) * .3;
12180 last = Date.now();
12181
12182 scrollParents(document.elementFromPoint(x, pos.y)).reverse().some(function (scrollEl) {
12183
12184 var scroll = scrollEl.scrollTop;
12185 var scrollHeight = scrollEl.scrollHeight;
12186
12187 var ref = offset(getViewport$1(scrollEl));
12188 var top = ref.top;
12189 var bottom = ref.bottom;
12190 var height = ref.height;
12191
12192 if (top < y && top + 35 > y) {
12193 scroll -= dist;
12194 } else if (bottom > y && bottom - 35 < y) {
12195 scroll += dist;
12196 } else {
12197 return;
12198 }
12199
12200 if (scroll > 0 && scroll < scrollHeight - height) {
12201 scrollTop(scrollEl, scroll);
12202 return true;
12203 }
12204
12205 });
12206
12207 }, 15);
12208
12209 }
12210
12211 function untrackScroll() {
12212 clearInterval(trackTimer);
12213 }
12214
12215 function appendDrag(container, element) {
12216 var clone = append(container, element.outerHTML.replace(/(^<)(?:li|tr)|(?:li|tr)(\/>$)/g, '$1div$2'));
12217
12218 css(clone, 'margin', '0', 'important');
12219 css(clone, assign({
12220 boxSizing: 'border-box',
12221 width: element.offsetWidth,
12222 height: element.offsetHeight
12223 }, css(element, ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom'])));
12224
12225 height(clone.firstElementChild, height(element.firstElementChild));
12226
12227 return clone;
12228 }
12229
12230 function findTarget(items, point) {
12231 return items[findIndex(items, function (item) { return pointInRect(point, item.getBoundingClientRect()); })];
12232 }
12233
12234 function findInsertTarget(list, target, placeholder, x, y, sameList) {
12235
12236 if (!children(list).length) {
12237 return;
12238 }
12239
12240 var rect = target.getBoundingClientRect();
12241 if (!sameList) {
12242
12243 if (!isHorizontal(list, placeholder)) {
12244 return y < rect.top + rect.height / 2
12245 ? target
12246 : target.nextElementSibling;
12247 }
12248
12249 return target;
12250 }
12251
12252 var placeholderRect = placeholder.getBoundingClientRect();
12253 var sameRow = linesIntersect(
12254 [rect.top, rect.bottom],
12255 [placeholderRect.top, placeholderRect.bottom]
12256 );
12257
12258 var pointerPos = sameRow ? x : y;
12259 var lengthProp = sameRow ? 'width' : 'height';
12260 var startProp = sameRow ? 'left' : 'top';
12261 var endProp = sameRow ? 'right' : 'bottom';
12262
12263 var diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;
12264
12265 if (placeholderRect[startProp] < rect[startProp]) {
12266
12267 if (diff && pointerPos < rect[startProp] + diff) {
12268 return false;
12269 }
12270
12271 return target.nextElementSibling;
12272 }
12273
12274 if (diff && pointerPos > rect[endProp] - diff) {
12275 return false;
12276 }
12277
12278 return target;
12279 }
12280
12281 function isHorizontal(list, placeholder) {
12282
12283 var single = children(list).length === 1;
12284
12285 if (single) {
12286 append(list, placeholder);
12287 }
12288
12289 var items = children(list);
12290 var isHorizontal = items.some(function (el, i) {
12291 var rectA = el.getBoundingClientRect();
12292 return items.slice(i + 1).some(function (el) {
12293 var rectB = el.getBoundingClientRect();
12294 return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);
12295 });
12296 });
12297
12298 if (single) {
12299 remove$1(placeholder);
12300 }
12301
12302 return isHorizontal;
12303 }
12304
12305 function linesIntersect(lineA, lineB) {
12306 return lineA[1] > lineB[0] && lineB[1] > lineA[0];
12307 }
12308
12309 var obj;
12310
12311 var tooltip = {
12312
12313 mixins: [Container, Togglable, Position],
12314
12315 args: 'title',
12316
12317 props: {
12318 delay: Number,
12319 title: String
12320 },
12321
12322 data: {
12323 pos: 'top',
12324 title: '',
12325 delay: 0,
12326 animation: ['uk-animation-scale-up'],
12327 duration: 100,
12328 cls: 'uk-active',
12329 clsPos: 'uk-tooltip'
12330 },
12331
12332 beforeConnect: function() {
12333 this._hasTitle = hasAttr(this.$el, 'title');
12334 attr(this.$el, 'title', '');
12335 this.updateAria(false);
12336 makeFocusable(this.$el);
12337 },
12338
12339 disconnected: function() {
12340 this.hide();
12341 attr(this.$el, 'title', this._hasTitle ? this.title : null);
12342 },
12343
12344 methods: {
12345
12346 show: function() {
12347 var this$1$1 = this;
12348
12349
12350 if (this.isToggled(this.tooltip || null) || !this.title) {
12351 return;
12352 }
12353
12354 this._unbind = once(document, ("show keydown " + pointerDown), this.hide, false, function (e) { return e.type === pointerDown && !within(e.target, this$1$1.$el)
12355 || e.type === 'keydown' && e.keyCode === 27
12356 || e.type === 'show' && e.detail[0] !== this$1$1 && e.detail[0].$name === this$1$1.$name; }
12357 );
12358
12359 clearTimeout(this.showTimer);
12360 this.showTimer = setTimeout(this._show, this.delay);
12361 },
12362
12363 hide: function() {
12364 var this$1$1 = this;
12365
12366
12367 if (matches(this.$el, 'input:focus')) {
12368 return;
12369 }
12370
12371 clearTimeout(this.showTimer);
12372
12373 if (!this.isToggled(this.tooltip || null)) {
12374 return;
12375 }
12376
12377 this.toggleElement(this.tooltip, false, false).then(function () {
12378 this$1$1.tooltip = remove$1(this$1$1.tooltip);
12379 this$1$1._unbind();
12380 });
12381 },
12382
12383 _show: function() {
12384 var this$1$1 = this;
12385
12386
12387 this.tooltip = append(this.container,
12388 ("<div class=\"" + (this.clsPos) + "\"> <div class=\"" + (this.clsPos) + "-inner\">" + (this.title) + "</div> </div>")
12389 );
12390
12391 on(this.tooltip, 'toggled', function (e, toggled) {
12392
12393 this$1$1.updateAria(toggled);
12394
12395 if (!toggled) {
12396 return;
12397 }
12398
12399 this$1$1.positionAt(this$1$1.tooltip, this$1$1.$el);
12400
12401 this$1$1.origin = this$1$1.getAxis() === 'y'
12402 ? ((flipPosition(this$1$1.dir)) + "-" + (this$1$1.align))
12403 : ((this$1$1.align) + "-" + (flipPosition(this$1$1.dir)));
12404 });
12405
12406 this.toggleElement(this.tooltip, true);
12407
12408 },
12409
12410 updateAria: function(toggled) {
12411 attr(this.$el, 'aria-expanded', toggled);
12412 }
12413
12414 },
12415
12416 events: ( obj = {
12417
12418 focus: 'show',
12419 blur: 'hide'
12420
12421 }, obj[(pointerEnter + " " + pointerLeave)] = function (e) {
12422 if (!isTouch(e)) {
12423 this[e.type === pointerEnter ? 'show' : 'hide']();
12424 }
12425 }, obj[pointerDown] = function (e) {
12426 if (isTouch(e)) {
12427 this.show();
12428 }
12429 }, obj )
12430
12431 };
12432
12433 function makeFocusable(el) {
12434 if (!isFocusable(el)) {
12435 attr(el, 'tabindex', '0');
12436 }
12437 }
12438
12439 var upload = {
12440
12441 props: {
12442 allow: String,
12443 clsDragover: String,
12444 concurrent: Number,
12445 maxSize: Number,
12446 method: String,
12447 mime: String,
12448 msgInvalidMime: String,
12449 msgInvalidName: String,
12450 msgInvalidSize: String,
12451 multiple: Boolean,
12452 name: String,
12453 params: Object,
12454 type: String,
12455 url: String
12456 },
12457
12458 data: {
12459 allow: false,
12460 clsDragover: 'uk-dragover',
12461 concurrent: 1,
12462 maxSize: 0,
12463 method: 'POST',
12464 mime: false,
12465 msgInvalidMime: 'Invalid File Type: %s',
12466 msgInvalidName: 'Invalid File Name: %s',
12467 msgInvalidSize: 'Invalid File Size: %s Kilobytes Max',
12468 multiple: false,
12469 name: 'files[]',
12470 params: {},
12471 type: '',
12472 url: '',
12473 abort: noop,
12474 beforeAll: noop,
12475 beforeSend: noop,
12476 complete: noop,
12477 completeAll: noop,
12478 error: noop,
12479 fail: noop,
12480 load: noop,
12481 loadEnd: noop,
12482 loadStart: noop,
12483 progress: noop
12484 },
12485
12486 events: {
12487
12488 change: function(e) {
12489
12490 if (!matches(e.target, 'input[type="file"]')) {
12491 return;
12492 }
12493
12494 e.preventDefault();
12495
12496 if (e.target.files) {
12497 this.upload(e.target.files);
12498 }
12499
12500 e.target.value = '';
12501 },
12502
12503 drop: function(e) {
12504 stop(e);
12505
12506 var transfer = e.dataTransfer;
12507
12508 if (!transfer || !transfer.files) {
12509 return;
12510 }
12511
12512 removeClass(this.$el, this.clsDragover);
12513
12514 this.upload(transfer.files);
12515 },
12516
12517 dragenter: function(e) {
12518 stop(e);
12519 },
12520
12521 dragover: function(e) {
12522 stop(e);
12523 addClass(this.$el, this.clsDragover);
12524 },
12525
12526 dragleave: function(e) {
12527 stop(e);
12528 removeClass(this.$el, this.clsDragover);
12529 }
12530
12531 },
12532
12533 methods: {
12534
12535 upload: function(files) {
12536 var this$1$1 = this;
12537
12538
12539 if (!files.length) {
12540 return;
12541 }
12542
12543 trigger(this.$el, 'upload', [files]);
12544
12545 for (var i = 0; i < files.length; i++) {
12546
12547 if (this.maxSize && this.maxSize * 1000 < files[i].size) {
12548 this.fail(this.msgInvalidSize.replace('%s', this.maxSize));
12549 return;
12550 }
12551
12552 if (this.allow && !match(this.allow, files[i].name)) {
12553 this.fail(this.msgInvalidName.replace('%s', this.allow));
12554 return;
12555 }
12556
12557 if (this.mime && !match(this.mime, files[i].type)) {
12558 this.fail(this.msgInvalidMime.replace('%s', this.mime));
12559 return;
12560 }
12561
12562 }
12563
12564 if (!this.multiple) {
12565 files = [files[0]];
12566 }
12567
12568 this.beforeAll(this, files);
12569
12570 var chunks = chunk(files, this.concurrent);
12571 var upload = function (files) {
12572
12573 var data = new FormData();
12574
12575 files.forEach(function (file) { return data.append(this$1$1.name, file); });
12576
12577 for (var key in this$1$1.params) {
12578 data.append(key, this$1$1.params[key]);
12579 }
12580
12581 ajax(this$1$1.url, {
12582 data: data,
12583 method: this$1$1.method,
12584 responseType: this$1$1.type,
12585 beforeSend: function (env) {
12586
12587 var xhr = env.xhr;
12588 xhr.upload && on(xhr.upload, 'progress', this$1$1.progress);
12589 ['loadStart', 'load', 'loadEnd', 'abort'].forEach(function (type) { return on(xhr, type.toLowerCase(), this$1$1[type]); }
12590 );
12591
12592 return this$1$1.beforeSend(env);
12593
12594 }
12595 }).then(
12596 function (xhr) {
12597
12598 this$1$1.complete(xhr);
12599
12600 if (chunks.length) {
12601 upload(chunks.shift());
12602 } else {
12603 this$1$1.completeAll(xhr);
12604 }
12605
12606 },
12607 function (e) { return this$1$1.error(e); }
12608 );
12609
12610 };
12611
12612 upload(chunks.shift());
12613
12614 }
12615
12616 }
12617
12618 };
12619
12620 function match(pattern, path) {
12621 return path.match(new RegExp(("^" + (pattern.replace(/\//g, '\\/').replace(/\*\*/g, '(\\/[^\\/]+)*').replace(/\*/g, '[^\\/]+').replace(/((?!\\))\?/g, '$1.')) + "$"), 'i'));
12622 }
12623
12624 function chunk(files, size) {
12625 var chunks = [];
12626 for (var i = 0; i < files.length; i += size) {
12627 var chunk = [];
12628 for (var j = 0; j < size; j++) {
12629 chunk.push(files[i + j]);
12630 }
12631 chunks.push(chunk);
12632 }
12633 return chunks;
12634 }
12635
12636 function stop(e) {
12637 e.preventDefault();
12638 e.stopPropagation();
12639 }
12640
12641 var components = /*#__PURE__*/Object.freeze({
12642 __proto__: null,
12643 Countdown: countdown,
12644 Filter: filter,
12645 Lightbox: lightbox,
12646 LightboxPanel: LightboxPanel,
12647 Notification: notification,
12648 Parallax: parallax,
12649 Slider: slider,
12650 SliderParallax: sliderParallax,
12651 Slideshow: slideshow,
12652 SlideshowParallax: sliderParallax,
12653 Sortable: sortable,
12654 Tooltip: tooltip,
12655 Upload: upload
12656 });
12657
12658 each(components, function (component, name) { return UIkit.component(name, component); }
12659 );
12660
12661 return UIkit;
12662
12663 }));