// KefinTweaks Skin Manager Configuration UI // Modular configuration modal for managing skins, themes, and optional includes (function() { 'use strict'; const LOG = (...args) => console.log('[KefinTweaks SkinManager Config]', ...args); const ERR = (...args) => console.error('[KefinTweaks SkinManager Config]', ...args); const WARN = (...args) => console.warn('[KefinTweaks SkinManager Config]', ...args); const MODAL_ID = 'kefin-skinmanager-config'; // Store loaded config for use in listeners let currentLoadedConfig = null; function hasDefaultSkinsCatalog() { const skins = window.KefinTweaksDefaultSkinsConfig?.skins; return Array.isArray(skins) && skins.length > 0; } function notifySkinManagerConfig(message) { if (window.KefinTweaksToaster?.toast) { window.KefinTweaksToaster.toast(message); } else { alert(message); } } // Helper function to build Jellyfin checkbox function buildJellyfinCheckbox(id, checked, label, dataAttributes = {}) { let className = 'emby-checkbox'; const otherAttrs = {}; for (const [key, value] of Object.entries(dataAttributes)) { if (key === 'class') { className += ' ' + value; } else { otherAttrs[key] = value; } } const dataAttrs = Object.entries(otherAttrs).map(([key, value]) => `${key}="${value}"`).join(' '); const checkedAttr = checked ? 'checked' : ''; return `