'):n+='
',n+='
'+a[i]+"
",(d[i]||[]).forEach(function(c){n+='
'+c[1]+'#000000
'}),n+="
"}),n}function w(){return window.THEMES.map(function(a){return'
"}).join("")}var H='
Theme Builder
Sample Card
Secondary text preview
ONOFF
Online Offline
'+T()+'
';injectModal("theme-builder-modal",H);var E=document.getElementById("theme-builder-modal"),$=document.getElementById("theme-builder-start"),I=document.getElementById("theme-builder-name"),L=document.getElementById("theme-builder-edit-select"),j=document.getElementById("theme-builder-existing"),M=document.getElementById("theme-builder-lightbg"),O=E.querySelectorAll(".theme-builder-color"),x=document.getElementById("theme-builder-advanced"),D=document.getElementById("theme-builder-advanced-toggle"),y=document.getElementById("theme-builder-export"),m=!1;D.addEventListener("click",function(){m=!m,x.style.display=m?"":"none",D.innerHTML=m?"Hide advanced colors ▲":"Show advanced colors ▼"});function b(){var a={};return O.forEach(function(d){a[d.dataset.prop]=d.value}),a["card-bg"]=a["card-base"],a}function p(){var a={};return O.forEach(function(d){d.dataset.advanced||(a[d.dataset.prop]=d.value)}),a["card-bg"]=a["card-base"],M.checked&&(a.lightBg=!0),a}function v(){var a=p(),d=window.deriveExtendedColors?window.deriveExtendedColors(a):{};O.forEach(function(n){if(n.dataset.advanced&&!A[n.dataset.prop]){var i=d[n.dataset.prop]||"#333333";n.value=i;var c=E.querySelector('[data-hex="'+n.dataset.prop+'"]');c&&(c.textContent=i.toUpperCase())}})}function s(a){var d=window.THEME_COLORS[a];d&&(A={},O.forEach(function(n){var i=d[n.dataset.prop]||"#000000";(i.startsWith("rgba")||i.startsWith("color-mix"))&&(i="#333333"),n.value=i;var c=E.querySelector('[data-hex="'+n.dataset.prop+'"]');c&&(c.textContent=i.toUpperCase())}),M.checked=!!d.lightBg,r())}function l(a){var d=safeGetJSON(window.USER_THEMES_KEY,{}),n=d[a];n&&(A={},O.forEach(function(i){var c=n[i.dataset.prop]||"#000000";i.value=c;var C=E.querySelector('[data-hex="'+i.dataset.prop+'"]');C&&(C.textContent=c.toUpperCase()),i.dataset.advanced&&n[i.dataset.prop]&&(A[i.dataset.prop]=!0)}),I.value=n.name||"",M.checked=!!n.lightBg,v(),r())}function r(){var a=b(),d=document.getElementById("theme-builder-preview"),n=document.getElementById("theme-preview-card"),i=n.querySelector(".preview-title"),c=n.querySelector(".preview-muted"),C=document.getElementById("preview-badge-ok"),B=document.getElementById("preview-badge-bad"),F=document.getElementById("preview-dot-ok"),q=document.getElementById("preview-dot-bad"),U=document.getElementById("preview-accent-btn"),G=n.querySelector(".preview-dots");d.style.background=a.bg,n.style.background=a["card-base"],n.style.borderColor=a.border,i.style.color=a.fg,c.style.color=a.muted,C.style.background=a["ok-bg"],C.style.color=a["ok-fg"],B.style.background=a["bad-bg"],B.style.color=a["bad-fg"],F.style.background=a["dot-ok"],q.style.background=a["dot-bad"],G.style.color=a.fg,U.style.background=a.accent,U.style.color=a.bg}function f(a){var d=window.deriveExtendedColors?window.deriveExtendedColors(a):{};window.THEME_PROPS.forEach(function(n){var i=a[n]||d[n];i&&document.documentElement.style.setProperty("--"+n,i)})}O.forEach(function(a){a.addEventListener("input",function(){var d=E.querySelector('[data-hex="'+a.dataset.prop+'"]');d&&(d.textContent=a.value.toUpperCase()),a.dataset.advanced?A[a.dataset.prop]=!0:v(),r(),f(b())})}),M.addEventListener("change",function(){v(),r(),f(b())}),$.addEventListener("change",function(){A={},s($.value),f(b())});function u(){var a=safeGetJSON(window.USER_THEMES_KEY,{}),d=Object.keys(a);L.innerHTML='
',d.forEach(function(n){var i=document.createElement("option");i.value=n,i.textContent=a[n].name||n,L.appendChild(i)}),j.style.display=d.length?"":"none"}function t(){$.innerHTML=w()}L.addEventListener("change",function(){var a=this.value;a?(S=a,l(a),f(b())):(S=null,A={},I.value="",$.value=window.getActiveTheme(),s($.value)),y.style.display=S?"":"none"});function e(){h=window.getActiveTheme(),S=null,A={},m=!1,x.style.display="none",D.innerHTML="Show advanced colors ▼",u(),t();var a=safeGetJSON(window.USER_THEMES_KEY,{});a[h]?(L.value=h,S=h,l(h)):(L.value="",I.value="",$.value=h,s(h)),y.style.display=S?"":"none",E.classList.add("show")}var o=document.getElementById("theme-customize-btn");o&&o.addEventListener("click",function(){e()}),document.getElementById("theme-builder-save").addEventListener("click",function(){var a=b(),d=I.value.trim();if(!d){showNotification("Please enter a theme name","warning",3e3),I.focus();return}var n=safeGetJSON(window.USER_THEMES_KEY,{}),i,c=null;if(S){i=S;var C=window.slugifyThemeName(d,S);if(C!==S){c=S,delete n[S];var B=window.THEMES.indexOf(S);B!==-1&&window.THEMES.splice(B,1),delete window.THEME_COLORS[S],i=C}}else i=window.slugifyThemeName(d);var F={name:d};M.checked&&(F.lightBg=!0),window.THEME_PROPS.forEach(function(U){a[U]&&(F[U]=a[U])}),n[i]=F,safeSet(window.USER_THEMES_KEY,JSON.stringify(n)),window.clearCustomProperties(),window.injectUserThemeStyles(),window.applyTheme(i),E.classList.remove("show"),g();var q={};window.THEME_PROPS.forEach(function(U){a[U]&&(q[U]=a[U])}),c&&secureFetch("/api/v1/themes/"+c,{method:"DELETE"}).catch(function(){}),secureFetch("/api/v1/themes/"+i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d,colors:q,lightBg:M.checked})}).then(function(){showNotification(d+" theme saved","success",3e3)}).catch(function(){showNotification(d+" theme saved locally (server sync failed)","warning",3e3)})}),document.getElementById("theme-builder-cancel").addEventListener("click",function(){E.classList.remove("show"),window.clearCustomProperties(),h&&window.applyTheme(h)}),document.getElementById("theme-builder-delete").addEventListener("click",function(){if(S){var a=safeGetJSON(window.USER_THEMES_KEY,{}),d=a[S]?a[S].name:S;if(confirm('Delete "'+d+'" theme?')){var n=S;delete a[n],safeSet(window.USER_THEMES_KEY,JSON.stringify(a));var i=window.THEMES.indexOf(n);i!==-1&&window.THEMES.splice(i,1),delete window.THEME_COLORS[n],window.clearCustomProperties(),window.injectUserThemeStyles();var c=h&&h!==n?h:"dark";window.applyTheme(c),S=null,E.classList.remove("show"),g(),secureFetch("/api/v1/themes/"+n,{method:"DELETE"}).then(function(){showNotification(d+" theme deleted","success",3e3)}).catch(function(){showNotification(d+" theme deleted locally (server sync failed)","warning",3e3)})}}}),document.getElementById("theme-builder-export").addEventListener("click",function(){if(!S){showNotification("Save the theme first, then export","warning",3e3);return}var a=safeGetJSON(window.USER_THEMES_KEY,{}),d=a[S];if(d){var n={_dashcaddy_theme:!0,version:"1.0",exportDate:new Date().toISOString(),slug:S,name:d.name,lightBg:d.lightBg||!1,colors:{}};window.THEME_PROPS.forEach(function(B){d[B]&&(n.colors[B]=d[B])});var i=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),c=URL.createObjectURL(i),C=document.createElement("a");C.href=c,C.download=S+"-theme.json",document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(c),showNotification("Theme exported as "+S+"-theme.json","success",3e3)}}),document.getElementById("theme-builder-import").addEventListener("click",function(){var a=document.createElement("input");a.type="file",a.accept=".json",a.onchange=function(d){var n=d.target.files[0];if(n){var i=new FileReader;i.onload=function(c){try{var C=JSON.parse(c.target.result),B,F,q;if(C._dashcaddy_theme&&C.colors)B=C.name||"Imported",F=C.colors,q=C.lightBg||!1;else if(C.name&&(C.bg||C["card-base"]))B=C.name,F={},window.THEME_PROPS.forEach(function(U){C[U]&&(F[U]=C[U])}),q=C.lightBg||!1;else throw new Error("Not a valid DashCaddy theme file");I.value=B,M.checked=!!q,S=null,L.value="",A={},O.forEach(function(U){var G=F[U.dataset.prop]||"#000000";U.value=G;var J=E.querySelector('[data-hex="'+U.dataset.prop+'"]');J&&(J.textContent=G.toUpperCase()),U.dataset.advanced&&F[U.dataset.prop]&&(A[U.dataset.prop]=!0)}),v(),r(),f(b()),y.style.display="none",showNotification('"'+B+'" loaded into builder. Click Save to keep it.',"success",5e3)}catch(U){showNotification("Import failed: "+U.message,"error",5e3)}},i.readAsText(n)}},a.click()}),wireModal(E),E.addEventListener("click",function(a){a.target===E&&(window.clearCustomProperties(),h&&window.applyTheme(h))})})(),(function(){injectModal("license-modal",`
+
`);const s=document.getElementById("clock-settings-modal"),d=document.getElementById("clock-chimes-toggle"),r=document.getElementById("clock-chime-volume"),f=document.getElementById("clock-volume-section");function v(){const t=safeGet("clock-style")||"default",e=s.querySelector(`input[value="${t}"]`);e&&(e.checked=!0),d.checked=safeGet("clock-chimes")==="true",r.value=safeGet("clock-chime-volume")||"50",f.style.opacity=d.checked?"1":"0.4"}d?.addEventListener("change",()=>{f.style.opacity=d.checked?"1":"0.4"}),document.getElementById("clock-settings")?.addEventListener("click",()=>{v(),s.classList.add("show")}),document.getElementById("clock-chime-test")?.addEventListener("click",()=>{const t=parseInt(r.value,10)/100,e=new Audio("/assets/sounds/church-bell.mp3");e.volume=t,e.play().catch(()=>{})}),document.getElementById("clock-settings-save")?.addEventListener("click",()=>{const t=s.querySelector('input[name="clock-style-radio"]:checked'),e=t?t.value:"default";safeSet("clock-style",e),safeSet("clock-chimes",String(d.checked)),safeSet("clock-chime-volume",r.value),R=e,g="",I(),m(),b(),s.classList.remove("show"),showNotification("Clock settings saved","success",2e3)}),document.getElementById("clock-settings-cancel")?.addEventListener("click",()=>{s.classList.remove("show")}),wireModal(s),s?.querySelectorAll('input[name="clock-style-radio"]').forEach(t=>{t.addEventListener("change",()=>{R=t.value,g="",I(),m()})})})(),(function(){async function h(){try{const P=await(await fetch("/api/v1/health-checks/status")).json();if(!P.success||!P.status)return;for(const[g,L]of Object.entries(P.status)){const w=document.getElementById("uptime-"+g),T=document.getElementById("uptime-bar-"+g);if(!w)continue;const k=L.uptime?.["24h"];if(k!=null){const B=k.toFixed(1);w.textContent=`${B}% uptime`,w.className="uptime-chip",k>=99.9?w.classList.add("excellent"):k>=99?w.classList.add("good"):k>=95?w.classList.add("degraded"):w.classList.add("poor"),T&&(T.style.width=B+"%")}}}catch{console.warn("[Card Badges] Health check API unavailable")}}let S;try{S=new Set(JSON.parse(safeSessionGet("dismissed-updates")||"[]"))}catch{S=new Set}let O=[];async function E(z){try{const g=await(await fetch("/api/v1/updates/available")).json();if(!g.success)return;document.querySelectorAll(".update-available-badge").forEach(w=>w.classList.remove("visible"));const L=g.updates||[];if(O=L,z&&L.length>0){const w=window._lastKnownUpdateCount||0;w>0&&L.length>w&&showNotification(`${L.length} container update(s) available \u2014 click Update Management to review.`,"info"),window._lastKnownUpdateCount=L.length}if(!L.length)return;for(const w of L){const T=window.APPS||[];for(const k of T)if(k.containerId===w.containerId||k.id===w.containerName||k.name===w.containerName){if(S.has(k.id))break;const B=document.getElementById("update-badge-"+k.id),I=document.getElementById("update-btn-"+k.id);B&&(B.classList.add("visible"),B.title="Update available \u2014 click to open Update Management.",B.style.cursor="pointer",B.onclick=C=>{C.stopPropagation(),window.openUpdateModal&&window.openUpdateModal(k.id)}),I&&(I.style.background="#f97316",I.style.borderColor="#f97316",I.style.boxShadow="0 0 6px #f9731688",I.title="Update available \u2014 click to open Update Management.");break}}}catch{console.warn("[Card Badges] Updates API unavailable")}}function N(){setTimeout(()=>{h(),E()},5e3),setInterval(()=>{h(),E(!0)},6e4)}const R=window.refreshAll;R&&(window.refreshAll=async function(){try{await R(),setTimeout(h,1e3)}catch(z){console.warn("[Card Badges] Error in refreshAll hook:",z.message)}}),N()})(),(function(){var h=null,S=null,O={},E={dark:"Dark",light:"Light",blue:"Blue",black:"Black",nord:"Nord",dracula:"Dracula","solarized-dark":"Solarized Dark","solarized-light":"Solarized Light",taxi:"Taxi",ocean:"Ocean"},N=[["bg","Background","base"],["card-base","Card","base"],["fg","Text","base"],["muted","Muted Text","base"],["border","Border","base"],["accent","Accent","accent"],["accent-strong","Accent Strong","accent"],["ok-bg","OK Background","status"],["ok-fg","OK Text","status"],["bad-bg","Error Bg","status"],["bad-fg","Error Text","status"],["dot-ok","Dot OK","status"],["dot-bad","Dot Error","status"],["uptime","Uptime Bar","status"],["hover","Hover","advanced"],["card-hover","Card Hover","advanced"],["base","Tags/Badges","advanced"],["fg-muted","Dim Text","advanced"],["success","Success","advanced"],["error","Error","advanced"],["warning","Warning","advanced"]],R=document.getElementById("theme");if(!R)return;var z=document.getElementById("theme-label");function P(a){if(E[a])return E[a];var l=safeGetJSON(window.USER_THEMES_KEY,{});return l[a]&&l[a].name||a}function g(){z&&(z.textContent=P(window.getActiveTheme()))}R.addEventListener("click",function(){var a=window.THEMES.slice(),l=window.getActiveTheme(),o=a.indexOf(l),i=a[(o+1)%a.length];window.applyTheme(i),g()}),g();function L(){var a={base:"Base Colors",accent:"Accent",status:"Status",advanced:"Advanced (auto-derived)"},l={};N.forEach(function(i){l[i[2]]||(l[i[2]]=[]),l[i[2]].push(i)});var o="";return Object.keys(a).forEach(function(i){i==="advanced"?(o+='
Show advanced colors ▼
',o+='
'):o+='
',o+='
'+a[i]+"
",(l[i]||[]).forEach(function(c){o+='
'+c[1]+'#000000
'}),o+="
"}),o}function w(){return window.THEMES.map(function(a){return'
"}).join("")}var T='
Theme Builder
Sample Card
Secondary text preview
ONOFF
Online Offline
'+L()+'
';injectModal("theme-builder-modal",T);var k=document.getElementById("theme-builder-modal"),B=document.getElementById("theme-builder-start"),I=document.getElementById("theme-builder-name"),C=document.getElementById("theme-builder-edit-select"),j=document.getElementById("theme-builder-existing"),M=document.getElementById("theme-builder-lightbg"),D=k.querySelectorAll(".theme-builder-color"),x=document.getElementById("theme-builder-advanced"),A=document.getElementById("theme-builder-advanced-toggle"),y=document.getElementById("theme-builder-export"),m=!1;A.addEventListener("click",function(){m=!m,x.style.display=m?"":"none",A.innerHTML=m?"Hide advanced colors ▲":"Show advanced colors ▼"});function b(){var a={};return D.forEach(function(l){a[l.dataset.prop]=l.value}),a["card-bg"]=a["card-base"],a}function p(){var a={};return D.forEach(function(l){l.dataset.advanced||(a[l.dataset.prop]=l.value)}),a["card-bg"]=a["card-base"],M.checked&&(a.lightBg=!0),a}function u(){var a=p(),l=window.deriveExtendedColors?window.deriveExtendedColors(a):{};D.forEach(function(o){if(o.dataset.advanced&&!O[o.dataset.prop]){var i=l[o.dataset.prop]||"#333333";o.value=i;var c=k.querySelector('[data-hex="'+o.dataset.prop+'"]');c&&(c.textContent=i.toUpperCase())}})}function s(a){var l=window.THEME_COLORS[a];l&&(O={},D.forEach(function(o){var i=l[o.dataset.prop]||"#000000";(i.startsWith("rgba")||i.startsWith("color-mix"))&&(i="#333333"),o.value=i;var c=k.querySelector('[data-hex="'+o.dataset.prop+'"]');c&&(c.textContent=i.toUpperCase())}),M.checked=!!l.lightBg,r())}function d(a){var l=safeGetJSON(window.USER_THEMES_KEY,{}),o=l[a];o&&(O={},D.forEach(function(i){var c=o[i.dataset.prop]||"#000000";i.value=c;var $=k.querySelector('[data-hex="'+i.dataset.prop+'"]');$&&($.textContent=c.toUpperCase()),i.dataset.advanced&&o[i.dataset.prop]&&(O[i.dataset.prop]=!0)}),I.value=o.name||"",M.checked=!!o.lightBg,u(),r())}function r(){var a=b(),l=document.getElementById("theme-builder-preview"),o=document.getElementById("theme-preview-card"),i=o.querySelector(".preview-title"),c=o.querySelector(".preview-muted"),$=document.getElementById("preview-badge-ok"),H=document.getElementById("preview-badge-bad"),U=document.getElementById("preview-dot-ok"),q=document.getElementById("preview-dot-bad"),F=document.getElementById("preview-accent-btn"),G=o.querySelector(".preview-dots");l.style.background=a.bg,o.style.background=a["card-base"],o.style.borderColor=a.border,i.style.color=a.fg,c.style.color=a.muted,$.style.background=a["ok-bg"],$.style.color=a["ok-fg"],H.style.background=a["bad-bg"],H.style.color=a["bad-fg"],U.style.background=a["dot-ok"],q.style.background=a["dot-bad"],G.style.color=a.fg,F.style.background=a.accent,F.style.color=a.bg}function f(a){var l=window.deriveExtendedColors?window.deriveExtendedColors(a):{};window.THEME_PROPS.forEach(function(o){var i=a[o]||l[o];i&&document.documentElement.style.setProperty("--"+o,i)})}D.forEach(function(a){a.addEventListener("input",function(){var l=k.querySelector('[data-hex="'+a.dataset.prop+'"]');l&&(l.textContent=a.value.toUpperCase()),a.dataset.advanced?O[a.dataset.prop]=!0:u(),r(),f(b())})}),M.addEventListener("change",function(){u(),r(),f(b())}),B.addEventListener("change",function(){O={},s(B.value),f(b())});function v(){var a=safeGetJSON(window.USER_THEMES_KEY,{}),l=Object.keys(a);C.innerHTML='
',l.forEach(function(o){var i=document.createElement("option");i.value=o,i.textContent=a[o].name||o,C.appendChild(i)}),j.style.display=l.length?"":"none"}function t(){B.innerHTML=w()}C.addEventListener("change",function(){var a=this.value;a?(S=a,d(a),f(b())):(S=null,O={},I.value="",B.value=window.getActiveTheme(),s(B.value)),y.style.display=S?"":"none"});function e(){h=window.getActiveTheme(),S=null,O={},m=!1,x.style.display="none",A.innerHTML="Show advanced colors ▼",v(),t();var a=safeGetJSON(window.USER_THEMES_KEY,{});a[h]?(C.value=h,S=h,d(h)):(C.value="",I.value="",B.value=h,s(h)),y.style.display=S?"":"none",k.classList.add("show")}var n=document.getElementById("theme-customize-btn");n&&n.addEventListener("click",function(){e()}),document.getElementById("theme-builder-save").addEventListener("click",function(){var a=b(),l=I.value.trim();if(!l){showNotification("Please enter a theme name","warning",3e3),I.focus();return}var o=safeGetJSON(window.USER_THEMES_KEY,{}),i,c=null;if(S){i=S;var $=window.slugifyThemeName(l,S);if($!==S){c=S,delete o[S];var H=window.THEMES.indexOf(S);H!==-1&&window.THEMES.splice(H,1),delete window.THEME_COLORS[S],i=$}}else i=window.slugifyThemeName(l);var U={name:l};M.checked&&(U.lightBg=!0),window.THEME_PROPS.forEach(function(F){a[F]&&(U[F]=a[F])}),o[i]=U,safeSet(window.USER_THEMES_KEY,JSON.stringify(o)),window.clearCustomProperties(),window.injectUserThemeStyles(),window.applyTheme(i),k.classList.remove("show"),g();var q={};window.THEME_PROPS.forEach(function(F){a[F]&&(q[F]=a[F])}),c&&secureFetch("/api/v1/themes/"+c,{method:"DELETE"}).catch(function(){}),secureFetch("/api/v1/themes/"+i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l,colors:q,lightBg:M.checked})}).then(function(){showNotification(l+" theme saved","success",3e3)}).catch(function(){showNotification(l+" theme saved locally (server sync failed)","warning",3e3)})}),document.getElementById("theme-builder-cancel").addEventListener("click",function(){k.classList.remove("show"),window.clearCustomProperties(),h&&window.applyTheme(h)}),document.getElementById("theme-builder-delete").addEventListener("click",function(){if(S){var a=safeGetJSON(window.USER_THEMES_KEY,{}),l=a[S]?a[S].name:S;if(confirm('Delete "'+l+'" theme?')){var o=S;delete a[o],safeSet(window.USER_THEMES_KEY,JSON.stringify(a));var i=window.THEMES.indexOf(o);i!==-1&&window.THEMES.splice(i,1),delete window.THEME_COLORS[o],window.clearCustomProperties(),window.injectUserThemeStyles();var c=h&&h!==o?h:"dark";window.applyTheme(c),S=null,k.classList.remove("show"),g(),secureFetch("/api/v1/themes/"+o,{method:"DELETE"}).then(function(){showNotification(l+" theme deleted","success",3e3)}).catch(function(){showNotification(l+" theme deleted locally (server sync failed)","warning",3e3)})}}}),document.getElementById("theme-builder-export").addEventListener("click",function(){if(!S){showNotification("Save the theme first, then export","warning",3e3);return}var a=safeGetJSON(window.USER_THEMES_KEY,{}),l=a[S];if(l){var o={_dashcaddy_theme:!0,version:"1.0",exportDate:new Date().toISOString(),slug:S,name:l.name,lightBg:l.lightBg||!1,colors:{}};window.THEME_PROPS.forEach(function(H){l[H]&&(o.colors[H]=l[H])});var i=new Blob([JSON.stringify(o,null,2)],{type:"application/json"}),c=URL.createObjectURL(i),$=document.createElement("a");$.href=c,$.download=S+"-theme.json",document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(c),showNotification("Theme exported as "+S+"-theme.json","success",3e3)}}),document.getElementById("theme-builder-import").addEventListener("click",function(){var a=document.createElement("input");a.type="file",a.accept=".json",a.onchange=function(l){var o=l.target.files[0];if(o){var i=new FileReader;i.onload=function(c){try{var $=JSON.parse(c.target.result),H,U,q;if($._dashcaddy_theme&&$.colors)H=$.name||"Imported",U=$.colors,q=$.lightBg||!1;else if($.name&&($.bg||$["card-base"]))H=$.name,U={},window.THEME_PROPS.forEach(function(F){$[F]&&(U[F]=$[F])}),q=$.lightBg||!1;else throw new Error("Not a valid DashCaddy theme file");I.value=H,M.checked=!!q,S=null,C.value="",O={},D.forEach(function(F){var G=U[F.dataset.prop]||"#000000";F.value=G;var J=k.querySelector('[data-hex="'+F.dataset.prop+'"]');J&&(J.textContent=G.toUpperCase()),F.dataset.advanced&&U[F.dataset.prop]&&(O[F.dataset.prop]=!0)}),u(),r(),f(b()),y.style.display="none",showNotification('"'+H+'" loaded into builder. Click Save to keep it.',"success",5e3)}catch(F){showNotification("Import failed: "+F.message,"error",5e3)}},i.readAsText(o)}},a.click()}),wireModal(k),k.addEventListener("click",function(a){a.target===k&&(window.clearCustomProperties(),h&&window.applyTheme(h))})})(),(function(){injectModal("license-modal",`
DashCaddy License
@@ -1853,13 +1853,94 @@ To endpoint: POST /api/v1/security/events/ingest or /events/batch`),m()}catch(f)
-
`);const h=document.getElementById("license-modal"),S=document.getElementById("license-code-input"),A=document.getElementById("license-activate"),k=document.getElementById("license-deactivate"),N=document.getElementById("license-error"),R=document.getElementById("license-success"),z=document.getElementById("license-badge-icon"),P=document.getElementById("license-badge-text"),g=document.getElementById("license-badge"),T=document.getElementById("license-details"),w=document.getElementById("license-feature-list"),H=document.getElementById("license-activate-section");let E=null;function $(){N.style.display="none",R.style.display="none"}function I(b){$(),N.textContent=b,N.style.display="block"}function L(b){$(),R.textContent=b,R.style.display="block"}function j(b){if(E=b,b.active){g.style.background="rgba(46,204,113,0.15)",g.style.color="var(--ok-fg)",z.textContent="\u2605",P.textContent="Premium Active";const s=b.lifetime?"
License: LIFETIME
":`
Expires: ${new Date(b.expiresAt).toLocaleDateString()} (${b.daysRemaining} days remaining)
`;T.innerHTML=`
+
`);const h=document.getElementById("license-modal"),S=document.getElementById("license-code-input"),O=document.getElementById("license-activate"),E=document.getElementById("license-deactivate"),N=document.getElementById("license-error"),R=document.getElementById("license-success"),z=document.getElementById("license-badge-icon"),P=document.getElementById("license-badge-text"),g=document.getElementById("license-badge"),L=document.getElementById("license-details"),w=document.getElementById("license-feature-list"),T=document.getElementById("license-activate-section");let k=null;function B(){N.style.display="none",R.style.display="none"}function I(b){B(),N.textContent=b,N.style.display="block"}function C(b){B(),R.textContent=b,R.style.display="block"}function j(b){if(k=b,b.active){g.style.background="rgba(46,204,113,0.15)",g.style.color="var(--ok-fg)",z.textContent="\u2605",P.textContent="Premium Active";const s=b.lifetime?"Your license has expired. Enter a new code to renew.
":"Enter a license code to unlock premium features.
",H.style.display="",A.style.display="",k.style.display="none";const p=b.premiumFeatures||{},v=new Set(b.features||[]);w.innerHTML=Object.entries(p).map(([s,l])=>`