');
+ addClass(this.panel.parentNode, this.clsMode);
+ }
+
+ css(document.documentElement, 'overflowY', this.overlay ? 'hidden' : '');
+ addClass(document.body, this.clsContainer, this.clsFlip);
+ css(document.body, 'touch-action', 'pan-y pinch-zoom');
+ css(this.$el, 'display', 'block');
+ addClass(this.$el, this.clsOverlay);
+ addClass(this.panel, this.clsSidebarAnimation, this.mode !== 'reveal' ? this.clsMode : '');
+
+ height(document.body); // force reflow
+ addClass(document.body, this.clsContainerAnimation);
+
+ this.clsContainerAnimation && suppressUserScale();
+
+
+ }
+ },
+
+ {
+ name: 'hide',
+
+ self: true,
+
+ handler: function() {
+ removeClass(document.body, this.clsContainerAnimation);
+ css(document.body, 'touch-action', '');
+ }
+ },
+
+ {
+ name: 'hidden',
+
+ self: true,
+
+ handler: function() {
+
+ this.clsContainerAnimation && resumeUserScale();
+
+ if (this.mode === 'reveal') {
+ unwrap(this.panel);
+ }
+
+ removeClass(this.panel, this.clsSidebarAnimation, this.clsMode);
+ removeClass(this.$el, this.clsOverlay);
+ css(this.$el, 'display', '');
+ removeClass(document.body, this.clsContainer, this.clsFlip);
+
+ css(document.documentElement, 'overflowY', '');
+
+ }
+ },
+
+ {
+ name: 'swipeLeft swipeRight',
+
+ handler: function(e) {
+
+ if (this.isToggled() && endsWith(e.type, 'Left') ^ this.flip) {
+ this.hide();
+ }
+
+ }
+ }
+
+ ]
+
+ };
+
+ // Chrome in responsive mode zooms page upon opening offcanvas
+ function suppressUserScale() {
+ getViewport$1().content += ',user-scalable=0';
+ }
+
+ function resumeUserScale() {
+ var viewport = getViewport$1();
+ viewport.content = viewport.content.replace(/,user-scalable=0$/, '');
+ }
+
+ function getViewport$1() {
+ return $('meta[name="viewport"]', document.head) || append(document.head, '
');
+ }
+
+ var overflowAuto = {
+
+ mixins: [Class],
+
+ props: {
+ selContainer: String,
+ selContent: String
+ },
+
+ data: {
+ selContainer: '.uk-modal',
+ selContent: '.uk-modal-dialog'
+ },
+
+ computed: {
+
+ container: function(ref, $el) {
+ var selContainer = ref.selContainer;
+
+ return closest($el, selContainer);
+ },
+
+ content: function(ref, $el) {
+ var selContent = ref.selContent;
+
+ return closest($el, selContent);
+ }
+
+ },
+
+ connected: function() {
+ css(this.$el, 'minHeight', 150);
+ },
+
+ update: {
+
+ read: function() {
+
+ if (!this.content || !this.container) {
+ return false;
+ }
+
+ return {
+ current: toFloat(css(this.$el, 'maxHeight')),
+ max: Math.max(150, height(this.container) - (offset(this.content).height - height(this.$el)))
+ };
+ },
+
+ write: function(ref) {
+ var current = ref.current;
+ var max = ref.max;
+
+ css(this.$el, 'maxHeight', max);
+ if (Math.round(current) !== Math.round(max)) {
+ trigger(this.$el, 'resize');
+ }
+ },
+
+ events: ['resize']
+
+ }
+
+ };
+
+ var responsive = {
+
+ props: ['width', 'height'],
+
+ connected: function() {
+ addClass(this.$el, 'uk-responsive-width');
+ },
+
+ update: {
+
+ read: function() {
+ return isVisible(this.$el) && this.width && this.height
+ ? {width: width(this.$el.parentNode), height: this.height}
+ : false;
+ },
+
+ write: function(dim) {
+ height(this.$el, Dimensions.contain({
+ height: this.height,
+ width: this.width
+ }, dim).height);
+ },
+
+ events: ['resize']
+
+ }
+
+ };
+
+ var scroll = {
+
+ props: {
+ offset: Number
+ },
+
+ data: {
+ offset: 0
+ },
+
+ methods: {
+
+ scrollTo: function(el) {
+ var this$1 = this;
+
+
+ el = el && $(el) || document.body;
+
+ if (trigger(this.$el, 'beforescroll', [this, el])) {
+ scrollIntoView(el, {offset: this.offset}).then(function () { return trigger(this$1.$el, 'scrolled', [this$1, el]); }
+ );
+ }
+
+ }
+
+ },
+
+ events: {
+
+ click: function(e) {
+
+ if (e.defaultPrevented) {
+ return;
+ }
+
+ e.preventDefault();
+ this.scrollTo(escape(decodeURIComponent(this.$el.hash)).substr(1));
+ }
+
+ }
+
+ };
+
+ var scrollspy = {
+
+ args: 'cls',
+
+ props: {
+ cls: String,
+ target: String,
+ hidden: Boolean,
+ offsetTop: Number,
+ offsetLeft: Number,
+ repeat: Boolean,
+ delay: Number
+ },
+
+ data: function () { return ({
+ cls: false,
+ target: false,
+ hidden: true,
+ offsetTop: 0,
+ offsetLeft: 0,
+ repeat: false,
+ delay: 0,
+ inViewClass: 'uk-scrollspy-inview'
+ }); },
+
+ computed: {
+
+ elements: {
+
+ get: function(ref, $el) {
+ var target = ref.target;
+
+ return target ? $$(target, $el) : [$el];
+ },
+
+ watch: function(elements) {
+ if (this.hidden) {
+ css(filter(elements, (":not(." + (this.inViewClass) + ")")), 'visibility', 'hidden');
+ }
+ },
+
+ immediate: true
+
+ }
+
+ },
+
+ update: [
+
+ {
+
+ read: function(ref) {
+ var this$1 = this;
+ var update = ref.update;
+
+
+ if (!update) {
+ return;
+ }
+
+ this.elements.forEach(function (el) {
+
+ var state = el._ukScrollspyState;
+
+ if (!state) {
+ state = {cls: data(el, 'uk-scrollspy-class') || this$1.cls};
+ }
+
+ state.show = isInView(el, this$1.offsetTop, this$1.offsetLeft);
+ el._ukScrollspyState = state;
+
+ });
+
+ },
+
+ write: function(data) {
+ var this$1 = this;
+
+
+ // Let child components be applied at least once first
+ if (!data.update) {
+ this.$emit();
+ return data.update = true;
+ }
+
+ this.elements.forEach(function (el) {
+
+ var state = el._ukScrollspyState;
+ var toggle = function (inview) {
+
+ css(el, 'visibility', !inview && this$1.hidden ? 'hidden' : '');
+
+ toggleClass(el, this$1.inViewClass, inview);
+ toggleClass(el, state.cls);
+
+ trigger(el, inview ? 'inview' : 'outview');
+
+ state.inview = inview;
+
+ this$1.$update(el);
+
+ };
+
+ if (state.show && !state.inview && !state.queued) {
+
+ state.queued = true;
+
+ data.promise = (data.promise || Promise.resolve()).then(function () { return new Promise(function (resolve) { return setTimeout(resolve, this$1.delay); }
+ ); }
+ ).then(function () {
+ toggle(true);
+ setTimeout(function () {
+ state.queued = false;
+ this$1.$emit();
+ }, 300);
+ });
+
+ } else if (!state.show && state.inview && !state.queued && this$1.repeat) {
+
+ toggle(false);
+
+ }
+
+ });
+
+ },
+
+ events: ['scroll', 'resize']
+
+ }
+
+ ]
+
+ };
+
+ var scrollspyNav = {
+
+ props: {
+ cls: String,
+ closest: String,
+ scroll: Boolean,
+ overflow: Boolean,
+ offset: Number
+ },
+
+ data: {
+ cls: 'uk-active',
+ closest: false,
+ scroll: false,
+ overflow: true,
+ offset: 0
+ },
+
+ computed: {
+
+ links: {
+
+ get: function(_, $el) {
+ return $$('a[href^="#"]', $el).filter(function (el) { return el.hash; });
+ },
+
+ watch: function(links) {
+ if (this.scroll) {
+ this.$create('scroll', links, {offset: this.offset || 0});
+ }
+ },
+
+ immediate: true
+
+ },
+
+ targets: function() {
+ return $$(this.links.map(function (el) { return escape(el.hash).substr(1); }).join(','));
+ },
+
+ elements: function(ref) {
+ var selector = ref.closest;
+
+ return closest(this.links, selector || '*');
+ }
+
+ },
+
+ update: [
+
+ {
+
+ read: function() {
+ var this$1 = this;
+
+
+ var ref = this.targets;
+ var length = ref.length;
+
+ if (!length || !isVisible(this.$el)) {
+ return false;
+ }
+
+ var scrollElement = last(scrollParents(this.targets[0]));
+ var scrollTop = scrollElement.scrollTop;
+ var scrollHeight = scrollElement.scrollHeight;
+ var viewport = getViewport(scrollElement);
+ var max = scrollHeight - offset(viewport).height;
+ var active = false;
+
+ if (scrollTop === max) {
+ active = length - 1;
+ } else {
+
+ this.targets.every(function (el, i) {
+ if (position(el, viewport).top - this$1.offset <= 0) {
+ active = i;
+ return true;
+ }
+ });
+
+ if (active === false && this.overflow) {
+ active = 0;
+ }
+ }
+
+ return {active: active};
+ },
+
+ write: function(ref) {
+ var active = ref.active;
+
+
+ this.links.forEach(function (el) { return el.blur(); });
+ removeClass(this.elements, this.cls);
+
+ if (active !== false) {
+ trigger(this.$el, 'active', [active, addClass(this.elements[active], this.cls)]);
+ }
+
+ },
+
+ events: ['scroll', 'resize']
+
+ }
+
+ ]
+
+ };
+
+ var sticky = {
+
+ mixins: [Class, Media],
+
+ props: {
+ top: null,
+ bottom: Boolean,
+ offset: String,
+ animation: String,
+ clsActive: String,
+ clsInactive: String,
+ clsFixed: String,
+ clsBelow: String,
+ selTarget: String,
+ widthElement: Boolean,
+ showOnUp: Boolean,
+ targetOffset: Number
+ },
+
+ data: {
+ top: 0,
+ bottom: false,
+ offset: 0,
+ animation: '',
+ clsActive: 'uk-active',
+ clsInactive: '',
+ clsFixed: 'uk-sticky-fixed',
+ clsBelow: 'uk-sticky-below',
+ selTarget: '',
+ widthElement: false,
+ showOnUp: false,
+ targetOffset: false
+ },
+
+ computed: {
+
+ offset: function(ref) {
+ var offset = ref.offset;
+
+ return toPx(offset);
+ },
+
+ selTarget: function(ref, $el) {
+ var selTarget = ref.selTarget;
+
+ return selTarget && $(selTarget, $el) || $el;
+ },
+
+ widthElement: function(ref, $el) {
+ var widthElement = ref.widthElement;
+
+ return query(widthElement, $el) || this.placeholder;
+ },
+
+ isActive: {
+
+ get: function() {
+ return hasClass(this.selTarget, this.clsActive);
+ },
+
+ set: function(value) {
+ if (value && !this.isActive) {
+ replaceClass(this.selTarget, this.clsInactive, this.clsActive);
+ trigger(this.$el, 'active');
+ } else if (!value && !hasClass(this.selTarget, this.clsInactive)) {
+ replaceClass(this.selTarget, this.clsActive, this.clsInactive);
+ trigger(this.$el, 'inactive');
+ }
+ }
+
+ }
+
+ },
+
+ connected: function() {
+ this.placeholder = $('+ .uk-sticky-placeholder', this.$el) || $('
');
+ this.isFixed = false;
+ this.isActive = false;
+ },
+
+ disconnected: function() {
+
+ if (this.isFixed) {
+ this.hide();
+ removeClass(this.selTarget, this.clsInactive);
+ }
+
+ remove(this.placeholder);
+ this.placeholder = null;
+ this.widthElement = null;
+ },
+
+ events: [
+
+ {
+
+ name: 'load hashchange popstate',
+
+ el: inBrowser && window,
+
+ handler: function() {
+ var this$1 = this;
+
+
+ if (!(this.targetOffset !== false && location.hash && window.pageYOffset > 0)) {
+ return;
+ }
+
+ var target = $(location.hash);
+
+ if (target) {
+ fastdom.read(function () {
+
+ var ref = offset(target);
+ var top = ref.top;
+ var elTop = offset(this$1.$el).top;
+ var elHeight = this$1.$el.offsetHeight;
+
+ if (this$1.isFixed && elTop + elHeight >= top && elTop <= top + target.offsetHeight) {
+ scrollTop(window, top - elHeight - (isNumeric(this$1.targetOffset) ? this$1.targetOffset : 0) - this$1.offset);
+ }
+
+ });
+ }
+
+ }
+
+ }
+
+ ],
+
+ update: [
+
+ {
+
+ read: function(ref, type) {
+ var height = ref.height;
+
+
+ if (this.isActive && type !== 'update') {
+ this.hide();
+ height = this.$el.offsetHeight;
+ this.show();
+ }
+
+ height = !this.isActive ? this.$el.offsetHeight : height;
+
+ this.topOffset = offset(this.isFixed ? this.placeholder : this.$el).top;
+ this.bottomOffset = this.topOffset + height;
+
+ var bottom = parseProp('bottom', this);
+
+ this.top = Math.max(toFloat(parseProp('top', this)), this.topOffset) - this.offset;
+ this.bottom = bottom && bottom - this.$el.offsetHeight;
+ this.inactive = !this.matchMedia;
+
+ return {
+ lastScroll: false,
+ height: height,
+ margins: css(this.$el, ['marginTop', 'marginBottom', 'marginLeft', 'marginRight'])
+ };
+ },
+
+ write: function(ref) {
+ var height = ref.height;
+ var margins = ref.margins;
+
+
+ var ref$1 = this;
+ var placeholder = ref$1.placeholder;
+
+ css(placeholder, assign({height: height}, margins));
+
+ if (!within(placeholder, document)) {
+ after(this.$el, placeholder);
+ attr(placeholder, 'hidden', '');
+ }
+
+ this.isActive = !!this.isActive; // force self-assign
+
+ },
+
+ events: ['resize']
+
+ },
+
+ {
+
+ read: function(ref) {
+ var scroll = ref.scroll; if ( scroll === void 0 ) scroll = 0;
+
+
+ this.width = offset(isVisible(this.widthElement) ? this.widthElement : this.$el).width;
+
+ this.scroll = window.pageYOffset;
+
+ return {
+ dir: scroll <= this.scroll ? 'down' : 'up',
+ scroll: this.scroll,
+ visible: isVisible(this.$el),
+ top: offsetPosition(this.placeholder)[0]
+ };
+ },
+
+ write: function(data, type) {
+ var this$1 = this;
+
+
+ var initTimestamp = data.initTimestamp; if ( initTimestamp === void 0 ) initTimestamp = 0;
+ var dir = data.dir;
+ var lastDir = data.lastDir;
+ var lastScroll = data.lastScroll;
+ var scroll = data.scroll;
+ var top = data.top;
+ var visible = data.visible;
+ var now = performance.now();
+
+ data.lastScroll = scroll;
+
+ if (scroll < 0 || scroll === lastScroll || !visible || this.disabled || this.showOnUp && type !== 'scroll') {
+ return;
+ }
+
+ if (now - initTimestamp > 300 || dir !== lastDir) {
+ data.initScroll = scroll;
+ data.initTimestamp = now;
+ }
+
+ data.lastDir = dir;
+
+ if (this.showOnUp && !this.isFixed && Math.abs(data.initScroll - scroll) <= 30 && Math.abs(lastScroll - scroll) <= 10) {
+ return;
+ }
+
+ if (this.inactive
+ || scroll < this.top
+ || this.showOnUp && (scroll <= this.top || dir === 'down' || dir === 'up' && !this.isFixed && scroll <= this.bottomOffset)
+ ) {
+
+ if (!this.isFixed) {
+
+ if (Animation.inProgress(this.$el) && top > scroll) {
+ Animation.cancel(this.$el);
+ this.hide();
+ }
+
+ return;
+ }
+
+ this.isFixed = false;
+
+ if (this.animation && scroll > this.topOffset) {
+ Animation.cancel(this.$el);
+ Animation.out(this.$el, this.animation).then(function () { return this$1.hide(); }, noop);
+ } else {
+ this.hide();
+ }
+
+ } else if (this.isFixed) {
+
+ this.update();
+
+ } else if (this.animation) {
+
+ Animation.cancel(this.$el);
+ this.show();
+ Animation.in(this.$el, this.animation).catch(noop);
+
+ } else {
+ this.show();
+ }
+
+ },
+
+ events: ['resize', 'scroll']
+
+ }
+
+ ],
+
+ methods: {
+
+ show: function() {
+
+ this.isFixed = true;
+ this.update();
+ attr(this.placeholder, 'hidden', null);
+
+ },
+
+ hide: function() {
+
+ this.isActive = false;
+ removeClass(this.$el, this.clsFixed, this.clsBelow);
+ css(this.$el, {position: '', top: '', width: ''});
+ attr(this.placeholder, 'hidden', '');
+
+ },
+
+ update: function() {
+
+ var active = this.top !== 0 || this.scroll > this.top;
+ var top = Math.max(0, this.offset);
+
+ if (isNumeric(this.bottom) && this.scroll > this.bottom - this.offset) {
+ top = this.bottom - this.scroll;
+ }
+
+ css(this.$el, {
+ position: 'fixed',
+ top: (top + "px"),
+ width: this.width
+ });
+
+ this.isActive = active;
+ toggleClass(this.$el, this.clsBelow, this.scroll > this.bottomOffset);
+ addClass(this.$el, this.clsFixed);
+
+ }
+
+ }
+
+ };
+
+ function parseProp(prop, ref) {
+ var $props = ref.$props;
+ var $el = ref.$el;
+ var propOffset = ref[(prop + "Offset")];
+
+
+ var value = $props[prop];
+
+ if (!value) {
+ return;
+ }
+
+ if (isString(value) && value.match(/^-?\d/)) {
+
+ return propOffset + toPx(value);
+
+ } else {
+
+ return offset(value === true ? $el.parentNode : query(value, $el)).bottom;
+
+ }
+ }
+
+ var Switcher = {
+
+ mixins: [Togglable],
+
+ args: 'connect',
+
+ props: {
+ connect: String,
+ toggle: String,
+ active: Number,
+ swiping: Boolean
+ },
+
+ data: {
+ connect: '~.uk-switcher',
+ toggle: '> * > :first-child',
+ active: 0,
+ swiping: true,
+ cls: 'uk-active',
+ clsContainer: 'uk-switcher',
+ attrItem: 'uk-switcher-item'
+ },
+
+ computed: {
+
+ connects: {
+
+ get: function(ref, $el) {
+ var connect = ref.connect;
+
+ return queryAll(connect, $el);
+ },
+
+ watch: function(connects) {
+ var this$1 = this;
+
+
+ connects.forEach(function (list) { return this$1.updateAria(list.children); });
+
+ if (this.swiping) {
+ css(connects, 'touch-action', 'pan-y pinch-zoom');
+ }
+
+ },
+
+ immediate: true
+
+ },
+
+ toggles: {
+
+ get: function(ref, $el) {
+ var toggle = ref.toggle;
+
+ return $$(toggle, $el).filter(function (el) { return !matches(el, '.uk-disabled *, .uk-disabled, [disabled]'); });
+ },
+
+ watch: function(toggles) {
+ var active = this.index();
+ this.show(~active && active || toggles[this.active] || toggles[0]);
+ },
+
+ immediate: true
+
+ },
+
+ children: function() {
+ var this$1 = this;
+
+ return children(this.$el).filter(function (child) { return this$1.toggles.some(function (toggle) { return within(toggle, child); }); });
+ }
+
+ },
+
+ events: [
+
+ {
+
+ name: 'click',
+
+ delegate: function() {
+ return this.toggle;
+ },
+
+ handler: function(e) {
+ if (!includes(this.toggles, e.current)) {
+ return;
+ }
+ e.preventDefault();
+ this.show(e.current);
+ }
+
+ },
+
+ {
+ name: 'click',
+
+ el: function() {
+ return this.connects;
+ },
+
+ delegate: function() {
+ return ("[" + (this.attrItem) + "],[data-" + (this.attrItem) + "]");
+ },
+
+ handler: function(e) {
+ e.preventDefault();
+ this.show(data(e.current, this.attrItem));
+ }
+ },
+
+ {
+ name: 'swipeRight swipeLeft',
+
+ filter: function() {
+ return this.swiping;
+ },
+
+ el: function() {
+ return this.connects;
+ },
+
+ handler: function(ref) {
+ var type = ref.type;
+
+ this.show(endsWith(type, 'Left') ? 'next' : 'previous');
+ }
+ }
+
+ ],
+
+ methods: {
+
+ index: function() {
+ var this$1 = this;
+
+ return findIndex(this.children, function (el) { return hasClass(el, this$1.cls); });
+ },
+
+ show: function(item) {
+ var this$1 = this;
+
+
+ var prev = this.index();
+ var next = getIndex(item, this.toggles, prev);
+
+ this.children.forEach(function (child, i) {
+ toggleClass(child, this$1.cls, next === i);
+ attr(this$1.toggles[i], 'aria-expanded', next === i);
+ });
+
+ this.connects.forEach(function (ref) {
+ var children = ref.children;
+
+ return this$1.toggleElement(toNodes(children).filter(function (child, i) { return i !== next && this$1.isToggled(child); }
+ ), false, prev >= 0).then(function () { return this$1.toggleElement(children[next], true, prev >= 0); }
+ );
+ }
+ );
+ }
+
+ }
+
+ };
+
+ var tab = {
+
+ mixins: [Class],
+
+ extends: Switcher,
+
+ props: {
+ media: Boolean
+ },
+
+ data: {
+ media: 960,
+ attrItem: 'uk-tab-item'
+ },
+
+ connected: function() {
+
+ var cls = hasClass(this.$el, 'uk-tab-left')
+ ? 'uk-tab-left'
+ : hasClass(this.$el, 'uk-tab-right')
+ ? 'uk-tab-right'
+ : false;
+
+ if (cls) {
+ this.$create('toggle', this.$el, {cls: cls, mode: 'media', media: this.media});
+ }
+ }
+
+ };
+
+ var toggle = {
+
+ mixins: [Media, Togglable],
+
+ args: 'target',
+
+ props: {
+ href: String,
+ target: null,
+ mode: 'list',
+ queued: Boolean
+ },
+
+ data: {
+ href: false,
+ target: false,
+ mode: 'click',
+ queued: true
+ },
+
+ computed: {
+
+ target: {
+
+ get: function(ref, $el) {
+ var href = ref.href;
+ var target = ref.target;
+
+ target = queryAll(target || href, $el);
+ return target.length && target || [$el];
+ },
+
+ watch: function() {
+ trigger(this.target, 'updatearia', [this]);
+ },
+
+ immediate: true
+
+ }
+
+ },
+
+ events: [
+
+ {
+
+ name: (pointerEnter + " " + pointerLeave),
+
+ filter: function() {
+ return includes(this.mode, 'hover');
+ },
+
+ handler: function(e) {
+ if (!isTouch(e)) {
+ this.toggle(("toggle" + (e.type === pointerEnter ? 'show' : 'hide')));
+ }
+ }
+
+ },
+
+ {
+
+ name: 'click',
+
+ filter: function() {
+ return includes(this.mode, 'click') || hasTouch && includes(this.mode, 'hover');
+ },
+
+ handler: function(e) {
+
+ // TODO better isToggled handling
+ var link;
+ if (closest(e.target, 'a[href="#"], a[href=""]')
+ || (link = closest(e.target, 'a[href]')) && (
+ this.cls && !hasClass(this.target, this.cls.split(' ')[0])
+ || !isVisible(this.target)
+ || link.hash && matches(this.target, link.hash)
+ )
+ ) {
+ e.preventDefault();
+ }
+
+ this.toggle();
+ }
+
+ }
+
+ ],
+
+ update: {
+
+ read: function() {
+ return includes(this.mode, 'media') && this.media
+ ? {match: this.matchMedia}
+ : false;
+ },
+
+ write: function(ref) {
+ var match = ref.match;
+
+
+ var toggled = this.isToggled(this.target);
+ if (match ? !toggled : toggled) {
+ this.toggle();
+ }
+
+ },
+
+ events: ['resize']
+
+ },
+
+ methods: {
+
+ toggle: function(type) {
+ var this$1 = this;
+
+
+ if (!trigger(this.target, type || 'toggle', [this])) {
+ return;
+ }
+
+ if (this.queued) {
+
+ var toggled = this.target.filter(this.isToggled);
+ this.toggleElement(toggled, false).then(function () { return this$1.toggleElement(this$1.target.filter(function (el) { return !includes(toggled, el); }
+ ), true); }
+ );
+
+ } else {
+ this.toggleElement(this.target);
+ }
+ }
+
+ }
+
+ };
+
+ var components = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ Accordion: Accordion,
+ Alert: alert,
+ Cover: cover,
+ Drop: drop,
+ Dropdown: drop,
+ FormCustom: formCustom,
+ Gif: gif,
+ Grid: grid,
+ HeightMatch: heightMatch,
+ HeightViewport: heightViewport,
+ Icon: Icon,
+ Img: img,
+ Leader: leader,
+ Margin: Margin,
+ Modal: modal,
+ Nav: nav,
+ Navbar: navbar,
+ Offcanvas: offcanvas,
+ OverflowAuto: overflowAuto,
+ Responsive: responsive,
+ Scroll: scroll,
+ Scrollspy: scrollspy,
+ ScrollspyNav: scrollspyNav,
+ Sticky: sticky,
+ Svg: SVG,
+ Switcher: Switcher,
+ Tab: tab,
+ Toggle: toggle,
+ Video: Video,
+ Close: Close,
+ Spinner: Spinner,
+ SlidenavNext: Slidenav,
+ SlidenavPrevious: Slidenav,
+ SearchIcon: Search,
+ Marker: IconComponent,
+ NavbarToggleIcon: IconComponent,
+ OverlayIcon: IconComponent,
+ PaginationNext: IconComponent,
+ PaginationPrevious: IconComponent,
+ Totop: IconComponent
+ });
+
+ // register components
+ each(components, function (component, name) { return UIkit.component(name, component); }
+ );
+
+ // core functionality
+ UIkit.use(Core);
+
+ boot(UIkit);
+
+ var countdown = {
+
+ mixins: [Class],
+
+ props: {
+ date: String,
+ clsWrapper: String
+ },
+
+ data: {
+ date: '',
+ clsWrapper: '.uk-countdown-%unit%'
+ },
+
+ computed: {
+
+ date: function(ref) {
+ var date = ref.date;
+
+ return Date.parse(date);
+ },
+
+ days: function(ref, $el) {
+ var clsWrapper = ref.clsWrapper;
+
+ return $(clsWrapper.replace('%unit%', 'days'), $el);
+ },
+
+ hours: function(ref, $el) {
+ var clsWrapper = ref.clsWrapper;
+
+ return $(clsWrapper.replace('%unit%', 'hours'), $el);
+ },
+
+ minutes: function(ref, $el) {
+ var clsWrapper = ref.clsWrapper;
+
+ return $(clsWrapper.replace('%unit%', 'minutes'), $el);
+ },
+
+ seconds: function(ref, $el) {
+ var clsWrapper = ref.clsWrapper;
+
+ return $(clsWrapper.replace('%unit%', 'seconds'), $el);
+ },
+
+ units: function() {
+ var this$1 = this;
+
+ return ['days', 'hours', 'minutes', 'seconds'].filter(function (unit) { return this$1[unit]; });
+ }
+
+ },
+
+ connected: function() {
+ this.start();
+ },
+
+ disconnected: function() {
+ var this$1 = this;
+
+ this.stop();
+ this.units.forEach(function (unit) { return empty(this$1[unit]); });
+ },
+
+ events: [
+
+ {
+
+ name: 'visibilitychange',
+
+ el: inBrowser && document,
+
+ handler: function() {
+ if (document.hidden) {
+ this.stop();
+ } else {
+ this.start();
+ }
+ }
+
+ }
+
+ ],
+
+ update: {
+
+ write: function() {
+ var this$1 = this;
+
+
+ var timespan = getTimeSpan(this.date);
+
+ if (timespan.total <= 0) {
+
+ this.stop();
+
+ timespan.days
+ = timespan.hours
+ = timespan.minutes
+ = timespan.seconds
+ = 0;
+ }
+
+ this.units.forEach(function (unit) {
+
+ var digits = String(Math.floor(timespan[unit]));
+
+ digits = digits.length < 2 ? ("0" + digits) : digits;
+
+ var el = this$1[unit];
+ if (el.textContent !== digits) {
+ digits = digits.split('');
+
+ if (digits.length !== el.children.length) {
+ html(el, digits.map(function () { return '
'; }).join(''));
+ }
+
+ digits.forEach(function (digit, i) { return el.children[i].textContent = digit; });
+ }
+
+ });
+
+ }
+
+ },
+
+ methods: {
+
+ start: function() {
+
+ this.stop();
+
+ if (this.date && this.units.length) {
+ this.$update();
+ this.timer = setInterval(this.$update, 1000);
+ }
+
+ },
+
+ stop: function() {
+
+ if (this.timer) {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+
+ }
+
+ }
+
+ };
+
+ function getTimeSpan(date) {
+
+ var total = date - Date.now();
+
+ return {
+ total: total,
+ seconds: total / 1000 % 60,
+ minutes: total / 1000 / 60 % 60,
+ hours: total / 1000 / 60 / 60 % 24,
+ days: total / 1000 / 60 / 60 / 24
+ };
+ }
+
+ var targetClass = 'uk-animation-target';
+
+ var Animate = {
+
+ props: {
+ animation: Number
+ },
+
+ data: {
+ animation: 150
+ },
+
+ computed: {
+
+ target: function() {
+ return this.$el;
+ }
+
+ },
+
+ methods: {
+
+ animate: function(action) {
+ var this$1 = this;
+
+
+ addStyle();
+
+ var children$1 = children(this.target);
+ var propsFrom = children$1.map(function (el) { return getProps(el, true); });
+
+ var oldHeight = height(this.target);
+ var oldScrollY = window.pageYOffset;
+
+ action();
+
+ Transition.cancel(this.target);
+ children$1.forEach(Transition.cancel);
+
+ reset(this.target);
+ this.$update(this.target, 'resize');
+ fastdom.flush();
+
+ var newHeight = height(this.target);
+
+ children$1 = children$1.concat(children(this.target).filter(function (el) { return !includes(children$1, el); }));
+
+ var propsTo = children$1.map(function (el, i) { return el.parentNode && i in propsFrom
+ ? propsFrom[i]
+ ? isVisible(el)
+ ? getPositionWithMargin(el)
+ : {opacity: 0}
+ : {opacity: isVisible(el) ? 1 : 0}
+ : false; }
+ );
+
+ propsFrom = propsTo.map(function (props, i) {
+ var from = children$1[i].parentNode === this$1.target
+ ? propsFrom[i] || getProps(children$1[i])
+ : false;
+
+ if (from) {
+ if (!props) {
+ delete from.opacity;
+ } else if (!('opacity' in props)) {
+ var opacity = from.opacity;
+
+ if (opacity % 1) {
+ props.opacity = 1;
+ } else {
+ delete from.opacity;
+ }
+ }
+ }
+
+ return from;
+ });
+
+ addClass(this.target, targetClass);
+ children$1.forEach(function (el, i) { return propsFrom[i] && css(el, propsFrom[i]); });
+ css(this.target, {height: oldHeight, display: 'block'});
+ scrollTop(window, oldScrollY);
+
+ return Promise.all(
+ children$1.map(function (el, i) { return ['top', 'left', 'height', 'width'].some(function (prop) { return propsFrom[i][prop] !== propsTo[i][prop]; }
+ ) && Transition.start(el, propsTo[i], this$1.animation, 'ease'); }
+ ).concat(oldHeight !== newHeight && Transition.start(this.target, {height: newHeight}, this.animation, 'ease'))
+ ).then(function () {
+ children$1.forEach(function (el, i) { return css(el, {display: propsTo[i].opacity === 0 ? 'none' : '', zIndex: ''}); });
+ reset(this$1.target);
+ this$1.$update(this$1.target, 'resize');
+ fastdom.flush(); // needed for IE11
+ }, noop);
+
+ }
+ }
+ };
+
+ function getProps(el, opacity) {
+
+ var zIndex = css(el, 'zIndex');
+
+ return isVisible(el)
+ ? assign({
+ display: '',
+ opacity: opacity ? css(el, 'opacity') : '0',
+ pointerEvents: 'none',
+ position: 'absolute',
+ zIndex: zIndex === 'auto' ? index(el) : zIndex
+ }, getPositionWithMargin(el))
+ : false;
+ }
+
+ function reset(el) {
+ css(el.children, {
+ height: '',
+ left: '',
+ opacity: '',
+ pointerEvents: '',
+ position: '',
+ top: '',
+ width: ''
+ });
+ removeClass(el, targetClass);
+ css(el, {height: '', display: ''});
+ }
+
+ function getPositionWithMargin(el) {
+ var ref = offset(el);
+ var height = ref.height;
+ var width = ref.width;
+ var ref$1 = position(el);
+ var top = ref$1.top;
+ var left = ref$1.left;
+
+ return {top: top, left: left, height: height, width: width};
+ }
+
+ var style;
+
+ function addStyle() {
+ if (style) {
+ return;
+ }
+ style = append(document.head, '