var e=`thinkrax.theme`;function t(e){let t=document.documentElement,n=window.matchMedia(`(prefers-color-scheme: dark)`).matches,r=e===`dark`||e===`system`&&n;t.classList.toggle(`dark`,r)}function n(){let n=document.documentElement.dataset.themeMode||`system`;t(window.sessionStorage.getItem(e)||n),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{(window.sessionStorage.getItem(e)||document.documentElement.dataset.themeMode)===`system`&&t(`system`)})}window.thinkraxSetTheme=n=>{window.sessionStorage.setItem(e,n),t(n)},window.thinkraxPrint=e=>{let t=document.getElementById(`thinkrax-print-frame`);t&&t.remove();let n=document.createElement(`iframe`);n.id=`thinkrax-print-frame`,n.style.cssText=`position:fixed;right:0;bottom:0;width:0;height:0;border:0;`,n.src=e,n.onload=()=>{try{n.contentWindow.focus(),n.contentWindow.print()}catch{window.open(e,`_blank`)}},document.body.appendChild(n)},n();