openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 2.12 kB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{ci as t,di as n}from"./control-ui-foundation-Cydpkyqa.js";import{Et as r,Tt as i}from"./control-ui-core-YphAl4aM.js";function a(e){i(e.seamColor);let n=document.documentElement,r=e.environment;if(!r){let e=n.getAttribute(t);if(e){let t=` · ${JSON.parse(e).label}`;document.title.endsWith(t)&&(document.title=document.title.slice(0,-t.length))}n.removeAttribute(t),n.style.removeProperty(`--control-ui-environment-color`),n.style.removeProperty(`--control-ui-environment-ink`),document.querySelector(`.control-ui-environment-stripe`)?.remove();for(let e of document.querySelectorAll(`link[rel="icon"][data-openclaw-original-favicon]`)){let t=JSON.parse(e.dataset.openclawOriginalFavicon);for(let[n,r]of[[`href`,t[0]],[`type`,t[1]]])r===null?e.removeAttribute(n):e.setAttribute(n,r);delete e.dataset.openclawOriginalFavicon}return}if(n.setAttribute(t,JSON.stringify(r)),n.style.setProperty(`--control-ui-environment-color`,`var(--control-ui-environment-${r.color})`),n.style.setProperty(`--control-ui-environment-ink`,`var(--control-ui-environment-${r.color}-ink)`),!document.querySelector(`.control-ui-environment-stripe`)){let e=document.createElement(`div`);e.className=`control-ui-environment-stripe`,e.setAttribute(`aria-hidden`,`true`),document.body.prepend(e)}document.title.endsWith(` · ${r.label}`)||(document.title=`${document.title} · ${r.label}`);let a=getComputedStyle(n).getPropertyValue(`--control-ui-environment-${r.color}`).trim();if(!a)return;let o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><path fill="${a}" d="M60 10C30 10 15 35 15 55c0 20 15 40 30 45v10h10v-10h10v10h10v-10c15-5 30-25 30-45 0-20-15-45-45-45Z"/></svg>`;for(let e of document.querySelectorAll(`link[rel="icon"]`))e.dataset.openclawOriginalFavicon??=JSON.stringify([e.getAttribute(`href`),e.getAttribute(`type`)]),e.href=`data:image/svg+xml,${encodeURIComponent(o)}`,e.type=`image/svg+xml`}function o(){return(o=e((()=>{n(),r()})))()}o();export{a as applyControlUiPresentation};
//# sourceMappingURL=control-ui-environment-presentation.runtime-BcIofN7_.js.map