openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 6.59 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{$n as t,by as n,er as r,gy as i,lw as a,my as o,uw as s,vy as c}from"./_2_____________________________.js";import{F as l,U as u,d,f,gt as p,j as m,u as h,x as g}from"./_6____________________.js";import{a as _,i as v,r as y}from"./_5_________________________.js";import"./route-chrome-styles-NRybfaJ0.js";function b(e,t,n){C={hubId:e,tab:t,at:Date.now(),source:n}}function x(e,t,n){if(!(n instanceof HTMLElement)||C?.hubId!==e||C.tab!==t)return;let r=C;Date.now()-r.at>S?C=null:queueMicrotask(()=>{if(C!==r)return;C=null;let e=n.ownerDocument.activeElement;n.isConnected&&Date.now()-r.at<=S&&(e===r.source||e===n.ownerDocument.body||e===n.ownerDocument.documentElement)&&n.focus()})}var S,C;function w(){return(w=e((()=>{S=2e3,C=null})))()}var T;function E(){return(E=e((()=>{T=`.hub-tabs{--indicator-color:var(--accent);align-items:stretch;gap:var(--space-2);flex-shrink:0;min-block-size:min-content;padding-block-end:2px;display:flex;overflow-x:auto}.hub-tabs--sub{gap:var(--space-1)}.hub-tab{font-size:var(--control-ui-text-sm);color:var(--muted);transition:color var(--duration-normal) var(--ease-out);padding:var(--space-1) var(--space-2) var(--space-2);align-items:center;gap:6px;font-weight:550;display:inline-flex}.hub-tabs--sub .hub-tab{font-size:var(--control-ui-text-xs);padding:3px var(--space-2) var(--space-1);font-weight:550}.hub-tab__badge{border-radius:var(--radius-full);background:var(--bg-hover);min-height:16px;color:var(--muted);align-items:center;padding:0 5px;font-size:10px;font-weight:700;line-height:1;display:inline-flex}.hub-tab[active] .hub-tab__badge{background:var(--accent-subtle);color:var(--accent)}@media (hover:hover){.hub-tab:hover{color:var(--text)}}.hub-tab[active]{color:var(--text-strong);box-shadow:0 2px 0 var(--indicator-color)}.hub-tab:focus-visible{border-radius:var(--radius-sm);box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);outline:none}.hub-tab[active]:focus-visible{box-shadow:0 2px 0 var(--indicator-color), 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent)}@media (forced-colors:active){.hub-tab[active]{text-underline-offset:4px;text-decoration-line:underline;text-decoration-thickness:2px}.hub-tab:focus-visible{outline-offset:-2px;outline:2px solid highlight}}.content-header.hub-page-header{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);display:grid}.content-header.hub-page-header--stacked{align-items:end;row-gap:var(--space-2);width:100%;max-width:1120px;max-height:none;padding-inline:var(--settings-header-inline-padding,var(--space-4));grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title actions""tabs tabs";margin-inline:auto}.content-header.hub-page-header--untabbed{grid-template-areas:"title actions"}.content-header.hub-page-header--wide{max-width:none;padding-inline:0}.content-header.hub-page-header--stacked .hub-page-header__title{grid-area:title;justify-self:start}.content-header.hub-page-header--stacked .page-title{font-size:26px}.content-header.hub-page-header--stacked .hub-page-header__tabs{padding-block:var(--space-2);grid-area:tabs;justify-self:start}.content-header.hub-page-header--stacked .hub-page-header__actions{grid-area:actions}.content-header.hub-page-header--stacked+.settings-workspace{margin-top:0}.hub-page-header__title,.hub-page-header__actions{min-width:0}.hub-page-header__actions{justify-self:end}@media (width>=769px) and (width<=1100px){.content-header.hub-page-header{row-gap:var(--space-2);grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title actions""tabs tabs";max-height:none}.hub-page-header__title{grid-area:title}.hub-page-header__tabs{grid-area:tabs;justify-self:center}.hub-page-header__actions{grid-area:actions}}@media (width<=768px),(width<=932px) and (height<=500px) and (orientation:landscape){.hub-tabs{scroll-padding-inline:32px}.hub-tabs[data-scrollable=true][data-at-end=false]{mask-image:linear-gradient(90deg,#000 calc(100% - 32px),#0000)}.hub-tabs[data-scrollable=true][data-at-start=false]{mask-image:linear-gradient(90deg,#0000,#000 32px)}.hub-tabs[data-scrollable=true][data-at-start=false][data-at-end=false]{mask-image:linear-gradient(90deg,#0000,#000 32px calc(100% - 32px),#0000)}.content-header.hub-page-header{justify-items:center;row-gap:var(--space-2);grid-template-columns:minmax(0,1fr);grid-template-areas:"intro""tabs""actions";max-height:none;display:grid}.hub-page-header .hub-page-header__title{grid-area:intro;justify-self:stretch}.hub-page-header .hub-page-header__tabs{grid-area:tabs}.hub-page-header .hub-page-header__actions{grid-area:actions;justify-self:center}.content-header.hub-page-header--stacked{grid-template-areas:"title""tabs""actions";justify-items:stretch}.content-header.hub-page-header--untabbed{grid-template-areas:"title""actions"}.content-header.hub-page-header--stacked .hub-page-header__title{grid-area:title}.content-header.hub-page-header--stacked .hub-page-header__actions{justify-self:end}.content-header.hub-page-header--stacked .page-title{font-size:22px}}@media (width<=640px){.content.content--hub-header .content-header.hub-page-header{padding-inline:0}}`})))()}function D(e){let t=l(()=>e.tabs.map(t=>({value:t.value,id:`${e.id}-tab-${t.value}`,panelId:e.panelId,disabled:t.disabled,testId:t.testId,className:[`hub-tab`,{"oc-segmented-item":e.carapace}],label:[f(()=>t.label),f(()=>f(()=>t.count==null)()?null:(()=>{var e=O();return d(e,()=>t.count),e})()),f(()=>f(()=>t.badge==null)()?null:(()=>{var e=k();return d(e,()=>t.badge),e})())]}))),n,i;p(()=>{e.active!==null&&x(e.id,e.active,i(e.active))});let s=r(!0),u=o(y,_()),h=l(()=>u()&&e.active!==null?`${e.active}|${e.tabs.map(e=>e.count).join(`,`)}`:null);return c(()=>{let t=h();return{reveal:t===null?void 0:{identity:[t],target:()=>e.active===null?void 0:i(e.active)}}},{region:()=>n,revealTiming:`animation-frame`,revealAxis:`inline`}),m(a,{ref:(e,t)=>{n=e,i=t,s(e)},get id(){return`${e.id}-tabs`},shadowStyles:[T],get items(){return t()},get active(){return e.active},activation:`manual`,get ariaLabel(){return e.ariaLabel},get class(){return[`hub-tabs`,`hub-tabs--${e.variant??`primary`}`,`${e.id}-hub-tabs`,{"oc-segmented":e.carapace},e.class]},onActivate:(t,n,r)=>{let i=e.tabs.find(e=>e.value===t);return!i||i.value===e.active||(r instanceof KeyboardEvent&&b(e.id,i.value,n),e.onSelect(i.value),e.onActivate?.(n)),!1}})}var O,k;function A(){return(A=e((()=>{h(),u(),v(),i(),n(),w(),t(),s(),E(),O=g(`<span class="hub-tab__badge hub-tab__badge--count">`),k=g(`<span class=hub-tab__badge>`)})))()}export{A as n,D as t};