',r.classList.add("edit-button"),n.append(t,r),r.onclick=t=>{re(e)},V.append(n)}else V.append(t)}const t=document.createElement("button");t.textContent="Create New Theme",t.onclick=t=>{!function(){const t=e("create-new-theme-dialog"),n=e("create-new-theme-inherits-input"),r=e("create-new-theme-name-input"),o=e("create-new-theme-inherits-input"),s=e("create-new-theme-cancel-button"),a=e("create-new-theme-create-button");r.value="",s.onclick=e=>{t.close()},a.onclick=e=>{const n=r.value,s=o.value,a=structuredClone(X.get(s));a.name=n,a.slug=i(n),ee.push(a),X.add(a.name,a.slug,a.properties),te(),_(a),oe(),t.close()},n.replaceChildren();for(const e of X.getAllThemes()){const t=document.createElement("option");t.textContent=e.name,t.value=e.slug,n.append(t)}t.showModal()}()},V.append(t)}ee.forEach((e=>X.add(e.name,e.slug,e.properties))),localStorage.getItem("theme")&&(X.theme=localStorage.getItem("theme")),oe();const se=document.getElementById("big-picture-overlay");let ae=0;function ie(e){e?(se.style.display=null,se.classList.add("open"),se.style.fontSize=window.innerWidth/100*3.2+"px",navigator.userAgentData&&navigator.userAgentData.mobile&&document.documentElement.requestFullscreen()):(se.style.display="none",se.classList.remove("open"),document.fullscreenElement&&document.exitFullscreen())}document.addEventListener("mousedown",(()=>{if(Date.now()-ae<=400)return ae=0,void ie(!se.classList.contains("open"));ae=Date.now()})),screen.orientation.onchange=()=>{ie(screen.orientation.type.includes("landscape"))},ie([90,270].includes(screen.orientation.angle)&&screen.orientation.type.includes("landscape"));