// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-hamburger-menu.js?ver=5.1.2 
/*
 * Implements the hamburger menu behaviour
 *
 *
 * @since 4.8		moved from avia.js to own file as some user request to customize this feature
 */
(function($)
{
    "use strict";

    $(function()
    {
		$.avia_utilities = $.avia_utilities || {};

		if( 'undefined' == typeof $.avia_utilities.isMobile )
		{
			if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement )
			{
				$.avia_utilities.isMobile = true;
			}
			else
			{
				$.avia_utilities.isMobile = false;
			}
		}

		//activates the hamburger mobile menu
		avia_hamburger_menu();

		$(window).trigger( 'resize' );

	});

	$.avia_utilities = $.avia_utilities || {};

	function avia_hamburger_menu()
	{
		var header		= $('#header'),
			header_main	= $('#main .av-logo-container'), //check if we got a top menu that is above the header
			menu		= $('#avia-menu'),
			burger_wrap = $('.av-burger-menu-main a'),
			htmlEL  	= $('html').eq(0),
			overlay		= $('<div class="av-burger-overlay"></div>'),
			overlay_scroll	= $('<div class="av-burger-overlay-scroll"></div>').appendTo(overlay),
			inner_overlay 	= $('<div class="av-burger-overlay-inner"></div>').appendTo(overlay_scroll),
			bgColor 	  	= $('<div class="av-burger-overlay-bg"></div>').appendTo(overlay),
			animating 	  	= false,
			first_level	  	= {},
			logo_container	= $('.av-logo-container .inner-container'),
			menu_in_logo_container = logo_container.find('.main_menu'),
			cloneFirst		= htmlEL.is('.html_av-submenu-display-click.html_av-submenu-clone, .html_av-submenu-display-hover.html_av-submenu-clone'),
			menu_generated 	= false,
			cloned_menu_cnt = 0;

		/**
		 * Check for alternate mobile menu
		 */
		var alternate = $('#avia_alternate_menu');
		if( alternate.length > 0 )
		{
			menu = alternate;
		}

		var	set_list_container_height = function()
			{
				//necessary for ios since the height is usually not 100% but 100% - menu bar which can be requested by window.innerHeight
				if($.avia_utilities.isMobile)
				{
					overlay_scroll.outerHeight(window.innerHeight);
				}
			},
			create_list = function( items , append_to )
			{
				if(!items) return;

				var list, link, current, subitems, megacolumns, sub_current, sub_current_list, new_li, new_ul;

				items.each(function()
				{
					current  = $(this);
					subitems = current.find(' > .sub-menu > li'); //find sublists of a regular defined menu
					if( subitems.length == 0 )
					{
						subitems = current.find(' > .children > li'); //find sublists of a fallback menu
					}
					megacolumns = current.find( '.avia_mega_div > .sub-menu > li.menu-item' );

					//	href = '#': we have a custom link that should not link to something - is also in use by megamenu for titles
					var cur_menu = current.find('>a');
					var clone_events = true;

					if( cur_menu.length )
					{
						if( cur_menu.get(0).hash == '#' || 'undefined' == typeof cur_menu.attr('href') || cur_menu.attr('href') == '#' )
						{
							// eventhandler conflict 'click' by megamenu (returns false) - ignore all handlers
							if( subitems.length > 0 || megacolumns.length > 0 )
							{
								clone_events = false;
							}
						}
					}

					link   = cur_menu.clone(clone_events).attr('style','');

						//	megamenus can have '' as url in top menu - allow click event in burger
					if( 'undefined' == typeof cur_menu.attr('href') )
					{
						link.attr( 'href', '#' );
					}

					new_li = $('<li>').append( link );

					//	Copy user set classes for menu items - these must not start with menu-item, page-item, page_item (used by default classes)
					var cls = [];
					if( 'undefined' != typeof current.attr('class') )
					{
						cls = current.attr('class').split(/\s+/);
						$.each( cls, function( index, value ){
										if( ( value.indexOf('menu-item') != 0 ) && ( value.indexOf('page-item') < 0 ) && ( value.indexOf('page_item') != 0 ) && ( value.indexOf('dropdown_ul') < 0 ) )
										{
											//	'current-menu-item' is also copied !!
											new_li.addClass( value );
										}
										return true;
									});
					}

					if( 'undefined' != typeof current.attr('id') && '' != current.attr('id') )
					{
						new_li.addClass(current.attr('id'));
					}
					else
					{
						//	fallback menu has no id -> try to find page id in class
						$.each( cls, function( index, value ){
										if( value.indexOf('page-item-') >= 0 )
										{
											new_li.addClass(value);
											return false;
										}
								});
					}

					append_to.append(new_li);

					if(subitems.length)
					{
						new_ul = $('<ul class="sub-menu">').appendTo(new_li);

						if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' ))
						{
							new_li.clone(true).prependTo(new_ul);
						}

						new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');

						create_list( subitems , new_ul);
					}
					else if(megacolumns.length)	//if we got no normal sublists try megamenu columns and sublists
					{
						new_ul = $('<ul class="sub-menu">').appendTo(new_li);

						if(cloneFirst && ( link.get(0).hash != '#' && link.attr('href') != '#' ))
						{
							new_li.clone(true).prependTo(new_ul);
						}

						megacolumns.each(function(iteration)
						{
							var megacolumn		= $(this),
								mega_current  	= megacolumn.find( '> .sub-menu' ),		//	can be 0 if only a column is used without submenus
								mega_title 		= megacolumn.find( '> .mega_menu_title' ),
								mega_title_link = mega_title.find('a').attr('href') || "#",
								current_megas 	= mega_current.length > 0 ? mega_current.find('>li') : null,
								mega_title_set  = false,
								mega_link 		= new_li.find('>a'),
								hide_enty		= '';

							//	ignore columns that have no actual link and no subitems
							if( ( current_megas === null ) || ( current_megas.length == 0 ) )
							{
								if( mega_title_link == '#' )
								{
									hide_enty = ' style="display: none;"';
								}
							}

							if(iteration == 0) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');

							//if we got a title split up submenu items into multiple columns
							if(mega_title.length && mega_title.text() != "")
							{
								mega_title_set  = true;

								//if we are within the first iteration we got a new submenu, otherwise we start a new one
								if(iteration > 0)
								{
									var check_li = new_li.parents('li').eq(0);

									if(check_li.length) new_li = check_li;

									new_ul = $('<ul class="sub-menu">').appendTo(new_li);
								}


								new_li = $('<li' + hide_enty + '>').appendTo(new_ul);
								new_ul = $('<ul class="sub-menu">').appendTo(new_li);

								$('<a href="'+mega_title_link+'"><span class="avia-bullet"></span><span class="avia-menu-text">' +mega_title.text()+ '</span></a>').insertBefore(new_ul);
								mega_link = new_li.find('>a');

								//	Clone if we have submenus
								if(cloneFirst && ( mega_current.length > 0 ) && ( mega_link.length && mega_link.get(0).hash != '#' && mega_link.attr('href') != '#' ))
								{
									new_li.clone(true).addClass('av-cloned-title').prependTo(new_ul);
								}

							}

								//	do not append av-submenu-indicator if no submenus (otherwise link action is blocked !!!)
							if( mega_title_set && ( mega_current.length > 0 ) ) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');
							create_list( current_megas , new_ul);
						});

					}

				});

				burger_wrap.trigger( 'avia_burger_list_created' );
				return list;
			};

		var burger_ul, burger;

		//prevent scrolling of outer window when scrolling inside
		$('body').on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-scroll', function (e)
		{
			var height = this.offsetHeight,
				scrollHeight = this.scrollHeight,
				direction = e.originalEvent.wheelDelta;

			if(scrollHeight != this.clientHeight)
			{
				if( ( this.scrollTop >= (scrollHeight - height) && direction < 0) || (this.scrollTop <= 0 && direction > 0) )
				{
			      e.preventDefault();
			    }
		    }
		    else
		    {
				e.preventDefault();
		    }
		});

		//prevent scrolling for the rest of the screen
		$(document).on( 'mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-bg, .av-burger-overlay-active .av-burger-menu-main', function (e)
		{
				e.preventDefault();
		});

		//prevent scrolling on mobile devices
		var touchPos = {};

		$(document).on('touchstart', '.av-burger-overlay-scroll', function(e)
		{
			touchPos.Y = e.originalEvent.touches[0].clientY;
		});

		$(document).on('touchend', '.av-burger-overlay-scroll', function(e)
		{
			touchPos = {};
		});

		//prevent rubberband scrolling http://blog.christoffer.me/six-things-i-learnt-about-ios-safaris-rubber-band-scrolling/
		$(document).on( 'touchmove', '.av-burger-overlay-scroll', function (e)
		{
			if(!touchPos.Y)
			{
				touchPos.Y = e.originalEvent.touches[0].clientY;
			}

			var	differenceY = e.originalEvent.touches[0].clientY - touchPos.Y,
				element 	= this,
				top 		= element.scrollTop,
				totalScroll = element.scrollHeight,
				currentScroll = top + element.offsetHeight,
				direction	  = differenceY > 0 ? "up" : "down";

			$('body').get(0).scrollTop = touchPos.body;

	        if( top <= 0 )
	        {
	            if( direction == "up" )
				{
					e.preventDefault();
				}

	        }
			else if( currentScroll >= totalScroll )
	        {
	            if( direction == "down" )
				{
					e.preventDefault();
				}
	        }
		});

		$(window).on( 'debouncedresize', function (e)
		{
			var close = true;

			//	@since 4.8.3 we support portrait/landscape screens to switch mobile menu
			if( $.avia_utilities.isMobile && htmlEL.hasClass( 'av-mobile-menu-switch-portrait' ) && htmlEL.hasClass( 'html_text_menu_active' ) )
			{
				var height = $( window ).height();
				var width = $( window ).width();

				if( width <= height )
				{
					//	in portrait mode we only need to remove added class
					htmlEL.removeClass( 'html_burger_menu' );
				}
				else
				{
					//	in landscape mode
					var switch_width = htmlEL.hasClass( 'html_mobile_menu_phone' ) ? 768 : 990;
					if( height < switch_width )
					{
						htmlEL.addClass( 'html_burger_menu' );
						close = false;
					}
					else
					{
						htmlEL.removeClass( 'html_burger_menu' );
					}
				}
			}


			//	close burger menu when returning to desktop
			if( close && burger && burger.length )
			{
				if( ! burger_wrap.is(':visible') )
				{
					burger.filter(".is-active").parents('a').eq(0).trigger('click');
				}
			}

			set_list_container_height();
		});

		//close overlay on overlay click
		$('.html_av-overlay-side').on( 'click', '.av-burger-overlay-bg', function (e)
		{
			e.preventDefault();
			burger.parents('a').eq(0).trigger('click');
		});

		 //close overlay when smooth scrollign begins
		$(window).on('avia_smooth_scroll_start', function()
		{
			if(burger && burger.length)
			{
				burger.filter(".is-active").parents('a').eq(0).trigger('click');
			}
		});


		//toogle hide/show for submenu items
		$('.html_av-submenu-display-hover').on( 'mouseenter', '.av-width-submenu', function (e)
		{
			$(this).children("ul.sub-menu").slideDown('fast');
		});

		$('.html_av-submenu-display-hover').on( 'mouseleave', '.av-width-submenu', function (e)
		{
			$(this).children("ul.sub-menu").slideUp('fast');
		});

		$('.html_av-submenu-display-hover').on( 'click', '.av-width-submenu > a', function (e)
		{
			e.preventDefault();
			e.stopImmediatePropagation();
		});

			//	for mobile we use same behaviour as submenu-display-click
		$('.html_av-submenu-display-hover').on( 'touchstart', '.av-width-submenu > a', function (e)
		{
			var menu = $(this);
			toggle_submenu( menu, e );
		});


		//toogle hide/show for submenu items
		$('.html_av-submenu-display-click').on( 'click', '.av-width-submenu > a', function (e)
		{
			var menu = $(this);
			toggle_submenu( menu, e );
		});


		//	close mobile menu if click on active menu item
		$('.html_av-submenu-display-click').on( 'click', '.av-burger-overlay a', function (e)
		{
			var loc = window.location.href.match(/(^[^#]*)/)[0];
			var cur = $(this).attr('href').match(/(^[^#]*)/)[0];

			if( cur == loc )
			{
				e.preventDefault();
				e.stopImmediatePropagation();

				burger.parents('a').eq(0).trigger('click');
				return false;
			}
			return true;
		});


		function toggle_submenu( menu, e )
		{
			e.preventDefault();
			e.stopImmediatePropagation();

			var parent  = menu.parents('li').eq(0);

			parent.toggleClass('av-show-submenu');

			if(parent.is('.av-show-submenu'))
			{
				parent.children("ul.sub-menu").slideDown('fast');
			}
			else
			{
				parent.children("ul.sub-menu").slideUp('fast');
			}
		};


		(function normalize_layout()
		{
			//if we got the menu outside of the main menu container we need to add it to the container as well
			if( menu_in_logo_container.length )
			{
				return;
			}

			var menu2 = $('#header .main_menu').clone(true),
				ul = menu2.find('ul.av-main-nav'),
				id = ul.attr('id');

			if( 'string' == typeof id && '' != id.trim() )
			{
				ul.attr('id', id + '-' + cloned_menu_cnt++ );
			}
			menu2.find('.menu-item:not(.menu-item-avia-special)').remove();
			menu2.insertAfter(logo_container.find('.logo').first());

			//check if we got social icons and append it to the secondary menu
			var social = $('#header .social_bookmarks').clone(true);
			if( ! social.length )
			{
				social = $('.av-logo-container .social_bookmarks').clone(true);
			}

			if( social.length )
			{
				menu2.find('.avia-menu').addClass('av_menu_icon_beside');
				menu2.append(social);
			}

			//re select the burger menu if we added a new one
			burger_wrap = $('.av-burger-menu-main a');
		}());



		burger_wrap.on('click', function(e)
		{
			if( animating )
			{
				return;
			}

			burger = $(this).find('.av-hamburger'),
			animating = true;

			if(!menu_generated)
			{
				menu_generated = true;
				burger.addClass("av-inserted-main-menu");

				burger_ul = $('<ul>').attr({id:'av-burger-menu-ul', class:''});
				var first_level_items = menu.find('> li:not(.menu-item-avia-special)'); //select all first level items that are not special items
				var	list = create_list( first_level_items , burger_ul);

				burger_ul.find('.noMobile').remove(); //remove any menu items with the class noMobile so user can filter manually if he wants
				burger_ul.appendTo(inner_overlay);
				first_level = inner_overlay.find('#av-burger-menu-ul > li');

				if($.fn.avia_smoothscroll)
				{
					$('a[href*="#"]', overlay).avia_smoothscroll(overlay);
				}
			}

			if(burger.is(".is-active"))
			{
				burger.removeClass("is-active");
				htmlEL.removeClass("av-burger-overlay-active-delayed");

				overlay.animate({opacity:0}, function()
	    		{
	    			overlay.css({display:'none'});
					htmlEL.removeClass("av-burger-overlay-active");
					animating = false;
	    		});

 			}
			else
			{
				set_list_container_height();

				var offsetTop = header_main.length ? header_main.outerHeight() + header_main.position().top : header.outerHeight() + header.position().top;

				overlay.appendTo($(e.target).parents('.avia-menu'));

				burger_ul.css({padding:( offsetTop ) + "px 0px"});

				first_level.removeClass('av-active-burger-items');

				burger.addClass("is-active");
				htmlEL.addClass("av-burger-overlay-active");
				overlay.css({display:'block'}).animate({opacity:1}, function()
				{
					animating = false;
				});

				setTimeout(function()
				{
					htmlEL.addClass("av-burger-overlay-active-delayed");
				}, 100);

				first_level.each(function(i)
				{
					var _self = $(this);
					setTimeout(function()
					{
						_self.addClass('av-active-burger-items');
					}, (i + 1) * 125);
				});

			}

			e.preventDefault();
		});
	}

})( jQuery );
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/parallax.js?ver=5.1.2 
"use strict";

var avia = window.avia || {};


avia.parallax = function ()
{
	//singelton
	if(avia.parallax.instance){ return avia.parallax.instance; }

	avia.parallax.instance = this;
	this.MediaQueryOptions = {

		'av-mini-':		'(max-width: 479px)',
		'av-small-':	'(min-width: 480px) and (max-width: 767px)',
		'av-medium-':	'(min-width: 768px) and (max-width: 989px)'
	};

	//all parallax elements
	this.elements = [];

	//run the event binding and therefore initialize parallax movement.
	this.bindEvents();
	return this;
};

avia.parallax.instance 	= false;
avia.parallax.prototype = {

	//blueprint for a single parallax element
	element: function( node , _self )
	{
		this.dom			= node;
		this.config			= node.dataset;
		this.scrollspeed	= parseFloat( this.config.parallax_speed || this.config.aviaParallaxRatio || 0 );
		this.translate		= {x: 0, y: 0, z: 0 };
		this.prev			= {top:0, left:0};
		this.rect			= {}; //positioning data of the element
		this.css			= (styles) => Object.assign(this.dom.style, styles);
		this.inViewport		= () =>
		{
			this.rect 			= this.dom.getBoundingClientRect();
			this.translate 		= this.getTranslateValues();

			return (
				this.rect.bottom - this.translate.y >= 0 && this.rect.right >= 0 &&
				this.rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&
				this.rect.left <= (window.innerWidth || document.documentElement.clientWidth)
			);
		};
		this.update = ( force = false ) =>
		{
			if(! this.scrollspeed ) return;

			_self.do( function( el )
			{
				if( ! el.inViewport() && ! force ) return;

				var style 		= {};
				var newLeft   	= 0;
				var offsetTop	= window.scrollY + el.rect.top - el.translate.y;
				var newTop 		= (window.scrollY * -1 )  * el.scrollspeed;

				if (offsetTop > window.innerHeight )
				{
					//scroll calc for elements that start out of vieport
					//We do this so elements that start out of window do not get re-positioned without a scroll
					newTop = parseFloat( (el.rect.top - window.innerHeight - el.translate.y) * el.scrollspeed );
				}

				console.log(window.innerHeight + el.rect.height);
				if(Math.abs(newTop) > window.innerHeight + el.rect.height) return;

				if(newTop != el.translate.y)
				{
					style.transform = "translate3d( "+ newLeft +"px," + newTop + "px, 0px )";
					el.css( style );
				}
			}, this);
		};

		//https://zellwk.com/blog/css-translate-values-in-javascript/
		this.getTranslateValues = () =>
		{
			const matrix = window.getComputedStyle(this.dom).transform;

			if (matrix === 'none' || typeof matrix === 'undefined') return { x: 0, y: 0, z: 0 }

			const matrixType 	= matrix.includes('3d') ? '3d' : '2d';
			const matrixValues 	= matrix.match(/matrix.*\((.+)\)/)[1].split(', ');

			if (matrixType === '2d') { return { x: matrixValues[4], y: matrixValues[5], z: 0 } }
			if (matrixType === '3d') { return { x: matrixValues[12], y: matrixValues[13], z: matrixValues[14] }}
		};

		//force update el and set visible
		this.update();
		_self.showElement( () => this.dom.classList.add('active-parallax') );

		return this;
	},
	//end element blueprint

	//bind events
	bindEvents: function()
	{
		this.addListener( window , ['scroll'], this.updateElements );
		this.addListener( window , ['resize','orientationchange','load','av-height-change'], this.updateElements  );
		this.addListener( document.body , ['av_resize_finished'], this.updateElements, true);
	},

	addListener: function( target, events, func, args = false)
	{
		for (var i  = 0, ev; ev = events[i]; i++)
		{
			target.addEventListener(ev, func.bind( this , args ),  { passive: true }  );
		}
	},

	//reveal image without jitter
	showElement: function( func )
	{
		if (document.readyState === 'complete') { func() } else { window.addEventListener( "load" , func ) }
  	},

	//add new parallax elements
	addElements: function( selector )
	{
		for (var i  = 0, item; item = document.querySelectorAll( selector )[i]; i++)
		{
			this.elements.push( new this.element( item , this ) );
		}
	},

	//iterate over all elements and run their update script on scroll
	updateElements: function(force, e)
	{
		for (var i  = 0, element; element = this.elements[i]; i++)
		{
			element.update(force);
		}
	},

	//generic wrapper for everything that access or manipulates the DOM
	//https://firefox-source-docs.mozilla.org/performance/bestpractices.html
	do: function( callback , args , delay = 0)
	{
		requestAnimationFrame(() => { setTimeout(() => callback.call(this, args) , delay); });
	},
};



(function($){

	//add ?new-parllax to the url to test. remove in production
	if(!window.location.search.includes('new-parallax')) { return; }

	var parallax = new avia.parallax();

	parallax.addElements('.av-parallax-object');


})(jQuery);
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-parallax.js?ver=5.1.2 
/*
 * Parallax Support
 * @since 5.0			added
 */
(function($)
{
	"use strict";

	$.avia_utilities = $.avia_utilities || {};

    $( function()
    {
		//activate parallax scrolling for background images (sections) and objects.
    	if( $.fn.avia_parallax )
		{
			$( '.av-parallax,.av-parallax-object' ).avia_parallax();
		}
	});

	/**
	 * Object Parallax scrolling feature
	 *
	 *		- horizontal or vertical parallax for objects like images with responsive support
	 *		- background image parallax (up to 5.0 handled by $.AviaParallaxElement) - was used for sections
	 *
	 * @since 5.0
	 * @param {} options
	 * @param {} element
	 */
	var AviaObjectParallaxElement = function( options, element )
	{
		//	do not use in old browsers that do not support this CSS
		if( ! ( this.transform || this.transform3d ) )
		{
			return;
		}

		this.options = $.extend( {}, options );
		this.win = $( window );
		this.body = $( 'body' );
		this.isMobile = $.avia_utilities.isMobile,		//	not defined in constructor
		this.winHeight = this.win.height();
		this.winWidth = this.win.width();
		this.el = $( element ).addClass( 'active-parallax' );
		this.objectType = this.el.hasClass( 'av-parallax-object' ) ? 'object' : 'background-image';
		this.elInner = this.el;							//	container to use for parallax calculation - may be smaller than element e.g. due to position rules
		this.elBackgroundParent = this.el.parent();		//	parent container when 'background-image' parallax
		this.elParallax = this.el.data( 'parallax' ) || {};
		this.direction = '';
		this.speed = 0.5;
		this.elProperty = {};
		this.ticking = false,
		this.isTransformed = false;						//	needed for responsive to reset transform when no parallax !!!

		//	set the browser transition string
		if( $.avia_utilities.supported.transition === undefined )
		{
			$.avia_utilities.supported.transition = $.avia_utilities.supports( 'transition' );
		}

		this._init( options );
	};

	AviaObjectParallaxElement.prototype =
	{
		mediaQueries: {
				'av-mini-':		'(max-width: 479px)',
				'av-small-':	'(min-width: 480px) and (max-width: 767px)',
				'av-medium-':	'(min-width: 768px) and (max-width: 989px)',
				'av-desktop-':	'(min-width: 990px)'
		   },

		transform:			document.documentElement.className.indexOf( 'avia_transform' ) !== -1,
		transform3d:		document.documentElement.className.indexOf( 'avia_transform3d' ) !== -1,
		mobileNoAnimation:	$( 'body' ).hasClass( 'avia-mobile-no-animations' ),
		defaultSpeed:		0.5,
		defaultDirections:	[ 'bottom_top', 'left_right', 'right_left', 'no_parallax' ],
		transformCSSProps:	[ 'transform', '-webkit-transform', '-moz-transform', '-ms-transform', '-o-transform' ],
		matrixDef:			[ 1, 0, 0, 1, 0, 0 ],
		matrix3dDef:		[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],

		_init: function()
		{
			var _self = this;

			//	select inner container if necessary for positioning
			if( typeof this.el.data( 'parallax-selector') != 'undefined' && this.el.data( 'parallax-selector') !== '' )
			{
				this.elInner = this.el.find( this.el.data( 'parallax-selector' ) );
				if( this.elInner.length == 0 )
				{
					this.elInner = this.el;
				}
			}

			if( 'background-image' == this.objectType )
			{
				//	shortcut and exit
				if( this.isMobile && this.mobileNoAnimation )
				{
					return;
				}

				//	by default we slow down
				this.elParallax.parallax = 'bottom_top';
				this.elParallax.parallax_speed = parseFloat( this.el.data( 'avia-parallax-ratio' ) ) || 0.5;
			}

			//fetch window constants
			setTimeout( function()
			{
				_self._fetchProperties();
			}, 30 );

			this.win.on( 'debouncedresize av-height-change', _self._fetchProperties.bind( _self ) );
			this.body.on( 'av_resize_finished', _self._fetchProperties.bind( _self ) );

			//activate the scrolling
			setTimeout( function()
			{
				_self.win.on( 'scroll', _self._onScroll.bind( _self ) );
			}, 100 );
		},

		_setParallaxProps: function()
		{
			if( 'background-image' == this.objectType )
			{
				this.direction = this.elParallax.parallax;
				this.speed = this.elParallax.parallax_speed;
				return;
			}

			var all_direction = this.elParallax.parallax || '',
				all_speed = this.elParallax.parallax_speed || '',
				resp_direction = '',
				resp_speed = '',
				media = 'all';

			if( this.defaultDirections.indexOf( all_direction ) < 0 )
			{
				all_direction = 'no_parallax';
			}

			if( typeof window.matchMedia == 'function' )
			{
				$.each( this.mediaQueries, function( key, query )
				{
					var mql = window.matchMedia( query );
					if( mql.matches )
					{
						media = key;
						return false;
					}
				});
			}

			if( 'all' == media )
			{
				this.direction = all_direction;
				this.speed = '' == all_speed ? this.defaultSpeed : parseFloat( all_speed ) / 100.0;
				return;
			}

			resp_direction = this.elParallax[ media + 'parallax' ] || '';
			resp_speed = this.elParallax[ media + 'parallax_speed' ] || '';

			if( 'inherit' == resp_direction )
			{
				resp_direction = all_direction;
				resp_speed = all_speed;
			}

			if( this.defaultDirections.indexOf( resp_direction ) < 0 )
			{
				resp_direction = 'no_parallax';
			}

			this.direction = resp_direction;
			this.speed = '' == resp_speed ? this.defaultSpeed : parseFloat( resp_speed ) / 100.0;
		},

		_getTranslateObject: function( element )
		{
			//	https://zellwk.com/blog/css-translate-values-in-javascript/
			//	This function might not work properly if stacked transform operations are used - this is a limitation
			var translate = {
						type:	'',
						matrix: [],
						x:		0,
						y:		0,
						z:		0
					};

			$.each( this.transformCSSProps, function( i, prop )
			{
				var found = element.css( prop );

				if( 'string' != typeof found || 'none' == found )
				{
					return;
				}

				if( found.indexOf( 'matrix' ) >= 0 )
				{
					var matrixValues = found.match( /matrix.*\((.+)\)/)[1].split( ', ' );

					if( found.indexOf( 'matrix3d' ) >= 0 )
					{
						translate.type = '3d';
						translate.matrix = matrixValues;

						//	3d have 16 values
						translate.x = matrixValues[12];
						translate.y = matrixValues[13];
						translate.z = matrixValues[14];
					}
					else
					{
						translate.type = '2d';
						translate.matrix = matrixValues;

						//	2d have 6 values
						translate.x = matrixValues[4];
						translate.y = matrixValues[5];
					}

					return false;
				}
				else
				{
					translate.type = '';

					// translateX
					var matchX = found.match( /translateX\((-?\d+\.?\d*px)\)/ );
					if( matchX )
					{
						translate.x = parseInt( matchX[1], 10 );
					}

					// translateY
					var matchY = found.match( /translateY\((-?\d+\.?\d*px)\)/ );
					if( matchY )
					{
						translate.y = parseInt( matchY[1], 10 );
					}
				}
			});

			return translate;
		},

		_getTranslateMatrix: function( translateObj, changes )
		{
			//	matrix( a, b, c, d, tx, ty )
			//	matrix3d( a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1 )
			var matrix = '';

			$.each( changes, function( key, value )
			{
				translateObj[key] = value;
			});

			if( this.transform3d )
			{
				var matrix3d = this.matrix3dDef.slice( 0 );

				switch( translateObj.type )
				{
					case '2d':
						//	2d have 6 values
						matrix3d[0] = translateObj.matrix[0];
						matrix3d[1] = translateObj.matrix[1];
						matrix3d[4] = translateObj.matrix[2];
						matrix3d[5] = translateObj.matrix[3];
						matrix3d[12] = translateObj.x;
						matrix3d[13] = translateObj.y;
						break;
					case '3d':
						//	3d have 16 values
						matrix3d = translateObj.matrix.slice( 0 );
						matrix3d[12] = translateObj.x;
						matrix3d[13] = translateObj.y;
						matrix3d[14] = translateObj.z;
						break;
					default:
						matrix3d[12] = translateObj.x;
						matrix3d[13] = translateObj.y;
						break;
				}

				matrix = 'matrix3d(' + matrix3d.join( ', ' ) + ')';
			}
			else if( this.transform )
			{
				var matrix2d = this.matrixDef.slice( 0 );

				switch( translateObj.type )
				{
					case '2d':
						//	2d have 6 values
						matrix2d = translateObj.matrix.slice( 0 );
						matrix2d[4] = translateObj.x;
						matrix2d[5] = translateObj.y;
						break;
					case '3d':		//	fallback only
						//	3d have 16 values
						matrix2d[0] = translateObj.matrix[0];
						matrix2d[1] = translateObj.matrix[1];
						matrix2d[2] = translateObj.matrix[4];
						matrix2d[3] = translateObj.matrix[5];
						matrix2d[4] = translateObj.x;
						matrix2d[5] = translateObj.y;
						break;
					default:
						matrix2d[4] = translateObj.x;
						matrix2d[5] = translateObj.y;
						break;
				}

				matrix = 'matrix(' + matrix2d.join( ', ' ) + ')';
			}

			return matrix;
		},

		_fetchProperties: function()
		{
			this._setParallaxProps();

			//	unset any added transform styles to get real CSS position before apply parallax transforms again
			this.el.css( $.avia_utilities.supported.transition + 'transform', '' );

			//	cache values that only change on resize of viewport
			this.winHeight = this.win.height();
			this.winWidth = this.win.width();

			if( 'background-image' == this.objectType )
			{
				//	special case where we have a div with background image
				this.elProperty.top = this.elBackgroundParent.offset().top;
				this.elProperty.height = this.elBackgroundParent.outerHeight();

				//	set the height of the element based on the windows height, offset ratio and parent height
				this.el.height( Math.ceil( ( this.winHeight * Math.abs( this.speed ) ) + this.elProperty.height ) );
			}
			else
			{
				this.elProperty.top = this.elInner.offset().top;
				this.elProperty.left = this.elInner.offset().left;
				this.elProperty.height = this.elInner.outerHeight();
				this.elProperty.width = this.elInner.outerWidth();
				this.elProperty.bottom = this.elProperty.top + this.elProperty.height;
				this.elProperty.right = this.elProperty.left + this.elProperty.width;

				this.elProperty.distanceLeft = this.elProperty.right;
				this.elProperty.distanceRight = this.winWidth - this.elProperty.left;
			}

			//	Save original position of element relative to container
			this.elProperty.translateObj = this._getTranslateObject( this.el );

			//re-position the element
			this._parallaxScroll();
		},

		_onScroll: function( e )
		{
			var _self = this;

			if( ! _self.ticking )
			{
				_self.ticking = true;
				window.requestAnimationFrame( _self._parallaxRequest.bind( _self ) );
			}
		},

		_inViewport: function( elTop, elRight, elBottom, elLeft, winTop, winBottom, winLeft, winRight )
		{
			//	add a few pixel to be on safe side
			return ! ( elTop > winBottom + 10 || elBottom < winTop - 10 || elLeft > winRight + 10 || elRight < winLeft - 10 );
		},

		_parallaxRequest: function( e )
		{
			//	https://stackoverflow.com/questions/47184298/why-is-it-recommend-to-nest-settimeout-in-requestanimationframe-when-scheduling
			var _self = this;
			setTimeout( _self._parallaxScroll.bind( _self ), 0 );
		},

		_parallaxScroll: function( e )
		{
			//	shortcut
			if( ( 'no_parallax' == this.direction || '' == this.direction ) && ! this.isTransformed )
			{
				this.ticking = false;
				return;
			}

			var winTop = this.win.scrollTop(),
				winLeft = this.win.scrollLeft(),
				winRight = winLeft + this.winWidth,
				winBottom = winTop + this.winHeight,
				scrollPos = 0,
				matrix = '';

			//	special case where we have a div with background image - 'bottom_top'
			if( 'background-image' == this.objectType )
			{
				//	shift element when it moves into viewport
				if( this.elProperty.top < winBottom && winTop <= this.elProperty.top + this.elProperty.height )
				{
					scrollPos = Math.ceil( ( winBottom - this.elProperty.top ) * this.speed );
					matrix = this._getTranslateMatrix( this.elProperty.translateObj, { y: scrollPos } );

					this.el.css( $.avia_utilities.supported.transition + 'transform', matrix );
				}

				this.ticking = false;
				return;
			}

			//	reset and shortcut
			if( ( 'no_parallax' == this.direction || '' == this.direction ) )
			{
				matrix = this._getTranslateMatrix( this.elProperty.translateObj, { x: 0, y: 0  } );
				this.el.css( $.avia_utilities.supported.transition + 'transform', matrix );

				this.ticking = false;
				this.isTransformed = false;
				return;
			}

			//	Get current coordinates for element
			var scroll_px_toTop = Math.ceil( this.elProperty.top - winTop ),
				scroll_px_el = Math.ceil( winBottom - this.elProperty.top ),
				scrolled_pc_toTop = 0,
				reduceDistanceX = 0,
				transform = { x: 0, y: 0 };

			//	if element is initially in viewport on unscrolled screen we leave it and reduce distance to move
			if( this.elProperty.top < this.winHeight )
			{
				reduceDistanceX = Math.ceil( this.winHeight - this.elProperty.top );
			}

			//	Calculate transform value
			if( this.elProperty.top > winBottom )
			{
				// element below viewport
				scrolled_pc_toTop = 0;
				scroll_px_el = 0;
			}
			else
			{
				//	container is inside viewport or above ( scroll_px_toTop is negative)
				scrolled_pc_toTop = 1 - ( scroll_px_toTop + reduceDistanceX ) / this.winHeight;
			}

			switch( this.direction )
			{
				case 'bottom_top':
					scrollPos = Math.ceil( ( scroll_px_el - reduceDistanceX ) * this.speed );
					transform.y = -scrollPos;
					matrix = this._getTranslateMatrix( this.elProperty.translateObj, { y: -scrollPos } );
					break;
				case 'left_right':
					scrollPos = Math.ceil( this.elProperty.distanceRight * scrolled_pc_toTop * this.speed );
					transform.x = scrollPos;
					matrix = this._getTranslateMatrix( this.elProperty.translateObj, { x: scrollPos } );
					break;
				case 'right_left':
					scrollPos = Math.ceil( this.elProperty.distanceLeft * scrolled_pc_toTop * this.speed );
					transform.x = -scrollPos;
					matrix = this._getTranslateMatrix( this.elProperty.translateObj, { x: -scrollPos } );
					break;
				default:
					break;
			}

			var elInViewport = this._inViewport( this.elProperty.top, this.elProperty.right, this.elProperty.bottom, this.elProperty.left, winTop, winBottom, winLeft, winRight ),
				transformedInViewport = this._inViewport( this.elProperty.top + transform.y, this.elProperty.right + transform.x, this.elProperty.bottom + transform.y, this.elProperty.left + transform.x, winTop, winBottom, winLeft, winRight );

			if( elInViewport || transformedInViewport )
			{
				this.el.css( $.avia_utilities.supported.transition + 'transform', matrix );
			}

			this.ticking = false;
			this.isTransformed = true;
		}
	};

	/**
	 * Wrapper to avoid double initialization of object
	 *
	 * @param {} options
	 */
	$.fn.avia_parallax = function( options )
	{

//		if( window.location.search.includes('new-parallax') ) //for testing 2 versions in 2 browser windows
//		{
//			return this;
//		}

		return this.each( function()
		{
			var obj = $( this );
			var self = obj.data( 'aviaParallax' );

			if( ! self )
			{
				self = obj.data( 'aviaParallax', new AviaObjectParallaxElement( options, this ) );
			}
		});
	};

})( jQuery );
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/aviapopup/jquery.magnific-popup.min.js?ver=5.1.2 
/*! Magnific Popup - v1.2.2 - 2022-04-11
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}((function(e){var t,i,n,o,r,a,s="Close",l="BeforeClose",c="MarkupParse",d="Open",p="Change",u="mfp",f=".mfp",m="mfp-ready",g="mfp-removing",v="mfp-prevent-close",h=function(){},y=!!window.jQuery,C=e(window),b=function(e,i){t.ev.on(u+e+f,i)},w=function(t,i,n,o){var r=document.createElement("div");return r.className="mfp-"+t,n&&(r.innerHTML=n),o?i&&i.appendChild(r):(r=e(r),i&&r.appendTo(i)),r},I=function(e,i){t.ev.triggerHandler(u+e,i),t.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),t.st.callbacks[e]&&t.st.callbacks[e].apply(t,Array.isArray(i)?i:[i]))},x=function(i){return i===a&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),a=i),t.currTemplate.closeBtn},k=function(){e.magnificPopup.instance||((t=new h).init(),e.magnificPopup.instance=t)};h.prototype={constructor:h,init:function(){var i=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document),t.popupsCache={}},open:function(i){var o;if(!1===i.isObj){t.items=i.items.toArray(),t.index=0;var a,s=i.items;for(o=0;o<s.length;o++)if((a=s[o]).parsed&&(a=a.el[0]),a===i.el[0]){t.index=o;break}}else t.items=Array.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(!t.isOpen){t.types=[],r="",i.mainEl&&i.mainEl.length?t.ev=i.mainEl.eq(0):t.ev=n,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=w("bg").on("click.mfp",(function(){t.close()})),t.wrap=w("wrap").attr("tabindex",-1).on("click.mfp",(function(e){t._checkIfClose(e.target)&&t.close()})),t.container=w("container",t.wrap)),t.contentContainer=w("content"),t.st.preloader&&(t.preloader=w("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(o=0;o<l.length;o++){var p=l[o];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}I("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(b(c,(function(e,t,i,n){i.close_replaceWith=x(n.type)})),r+=" mfp-close-btn-in"):t.wrap.append(x())),t.st.alignTop&&(r+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:C.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:n.height(),position:"absolute"}),t.st.enableEscapeKey&&n.on("keyup.mfp",(function(e){27===e.keyCode&&t.close()})),C.on("resize.mfp",(function(){t.updateSize()})),t.st.closeOnContentClick||(r+=" mfp-auto-cursor"),r&&t.wrap.addClass(r);var u=t.wH=C.height(),f={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(f.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):f.overflow="hidden");var v=t.st.mainClass;return t.isIE7&&(v+=" mfp-ie7"),v&&t._addClassToMFP(v),t.updateItemHTML(),I("BuildControls"),e("html").css(f),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout((function(){t.content?(t._addClassToMFP(m),t._setFocus()):t.bgOverlay.addClass(m),n.on("focusin.mfp",t._onFocusIn)}),16),t.isOpen=!0,t.updateSize(u),I(d),i}t.updateItemHTML()},close:function(){t.isOpen&&(I(l),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(g),setTimeout((function(){t._close()}),t.st.removalDelay)):t._close())},_close:function(){I(s);var i="mfp-removing mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={marginRight:""};t.isIE7?e("body, html").css("overflow",""):o.overflow="",e("html").css(o)}n.off("keyup.mfp focusin.mfp"),t.ev.off(f),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t.st.autoFocusLast&&t._lastFocusedEl&&e(t._lastFocusedEl).trigger("focus"),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,I("AfterClose")},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||C.height();t.fixedContentPos||t.wrap.css("height",t.wH),I("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(I("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var r=!!t.st[n]&&t.st[n].markup;I("FirstMarkupParse",r),t.currTemplate[n]=!r||e(r)}o&&o!==i.type&&t.container.removeClass("mfp-"+o+"-holder");var a=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(a,n),i.preloaded=!0,I(p,i),o=i.type,t.container.prepend(t.contentContainer),I("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[i]?t.content.find(".mfp-close").length||t.content.append(x()):t.content=e:t.content="",I("BeforeAppend"),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n,o=t.items[i];if(o.tagName?o={el:e(o)}:(n=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;a<r.length;a++)if(o.el.hasClass("mfp-"+r[a])){n=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=n||t.st.type||"inline",o.index=i,o.parsed=!0,t.items[i]=o,I("ElementParse",o),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){if((void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick)||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){var r=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(r)if("function"==typeof r){if(!r.call(t))return!0}else if(C.width()<r)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};I("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",(function(e){e.stopImmediatePropagation()})),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass(v)){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?n.height():document.body.scrollHeight)>(e||C.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).trigger("focus")},_onFocusIn:function(i){if(i.target!==t.wrap[0]&&!e.contains(t.wrap[0],i.target))return t._setFocus(),!1},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),I(c,[t,i,n]),e.each(i,(function(i,n){if(void 0===n||!1===n)return!0;if((o=i.split("_")).length>1){var r=t.find(".mfp-"+o[0]);if(r.length>0){var a=o[1];"replaceWith"===a?r[0]!==n[0]&&r.replaceWith(n):"img"===a?r.is("img")?r.attr("src",n):r.replaceWith(e("<img>").attr("src",n).attr("class",r.attr("class"))):r.attr(o[1],n)}}else t.find(".mfp-"+i).html(n)}))},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:h.prototype,modules:[],open:function(t,i){return k(),(t=t?e.extend(!0,{},t):{}).isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(i){k();var n=e(this);if("string"==typeof i)if("open"===i){var o,r=y?n.data("magnificPopup"):n[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=n,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},n,r)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),y?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var T,_,z,P="inline",S=function(){z&&(_.after(z.addClass(T)).detach(),z=null)};e.magnificPopup.registerModule(P,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(P),b("Close.inline",(function(){S()}))},getInline:function(i,n){if(S(),i.src){var o=t.st.inline,r=e(i.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(_||(T=o.hiddenClass,_=w(T),T="mfp-"+T),z=r.after(_).detach().removeClass(T)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("<div>");return i.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var E,O="ajax",M=function(){E&&e(document.body).removeClass(E)},B=function(){M(),t.req&&t.req.abort()};e.magnificPopup.registerModule(O,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(O),E=t.st.ajax.cursor,b("Close.ajax",B),b("BeforeChange.ajax",B)},getAjax:function(i){E&&e(document.body).addClass(E),t.updateStatus("loading");var n=e.extend({url:i.src,success:function(n,o,r){var a={data:n,xhr:r};I("ParseAjax",a),t.appendContent(e(a.data),O),i.finished=!0,M(),t._setFocus(),setTimeout((function(){t.wrap.addClass(m)}),16),t.updateStatus("ready"),I("AjaxContentAdded")},error:function(){M(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(n),""}}});var A,L=function(e){if(e.data&&void 0!==e.data.title)return e.data.title;var i=t.st.image.titleSrc;if(i){if("function"==typeof i)return i.call(t,e);if(e.el)return e.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var i=t.st.image,n=".image";t.types.push("image"),b("Open.image",(function(){"image"===t.currItem.type&&i.cursor&&e(document.body).addClass(i.cursor)})),b("Close.image",(function(){i.cursor&&e(document.body).removeClass(i.cursor),C.off("resize.mfp")})),b("Resize"+n,t.resizeImage),t.isLowIE&&b("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,A&&clearInterval(A),e.isCheckingImgSize=!1,I("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(r){A&&clearInterval(A),A=setInterval((function(){n.naturalWidth>0?t._onImageHasSize(e):(i>200&&clearInterval(A),3===++i?o(10):40===i?o(50):100===i&&o(500))}),r)};o(1)},getImage:function(i,n){var o=0,r=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,I("ImageLoadComplete")):++o<200?setTimeout(r,100):a())},a=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=document.createElement("img");if(c.className="mfp-img",i.el&&i.el.find("img").length&&(c.alt=i.el.find("img").attr("alt")),i.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=i.src,e("body").hasClass("responsive-images-lightbox-support")){var d=i.el.data("srcset"),p=i.el.data("sizes");void 0!==d?(c.srcset=d,void 0!==p&&(c.sizes=p)):(void 0!==(d=i.el.find("img").attr("srcset"))&&(c.srcset=d),void 0!==(p=i.el.find("img").attr("sizes"))&&(c.sizes=p))}l.is("img")&&(i.img=i.img.clone()),(c=i.img[0]).naturalWidth>0?i.hasSize=!0:c.width||(i.hasSize=!1)}return t._parseMarkup(n,{title:L(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(A&&clearInterval(A),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var H;e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,i=t.st.zoom,n=".zoom";if(i.enabled&&t.supportsTransition){var o,r,a=i.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+i.duration/1e3+"s "+i.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=n,t.css(o),t},l=function(){t.content.css("visibility","visible")};b("BuildControls"+n,(function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void l();(r=s(e)).css(t._getOffset()),t.wrap.append(r),o=setTimeout((function(){r.css(t._getOffset(!0)),o=setTimeout((function(){l(),setTimeout((function(){r.remove(),e=r=null,I("ZoomAnimationEnded")}),16)}),a)}),16)}})),b("BeforeClose.zoom",(function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(!(e=t._getItemToZoom()))return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout((function(){r.css(t._getOffset())}),16)}})),b("Close.zoom",(function(){t._allowZoom()&&(l(),r&&r.remove(),e=null)}))}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(i){var n,o=(n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem)).offset(),r=parseInt(n.css("padding-top"),10),a=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:n.width(),height:(y?n.innerHeight():n[0].offsetHeight)-a-r};return void 0===H&&(H=void 0!==document.createElement("p").style.MozTransform),H?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var F="iframe",j=function(e){if(t.currTemplate.iframe){var i=t.currTemplate.iframe.find("iframe");i.length&&(e||(i[0].src="//about:blank"),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(F,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(F),b("BeforeChange",(function(e,t,i){t!==i&&(t===F?j():i===F&&j(!0))})),b("Close.iframe",(function(){j()}))},getIframe:function(i,n){var o=i.src,r=t.st.iframe;e.each(r.patterns,(function(){if(o.indexOf(this.index)>-1)return this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1}));var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(n,a,i),t.updateStatus("ready"),n}}});var N=function(e){var i=t.items.length;return e>i-1?e-i:e<0?i+e:e},W=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,o=".mfp-gallery";if(t.direction=!0,!i||!i.enabled)return!1;r+=" mfp-gallery",b(d+o,(function(){i.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",(function(){if(t.items.length>1)return t.next(),!1})),n.on("keydown"+o,(function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()}))})),b("UpdateStatus"+o,(function(e,i){i.text&&(i.text=W(i.text,t.currItem.index,t.items.length))})),b(c+o,(function(e,n,o,r){var a=t.items.length;o.counter=a>1?W(i.tCounter,r.index,a):""})),b("BuildControls"+o,(function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass(v),r=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass(v);o.on("click",(function(){t.prev()})),r.on("click",(function(){t.next()})),t.container.append(o.add(r))}})),b(p+o,(function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout((function(){t.preloadNearbyImages(),t._preloadTimeout=null}),16)})),b(s+o,(function(){n.off(o),t.wrap.off("click"+o),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=N(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=N(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;e<=(t.direction?o:n);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?n:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=N(i),!t.items[i].preloaded){var n=t.items[i];if(n.parsed||(n=t.parseEl(i)),I("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",(function(){n.hasSize=!0})).on("error.mfploader",(function(){n.hasSize=!0,n.loadError=!0,I("LazyLoadError",n)})).attr("src",n.src),e("body").hasClass("responsive-images-lightbox-support")&&n.el.length>0)){var o=e(n.el[0]),r=o.data("srcset"),a=o.data("sizes");if(void 0!==r)n.img.attr("srcset",r),void 0!==a&&n.img.attr("sizes",a);else{var s=e(n.el[0]).find("img");void 0!==(r=s.attr("srcset"))&&n.img.attr("srcset",r),void 0!==(a=s.attr("sizes"))&&n.img.attr("sizes",a)}}n.preloaded=!0}}}});var Z="retina";e.magnificPopup.registerModule(Z,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,(function(e){return"@2x"+e}))},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;(i=isNaN(i)?i():i)>1&&(b("ImageHasSize.retina",(function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})})),b("ElementParse.retina",(function(t,n){n.src=e.replaceSrc(n,i)})))}}}}),k()}));
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-lightbox.js?ver=5.1.2 
(function($)
{
    "use strict";

	// -------------------------------------------------------------------------------------------
	// Ligthbox activation
	// -------------------------------------------------------------------------------------------

	$.avia_utilities = $.avia_utilities || {};

	$.avia_utilities.av_popup = {
			type: 				'image',
			mainClass: 			'avia-popup mfp-zoom-in',
			tLoading: 			'',
			tClose: 			'',
			removalDelay: 		300, //delay removal by X to allow out-animation
			closeBtnInside: 	true,
			closeOnContentClick:false,
			midClick: 			true,
			autoFocusLast: 		false, // false, prevents issues with accordion slider
			fixedContentPos: 	$('html').hasClass('av-default-lightbox-no-scroll'), // allows scrolling when lightbox is open but also removes any jumping because of scrollbar removal
			iframe: {
			    patterns: {
			        youtube: {
			            index: 'youtube.com/watch',
			            id: function(url) {

				            //fetch the id
			                var m = url.match(/[\\?\\&]v=([^\\?\\&]+)/),
								id,
								params;

			                if( !m || !m[1] )
							{
								return null;
							}

							id = m[1];

			                //fetch params
			                params = url.split('/watch');
			                params = params[1];

			                return id + params;
			            },
			            src: '//www.youtube.com/embed/%id%'
			        },
					vimeo: {
						index: 'vimeo.com/',
						id: function(url) {

							//fetch the id
							var m = url.match(/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/), id, params;
							if( !m || !m[5] )
							{
								return null;
							}

							id = m[5];

							//fetch params
							params = url.split('?');
							params = params[1];

							return id + '?' + params;
						},
						src: '//player.vimeo.com/video/%id%'
					}
			    }
			},
			image: {
			    titleSrc: function( item )
						{
							var title = item.el.attr('title');
							if( ! title )
							{
								title = item.el.find('img').attr('title');
							}
							if( ! title )
							{
								title = item.el.parent().next( '.wp-caption-text' ).html();
							}
							if( typeof title != "undefined" )
							{
								return title;
							}

							if( ! $( 'body' ).hasClass( 'avia-mfp-show-alt-text' ) )
							{
								return '';
							}

							//	@since 4.7.6.2 check for alt attribute
							var alt = item.el.attr('alt');
							if( typeof alt != "undefined" )
							{
								return alt;
							}

							alt = item.el.find('img').attr('alt');
							if( typeof alt != "undefined" )
							{
								return alt;
							}

							return '';
						}
			},

			gallery: {
				// delegate: 	options.autolinkElements,
				tPrev:		'',
				tNext:		'',
				tCounter:	'%curr% / %total%',
				enabled:	true,
				preload:	[1,1] // Will preload 1 - before current, and 1 after the current image
			},

			callbacks:
			{
				beforeOpen: function()
				{
					//add custom css class for different styling
					if( this.st.el && this.st.el.data('fixed-content') )
					{
						this.fixedContentPos = true;
					}
				},

				open: function()
				{
					//overwrite default prev + next function. Add timeout for  crossfade animation
					$.magnificPopup.instance.next = function()
					{
						var self = this;
						self.wrap.removeClass('mfp-image-loaded');
						setTimeout(function() { $.magnificPopup.proto.next.call(self); }, 120);
					};

					$.magnificPopup.instance.prev = function()
					{
						var self = this;
						self.wrap.removeClass('mfp-image-loaded');
						setTimeout(function() { $.magnificPopup.proto.prev.call(self); }, 120);
					};

					//add custom css class for different styling
					if( this.st.el && this.st.el.data('av-extra-class') )
					{
						this.wrap.addClass( this.currItem.el.data('av-extra-class') );
					}


				},

				markupParse: function( template, values, item )
				{
					if( typeof values.img_replaceWith == 'undefined' || typeof values.img_replaceWith.length == 'undefined' || values.img_replaceWith.length == 0 )
					{
						return;
					}

					var img = $( values.img_replaceWith[0] );

					if( typeof img.attr( 'alt' ) != 'undefined' )
					{
						return;
					}

					var alt = item.el.attr( 'alt' );
					if( typeof alt == "undefined" )
					{
						alt = item.el.find('img').attr('alt');
					}

					if( typeof alt != "undefined" )
					{
						img.attr( 'alt', alt );
					}

					return;
				},

				imageLoadComplete: function()
				{
					var self = this;
					setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16);
				},
				change: function()
				{
				    if( this.currItem.el )
				    {
					    var current = this.currItem.el;

					    this.content.find( '.av-extra-modal-content, .av-extra-modal-markup' ).remove();

					    if( current.data('av-extra-content') )
					    {
						    var extra = current.data('av-extra-content');
						    this.content.append( "<div class='av-extra-modal-content'>" + extra + "</div>" );
					    }

					    if( current.data('av-extra-markup') )
					    {
						    var markup = current.data('av-extra-markup');
						    this.wrap.append( "<div class='av-extra-modal-markup'>" + markup + "</div>"  );
					    }
				    }
				}
			}
		};

	$.fn.avia_activate_lightbox = function(variables)
	{

		var defaults = {
			groups			:	['.avia-slideshow', '.avia-gallery', '.av-horizontal-gallery', '.av-instagram-pics', '.portfolio-preview-image', '.portfolio-preview-content', '.isotope', '.post-entry', '.sidebar', '#main', '.main_menu', '.woocommerce-product-gallery'],
			autolinkElements:   'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=webp], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
			videoElements	: 	'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
			exclude			:	'.noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]'
		},

		options = $.extend({}, defaults, variables),

		active = ! $('html').is('.av-custom-lightbox');

		if( ! active)
		{
			return this;
		}

		return this.each(function()
		{
			var container	= $(this),
				videos		= $(options.videoElements, this).not(options.exclude).addClass('mfp-iframe'), /*necessary class for the correct lightbox markup*/
				ajaxed		= ! container.is('body') && ! container.is('.ajax_slide');
				for( var i = 0; i < options.groups.length; i++ )
				{
					container.find(options.groups[i]).each(function()
					{
						var links = $(options.autolinkElements, this);

						if( ajaxed )
						{
							links.removeClass('lightbox-added');
						}

						links.not(options.exclude).addClass('lightbox-added').magnificPopup($.avia_utilities.av_popup);
					});
				}

		});
	};
})(jQuery);
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-megamenu.js?ver=5.1.2 
/**
 * -------------------------------------------------------------------------------------------
 * Avia Menu and Mega Menu
 * -------------------------------------------------------------------------------------------
 *
 * this file is only called if a main menu with submenu items is available
 */
(function($)
{
    "use strict";

    $( function()
    {
		//activates the mega menu javascript.
		if( $.fn.aviaMegamenu )
		{
			$( ".main_menu .menu" ).aviaMegamenu( { modify_position: true } );
		}
    });


	$.fn.aviaMegamenu = function( variables )
	{
		var defaults =
		{
			modify_position: true,
			delay: 300
		};

		var options = $.extend( defaults, variables );

		return this.each( function()
		{
			var the_html = $('html').first(),
				main = $('#main .container').first(),
				left_menu = the_html.filter('.html_menu_left, .html_logo_center').length,
				isMobile = $.avia_utilities.isMobile,
				menu = $(this),
				menuItems = menu.find(">li:not(.ignore_menu)"),
				megaItems = menuItems.find(">div").parent().css({overflow:'hidden'}),
				menuActive = menu.find('>.current-menu-item>a, >.current_page_item>a'),
				dropdownItems = menuItems.find(">ul").parent(),
				parentContainer = menu.parent(),
				mainMenuParent = menu.parents('.main_menu').eq(0),
				parentContainerWidth = parentContainer.width(),
				delayCheck = {},
				mega_open = [];

			if( ! menuActive.length )
			{
				menu.find('.current-menu-ancestor, .current_page_ancestor').eq( 0 ).find( 'a').eq( 0 ).parent().addClass('active-parent-item');
			}

			if( ! the_html.is('.html_header_top') )
			{
				options.modify_position = false;
			}

			menuItems.on( 'click' ,'a', function(e)
			{
				if( this.href == window.location.href + "#" || this.href == window.location.href + "/#" )
				{
					e.preventDefault();
				}
			});

			menuItems.each( function()
			{
				var item = $(this),
					pos = item.position(),
					megaDiv = item.find("div").first().css({opacity:0, display:"none"}),
					normalDropdown = "";

				//check if we got a mega menu
				if( ! megaDiv.length )
				{
					normalDropdown = item.find(">ul").css({display:"none"});
				}

				//if we got a mega menu or dropdown menu add the arrow beside the menu item
				if( megaDiv.length || normalDropdown.length )
				{
					var link = item.addClass('dropdown_ul_available').find('>a');
					link.append('<span class="dropdown_available"></span>');

					//is a mega menu main item doesnt have a link to click use the default cursor
					if( typeof link.attr('href') != 'string' || link.attr('href') == "#")
					{
						link.css('cursor', 'default').on( 'click', function(e)
						{
							e.preventDefault();
						});
					}
				}


				//correct position of mega menus
				if( options.modify_position && megaDiv.length )
				{
					item.on('mouseenter focusin', function()
					{
						calc_offset( item, pos, megaDiv, parentContainerWidth );
					});
				}
			});


			function calc_offset( item, pos, megaDiv, parentContainerWidth )
			{
				pos = item.position();

				if( ! left_menu )
				{
					if( pos.left + megaDiv.width() < parentContainerWidth )
					{
						megaDiv.css({right: -megaDiv.outerWidth() + item.outerWidth()  });
						//item.css({position:'static'});
					}
					else if( pos.left + megaDiv.width() > parentContainerWidth )
					{
						megaDiv.css({right: -mainMenuParent.outerWidth() + (pos.left + item.outerWidth() ) });
					}
				}
				else
				{
					if(megaDiv.width() > pos.left + item.outerWidth())
					{
						megaDiv.css({left: (pos.left* -1)});
					}
					else if(pos.left + megaDiv.width() > parentContainerWidth)
					{
						megaDiv.css({left: (megaDiv.width() - pos.left) * -1 });
					}
				}
			}

			function megaDivShow(i)
			{
				if(delayCheck[i] == true)
				{
					var item = megaItems.eq( i ).css({overflow:'visible'}).find("div").first(),
						link = megaItems.eq( i ).find("a").first();

					mega_open["check"+i] = true;

					item.stop().css('display','block').animate({opacity:1},300);

					if( item.length )
					{
						link.addClass('open-mega-a');
					}
				}
			}

			function megaDivHide(i)
			{
				if(delayCheck[i] == false)
				{
					megaItems.eq( i ).find(">a").removeClass('open-mega-a');

					var listItem = megaItems.eq( i ),
						item = listItem.find("div").first();


					item.stop().css('display','block').animate({opacity:0},300, function()
					{
						$(this).css('display','none');
						listItem.css({overflow:'hidden'});
						mega_open["check"+i] = false;
					});
				}
			}

			if( isMobile )
			{
				megaItems.each( function(i)
				{
					$(this).on('click', function()
					{
						if( mega_open["check"+i] != true )
						{
							return false;
						}
					});
				});
			}

			//bind event for mega menu
			megaItems.each( function(i)
			{
				$(this).on( 'mouseenter', function()
				{
					delayCheck[i] = true;
					setTimeout( function(){megaDivShow(i); }, options.delay );
				}).on( 'mouseleave', function()
				{
					delayCheck[i] = false;
					setTimeout( function(){megaDivHide(i); }, options.delay );
				});

				$(this).find("a").on( 'focus', function()
				{
					delayCheck[i] = true;
					setTimeout( function(){ megaDivShow(i); }, 50 );
				}).on( 'blur', function()
				{
					delayCheck[i] = false;
					setTimeout( function(){ megaDivHide(i); }, 50 );
				});
			});


			// bind events for dropdown menu
			dropdownItems.find('li').addBack().each( function()
			{
				var currentItem = $(this),
					sublist = currentItem.find('ul').first(),
					showList = false;

				if( sublist.length )
				{
					sublist.css({display:'block', opacity:0, visibility:'hidden'});
					var currentLink = currentItem.find('>a');

					currentLink.on( 'mouseenter', function()
					{
						sublist.stop().css({visibility:'visible'}).animate({opacity:1});
					});

					currentLink.on( 'focus', function()
					{
						sublist.stop().css({ visibility: 'visible' }).animate({ opacity: 1 });

						sublist.find('li').on( 'focusin', function()
						{
							sublist.stop().css({ visibility: 'visible' }).animate({ opacity: 1 });
						}).on( 'focusout', function()
						{
							sublist.stop().animate({ opacity: 0 }, function()
							{
								sublist.css({ visibility: 'hidden' });
							});
						});
					}).on( 'focusout', function()
					{
						$( this ).trigger( 'mouseleave' );
					});

					currentItem.on( 'mouseleave', function()
					{
						sublist.stop().animate({opacity:0}, function()
						{
							sublist.css({visibility:'hidden'});
						});
					});
				}
			});
		});
	};

})(jQuery);
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-footer-effects.js?ver=5.1.2 
/**
 * Support for footer behaviour
 * ============================
 *
 *	- Curtain effect
 *
 * @since 4.8.6.3
 */
(function($)
{
	"use strict";

	var win = null,
		body = null,
		placeholder = null,
		footer = null,
		max_height = null;

	$( function()
	{
		win = $(window);
		body = $('body');

		if( body.hasClass( 'av-curtain-footer' ) )
		{
			aviaFooterCurtain();
			return;
		}

		return;
	});


	function aviaFooterCurtain()
	{
		footer = body.find( '.av-curtain-footer-container' );

		//	remove classes
		if( footer.length == 0 )
		{
			body.removeClass( 'av-curtain-footer av-curtain-activated av-curtain-numeric av-curtain-screen' );
			return;
		}

		placeholder = $( '<div id="av-curtain-footer-placeholder"></div>' );
		footer.before( placeholder );

		if( body.hasClass( 'av-curtain-numeric' ) )
		{
			max_height = footer.data( 'footer_max_height' );
			if( 'undefined' == typeof max_height )
			{
				max_height = 70;
			}
			else
			{
				max_height = parseInt( max_height, 10 );
				if( isNaN( max_height ) )
				{
					max_height = 70;
				}
			}
		}

		aviaCurtainEffects();

		win.on( 'debouncedresize', aviaCurtainEffects );
	}

	function aviaCurtainEffects()
	{
		var height = Math.floor( footer.outerHeight() ),
			viewportHeight = win.innerHeight();

		//	screen width based
		if( null == max_height )
		{
			placeholder.css( { height: height + 'px' } );
		}
		else
		{
			var limit = Math.floor( viewportHeight * ( max_height / 100.0 ) );
			if( height > limit )
			{
				body.removeClass( 'av-curtain-activated' );
				placeholder.css( { height: '' } );
			}
			else
			{
				body.addClass( 'av-curtain-activated' );
				placeholder.css( { height: height + 'px' } );
			}
		}

	}

})(jQuery);
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/js/avia-snippet-widget.js?ver=5.1.2 
(function($)
{
	"use strict";

	$( function()
	{
		$('.avia_auto_toc').each(function(){

			var $toc_section = $(this).attr('id');
			var $levels = 'h1';
			var $levelslist = new Array();
			var $excludeclass = '';

			var $toc_container = $(this).find('.avia-toc-container');

			if( $toc_container.length )
			{
				var $levels_attr = $toc_container.attr('data-level');
				var $excludeclass_attr = $toc_container.attr('data-exclude');

				if( typeof $levels_attr != 'undefined' )
				{
					$levels = $levels_attr;
				}

				if( typeof $excludeclass_attr != 'undefined' )
				{
					$excludeclass = $excludeclass_attr.trim();
				}
			}

			$levelslist = $levels.split(',');

			$('.entry-content-wrapper').find( $levels ).each( function()
			{
				var headline = $( this );

				if( headline.hasClass('av-no-toc') )
				{
					return;
				}

				if( $excludeclass != '' && ( headline.hasClass( $excludeclass ) || headline.parent().hasClass( $excludeclass ) ) )
				{
					return;
				}

				var $h_id = headline.attr('id');
				var $tagname = headline.prop( 'tagName' ).toLowerCase();
				var $txt = headline.text();
				var $pos = $levelslist.indexOf($tagname);

				if( typeof $h_id == 'undefined' )
				{
					var $new_id = av_pretty_url( $txt );
					headline.attr( 'id', $new_id );
					$h_id = $new_id;
				}

				var $list_tag = '<a href="#' + $h_id + '" class="avia-toc-link avia-toc-level-' + $pos + '"><span>' + $txt + '</span></a>';
				$toc_container.append( $list_tag );
			});

            // Smooth Scrolling
			$( ".avia-toc-smoothscroll .avia-toc-link" ).on( 'click', function(e)
			{
				e.preventDefault();

				var $target = $(this).attr('href');
				var $offset = 50;

				// calculate offset if there is a sticky header
				var $sticky_header = $('.html_header_top.html_header_sticky #header');

				if( $sticky_header.length )
				{
					$offset = $sticky_header.outerHeight() + 50;
				}

				$('html,body').animate( { scrollTop: $($target).offset().top - $offset } );
			});
        });
    });


    function av_pretty_url(text)
	{
		return text.toLowerCase()
					.replace( /[^a-z0-9]+/g, "-" )
					.replace( /^-+|-+$/g, "-" )
					.replace( /^-+|-+$/g, '' );
    }

})( jQuery );
// source --> https://axhotelsmalta.com/wp-content/themes/enfold/config-gutenberg/js/avia_blocks_front.js?ver=5.1.2 
/**
 * Holds frontend script necessary to support WC blocks
 *
 */
( function($)
{

	"use strict";

	//	Add a predefined color to element
	var elements = $( '.has-background, .has-text-color' );

	elements.each( function( i )
	{
		var element = $(this);
		if( ! ( element.hasClass( 'has-background' ) || element.hasClass( 'has-text-color' ) ) )
		{
			return;
		}

		var classList = element.attr( 'class' ).split( /\s+/ );
		var color = '';
		var style = '';

		if( element.hasClass( 'has-background' ) )
		{
			$.each( classList, function( index, item )
			{
				item = item.trim().toLowerCase();
				if( 0 == item.indexOf( 'has-col-' ) && -1 != item.indexOf( '-background-color' ) )
				{
					color = item.replace( 'has-col-', '' );
					color = color.replace( '-background-color', '' );
					color = color.replace( /-|[^0-9a-fA-F]/g, '' );
					if( color.length == 3 || color.length == 6 )
					{
						element.css( { 'background-color': '', 'border-color': '' } );		//	force hex instead rgb
						style = 'undefined' != typeof element.attr( 'style' ) ? element.attr( 'style' ) + ';' : '';
						element.attr( 'style', style + ' background-color: #' + color + '; border-color: #' + color + ';' );
					}
				}
			});
		}

		if( element.hasClass( 'has-text-color' ) )
		{
			$.each( classList, function( index, item )
			{
				item = item.trim().toLowerCase();
				if( 0 == item.indexOf( 'has-col-' ) && -1 == item.indexOf( '-background-color' ) && -1 != item.indexOf( '-color' ) )
				{
					var color = item.replace( 'has-col-', '' );
					color = color.replace( '-color', '' );
					color = color.replace( /-|[^0-9a-fA-F]/g, '' );
					if( color.length == 3 || color.length == 6 )
					{
						element.css( 'color', '' );		//	force hex instead rgb
						style = 'undefined' != typeof element.attr( 'style' ) ? element.attr( 'style' ) + ';' : '';
						element.attr( 'style', style + ' color: #' + color + ';' );
					}
				}
			});
		}

	});

	//	add a custom font size to element
	elements = $('[class^="has-fs-"], [class$="-font-size"]');

	elements.each( function( i )
	{
		var element = $(this);

		var classList = element.attr( 'class' ).split( /\s+/ );

		$.each( classList, function( index, item )
		{
			item = item.trim().toLowerCase();

			if( 0 == item.indexOf( 'has-fs-' ) && -1 != item.indexOf( '-font-size' ) )
			{
				item = item.replace( 'has-fs-', '' );
				item = item.replace( '-font-size', '' );
				item = item.split( '-' );

				if( item.length != 2 )
				{
					return;
				}

				var style = 'undefined' != typeof element.attr( 'style' ) ? element.attr( 'style' ) + ';' : '';
				element.attr( 'style', style + ' font-size:' + item[0] + item[1] + ';');
			}
		});

	});

})( jQuery );
// source --> https://axhotelsmalta.com/wp-includes/js/dist/dom-ready.min.js?ver=f77871ff7694fffea381 
/*! This file is auto-generated */
(()=>{"use strict";var e={d:(t,d)=>{for(var o in d)e.o(d,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:d[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};function d(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:()=>d}),(window.wp=window.wp||{}).domReady=t.default})();
// source --> https://axhotelsmalta.com/wp-includes/js/dist/hooks.min.js?ver=4d63a3d491d11ffd8ac6 
/*! This file is auto-generated */
(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{actions:()=>P,addAction:()=>A,addFilter:()=>m,applyFilters:()=>w,applyFiltersAsync:()=>I,createHooks:()=>h,currentAction:()=>x,currentFilter:()=>T,defaultHooks:()=>f,didAction:()=>j,didFilter:()=>z,doAction:()=>g,doActionAsync:()=>k,doingAction:()=>O,doingFilter:()=>S,filters:()=>Z,hasAction:()=>_,hasFilter:()=>v,removeAction:()=>p,removeAllActions:()=>F,removeAllFilters:()=>b,removeFilter:()=>y});const n=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};const r=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};const o=function(t,e){return function(o,i,s,c=10){const l=t[e];if(!r(o))return;if(!n(i))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:i};if(l[o]){const t=l[o].handlers;let e;for(e=t.length;e>0&&!(c>=t[e-1].priority);e--);e===t.length?t[e]=a:t.splice(e,0,a),l.__current.forEach((t=>{t.name===o&&t.currentIndex>=e&&t.currentIndex++}))}else l[o]={handlers:[a],runs:0};"hookAdded"!==o&&t.doAction("hookAdded",o,i,s,c)}};const i=function(t,e,o=!1){return function(i,s){const c=t[e];if(!r(i))return;if(!o&&!n(s))return;if(!c[i])return 0;let l=0;if(o)l=c[i].handlers.length,c[i]={runs:c[i].runs,handlers:[]};else{const t=c[i].handlers;for(let e=t.length-1;e>=0;e--)t[e].namespace===s&&(t.splice(e,1),l++,c.__current.forEach((t=>{t.name===i&&t.currentIndex>=e&&t.currentIndex--})))}return"hookRemoved"!==i&&t.doAction("hookRemoved",i,s),l}};const s=function(t,e){return function(n,r){const o=t[e];return void 0!==r?n in o&&o[n].handlers.some((t=>t.namespace===r)):n in o}};const c=function(t,e,n,r){return function(o,...i){const s=t[e];s[o]||(s[o]={handlers:[],runs:0}),s[o].runs++;const c=s[o].handlers;if(!c||!c.length)return n?i[0]:void 0;const l={name:o,currentIndex:0};return(r?async function(){try{s.__current.add(l);let t=n?i[0]:void 0;for(;l.currentIndex<c.length;){const e=c[l.currentIndex];t=await e.callback.apply(null,i),n&&(i[0]=t),l.currentIndex++}return n?t:void 0}finally{s.__current.delete(l)}}:function(){try{s.__current.add(l);let t=n?i[0]:void 0;for(;l.currentIndex<c.length;){t=c[l.currentIndex].callback.apply(null,i),n&&(i[0]=t),l.currentIndex++}return n?t:void 0}finally{s.__current.delete(l)}})()}};const l=function(t,e){return function(){var n;const r=t[e],o=Array.from(r.__current);return null!==(n=o.at(-1)?.name)&&void 0!==n?n:null}};const a=function(t,e){return function(n){const r=t[e];return void 0===n?r.__current.size>0:Array.from(r.__current).some((t=>t.name===n))}};const u=function(t,e){return function(n){const o=t[e];if(r(n))return o[n]&&o[n].runs?o[n].runs:0}};class d{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=o(this,"actions"),this.addFilter=o(this,"filters"),this.removeAction=i(this,"actions"),this.removeFilter=i(this,"filters"),this.hasAction=s(this,"actions"),this.hasFilter=s(this,"filters"),this.removeAllActions=i(this,"actions",!0),this.removeAllFilters=i(this,"filters",!0),this.doAction=c(this,"actions",!1,!1),this.doActionAsync=c(this,"actions",!1,!0),this.applyFilters=c(this,"filters",!0,!1),this.applyFiltersAsync=c(this,"filters",!0,!0),this.currentAction=l(this,"actions"),this.currentFilter=l(this,"filters"),this.doingAction=a(this,"actions"),this.doingFilter=a(this,"filters"),this.didAction=u(this,"actions"),this.didFilter=u(this,"filters")}}const h=function(){return new d},f=h(),{addAction:A,addFilter:m,removeAction:p,removeFilter:y,hasAction:_,hasFilter:v,removeAllActions:F,removeAllFilters:b,doAction:g,doActionAsync:k,applyFilters:w,applyFiltersAsync:I,currentAction:x,currentFilter:T,doingAction:O,doingFilter:S,didAction:j,didFilter:z,actions:P,filters:Z}=f;(window.wp=window.wp||{}).hooks=e})();
// source --> https://axhotelsmalta.com/wp-includes/js/dist/i18n.min.js?ver=5e580eb46a90c2b997e6 
/*! This file is auto-generated */
(()=>{var t={2058:(t,e,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,p,c,f,d=1,h=t.length,g="";for(n=0;n<h;n++)if("string"==typeof t[n])g+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[d],o=0;o<s.keys.length;o++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?e[s.param_no]:e[d++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(c=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?g+=r:(!i.number.test(s.type)||c&&!s.sign?f="":(f=c?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(f+r).length,l=s.width&&p>0?u.repeat(p):"",g+=s.align?f+r+l:"0"===u?f+l+r:l+f+r)}return g}(function(t){if(s[t])return s[t];var e,r=t,n=[],a=0;for(;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__:()=>F,_n:()=>j,_nx:()=>L,_x:()=>S,createI18n:()=>x,defaultI18n:()=>_,getLocaleData:()=>v,hasTranslation:()=>D,isRTL:()=>T,resetLocaleData:()=>w,setLocaleData:()=>m,sprintf:()=>a,subscribe:()=>k});var t=r(2058),e=r.n(t);const i=function(t,e){var r,n,i=0;function a(){var a,o,s=r,l=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(o=0;o<l;o++)if(s.args[o]!==arguments[o]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(a=new Array(l),o=0;o<l;o++)a[o]=arguments[o];return s={args:a,val:t.apply(null,a)},r?(r.prev=s,s.next=r):n=s,i===e.maxSize?(n=n.prev).next=null:i++,r=s,s.val}return e=e||{},a.clear=function(){r=null,n=null,i=0},a}(console.error);function a(t,...r){try{return e().sprintf(t,...r)}catch(e){return e instanceof Error&&i("sprintf error: \n\n"+e.toString()),t}}var o,s,l,u;o={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},s=["(","?"],l={")":["("],":":["?","?:"]},u=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function c(t){var e=function(t){for(var e,r,n,i,a=[],p=[];e=t.match(u);){for(r=e[0],(n=t.substr(0,e.index).trim())&&a.push(n);i=p.pop();){if(l[r]){if(l[r][0]===i){r=l[r][1]||r;break}}else if(s.indexOf(i)>=0||o[i]<o[r]){p.push(i);break}a.push(i)}l[r]||p.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&a.push(t),a.concat(p.reverse())}(t);return function(t){return function(t,e){var r,n,i,a,o,s,l=[];for(r=0;r<t.length;r++){if(o=t[r],a=p[o]){for(n=a.length,i=Array(n);n--;)i[n]=l.pop();try{s=a.apply(null,i)}catch(t){return t}}else s=e.hasOwnProperty(o)?e[o]:+o;l.push(s)}return l[0]}(e,t)}}var f={contextDelimiter:"",onMissingKey:null};function d(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},f)this.options[r]=void 0!==e&&r in e?e[r]:f[r]}d.prototype.getPluralForm=function(t,e){var r,n,i,a=this.pluralForms[t];return a||("function"!=typeof(i=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),i=function(t){var e=c(t);return function(t){return+e({n:t})}}(n)),a=this.pluralForms[t]=i),a(e)},d.prototype.dcnpgettext=function(t,e,r,n,i){var a,o,s;return a=void 0===i?0:this.getPluralForm(t,i),o=r,e&&(o=e+this.options.contextDelimiter+r),(s=this.data[t][o])&&s[a]?s[a]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===a?r:n)};const h={plural_forms:t=>1===t?0:1},g=/^i18n\.(n?gettext|has_translation)(_|$)/,x=(t,e,r)=>{const n=new d({}),i=new Set,a=()=>{i.forEach((t=>t()))},o=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},s=(t,e)=>{o(t,e),a()},l=(t="default",e,r,i,a)=>(n.data[t]||o(void 0,t),n.dcnpgettext(t,e,r,i,a)),u=(t="default")=>t,p=(t,e,n)=>{let i=l(n,e,t);return r?(i=r.applyFilters("i18n.gettext_with_context",i,t,e,n),r.applyFilters("i18n.gettext_with_context_"+u(n),i,t,e,n)):i};if(t&&s(t,e),r){const t=t=>{g.test(t)&&a()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:s,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],a()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},s(t,e)},subscribe:t=>(i.add(t),()=>i.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:p,_n:(t,e,n,i)=>{let a=l(i,void 0,t,e,n);return r?(a=r.applyFilters("i18n.ngettext",a,t,e,n,i),r.applyFilters("i18n.ngettext_"+u(i),a,t,e,n,i)):a},_nx:(t,e,n,i,a)=>{let o=l(a,i,t,e,n);return r?(o=r.applyFilters("i18n.ngettext_with_context",o,t,e,n,i,a),r.applyFilters("i18n.ngettext_with_context_"+u(a),o,t,e,n,i,a)):o},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(t,e,i)=>{const a=e?e+""+t:t;let o=!!n.data?.[null!=i?i:"default"]?.[a];return r&&(o=r.applyFilters("i18n.has_translation",o,t,e,i),o=r.applyFilters("i18n.has_translation_"+u(i),o,t,e,i)),o}}},y=window.wp.hooks,b=x(void 0,void 0,y.defaultHooks),_=b,v=b.getLocaleData.bind(b),m=b.setLocaleData.bind(b),w=b.resetLocaleData.bind(b),k=b.subscribe.bind(b),F=b.__.bind(b),S=b._x.bind(b),j=b._n.bind(b),L=b._nx.bind(b),T=b.isRTL.bind(b),D=b.hasTranslation.bind(b)})(),(window.wp=window.wp||{}).i18n=n})();