(function ($) { const WCF_Feature_Posts = function ($scope, $) { const $popup_id = $scope.attr('data-id'); let popup_content = $(`.wcf--popup-video-wrapper`).first(); // Move popup content to body if not already moved if (!popup_content.parent().is('body')) { if (!$('body > .wcf--popup-video-wrapper').length) { popup_content.appendTo('body'); } } const open_popup = $(`.elementor-element-${$popup_id} .wcf-post-popup,.wcf-post-popup`); open_popup.each(function (index) { $(this).next('.wcf--popup-video-wrapper').remove(); $(this).off('click').on('click', function () { let $_url = $(this).attr('data-src'); $(`.wcf--popup-video-wrapper`).find('.aae-popup-content-container').html(''); if ($(this).hasClass('audio')) { $('.wcf--popup-video-wrapper').find('.aae-popup-content-container').html(`