UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 4.49 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{oi as t,ri as n}from"./control-ui-connection-Bfj9beF_.js";import{BA as r,dj as i,mj as a,zA as o}from"./control-ui-boot-shared-DFTSUQQ0.js";import{F as s,J as c,O as l,U as u,d,gt as f,j as p,u as m,x as h,y as g}from"./solid-runtime-C416s-HC.js";import{Dr as _,F as v,L as y,Or as b,R as x,Tr as S,jr as C,kr as w,wr as T}from"./control-ui-boot-chat-DewxEbIm.js";import{a as E,c as D,i as O,n as k,o as A,r as j}from"./board-widget-menu-CjsqxLWt.js";import{n as M,t as N}from"./chat-quick-action-Bzzs1KkE.js";function P(e){let r=c(()=>e.menuProps),i=s(()=>{let e=r.sidebarLayout,i=[];if(!r.mobile&&e&&r.onLayoutChange){let o=t(e),s=e.columns.flatMap(e=>e.panels).find(e=>e.slot===`dashboard`);s&&e.open&&!e.expanded&&i.push({id:`dashboard-swap`,label:a(`chat.sidePanel.swap`,{main:a(`chat.sidePanel.conversation`),side:a(`chat.sidePanel.dashboard`)}),icon:`arrowLeftRight`,onActivate:()=>{let t=T(e),n=o?.slot===`dashboard`?t.columns.flatMap(e=>e.panels).find(e=>e.slot===`conversation`):s;n&&r.onLayoutChange?.(_(b(t,n.id),o?.slot===`dashboard`?`dashboard`:`conversation`),{dashboardPresentation:`personal`})}}),s&&i.push({id:`dashboard-expand`,label:a(e.expanded?`chat.sidePanel.restore`:`chat.sidePanel.expandPanel`,{panel:a(`chat.sidePanel.dashboard`)}),icon:e.expanded?`minimize`:`maximize`,onActivate:()=>r.onLayoutChange?.(o?.slot===`dashboard`||e.expanded?w(e,!e.expanded):C(e,s.id),{dashboardPresentation:`personal`})}),n(e,`conversation`)||i.push({id:`dashboard-show-chat`,label:a(`chat.sidePanel.showChat`),icon:`messageSquare`,onActivate:()=>r.onLayoutChange?.(_(T(e),`conversation`),{dashboardPresentation:`personal`})})}for(let e of r.layoutMenuActions??[])e.id===`dashboard-default`&&i.push({...e,icon:`bookmark`});return i}),u=M(i),m=s(()=>u().flatMap(e=>e.id===`dashboard-default`?[{kind:`content`,id:`default-separator`,content:I()},e.kind===`content`?{id:`${e.id}-status`,label:i().find(t=>t.id===e.id).label,disabled:!0,render:t=>(()=>{var n=L(),r=n.firstChild,i=r.nextSibling;return g(n,[t,{class:`chat-dashboard-menu__default-status`}],!0),d(n,()=>e.content,r),d(n,p(o,{name:`check`}),i),n})()}:e]:[e])),h=s(()=>{let e=r.widgetMenu;if(!e?.canMutate)return[];let t=k({...e,disabled:!1}),n=t.filter(e=>e.id.startsWith(`move:`)),i=Object.entries(O).find(([,t])=>t.w===e.widget.sizeW&&t.h===e.widget.sizeH)?.[0];for(let e of t)e.kind!==`content`&&e.kind!==`group`&&(e.id.startsWith(`resize:`)?e.class=[`board-widget__preset`,{"is-current":e.id===`resize:${i}`}]:e.id===`height:auto`&&(e.icon=p(o,{name:`arrowUpDown`})));return[{kind:`content`,id:`page-separator`,content:I()},{kind:`content`,id:`resize-heading`,content:(()=>{var e=R();return d(e,()=>a(`chat.sidePanel.dashboardSize`)),e})()},{kind:`group`,id:`page-sizes`,class:`chat-dashboard-menu__sizes`,items:t.filter(e=>e.id.startsWith(`resize:`))},...t.filter(e=>e.id===`height:auto`),...n.length?[{id:`page-move`,label:a(`board.widget.moveToTab`),icon:p(o,{name:`panelsTopLeft`}),children:n}]:[],...t.filter(e=>e.id===`separator`||e.id===`remove`)]}),v=s(()=>[...m(),...h(),{kind:`content`,id:`page-granted-capabilities`,content:p(l,{get when(){return r.widgetMenu},children:e=>p(A,{get widget(){return e().widget},presentation:`details`})})}]);return f(()=>(e.onReady({items:v,select:(t,n)=>{n.preventDefault(),e.readMenu()?.close();let a=i().find(e=>e.id===t.id);a?a.kind!==`status`&&!a.disabled&&a.onActivate():r.widgetMenu?.onSelect(t.id)}}),()=>e.onReady(void 0))),e.renderItems(v)}function F(e){let t=c(()=>e.menuProps),n=e.controls,r=s(()=>y(t)),i=s(()=>p(v,{get model(){return r()},controls:n}),{lazy:!0}),a=M(()=>t.mobile?r().panelActions:r().actions,!0),o=M(()=>t.mobile?r().actions:r().panelActions,!0),l=s(()=>[...a(),...a().length&&o().length?[{kind:`content`,id:`panel-actions`,content:z()}]:[],...o(),{kind:`content`,id:`header-actions`,content:i()}],{lazy:!0});return f(()=>(e.onReady({items:l,select:(t,n)=>{let i=r().allActions.find(e=>e.id===t.id);i&&i.kind!==`status`&&!i.disabled&&(n.preventDefault(),e.readMenu()?.close(),i.onActivate())}}),()=>e.onReady(void 0))),e.renderItems(l)}var I,L,R,z;function B(){return(B=e((()=>{m(),u(),D(),E(),j(),r(),i(),S(),x(),N(),I=h(`<div class=board-widget__menu-separator role=separator>`),L=h(`<div><!><!>`),R=h(`<div class=board-widget__menu-heading>`),z=h(`<div class=session-menu__separator role=separator>`)})))()}B();export{P as ChatDashboardMenuContent,F as ChatPaneLayoutMenuContent};