{"version":3,"names":["themeStorageKey","defaultTheme","selectedTheme","params","Proxy","URLSearchParams","window","location","search","get","searchParams","prop","theme","localStorage","setItem","getItem","document","body","setAttribute","removeAttribute"],"sources":["../../../js/demo-theme.js"],"sourcesContent":["/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\n\nconst themeStorageKey = \"tablerTheme\"\nconst defaultTheme = \"light\"\nlet selectedTheme\n\n// https://stackoverflow.com/a/901144\nconst params = new Proxy(new URLSearchParams(window.location.search), {\n\tget: (searchParams, prop) => searchParams.get(prop),\n})\n\nif (!!params.theme) {\n\tlocalStorage.setItem(themeStorageKey, params.theme)\n\tselectedTheme = params.theme\n} else {\n\tconst storedTheme = localStorage.getItem(themeStorageKey)\n\tselectedTheme = storedTheme ? storedTheme : defaultTheme\n}\n\nif (selectedTheme === 'dark') {\n\tdocument.body.setAttribute(\"data-bs-theme\", selectedTheme)\n} else {\n\tdocument.body.removeAttribute(\"data-bs-theme\")\n}"],"mappings":";;;;;;AAMA,MAAMA,gBAAkB,cAClBC,aAAe,QACrB,IAAIC,cAGJ,MAAMC,OAAS,IAAIC,MAAM,IAAIC,gBAAgBC,OAAOC,SAASC,QAAS,CACrEC,IAAKA,CAACC,EAAcC,IAASD,EAAaD,IAAIE,KAG/C,GAAMR,OAAOS,MACZC,aAAaC,QAVU,cAUeX,OAAOS,OAC7CV,cAAgBC,OAAOS,UACjB,CAENV,cADoBW,aAAaE,QAbV,gBACH,OAcrB,CAEsB,SAAlBb,cACHc,SAASC,KAAKC,aAAa,gBAAiBhB,eAE5Cc,SAASC,KAAKE,gBAAgB","ignoreList":[]}