"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");var e=require("../utils/genericFunctions/eventDispatch.js"),t=require("../utils/genericFunctions/localStorage.js");require("../node_modules/tslib/tslib.es6.js");var s=require("../store/index.js"),r=function(){document.documentElement.classList.add("pi-dark")},i=function(){document.documentElement.classList.remove("pi-dark")},c=function(){var e=t.getJSONItem("phone-island-theme-selected")||{},c="system";"dark"===e.themeSelected?(c="dark",r()):"light"===e.themeSelected?(c="light",i()):window.matchMedia("(prefers-color-scheme: dark)").matches?r():i(),s.store.dispatch.darkTheme.update(c)};exports.checkDarkTheme=c,exports.setTheme=function(s){t.setJSONItem("phone-island-theme-selected",{themeSelected:s}),c(),e.eventDispatch("phone-island-theme-changed",{})};
//# sourceMappingURL=darkTheme.js.map
