// source --> https://elanillounico.com/wp-content/plugins/buddypress/bp-core/js/vendor/livestamp.min.js?ver=14.4.0 
!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):t(jQuery,moment)}(function(o,m){function a(t,e){var a=t.data("livestampdata");"number"==typeof e&&(e*=1e3),t.removeAttr("data-livestamp").removeData("livestamp"),e=m(e),m.isMoment(e)&&!isNaN(+e)&&((a=o.extend({},{original:t.contents()},a)).moment=m(e),t.data("livestampdata",a).empty(),u.push(t[0]))}function t(){n||(i.update(),setTimeout(t,e))}var e=1e3,n=!1,u=o([]),i={update:function(){o("[data-livestamp]").each(function(){var t=o(this);a(t,t.data("livestamp"))});var i=[];u.each(function(){var t,e,a=o(this),n=a.data("livestampdata");void 0===n?i.push(this):m.isMoment(n.moment)&&(t=a.html())!=(n=n.moment.fromNow())&&(e=o.Event("change.livestamp"),a.trigger(e,[t,n]),e.isDefaultPrevented()||a.html(n))}),delete(u=u.not(i)).prevObject},pause:function(){n=!0},resume:function(){n=!1,t()},interval:function(t){if(void 0===t)return e;e=t}},r={add:function(t,e){return"number"==typeof e&&(e*=1e3),e=m(e),m.isMoment(e)&&!isNaN(+e)&&(t.each(function(){a(o(this),e)}),i.update()),t},destroy:function(a){return u=u.not(a),a.each(function(){var t=o(this),e=t.data("livestampdata");if(void 0===e)return a;t.html(e.original||"").removeData("livestampdata")}),a},isLivestamp:function(t){return void 0!==t.data("livestampdata")}};o.livestamp=i,o(function(){i.resume()}),o.fn.livestamp=function(t,e){return r[t]||(e=t,t="add"),r[t](this,e)}});
// source --> https://elanillounico.com/wp-content/plugins/efemerides/public/slider.js?ver=1.0 
jQuery(document).ready(function($) {
    var currentSlide = 0;
    var slides = $('.efemerides-slider .slide');
    var numSlides = slides.length;

    if (numSlides > 1) {
        slides.hide();
        slides.eq(currentSlide).show();

        setInterval(function() {
            slides.eq(currentSlide).fadeOut(600, function() {
                currentSlide = (currentSlide + 1) % numSlides;
                slides.eq(currentSlide).fadeIn(600);
            });
        }, 5000); // Intervalo de 5 segundos
    }
});
// source --> https://elanillounico.com/wp-content/plugins/bbpress/templates/default/js/editor.min.js?ver=2.6.14 
/*! This file is automatically generated. */

jQuery(document).ready(function(){"undefined"!=typeof edButtons&&(edButtons[110]=new QTags.TagButton("code","code","`","`","c"),QTags._buttonsInit()),jQuery("#bbp_topic_title").bind("keydown.editor-focus",function(e){if(9===e.which&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){if("undefined"!=typeof tinymce)if(tinymce.activeEditor.isHidden())jQuery("textarea.bbp-the-content").focus();else{var t=tinymce.activeEditor.editorContainer;jQuery("#"+t+" td.mceToolbar > a").focus()}else jQuery("textarea.bbp-the-content").focus();e.preventDefault()}}),jQuery("#bbp_topic_tags").bind("keydown.editor-focus",function(e){if(9===e.which&&e.shiftKey&&!e.ctrlKey&&!e.altKey){if("undefined"!=typeof tinymce)if(tinymce.activeEditor.isHidden())jQuery("textarea.bbp-the-content").focus();else{var t=tinymce.activeEditor.editorContainer;jQuery("#"+t+" td.mceToolbar > a").focus()}else jQuery("textarea.bbp-the-content").focus();e.preventDefault()}})});
// source --> https://elanillounico.com/wp-content/plugins/eau-imagenes/assets/frontend/lightbox.js?ver=1.2.1 
(function () {
    'use strict';

    var links = [];
    var currentIndex = -1;
    var overlay = null;
    var picture = null;
    var caption = null;
    var closeButton = null;
    var previousButton = null;
    var nextButton = null;
    var lightboxSelector = '[data-eau-lightbox="1"], .entry-content a.ngg-fancybox[href]';
    var imageUrlPattern = /\.(?:avif|webp|jpe?g|png|gif)(?:[?#].*)?$/i;

    function collectLinks() {
        links = Array.prototype.slice.call(document.querySelectorAll(lightboxSelector)).filter(isLightboxLink);
    }

    function isLightboxLink(link) {
        if (!link || link.getAttribute('data-eau-no-lightbox') === '1') {
            return false;
        }

        if (link.getAttribute('data-eau-lightbox') === '1') {
            return true;
        }

        return imageUrlPattern.test(getFullSrc(link));
    }

    function getLightboxLink(target) {
        var link = target.closest(lightboxSelector);
        return isLightboxLink(link) ? link : null;
    }

    function getFullSrc(link) {
        return link.getAttribute('data-full-src') || link.getAttribute('data-src') || link.href || '';
    }

    function getCaption(link) {
        var figure = link.closest('figure');
        var figcaption = figure ? figure.querySelector('figcaption') : null;

        return link.getAttribute('data-caption') ||
            link.getAttribute('data-title') ||
            (figcaption ? figcaption.textContent.trim() : '');
    }

    function getAlt(link) {
        var image = link.querySelector('img');

        return link.getAttribute('data-alt') ||
            (image ? image.getAttribute('alt') || '' : '') ||
            getCaption(link);
    }

    function createOverlay() {
        if (overlay) {
            return;
        }

        overlay = document.createElement('div');
        overlay.className = 'eau-lightbox';
        overlay.setAttribute('role', 'dialog');
        overlay.setAttribute('aria-modal', 'true');
        overlay.setAttribute('aria-hidden', 'true');

        closeButton = document.createElement('button');
        closeButton.type = 'button';
        closeButton.className = 'eau-lightbox__button eau-lightbox__close';
        closeButton.setAttribute('aria-label', 'Cerrar imagen');
        closeButton.textContent = 'x';

        previousButton = document.createElement('button');
        previousButton.type = 'button';
        previousButton.className = 'eau-lightbox__button eau-lightbox__previous';
        previousButton.setAttribute('aria-label', 'Imagen anterior');
        previousButton.textContent = '<';

        nextButton = document.createElement('button');
        nextButton.type = 'button';
        nextButton.className = 'eau-lightbox__button eau-lightbox__next';
        nextButton.setAttribute('aria-label', 'Imagen siguiente');
        nextButton.textContent = '>';

        picture = document.createElement('picture');
        picture.className = 'eau-lightbox__picture';

        caption = document.createElement('div');
        caption.className = 'eau-lightbox__caption';

        overlay.appendChild(closeButton);
        overlay.appendChild(previousButton);
        overlay.appendChild(nextButton);
        overlay.appendChild(picture);
        overlay.appendChild(caption);
        document.body.appendChild(overlay);

        closeButton.addEventListener('click', closeLightbox);
        previousButton.addEventListener('click', function () {
            showImage(currentIndex - 1);
        });
        nextButton.addEventListener('click', function () {
            showImage(currentIndex + 1);
        });
        overlay.addEventListener('click', function (event) {
            if (event.target === overlay) {
                closeLightbox();
            }
        });
    }

    function setPicture(link) {
        var full = getFullSrc(link);
        var avif = link.getAttribute('data-avif-src') || '';
        var webp = link.getAttribute('data-webp-src') || '';
        var alt = getAlt(link);
        var text = getCaption(link);
        var html = '';

        if (avif) {
            html += '<source type="image/avif" srcset="' + escapeAttribute(avif) + '">';
        }
        if (webp) {
            html += '<source type="image/webp" srcset="' + escapeAttribute(webp) + '">';
        }
        html += '<img src="' + escapeAttribute(full) + '" alt="' + escapeAttribute(alt) + '">';

        picture.innerHTML = html;
        caption.textContent = text;
        caption.hidden = !text;
    }

    function showImage(index) {
        if (!links.length) {
            return;
        }

        if (index < 0) {
            index = links.length - 1;
        } else if (index >= links.length) {
            index = 0;
        }

        currentIndex = index;
        setPicture(links[currentIndex]);
        previousButton.hidden = links.length < 2;
        nextButton.hidden = links.length < 2;
    }

    function openLightbox(index) {
        createOverlay();
        showImage(index);
        overlay.classList.add('is-open');
        overlay.setAttribute('aria-hidden', 'false');
        document.documentElement.classList.add('eau-lightbox-open');
        closeButton.focus();
    }

    function closeLightbox() {
        if (!overlay) {
            return;
        }

        overlay.classList.remove('is-open');
        overlay.setAttribute('aria-hidden', 'true');
        document.documentElement.classList.remove('eau-lightbox-open');
    }

    function escapeAttribute(value) {
        return String(value).replace(/[&<>"']/g, function (character) {
            return {
                '&': '&amp;',
                '<': '&lt;',
                '>': '&gt;',
                '"': '&quot;',
                "'": '&#039;'
            }[character];
        });
    }

    document.addEventListener('click', function (event) {
        var link = getLightboxLink(event.target);
        if (!link) {
            return;
        }

        collectLinks();
        var index = links.indexOf(link);
        if (index < 0) {
            return;
        }

        event.preventDefault();
        openLightbox(index);
    });

    document.addEventListener('keydown', function (event) {
        if (!overlay || !overlay.classList.contains('is-open')) {
            return;
        }

        if (event.key === 'Escape') {
            closeLightbox();
        } else if (event.key === 'ArrowLeft') {
            showImage(currentIndex - 1);
        } else if (event.key === 'ArrowRight') {
            showImage(currentIndex + 1);
        }
    });
}());