{ "version": 3, "sources": ["../../typescript/core/loading.component.ts", "../../typescript/theme-toggle/theme.ts", "../../typescript/core/translate.ts", "../../typescript/theme-toggle/theme-toggle.component.ts", "../../typescript/core/scroll-to-top.component.ts", "../../typescript/core/selector.ts", "../../typescript/core/continue-reading.component.ts", "../../typescript/head.ts"], "sourcesContent": ["export class LoadingComponent extends HTMLElement {\n connectedCallback() {\n this.innerHTML = /*html*/ `\n
\n
\n Loading...\n
\n
`;\n }\n}\n", "export declare type Theme = 'dark' | 'light';\n\nexport function setTheme(theme: Theme) {\n document.querySelector('html').dataset.bsTheme = theme;\n localStorage.setItem('bsTheme', theme);\n}\n\nexport function getTheme(): Theme {\n return localStorage.getItem('bsTheme') as Theme;\n}\n", "declare const __translate: { [name: string]: string };\n\nexport function translate(name: string): string {\n return __translate[name] ?? name;\n}\n", "import { Theme, getTheme, setTheme } from './theme';\nimport { translate } from '../core/translate';\n\nexport class ThemeToggleComponent extends HTMLElement {\n constructor() {\n super();\n\n const darkThemeMq = window.matchMedia('(prefers-color-scheme: dark)');\n\n darkThemeMq.addEventListener('change', (e) => {\n const newTheme = e.matches ? 'dark' : 'light';\n this.setActiveTheme(newTheme);\n });\n }\n\n connectedCallback() {\n this.render();\n\n const currentMode = getTheme();\n this.updateVisibleIcon(currentMode);\n\n this.querySelectorAll('.mode-toggle').forEach((el: HTMLElement) => {\n el.addEventListener('click', () => {\n const mode = el.dataset.theme as Theme;\n this.setActiveTheme(mode);\n });\n });\n }\n\n private setActiveTheme(theme: Theme) {\n setTheme(theme);\n this.updateVisibleIcon(theme);\n }\n\n private updateVisibleIcon(currentMode: string) {\n if (currentMode === 'dark') {\n document.getElementById('dark-mode-button').classList.remove('d-none');\n document.getElementById('light-mode-button').classList.add('d-none');\n } else {\n document.getElementById('dark-mode-button').classList.add('d-none');\n document.getElementById('light-mode-button').classList.remove('d-none');\n }\n }\n\n private render() {\n this.innerHTML = `\n
\n \n \n
`;\n }\n}\n", "import { translate } from './translate';\n\nexport class ScrollToTopComponent extends HTMLElement {\n scrollToTop() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n\n connectedCallback() {\n this.style.display = 'block';\n this.addEventListener('click', () => this.scrollToTop());\n\n this.innerHTML = `\n
\n ${translate('Back to top')}\n \n \n \n
\n `;\n }\n}\n", "export default class Select {\n static byId(id: string): T {\n return document.getElementById(id) as T;\n }\n\n static byClass(className: string): T {\n return document.getElementsByClassName(className)[0] as T;\n }\n\n static byClassAll(className: string): T[] {\n return Array.from(document.getElementsByClassName(className)) as T[];\n }\n\n static byCss(selector: string): T {\n return document.querySelector(selector) as T;\n }\n\n static byCssAll(selector: string): T[] {\n return Array.from(document.querySelectorAll(selector)) as T[];\n }\n}\n", "import Select from './selector';\nimport { translate } from './translate';\n\nexport class ContinueReadingComponent extends HTMLElement {\n scrollToChoices() {\n Select.byId('option-container').scrollIntoView({ behavior: 'smooth' });\n }\n\n connectedCallback() {\n this.style.display = 'block';\n this.addEventListener('click', () => this.scrollToChoices());\n\n this.innerHTML = `\n
\n ${translate('Continue Reading')}\n \n \n \n
\n `;\n }\n}\n", "import initTheme from './theme-toggle/init';\nimport { LoadingComponent } from './core/loading.component';\nimport { ThemeToggleComponent } from './theme-toggle/theme-toggle.component';\nimport { ScrollToTopComponent } from './core/scroll-to-top.component';\nimport { ContinueReadingComponent } from './core/continue-reading.component';\n\n// initTheme();\n\ncustomElements.define('app-theme-toggle', ThemeToggleComponent);\ncustomElements.define('app-loading', LoadingComponent);\ncustomElements.define('app-scroll-to-top', ScrollToTopComponent);\ncustomElements.define('app-continue-reading', ContinueReadingComponent);\n\n"], "mappings": "MAAO,IAAMA,EAAN,cAA+B,WAAY,CAChD,mBAAoB,CAClB,KAAK,UAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,eAM5B,CACF,ECPO,SAASC,EAASC,EAAc,CACrC,SAAS,cAAc,MAAM,EAAE,QAAQ,QAAUA,EACjD,aAAa,QAAQ,UAAWA,CAAK,CACvC,CAEO,SAASC,GA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,CAAC,CAChD,CAEA,mBAAoB,CAClB,KAAK,MAAM,QAAU,QACrB,KAAK,iBAAiB,QAAS,IAAM,KAAK,YAAY,CAAC,EAEvD,KAAK,UAAY;AAAA;AAAA,qCAEgBC,EAAU,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,SAM1D,CACF,ECpBA,IAAqBC,EAArB,KAA4B,CAC1B,OAAO,KAA4BC,EAAe,CAChD,OAAO,SAAS,eAAeA,CAAE,CACnC,CAEA,OAAO,QAA+BC,EAAsB,CAC1D,OAAO,SAAS,uBAAuBA,CAAS,EAAE,CAAC,CACrD,CAEA,OAAO,WAAkCA,EAAwB,CAC/D,OAAO,MAAM,KAAK,SAAS,uBAAuBA,CAAS,CAAC,CAC9D,CAEA,OAAO,MAA6BC,EAAqB,CACvD,OAAO,SAAS,cAAcA,CAAQ,CACxC,CAEA,OAAO,SAAgCA,EAAuB,CAC5D,OAAO,MAAM,KAAK,SAAS,iBAAiBA,CAAQ,CAAC,CACvD,CACF,ECjBO,IAAMC,EAAN,cAAuC,WAAY,CACxD,iBAAkB,CAChBC,EAAO,KAAK,kBAAkB,EAAE,eAAe,CAAE,SAAU,QAAS,CAAC,CACvE,CAEA,mBAAoB,CAClB,KAAK,MAAM,QAAU,QACrB,KAAK,iBAAiB,QAAS,IAAM,KAAK,gBAAgB,CAAC,EAE3D,KAAK,UAAY;AAAA;AAAA,qCAEgBC,EAAU,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,SAM/D,CACF,ECbA,eAAe,OAAO,mBAAoBC,CAAoB,EAC9D,eAAe,OAAO,cAAeC,CAAgB,EACrD,eAAe,OAAO,oBAAqBC,CAAoB,EAC/D,eAAe,OAAO,uBAAwBC,CAAwB", "names": ["LoadingComponent", "setTheme", "theme", "getTheme", "translate", "name", "_a", "ThemeToggleComponent", "e", "newTheme", "currentMode", "getTheme", "el", "mode", "theme", "setTheme", "translate", "ScrollToTopComponent", "translate", "Select", "id", "className", "selector", "ContinueReadingComponent", "Select", "translate", "ThemeToggleComponent", "LoadingComponent", "ScrollToTopComponent", "ContinueReadingComponent"] }