document.addEventListener('DOMContentLoaded', function() {
setTimeout(function() {
// Find all tab content elements
const tabContents = document.querySelectorAll('.e-n-tabs-content > div[id^="e-n-tab-content-"]');
tabContents.forEach(function(tabContent) {
// A tab is considered empty only if it has no children at all
// OR if it only has empty container elements
let isEmpty = true;
// If the tab has any HTML content at all (not just whitespace)
if (tabContent.innerHTML.trim() !== '') {
// Check for any actual content
// This will detect images, videos, text, buttons, etc.
const allElements = tabContent.querySelectorAll('*');
for (let i = 0; i < allElements.length; i++) {
const element = allElements[i];
// Check if this is a container element
const isContainer = element.tagName === 'DIV' ||
element.tagName === 'SECTION' ||
element.classList.contains('e-con') ||
element.classList.contains('e-con-inner');
// If it's not just a container, the tab has content
if (!isContainer || element.innerHTML.trim() !== '') {
isEmpty = false;
break;
}
}
}
// If the tab is truly empty, hide it
if (isEmpty) {
// Get the tab ID
const tabId = tabContent.getAttribute('id');
// Find the corresponding tab title
const tabTitle = document.querySelector(`button[aria-controls="${tabId}"]`);
if (tabTitle) {
// Hide the tab title
tabTitle.style.display = 'none';
}
}
});
}, 800);
});