-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp-4dc7f47a.js
6 lines (6 loc) · 1021 Bytes
/
p-4dc7f47a.js
1
2
3
4
5
6
/*!
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
* v1.4.0
*/
import{d as e,a as t}from"./p-358bad77.js";function o(){const{classList:o}=document.body,n=window.matchMedia("(prefers-color-scheme: dark)").matches,d=()=>o.contains(e)||o.contains(t)&&n?"dark":"light",c=e=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:e}})),i=e=>{a!==e&&c(e),a=e};let a=d();c(a),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(e=>i(e.matches?"dark":"light"))),new MutationObserver((()=>i(d()))).observe(document.body,{attributes:!0,attributeFilter:["class"]})}const n=function(){"undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document&&("interactive"===document.readyState?o():document.addEventListener("DOMContentLoaded",(()=>o()),{once:!0}))};export{n as g}