). We later use the `html:has(head > [data-stack-theme=XYZ])` selector to apply styles based on the theme. */",document.head.appendChild(b)),b.setAttribute("data-stack-theme",a)},d=()=>{let a=getComputedStyle(document.documentElement).getPropertyValue("color-scheme");if(a){let d=b(a);if(d)return c(d),!0}return!1},e=()=>{let a=getComputedStyle(document.documentElement).getPropertyValue("--background");if(a){/^\d+\s\d+%\s\d+(\.\d+)?%$/.test(a)&&(a=`hsl(${a})`);let b=(a=>{let b=document.createElement("div");b.style.color=a,document.body.appendChild(b);let c=getComputedStyle(b).color;document.body.removeChild(b);let d=c.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return d?[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]:null})(a);if(b)return 128>(a=>(299*a[0]+587*a[1]+114*a[2])/1e3)(b)?c("dark"):c("light"),!0}return!1},f=()=>{for(let d of a){let a=document.documentElement.getAttribute(d);if(a){let d=b(a);if(d)return c(d),!0}}return!1};new MutationObserver(b=>{b.forEach(b=>{if(!d()&&!(b.attributeName&&a.includes(b.attributeName)&&f())&&e())return})}).observe(document.documentElement,{attributes:!0,attributeFilter:a}),d()||f()||e()})()Browser Use Cloud