import{s as e}from"./p-6ddf6362.js";import{U as r,g as o,s as c}from"./p-cb31d0af.js";import{F as n,S as t}from"./p-8f9c0865.js";const a=e=>{if("(prefers-color-scheme: dark)"!==e.media)return;const r=s();document.documentElement.setAttribute("color-scheme","auto"===r?e.matches?"dark":"light":r)},s=()=>localStorage.getItem("bce-color-scheme")||"auto";var i={file:n.inMemory(),FileManager:n,generateId:function(){return r.v4()},getColorScheme:s,getColorShade:o,setColorScheme:e=>{if("dark"===e||"light"===e)localStorage.setItem("bce-color-scheme",e),document.documentElement.setAttribute("color-scheme",e);else{localStorage.removeItem("bce-color-scheme");const e=window.matchMedia("(prefers-color-scheme: dark)");a(e)}},setColorShade:c,ScrollSpy:t},b=function(e,r){for(var o=[],c=2;c<arguments.length;c++)o[c-2]=arguments[c];if(!e.matches(r))return!1;for(var n=0,t=o;n<t.length;n++){var a=t[n],s=e.parentElement;if(!s||!s.matches(a))return!1;e=s}return!0};const l=function(){window.BCE=window.BCE||i,(()=>{const e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener?e.addEventListener("change",a):e.addListener(a),a(e)})(),e((function(e){if(b(e,"bce-button","bce-fab"))return"bce-fab";if(b(e,"bce-button","bce-menu"))return"bce-menu";if(b(e,"bce-link","bce-link"))return"bce-link";if(b(e,"bce-link","bce-nav","bce-header"))return"bce-header";if(b(e,"bce-nav","bce-header"))return"bce-header";if(b(e,"bce-nav","bce-side-bar"))return"bce-side-bar";var r=e.closest("bce-root");return e.getAttribute("mode")||r&&r.mode||"default"}))};export{l as g};