/** * Start accordion widget script */ (function ($, elementor) { "use strict"; var widgetAccordion = function ($scope, $) { var $accrContainer = $scope.find(".bdt-ep-accordion-container"), $accordion = $accrContainer.find(".bdt-ep-accordion"), $activeItem = $accrContainer.find(".bdt-ep-accordion-item.bdt-open"); if (!$accrContainer.length) { return; } var $settings = $accordion.data("settings"), activeHash = $settings.activeHash, hashTopOffset = $settings.hashTopOffset, hashScrollspyTime = $settings.hashScrollspyTime, activeScrollspy = $settings.activeScrollspy, closeAllItemsOnMobile = $settings.closeAllItemsOnMobile; if (closeAllItemsOnMobile) { if (isMobileDevice()) { $activeItem.removeClass("bdt-open"); $activeItem.find(".bdt-ep-accordion-content").prop("hidden", true); } } function isMobileDevice() { return window.matchMedia("(max-width: 767px)").matches; } if (activeScrollspy === null || typeof activeScrollspy === "undefined") { activeScrollspy = "no"; } function hashHandler($accordion, hashScrollspyTime, hashTopOffset) { if (window.location.hash) { if ( $($accordion).find( '[data-title="' + window.location.hash.substring(1) + '"]' ).length ) { var hashTarget = $( '[data-title="' + window.location.hash.substring(1) + '"]' ) .closest($accordion) .attr("id"); if (activeScrollspy == "yes") { $("html, body") .animate( { easing: "slow", scrollTop: $("#" + hashTarget).offset().top - hashTopOffset, }, hashScrollspyTime, function () {} ) .promise() .then(function () { bdtUIkit .accordion($accordion) .toggle( $( '[data-title="' + window.location.hash.substring(1) + '"]' ).data("accordion-index"), false ); }); } else { bdtUIkit .accordion($accordion) .toggle( $( '[data-title="' + window.location.hash.substring(1) + '"]' ).data("accordion-index"), true ); } } } } if (activeHash == "yes") { $(window).on("load", function () { if (activeScrollspy == "yes") { hashHandler($accordion, hashScrollspyTime, hashTopOffset); } else { bdtUIkit .accordion($accordion) .toggle( $( '[data-title="' + window.location.hash.substring(1) + '"]' ).data("accordion-index"), false ); } }); $($accordion) .find(".bdt-ep-accordion-title") .off("click") .on("click", function (event) { window.location.hash = $.trim($(this).attr("data-title")); hashHandler($accordion, (hashScrollspyTime = 1000), hashTopOffset); }); $(window).on("hashchange", function (e) { hashHandler($accordion, (hashScrollspyTime = 1000), hashTopOffset); }); } }; jQuery(window).on("elementor/frontend/init", function () { elementorFrontend.hooks.addAction( "frontend/element_ready/bdt-accordion.default", widgetAccordion ); elementorFrontend.hooks.addAction( "frontend/element_ready/bdt-acf-accordion.default", widgetAccordion ); }); })(jQuery, window.elementorFrontend); /** * End accordion widget script */ /** * Start dual button widget script */ (function ($, elementor) { "use strict"; var widgetDualButton = function ($scope, $) { var $buttons = $scope.find(".bdt-dual-button .bdt-ep-button[data-onclick]"); if (!$buttons.length) return; $buttons.on("click", function (event) { event.preventDefault(); var functionName = $(this).data("onclick")?.trim(); if (functionName) { functionName = functionName.replace(/[\(\);\s]/g, ''); if (typeof window[functionName] === "function") { window[functionName](); } else { console.warn(`Function "${functionName}" is not defined.`); } } }); }; jQuery(window).on("elementor/frontend/init", function () { elementorFrontend.hooks.addAction( "frontend/element_ready/bdt-dual-button.default", widgetDualButton ); }); })(jQuery, window.elementorFrontend); /** * End dual button widget script */ /** * Start advanced divider widget script */ (function($, elementor) { 'use strict'; var widgetBusinessHours = function($scope, $) { var $businessHoursContainer = $scope.find('.bdt-ep-business-hours'), $businessHours = $businessHoursContainer.find('.bdt-ep-business-hours-current-time'); if (!$businessHoursContainer.length) { return; } var $settings = $businessHoursContainer.data('settings'); var dynamic_timezone = $settings.dynamic_timezone; var timeNotation = $settings.timeNotation; var business_hour_style = $settings.business_hour_style; if (business_hour_style != 'dynamic') return; $(document).ready(function() { var offset_val; var timeFormat = '%H:%M:%S', timeZoneFormat; var dynamic_timezone = $settings.dynamic_timezone; if(business_hour_style == 'static'){ offset_val = $settings.dynamic_timezone_default; }else{ offset_val = dynamic_timezone; } if(timeNotation == '12h'){ timeFormat = '%I:%M:%S %p'; } if (offset_val == '') return; var options = { // format:'%A, %d %B %I:%M:%S %P', // format:' %I:%M:%S ', format: timeFormat, timeNotation: timeNotation, //'24h', am_pm: true, utc: true, utc_offset: offset_val } $($businessHoursContainer).find('.bdt-ep-business-hours-current-time').jclock(options); }); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-business-hours.default', widgetBusinessHours); }); }(jQuery, window.elementorFrontend)); /** * End business hours widget script */ /** * Start contact form widget script */ (function ($, elementor) { 'use strict'; var widgetSimpleContactForm = function ($scope, $) { var $contactForm = $scope.find('.bdt-contact-form .without-recaptcha'), widgetID = $scope.data('id'); // Validate tel type input field var $inputFieldTel = $scope.find('.bdt-contact-form input[type="tel"]'); $inputFieldTel.on('input', function(e) { this.value = this.value.replace(/[^0-9\+]/g, ''); // Allow only numbers and the plus sign }); if (!$contactForm.length) { return; } $contactForm.on('submit', function (e) { sendContactForm($contactForm, widgetID); return false; }); return false; }; function sendContactForm($contactForm, widgetID = false) { var langStr = window.ElementPackConfig.contact_form; $.ajax({ url: $contactForm.attr('action'), type: 'POST', data: $contactForm.serialize(), beforeSend: function () { bdtUIkit.notification({ message: '
' + langStr.sending_msg, timeout: false, status: 'primary' }); }, success: function (data) { var redirectURL = $(data).data('redirect'), isExternal = $(data).data('external'), resetStatus = $(data).data('resetstatus'); bdtUIkit.notification.closeAll(); var notification = bdtUIkit.notification({ message: '' }); if (redirectURL) { if (redirectURL != 'no') { bdtUIkit.util.on(document, 'close', function (evt) { if (evt.detail[0] === notification) { window.open(redirectURL, isExternal); } }); } } localStorage.setItem("bdtCouponCode", $contactForm.attr('id')); if (resetStatus) { if (resetStatus !== 'no') { $contactForm[0].reset(); } } // $contactForm[0].reset(); } }); return false; } // google invisible captcha function elementPackGIC() { var langStr = window.ElementPackConfig.contact_form; return new Promise(function (resolve, reject) { if (grecaptcha === undefined) { bdtUIkit.notification({ message: ' ' + langStr.captcha_nd, timeout: false, status: 'warning' }); reject(); } var response = grecaptcha.getResponse(); if (!response) { bdtUIkit.notification({ message: ' ' + langStr.captcha_nr, timeout: false, status: 'warning' }); reject(); } var $contactForm = $('textarea.g-recaptcha-response').filter(function () { return $(this).val() === response; }).closest('form.bdt-contact-form-form'); var contactFormAction = $contactForm.attr('action'); if (contactFormAction && contactFormAction !== '') { sendContactForm($contactForm); } grecaptcha.reset(); }); //end promise } //Contact form recaptcha callback, if needed window.elementPackGICCB = elementPackGIC; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-contact-form.default', widgetSimpleContactForm); }); }(jQuery, window.elementorFrontend)); /** * End contact form widget script */ /** * Start cookie consent widget script */ (function ($, elementor) { 'use strict'; var widgetCookieConsent = function ($scope, $) { var $cookieConsent = $scope.find('.bdt-cookie-consent'), $settings = $cookieConsent.data('settings'), editMode = Boolean(elementorFrontend.isEditMode()), gtagSettings = $cookieConsent.data('gtag'); if (!$cookieConsent.length || editMode) { return; } window.cookieconsent.initialise($settings); $('.cc-compliance').append( `` ); /** * Dismiss if user click close button */ $('.cc-btn.btn-denyCookie').on('click', function () { $('.bdt-cookie-consent').hide(); document.cookie = 'element_pack_cookie_widget_gtag=denied; max-age=' + 60 * 60 * 24 * 7 + '; path=/'; return; }); if (document.cookie.indexOf('element_pack_cookie_widget_gtag=denied') !== -1) { $('.bdt-cookie-consent').hide(); return; } /** * gtag consent update */ if (gtagSettings === undefined) { return; } if (gtagSettings.gtag_enabled !== true) { return; } function consentGrantedAdStorage(args) { gtag('consent', 'update', args); } let gtagAttrObj = { 'ad_user_data': gtagSettings.ad_user_data, 'ad_personalization': gtagSettings.ad_personalization, 'ad_storage': gtagSettings.ad_storage, 'analytics_storage': gtagSettings.analytics_storage, }; $('.cc-btn.cc-dismiss').on('click', function () { consentGrantedAdStorage(gtagAttrObj); }); $('.cc-btn.btn-denyCookie').on('click', function () { consentGrantedAdStorage({ 'ad_storage': 'denied', 'analytics_storage': 'denied' }); }); }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-cookie-consent.default', widgetCookieConsent); }); }(jQuery, window.elementorFrontend)); /** * End cookie consent widget script */ /** * Start countdown widget script */ (function ($, elementor) { 'use strict'; var widgetCountdown = function ($scope, $) { var $countdown = $scope.find('.bdt-countdown-wrapper'); if (!$countdown.length) { return; } var $settings = $countdown.data('settings'), endTime = $settings.endTime, loopHours = $settings.loopHours, isLogged = $settings.isLogged; var countDownObj = { setCookie: function (name, value, hours) { var expires = ""; if (hours) { var date = new Date(); date.setTime(date.getTime() + (hours * 60 * 60 * 1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; }, getCookie: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }, randomIntFromInterval: function (min, max) { // min and max included return Math.floor(Math.random() * (max - min + 1) + min) }, getTimeSpan: function (date) { var total = date - Date.now(); return { total, seconds: total / 1000 % 60, minutes: total / 1000 / 60 % 60, hours: total / 1000 / 60 / 60 % 24, days: total / 1000 / 60 / 60 / 24 }; }, showPost: function (endTime) { jQuery.ajax({ url: $settings.adminAjaxUrl, type: 'post', data: { action: 'element_pack_countdown_end', endTime: endTime, couponTrickyId: $settings.couponTrickyId }, success: function (data) { if (data == 'ended') { if ($settings.endActionType == 'message') { jQuery($settings.msgId).css({ 'display': 'block' }); jQuery($settings.id + '-timer').css({ 'display': 'none' }); } if ($settings.endActionType == 'url' && $settings.redirectUrl !== '' && $settings.redirectUrl.indexOf('http') > -1) { setInterval(function () { jQuery(location).attr('href', $settings.redirectUrl); }, $settings.redirectDelay); } } }, error: function () { // error handling code can be added here if needed } }); }, couponCode: function(){ jQuery.ajax({ url: $settings.adminAjaxUrl, type: 'post', data: { action: 'element_pack_countdown_end', endTime: endTime, couponTrickyId: $settings.couponTrickyId }, success: function (data) { }, error: function () { } }); }, triggerFire : function(){ jQuery.ajax({ url: $settings.adminAjaxUrl, type: 'post', data: { action: 'element_pack_countdown_end', endTime: endTime, couponTrickyId: $settings.couponTrickyId }, success: function (data) { if (data == 'ended') { setTimeout(function () { if ($settings.triggerId){ document.getElementById($settings.triggerId).click(); } // document.getElementById($settings.triggerId).click(); // jQuery('#' + $settings.triggerId).trigger('click'); }, 1500); } }, error: function () { // error handling code can be added here if needed } }); }, clearInterVal: function (myInterVal) { clearInterval(myInterVal); } }; if (loopHours == false) { var countdown = bdtUIkit.countdown($($settings.id + '-timer'), { date: $settings.finalTime }); var myInterVal = setInterval(function () { var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0); var finalSeconds = parseInt(seconds); if (finalSeconds < 0) { if (!jQuery('body').hasClass('elementor-editor-active')) { jQuery($settings.id + '-msg').css({ 'display': 'none' }); if ($settings.endActionType != 'none') { countDownObj.showPost(endTime) }; } countDownObj.clearInterVal(myInterVal); } }, 1000); // for coupon code if ($settings.endActionType == 'coupon-code') { var myInterVal2 = setInterval(function () { var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0); var finalSeconds = parseInt(seconds); if (finalSeconds < 0) { if (!jQuery('body').hasClass('elementor-editor-active')) { if ($settings.endActionType == 'coupon-code') { countDownObj.couponCode(endTime) }; } countDownObj.clearInterVal(myInterVal2); } }, 1000); } // custom trigger on the end if ($settings.triggerId !== false) { var myInterVal2 = setInterval(function () { var seconds = countDownObj.getTimeSpan(countdown.date).seconds.toFixed(0); var finalSeconds = parseInt(seconds); if (finalSeconds < 0) { if (!jQuery('body').hasClass('elementor-editor-active')) { countDownObj.triggerFire(); } countDownObj.clearInterVal(myInterVal2); } }, 1000); } } if (loopHours !== false) { var now = new Date(), randMinute = countDownObj.randomIntFromInterval(6, 14), hours = loopHours * 60 * 60 * 1000 - (randMinute * 60 * 1000), timer = new Date(now.getTime() + hours), loopTime = timer.toISOString(), getCookieLoopTime = countDownObj.getCookie('bdtCountdownLoopTime'); if ((getCookieLoopTime == null || getCookieLoopTime == 'undefined') && isLogged === false) { countDownObj.setCookie('bdtCountdownLoopTime', loopTime, loopHours); } var setLoopTimer; if (isLogged === false) { setLoopTimer = countDownObj.getCookie('bdtCountdownLoopTime'); } else { setLoopTimer = loopTime; } $($settings.id + '-timer').attr('data-bdt-countdown', 'date: ' + setLoopTimer); var countdown = bdtUIkit.countdown($($settings.id + '-timer'), { date: setLoopTimer }); var countdownDate = countdown.date; setInterval(function () { var seconds = countDownObj.getTimeSpan(countdownDate).seconds.toFixed(0); var finalSeconds = parseInt(seconds); // console.log(finalSeconds); if (finalSeconds > 0) { if ((getCookieLoopTime == null || getCookieLoopTime == 'undefined') && isLogged === false) { countDownObj.setCookie('bdtCountdownLoopTime', loopTime, loopHours); bdtUIkit.countdown($($settings.id + '-timer'), { date: setLoopTimer }); } } }, 1000); } }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-countdown.default', widgetCountdown); elementorFrontend.hooks.addAction('frontend/element_ready/bdt-countdown.bdt-tiny-countdown', widgetCountdown); }); }(jQuery, window.elementorFrontend)); /** * End countdown widget script */ /** * Start bdt custom gallery widget script */ (function($, elementor) { 'use strict'; var widgetCustomGallery = function($scope, $) { var $customGallery = $scope.find('.bdt-custom-gallery'), $settings = $customGallery.data('settings'); if (!$customGallery.length) { return; } if ($settings.tiltShow == true) { var elements = document.querySelectorAll($settings.id + " [data-tilt]"); VanillaTilt.init(elements); } }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.default', widgetCustomGallery); elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.bdt-abetis', widgetCustomGallery); elementorFrontend.hooks.addAction('frontend/element_ready/bdt-custom-gallery.bdt-fedara', widgetCustomGallery); }); }(jQuery, window.elementorFrontend)); /** * End bdt custom gallery widget script */ ; (function ($, elementor) { 'use strict'; $(window).on('elementor/frontend/init', function () { var ModuleHandler = elementorModules.frontend.handlers.Base, FloatingEffect; FloatingEffect = ModuleHandler.extend({ bindEvents: function () { this.run(); }, getDefaultSettings: function () { return { direction: 'alternate', easing: 'easeInOutSine', loop: true }; }, settings: function (key) { return this.getElementSettings('ep_floating_effects_' + key); }, onElementChange: debounce(function (prop) { if (prop.indexOf('ep_floating') !== -1) { this.anime && this.anime.restart(); this.run(); } }, 400), run: function () { var options = this.getDefaultSettings(), element = this.$element[0]; if (this.settings('translate_toggle')) { if (this.settings('translate_x.sizes.from').length !== 0 || this.settings('translate_x.sizes.to').length !== 0) { options.translateX = { value: [this.settings('translate_x.sizes.from') || 0, this.settings('translate_x.sizes.to') || 0], duration: this.settings('translate_duration.size'), delay: this.settings('translate_delay.size') || 0 }; } if (this.settings('translate_y.sizes.from').length !== 0 || this.settings('translate_y.sizes.to').length !== 0) { options.translateY = { value: [this.settings('translate_y.sizes.from') || 0, this.settings('translate_y.sizes.to') || 0], duration: this.settings('translate_duration.size'), delay: this.settings('translate_delay.size') || 0 }; } } if (this.settings('rotate_toggle')) { if (this.settings('rotate_infinite') !== 'yes') { if (this.settings('rotate_x.sizes.from').length !== 0 || this.settings('rotate_x.sizes.to').length !== 0) { options.rotateX = { value: [this.settings('rotate_x.sizes.from') || 0, this.settings('rotate_x.sizes.to') || 0], duration: this.settings('rotate_duration.size'), delay: this.settings('rotate_delay.size') || 0 }; } if (this.settings('rotate_y.sizes.from').length !== 0 || this.settings('rotate_y.sizes.to').length !== 0) { options.rotateY = { value: [this.settings('rotate_y.sizes.from') || 0, this.settings('rotate_y.sizes.to') || 0], duration: this.settings('rotate_duration.size'), delay: this.settings('rotate_delay.size') || 0 }; } if (this.settings('rotate_z.sizes.from').length !== 0 || this.settings('rotate_z.sizes.to').length !== 0) { options.rotateZ = { value: [this.settings('rotate_z.sizes.from') || 0, this.settings('rotate_z.sizes.to') || 0], duration: this.settings('rotate_duration.size'), delay: this.settings('rotate_delay.size') || 0 }; } } } if (this.settings('scale_toggle')) { if (this.settings('scale_x.sizes.from').length !== 0 || this.settings('scale_x.sizes.to').length !== 0) { options.scaleX = { value: [this.settings('scale_x.sizes.from') || 0, this.settings('scale_x.sizes.to') || 0], duration: this.settings('scale_duration.size'), delay: this.settings('scale_delay.size') || 0 }; } if (this.settings('scale_y.sizes.from').length !== 0 || this.settings('scale_y.sizes.to').length !== 0) { options.scaleY = { value: [this.settings('scale_y.sizes.from') || 0, this.settings('scale_y.sizes.to') || 0], duration: this.settings('scale_duration.size'), delay: this.settings('scale_delay.size') || 0 }; } } if (this.settings('skew_toggle')) { if (this.settings('skew_x.sizes.from').length !== 0 || this.settings('skew_x.sizes.to').length !== 0) { options.skewX = { value: [this.settings('skew_x.sizes.from') || 0, this.settings('skew_x.sizes.to') || 0], duration: this.settings('skew_duration.size'), delay: this.settings('skew_delay.size') || 0 }; } if (this.settings('skew_y.sizes.from').length !== 0 || this.settings('skew_y.sizes.to').length !== 0) { options.skewY = { value: [this.settings('skew_y.sizes.from') || 0, this.settings('skew_y.sizes.to') || 0], duration: this.settings('skew_duration.size'), delay: this.settings('skew_delay.size') || 0 }; } } if (this.settings('border_radius_toggle')) { jQuery(element).css('overflow', 'hidden'); if (this.settings('border_radius.sizes.from').length !== 0 || this.settings('border_radius.sizes.to').length !== 0) { options.borderRadius = { value: [this.settings('border_radius.sizes.from') || 0, this.settings('border_radius.sizes.to') || 0], duration: this.settings('border_radius_duration.size'), delay: this.settings('border_radius_delay.size') || 0 }; } } if (this.settings('opacity_toggle')) { if (this.settings('opacity_start.size').length !== 0 || this.settings('opacity_end.size').length !== 0) { options.opacity = { value: [this.settings('opacity_start.size') || 1, this.settings('opacity_end.size') || 0], duration: this.settings('opacity_duration.size'), easing: 'linear' }; } } if (this.settings('easing')) { options.easing = this.settings('easing'); } if (this.settings('show')) { options.targets = element; if ( this.settings('translate_toggle') || this.settings('rotate_toggle') || this.settings('scale_toggle') || this.settings('skew_toggle') || this.settings('border_radius_toggle') || this.settings('opacity_toggle') ) { this.anime = window.anime && window.anime(options); } } } }); elementorFrontend.hooks.addAction('frontend/element_ready/widget', function ($scope) { elementorFrontend.elementsHandler.addHandler(FloatingEffect, { $element: $scope }); }); }); }(jQuery, window.elementorFrontend)); /** * Start Flip Box widget script */ (function ($, elementor) { 'use strict'; var widgetFlipBox = function ($scope, $) { var $flipBox = $scope.find('.bdt-flip-box'), $settings = $flipBox.data('settings'); if (!$flipBox.length) { return; } if ('click' === $settings.flipTrigger) { $($flipBox).on('click', function () { $(this).toggleClass('bdt-active'); }); } if ('hover' === $settings.flipTrigger) { $($flipBox).on('mouseenter', function () { $(this).addClass('bdt-active'); }); $($flipBox).on('mouseleave', function () { $(this).removeClass('bdt-active'); }); } }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-flip-box.default', widgetFlipBox); }); }(jQuery, window.elementorFrontend)); /** * End Flip Box widget script */ (function ($, elementor) { "use strict"; var widgetImageAccordion = function ($scope, $) { var $imageAccordion = $scope.find(".bdt-ep-image-accordion"), $settings = $imageAccordion.data("settings"); var accordionItem = $imageAccordion.find(".bdt-ep-image-accordion-item"); var totalItems = $imageAccordion.children().length; // Make each accordion item focusable accordionItem.attr('tabindex', '0'); if ( $settings.activeItem == true && $settings.activeItemNumber <= totalItems ) { $imageAccordion.find(".bdt-ep-image-accordion-item").removeClass("active"); $imageAccordion.children().eq($settings.activeItemNumber - 1).addClass("active"); } // Mouse event $(accordionItem).on($settings.mouse_event, function () { $(this).siblings().removeClass("active"); $(this).addClass("active"); }); // Keyboard focus event $(accordionItem).on('focus', function () { $(this).siblings().removeClass("active"); $(this).addClass("active"); }); // Keydown event for Enter or Space key $(accordionItem).on('keydown', function (e) { if (e.key === "Enter" || e.key === " ") { e.preventDefault(); $(this).siblings().removeClass("active"); $(this).addClass("active"); } }); if ($settings.activeItem != true) { $("body").on($settings.mouse_event, function (e) { if ( e.target.$imageAccordion == "bdt-ep-image-accordion" || $(e.target).closest(".bdt-ep-image-accordion").length ) { // inside accordion, do nothing } else { $imageAccordion.find(".bdt-ep-image-accordion-item").removeClass("active"); } }); } // Swiping (unchanged) function handleSwipe(event) { var deltaX = touchendX - touchstartX; var hasPrev = $(event.currentTarget).prev(); var hasNext = $(event.currentTarget).next(); if (deltaX > 50) { if (hasPrev.length) { $(accordionItem).removeClass("active"); hasPrev.addClass("active"); } } else if (deltaX < -50) { if (hasNext.length) { $(accordionItem).removeClass("active"); hasNext.addClass("active"); } } } if ($settings.swiping) { var touchstartX = 0; var touchendX = 0; $(accordionItem).on("touchstart", function (event) { touchstartX = event.changedTouches[0].screenX; }); $(accordionItem).on("touchend", function (event) { touchendX = event.changedTouches[0].screenX; handleSwipe(event); }); } // Inactive Item if ($settings.inactiveItemOverlay) { $(accordionItem).on($settings.mouse_event, function (event) { event.stopPropagation(); if ($(this).hasClass("active")) { $(this).removeClass("bdt-inactive").siblings().addClass("bdt-inactive"); } else { $(this).siblings().removeClass("bdt-inactive"); } }); $(document).on($settings.mouse_event, function () { $(accordionItem).removeClass("bdt-inactive"); }); } }; jQuery(window).on("elementor/frontend/init", function () { elementorFrontend.hooks.addAction( "frontend/element_ready/bdt-image-accordion.default", widgetImageAccordion ); }); })(jQuery, window.elementorFrontend); /** * Start image compare widget script */ ( function( $, elementor ) { 'use strict'; var widgetImageCompare = function( $scope, $ ) { var $image_compare_main = $scope.find('.bdt-image-compare'); var $image_compare = $scope.find('.image-compare'); if ( !$image_compare.length ) { return; } var $settings = $image_compare.data('settings'); var sanitizeHTML = function(str) { return str.replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); }; var default_offset_pct = $settings.default_offset_pct, orientation = $settings.orientation, before_label = sanitizeHTML($settings.before_label || ''), after_label = sanitizeHTML($settings.after_label || ''), no_overlay = $settings.no_overlay, on_hover = $settings.on_hover, add_circle_blur = $settings.add_circle_blur, add_circle_shadow = $settings.add_circle_shadow, add_circle = $settings.add_circle, smoothing = $settings.smoothing, smoothing_amount = $settings.smoothing_amount, bar_color = $settings.bar_color, move_slider_on_hover = $settings.move_slider_on_hover; var viewers = document.querySelectorAll('#' + $settings.id); var options = { // UI Theme Defaults controlColor : bar_color, controlShadow: add_circle_shadow, addCircle : add_circle, addCircleBlur: add_circle_blur, // Label Defaults showLabels : no_overlay, labelOptions : { before : before_label, after : after_label, onHover : on_hover }, // Smoothing smoothing : smoothing, smoothingAmount: smoothing_amount, // Other options hoverStart : move_slider_on_hover, verticalMode : orientation, startingPoint : default_offset_pct, fluidMode : false }; viewers.forEach(function (element){ var view = new ImageCompare(element, options).mount(); }); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-compare.default', widgetImageCompare ); }); }( jQuery, window.elementorFrontend ) ); /** * End image compare widget script */ /** * Start image magnifier widget script */ ( function( $, elementor ) { 'use strict'; var widgetImageMagnifier = function( $scope, $ ) { var $imageMagnifier = $scope.find( '.bdt-image-magnifier' ), settings = $imageMagnifier.data('settings'), magnifier = $imageMagnifier.find('> .bdt-image-magnifier-image'); if ( ! $imageMagnifier.length ) { return; } $(magnifier).ImageZoom(settings); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-magnifier.default', widgetImageMagnifier ); }); }( jQuery, window.elementorFrontend ) ); /** * End image magnifier widget script */ /** * Start price table widget script */ ( function( $, elementor ) { 'use strict'; var widgetImageStack = function( $scope, $ ) { var $imageStack = $scope.find( '.bdt-image-stack' ); if ( ! $imageStack.length ) { return; } var $tooltip = $imageStack.find('.bdt-tippy-tooltip'), widgetID = $scope.data('id'); $tooltip.each( function( index ) { tippy( this, { allowHTML: true, theme: 'bdt-tippy-' + widgetID }); }); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-image-stack.default', widgetImageStack ); }); }( jQuery, window.elementorFrontend ) ); /** * End price table widget script */ /** * Start marker widget script */ ( function( $, elementor ) { 'use strict'; var widgetIconMobileMenu = function( $scope, $ ) { var $marker = $scope.find( '.bdt-icon-mobile-menu-wrap' ); if ( ! $marker.length ) { return; } var $tooltip = $marker.find('ul > li > .bdt-tippy-tooltip'), widgetID = $scope.data('id'); $tooltip.each( function( index ) { tippy( this, { allowHTML: true, theme: 'bdt-tippy-' + widgetID }); }); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-icon-mobile-menu.default', widgetIconMobileMenu ); }); }( jQuery, window.elementorFrontend ) ); /** * End marker widget script */ /** * Start logo grid widget script */ (function($, elementor) { 'use strict'; var widgetLogoGrid = function($scope, $) { var $logogrid = $scope.find('.bdt-logo-grid-wrapper'); if (!$logogrid.length) { return; } var $tooltip = $logogrid.find('> .bdt-tippy-tooltip'), widgetID = $scope.data('id'); $tooltip.each(function(index) { tippy(this, { allowHTML: true, theme: 'bdt-tippy-' + widgetID }); }); }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-logo-grid.default', widgetLogoGrid); }); }(jQuery, window.elementorFrontend)); /** * Start open street map widget script */ ( function( $, elementor ) { 'use strict'; var widgetOpenStreetMap = function( $scope, $ ) { var $openStreetMap = $scope.find( '.bdt-open-street-map' ), settings = $openStreetMap.data('settings'), markers = $openStreetMap.data('map_markers'), tileSource = ''; if ( ! $openStreetMap.length ) { return; } var avdOSMap = L.map($openStreetMap[0], { zoomControl: settings.zoomControl, scrollWheelZoom: false }).setView([ settings.lat, settings.lng ], settings.zoom ); if (settings.mapboxToken !== '' && settings.mapboxToken !== false) { tileSource = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=' + settings.mapboxToken; L.tileLayer( tileSource, { maxZoom: 18, attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox', id: 'mapbox/streets-v11', tileSize: 512, zoomOffset: -1 }).addTo(avdOSMap); } else { L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: '© OpenStreetMap contributors' }).addTo(avdOSMap); } for (var i in markers) { if( (markers[i]['iconUrl']) != '' && typeof (markers[i]['iconUrl']) !== 'undefined'){ var LeafIcon = L.Icon.extend({ options: { iconSize : [25, 41], iconAnchor : [12, 41], popupAnchor: [2, -41] } }); var greenIcon = new LeafIcon({iconUrl: markers[i]['iconUrl'] }); // Create a safe popup content that allows HTML formatting but prevents XSS var popupContent = document.createElement('div'); popupContent.innerHTML = markers[i]['infoWindow']; // Remove any script tags and event handlers for security var scripts = popupContent.querySelectorAll('script'); for (var j = 0; j < scripts.length; j++) { scripts[j].remove(); } // Remove any elements with event handlers var elementsWithEvents = popupContent.querySelectorAll('[onclick], [onload], [onerror], [onmouseover], [onmouseout]'); for (var k = 0; k < elementsWithEvents.length; k++) { elementsWithEvents[k].removeAttribute('onclick'); elementsWithEvents[k].removeAttribute('onload'); elementsWithEvents[k].removeAttribute('onerror'); elementsWithEvents[k].removeAttribute('onmouseover'); elementsWithEvents[k].removeAttribute('onmouseout'); } L.marker( [markers[i]['lat'], markers[i]['lng']], {icon: greenIcon} ).bindPopup(popupContent).addTo(avdOSMap); } else { if( (markers[i]['lat']) != '' && typeof (markers[i]['lat']) !== 'undefined'){ // Create a safe popup content that allows HTML formatting but prevents XSS var popupContent = document.createElement('div'); popupContent.innerHTML = markers[i]['infoWindow']; // Remove any script tags and event handlers for security var scripts = popupContent.querySelectorAll('script'); for (var j = 0; j < scripts.length; j++) { scripts[j].remove(); } // Remove any elements with event handlers var elementsWithEvents = popupContent.querySelectorAll('[onclick], [onload], [onerror], [onmouseover], [onmouseout]'); for (var k = 0; k < elementsWithEvents.length; k++) { elementsWithEvents[k].removeAttribute('onclick'); elementsWithEvents[k].removeAttribute('onload'); elementsWithEvents[k].removeAttribute('onerror'); elementsWithEvents[k].removeAttribute('onmouseover'); elementsWithEvents[k].removeAttribute('onmouseout'); } L.marker( [markers[i]['lat'], markers[i]['lng']] ).bindPopup(popupContent).addTo(avdOSMap); } } } }; jQuery(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction( 'frontend/element_ready/bdt-open-street-map.default', widgetOpenStreetMap ); }); }( jQuery, window.elementorFrontend ) ); /** * End open street map widget script */ /** * Start panel slider widget script */ (function ($, elementor) { 'use strict'; var widgetPanelSlider = function ($scope, $) { var $slider = $scope.find('.bdt-panel-slider'); if (!$slider.length) { return; } var $sliderContainer = $slider.find('.swiper-carousel'), $settings = $slider.data('settings'), $widgetSettings = $slider.data('widget-settings'); const Swiper = elementorFrontend.utils.swiper; initSwiper(); async function initSwiper() { var swiper = await new Swiper($sliderContainer, $settings); if ($settings.pauseOnHover) { $($sliderContainer).hover(function () { (this).swiper.autoplay.stop(); }, function () { (this).swiper.autoplay.start(); }); } }; if ($widgetSettings.mouseInteractivity == true) { setTimeout(() => { var data = $($widgetSettings.id).find('.bdt-panel-slide-item'); $(data).each((index, element) => { var scene = $(element).get(0); var parallaxInstance = new Parallax(scene, { selector: '.bdt-panel-slide-thumb', hoverOnly: true, pointerEvents: true }); }); }, 2000); } }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.default', widgetPanelSlider); elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.bdt-middle', widgetPanelSlider); elementorFrontend.hooks.addAction('frontend/element_ready/bdt-panel-slider.always-visible', widgetPanelSlider); }); }(jQuery, window.elementorFrontend)); /** * End panel slider widget script */ /** * Start progress pie widget script */ (function ($, elementor) { 'use strict'; var widgetProgressPie = function ($scope, $) { var $progressPie = $scope.find('.bdt-progress-pie'); if (!$progressPie.length) { return; } epObserveTarget($scope[0], function () { var $this = $($progressPie); $this.asPieProgress({ namespace: 'pieProgress', classes: { svg: 'bdt-progress-pie-svg', number: 'bdt-progress-pie-number', content: 'bdt-progress-pie-content' } }); $this.asPieProgress('start'); }, { root: null, // Use the viewport as the root rootMargin: '0px', // No margin around the root threshold: 1 // 80% visibility (1 - 0.8) }); }; jQuery(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/bdt-progress-pie.default', widgetProgressPie); }); }(jQuery, window.elementorFrontend)); /** * End progress pie widget script */ /** * Start reading progress widget script */ (function($, elementor) { 'use strict'; var readingProgressWidget = function($scope, $) { var $readingProgress = $scope.find('.bdt-reading-progress'); if (!$readingProgress.length) { return; } var $settings = $readingProgress.data('settings'); jQuery(document).ready(function(){ var settings = { borderSize: 10, mainBgColor: '#E6F4F7', lightBorderColor: '#A2ECFB', darkBorderColor: '#39B4CC' }; var colorBg = $settings.progress_bg; //'red' var progressColor = $settings.scroll_bg; //'green'; var innerHeight, offsetHeight, netHeight, self = this, container = $($readingProgress), borderContainer = 'bdt-reading-progress-border', circleContainer = 'bdt-reading-progress-circle', textContainer = 'bdt-reading-progress-text'; var getHeight = function () { innerHeight = window.innerHeight; offsetHeight = document.body.offsetHeight; netHeight = offsetHeight - innerHeight; }; var addEvent = function () { var e = document.createEvent('Event'); e.initEvent('scroll', false, false); window.dispatchEvent(e); }; var updateProgress = function (percnt) { var per = Math.round(100 * percnt); if (typeof percnt !== 'number' || !isFinite(percnt) || per < 0 || per > 100) { per = 0; } var deg = per * 360 / 100; if (deg <= 180) { $('.' + borderContainer, container).css('background-image', 'linear-gradient(' + (90 + deg) + 'deg, transparent 50%, ' + colorBg + ' 50%),linear-gradient(90deg, ' + colorBg + ' 50%, transparent 50%)'); } else { $('.' + borderContainer, container).css('background-image', 'linear-gradient(' + (deg - 90) + 'deg, transparent 50%, ' + progressColor + ' 50%),linear-gradient(90deg, ' + colorBg + ' 50%, transparent 50%)'); } $('.' + textContainer, container).text(per + '%'); }; var prepare = function () { $(container).html("