{"version":3,"file":"shoelace_theme_switcher-802a22655de39a6b1a13.digested.js","mappings":"mBAAAA,OAAOC,OAASC,IACqC,WAA/CC,SAASC,gBAAgBC,QAAQC,YAC/BN,OAAOO,YAAcP,OAAOO,WAAW,gCAAgCC,SACzEL,SAASC,gBAAgBK,UAAUC,QAAQ,iBAAkB,iBAG/DV,OAAOO,WAAW,gCAAgCI,iBAAiB,UAAUC,IAC3E,MAAMC,EAAW,CACfC,KAAM,OACNC,MAAO,SAGHC,EAAW,YAAYH,GAAUD,EAAMJ,WACvCS,EAAW,YAAYJ,EAASD,EAAMJ,WAC5CL,SAASC,gBAAgBK,UAAUC,QAAQM,EAAUC,EAAS,KAIf,SAA/Cd,SAASC,gBAAgBC,QAAQC,WACnCH,SAASC,gBAAgBK,UAAUC,QAAQ,iBAAkB,gBAC/D,C","sources":["webpack://landone-takeoff/./app/javascript/packs/shoelace_theme_switcher.js"],"sourcesContent":["window.onload = _event => {\n if (document.documentElement.dataset.themeMode === 'system') {\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n document.documentElement.classList.replace('sl-theme-light', 'sl-theme-dark')\n }\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {\n const themeMap = {\n true: 'dark',\n false: 'light',\n }\n\n const oldTheme = `sl-theme-${themeMap[!event.matches]}`\n const newTheme = `sl-theme-${themeMap[event.matches]}`\n document.documentElement.classList.replace(oldTheme, newTheme)\n })\n }\n\n if (document.documentElement.dataset.themeMode === 'dark') {\n document.documentElement.classList.replace('sl-theme-light', 'sl-theme-dark')\n }\n}\n"],"names":["window","onload","_event","document","documentElement","dataset","themeMode","matchMedia","matches","classList","replace","addEventListener","event","themeMap","true","false","oldTheme","newTheme"],"sourceRoot":""}