diff --git a/assets/front-end/js/view/filterable-gallery.js b/assets/front-end/js/view/filterable-gallery.js index f9aa19d90..e8b91074f 100644 --- a/assets/front-end/js/view/filterable-gallery.js +++ b/assets/front-end/js/view/filterable-gallery.js @@ -93,7 +93,7 @@ /*! no static exports found */ /***/ (function(module, exports) { -eval("function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\njQuery(window).on(\"elementor/frontend/init\", function () {\n function getVideoId(url) {\n var vimeoMatch = url.match(/\\/\\/(?:player\\.)?vimeo.com\\/(?:video\\/)?([0-9]+)/);\n if (vimeoMatch) {\n return vimeoMatch[1];\n }\n var youtubeMatch = url.match(/(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com\\/(?:[^\\/\\n\\s]+\\/\\S+\\/|(?:v|e(?:mbed)?)\\/|\\S*?[?&]v=)|youtu\\.be\\/)([a-zA-Z0-9_-]{11})/);\n if (youtubeMatch) {\n return youtubeMatch[1];\n }\n return null;\n }\n function shuffleGalleryItems(items) {\n for (var i = 0; i < items.length - 1; i++) {\n var j = i + Math.floor(Math.random() * (items.length - i));\n var temp = items[j];\n items[j] = items[i];\n items[i] = temp;\n }\n return items;\n }\n function manageNotFoundDiv($isotope_gallery, $scope, $) {\n var notFoundDiv = $(\"#eael-fg-no-items-found\", $scope),\n minHeight = notFoundDiv.css(\"font-size\");\n $(\".eael-filter-gallery-container\", $scope).css(\"min-height\", parseInt(minHeight) * 2 + \"px\");\n if (!$isotope_gallery.data(\"isotope\").filteredItems.length) {\n $(\"#eael-fg-no-items-found\", $scope).show();\n } else {\n $(\"#eael-fg-no-items-found\", $scope).hide();\n }\n }\n var filterableGalleryHandler = function filterableGalleryHandler($scope, $) {\n var _localize;\n var filterControls = $scope.find(\".fg-layout-3-filter-controls\").eq(0),\n filterTrigger = $scope.find(\"#fg-filter-trigger\"),\n form = $scope.find(\".fg-layout-3-search-box\"),\n input = $scope.find(\"#fg-search-box-input\"),\n searchRegex,\n buttonFilter,\n timer,\n fg_mfp_counter_text = (_localize = localize) === null || _localize === void 0 || (_localize = _localize.eael_translate_text) === null || _localize === void 0 ? void 0 : _localize.fg_mfp_counter_text;\n fg_mfp_counter_text = fg_mfp_counter_text ? \"%curr% \" + fg_mfp_counter_text + \" %total%\" : \"%curr% of %total%\";\n var $galleryWrap = $(\".eael-filter-gallery-wrapper\", $scope);\n var custom_default_control = $galleryWrap.data(\"custom_default_control\");\n var default_control_key = $galleryWrap.data(\"default_control_key\");\n custom_default_control = typeof custom_default_control !== \"undefined\" ? parseInt(custom_default_control) : 0;\n default_control_key = typeof default_control_key !== \"undefined\" ? parseInt(default_control_key) : 0;\n var scrollToTop = function scrollToTop() {\n if ($settings.mobile_scroll_to_top === \"yes\" && window.innerWidth <= 767) {\n var $container = $(\".eael-filter-gallery-container\", $scope);\n if ($container.length) {\n var offset = typeof $settings.mobile_scroll_offset === \"number\" ? $settings.mobile_scroll_offset : 0;\n $(\"html, body\").animate({\n scrollTop: $container.offset().top - offset\n }, 600);\n }\n }\n };\n if (form.length) {\n form.on(\"submit\", function (e) {\n e.preventDefault();\n });\n }\n filterTrigger.on(\"click\", function () {\n filterControls.toggleClass(\"open-filters\");\n });\n filterTrigger.on(\"blur\", function () {\n filterControls.removeClass(\"open-filters\");\n });\n $scope.on(\"click\", \".video-popup.eael-magnific-video-link.playout-vertical\", function () {\n setTimeout(function () {\n $(\".mfp-iframe-holder\").addClass(\"eael-gf-vertical-video-popup\");\n }, 1);\n });\n $(\".eael-magnific-link\", $scope).on(\"click\", function () {\n setTimeout(function () {\n $(\".mfp-wrap\").addClass(\"eael-gf-mfp-popup\");\n }, 1);\n });\n $(document).on(\"click\", \".mfp-arrow.mfp-arrow-left, .mfp-arrow.mfp-arrow-right\", function () {\n setTimeout(function () {\n var container = $(\".eael-gf-mfp-popup .mfp-container\");\n if (container.hasClass(\"mfp-iframe-holder\")) {\n var src = $(\"iframe\", container).length ? $(\"iframe\", container).attr(\"src\") : $(\"video\", container).attr(\"src\"),\n plyBtn = $('a[href=\"' + src + '\"]');\n if (plyBtn.length < 1) {\n var videoId = getVideoId(src),\n plyBtn = $('a[href*=\"' + videoId + '\"]');\n }\n if (plyBtn.hasClass(\"playout-vertical\")) {\n container.addClass(\"eael-gf-vertical-video-popup\");\n } else {\n container.removeClass(\"eael-gf-vertical-video-popup\");\n }\n }\n }, 1);\n });\n if (!isEditMode) {\n var $gallery = $(\".eael-filter-gallery-container\", $scope),\n $settings = $gallery.data(\"settings\"),\n fg_items = JSON.parse(atob($gallery.data(\"gallery-items\"))),\n $layout_mode = $settings.grid_style === \"masonry\" ? \"masonry\" : \"fitRows\",\n $gallery_enabled = $settings.gallery_enabled === \"yes\",\n $images_per_page = $gallery.data(\"images-per-page\"),\n $init_show_setting = $gallery.data(\"init-show\"),\n $is_randomize = $gallery.data(\"is-randomize\");\n isRTL = $(\"body\").hasClass(\"rtl\");\n fg_items = fg_items.map(function (item) {\n return DOMPurify.sanitize(item);\n });\n if (\"yes\" === $is_randomize) {\n fg_items = shuffleGalleryItems(fg_items);\n $gallery.empty();\n for (var i = 0; i < $init_show_setting; i++) {\n $gallery.append(fg_items[i]);\n }\n }\n fg_items.splice(0, $init_show_setting);\n\n // init isotope\n var gwrap = $(\".eael-filter-gallery-wrapper\");\n var layoutMode = gwrap.data(\"layout-mode\");\n var $isotope_gallery = $gallery.isotope({\n itemSelector: \".eael-filterable-gallery-item-wrap\",\n layoutMode: $layout_mode,\n percentPosition: true,\n stagger: 30,\n transitionDuration: $settings.duration + \"ms\",\n isOriginLeft: !isRTL,\n filter: function filter() {\n var $this = $(this);\n var $result = searchRegex ? $this.text().match(searchRegex) : true;\n if (buttonFilter === undefined) {\n if (layoutMode !== \"layout_3\") {\n buttonFilter = $scope.find(\".eael-filter-gallery-control ul li\").first().data(\"filter\");\n } else {\n buttonFilter = $scope.find(\".fg-layout-3-filter-controls li\").first().data(\"filter\");\n }\n }\n var buttonResult = buttonFilter ? $this.is(buttonFilter) : true;\n return $result && buttonResult;\n }\n });\n\n // Popup\n $($scope).magnificPopup({\n delegate: \".eael-filterable-gallery-item-wrap:not([style*='display: none']) .eael-magnific-link.active\",\n type: \"image\",\n gallery: {\n enabled: $gallery_enabled,\n tCounter: fg_mfp_counter_text\n },\n iframe: {\n markup: \"