openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 7.07 kB
JavaScript
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{BA as n,dj as r,ds as i,lj as a,mj as o,us as s,zA as c}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as l,C as u,F as d,O as f,Rt as p,U as m,d as h,f as g,g as _,j as v,l as y,m as b,s as x,u as S,x as C}from"./solid-runtime-C416s-HC.js";import{a as w,l as T,n as ee,y as E}from"./settings-ui-Ck6BJLhD.js";import{i as D,n as O,r as k,t as A}from"./config-form.tiers-yU5oXLQm.js";import{a as j,i as M,l as N,m as P}from"./config-form-utils-BqrafwiP.js";import{v as F}from"./config-form.constraints-BF6pi17w.js";import{n as I,t as te}from"./config-form.node-CQQMqV6O.js";import{n as ne,o as re,r as ie}from"./config-form.search-CIkOo1VV.js";var L=t({ConfigForm:()=>B,ConfigTierGroups:()=>R});function R(e){let t=d(()=>O({schema:e.schema,path:e.path.map(String),hints:e.hints}));var n=H(),r=n.firstChild,i=r.nextSibling;return h(n,v(f,{get when(){return t().common||e.commonPrelude},get children(){var n=V(),r=n.firstChild,i=r.nextSibling;return h(n,()=>e.commonPrelude,r),h(n,v(f,{get when(){return t().common},children:t=>e.renderTier(t)}),i),n}}),r),h(n,v(f,{get when(){return t().advanced},children:t=>(()=>{var n=W(),r=n.firstChild;return n.addEventListener(`toggle`,t=>{let n=t.currentTarget;n.open!==e.revealAdvanced&&(n.open?e.onShowAdvanced():e.onHideAdvanced?e.onHideAdvanced():n.open=!0)}),h(r,()=>o(`configForm.advancedSettings`)),h(n,v(f,{get when(){return e.revealAdvanced},get children(){var n=U();return h(n,()=>e.renderTier(t)),n}}),null),y(()=>e.revealAdvanced,e=>{_(n,`open`,e)}),n})()}),i),n}function z(e){let[t,n]=l(),r,i=()=>e.form.showSectionDocs===!1?void 0:M(e.section.path.slice(0,1),e.form.uiHints)?.docsUrl,a=()=>`settings-section-help-${e.section.id}`,u=()=>e.form.showAdvanced===!0||e.form.forceAdvancedSection===e.section.path[0]||!!e.form.searchQuery;var d=q(),m=d.firstChild,x=m.firstChild,S=m.nextSibling,C=S.nextSibling;return h(x,()=>e.section.label),h(m,v(f,{get when(){return e.form.sectionActions||i()},get children(){var l=G(),u=l.firstChild,d=u.nextSibling;return h(l,()=>e.form.sectionActions,u),h(l,v(f,{get when(){return i()},children:i=>(()=>{var l=J(),u=l.firstChild,d=u.firstChild,m=d.firstChild;return u._$owner=p(),d._$$click=()=>r.overlay.request(!r.overlay.open),b(()=>n,d),h(m,v(c,{name:`circleQuestionMark`})),h(l,v(f,{get when(){return t()},children:t=>v(s,{ref:e=>r=e,get id(){return`settings-section-help-popover-${e.section.id}`},get label(){return o(`configForm.sectionHelp`,{section:e.section.label})},class:`settings-section__help-popover`,get anchor(){return t()},placement:`bottom-end`,get children(){var t=X(),n=t.firstChild,r=n.nextSibling;return h(t,v(f,{get when(){return e.section.description},get children(){var t=Y();return h(t,()=>e.section.description),t}}),n),h(t,v(ee,{get url(){return i()}}),r),t}})}),null),y(()=>({e:o(`configForm.sectionHelp`,{section:e.section.label}),t:a(),a:o(`configForm.sectionHelp`,{section:e.section.label}),o:`settings-section-help-popover-${e.section.id}`}),({e,t,a:n,o:r},i)=>{e!==i?.e&&(u.content=e),t!==i?.t&&_(d,`id`,t),n!==i?.a&&_(d,`aria-label`,n),r!==i?.o&&_(d,`aria-controls`,r)}),l})()}),d),l}}),null),h(d,v(f,{get when(){return e.section.description},get children(){var t=K();return h(t,()=>e.section.description),t}}),S),h(d,v(R,{get schema(){return e.section.node},get path(){return e.section.path},get hints(){return e.form.uiHints},get revealAdvanced(){return u()},get onShowAdvanced(){return e.form.onShowAdvanced},get onHideAdvanced(){return g(()=>!(e.form.showAdvanced!==!0||e.form.forceAdvancedSection===e.section.path[0]||e.form.searchQuery))()?e.form.onHideAdvanced:void 0},get commonPrelude(){return e.form.sectionPrelude},renderTier:t=>v(te,{get params(){return{schema:t(),value:e.section.nodeValue,path:e.section.path,hints:e.form.uiHints,rawAvailable:e.form.rawAvailable??!0,unsupported:new Set(e.form.unsupportedPaths??[]),disabled:e.form.disabled??!1,showLabel:!1,showHeaderMeta:!0,searchCriteria:re(e.form.searchQuery??``),revealSensitive:e.form.revealSensitive??!1,maskSensitive:e.form.maskSensitive,isSensitivePathRevealed:e.form.isSensitivePathRevealed,onToggleSensitivePath:e.form.onToggleSensitivePath,onPatch:e.form.onPatch,onRemove:e.form.onRemove}}})}),C),y(()=>e.section.id,e=>{_(d,`id`,e)}),d}function B(e){let t=d(()=>{a();let t=e.schema;if(!t||P(t)!==`object`||!t.properties)return[];let n=e.value??{},r=e.uiHints,i=e.activeSection,o=e.searchQuery,s=Object.entries(t.properties).toSorted(([e],[t])=>(M([e],r)?.order??50)-(M([t],r)?.order??50)||e.localeCompare(t)).filter(([e,t])=>(!i||e===i)&&(!o||ie({key:e,schema:t,value:n[e],hints:r,query:o,label:k[e]?.label,description:k[e]?.description}))),c=s[0];if(e.activeSection&&e.activeSubsection&&s.length===1&&c&&P(c[1])===`object`){let t=c[1].properties?.[e.activeSubsection];if(t){let r=[e.activeSection,e.activeSubsection],i=N(r,e.uiHints),a=n[e.activeSection],o;return a&&typeof a==`object`&&(o=a[e.activeSubsection]),[{id:`config-section-${r.join(`-`)}`,label:i?.label??t.title??j(e.activeSubsection),description:i?.help??t.description??``,node:t,path:r,nodeValue:o}]}}return s.map(([e,t])=>{let i=N([e],r),a=k[e]??{label:i?.label??e.charAt(0).toUpperCase()+e.slice(1),description:i?.help??t.description??``};return{id:`config-section-${e}`,label:a.label,description:a.description,node:t,nodeValue:n[e],path:[e]}})});return v(f,{get when(){return e.schema},get fallback(){var e=Z();return h(e,()=>o(`configForm.schemaUnavailable`)),e},get children(){return v(f,{get when(){return g(()=>P(e.schema)===`object`)()&&e.schema.properties},get fallback(){var e=Q();return h(e,()=>o(`configForm.unsupportedSchema`)),e},get children(){return v(f,{get when(){return t().length>0},get fallback(){return v(f,{get when(){return!e.embedded||e.searchQuery},get children(){return v(T,{get children(){return v(w,{get message(){return g(()=>!!e.searchQuery)()?o(`configForm.noSettingsMatch`,{query:e.searchQuery}):o(`configForm.noSettingsInSection`)}})}})}})},get children(){return v(T,{get children(){return v(u,{get each(){return t()},keyed:e=>e.id,children:t=>v(z,{get section(){return t()},form:e})})}})}})}})}})}var V,H,U,W,G,K,q,J,Y,X,Z,Q;function $(){return($=e((()=>{S(),m(),r(),D(),I(),ne(),F(),A(),n(),i(),E(),V=C(`<div class=settings-group><!><!>`),H=C(`<div class=config-tier-groups><!><!>`),U=C(`<div class=settings-group>`),W=C(`<details class=config-advanced-disclosure><summary class="settings-section__heading config-advanced-disclosure__summary">`),G=C(`<div class=settings-section__actions><!><!>`),K=C(`<p class=settings-section__desc>`),q=C(`<section class=settings-section><div class=settings-section__header><h2 class=settings-section__heading></h2></div><!><!>`),J=C(`<span class=settings-section__docs><openclaw-tooltip><button type=button class=settings-section__help-button aria-haspopup=dialog><span aria-hidden=true>`,1),Y=C(`<p>`),X=C(`<div class=settings-section__help-panel><!><!>`),Z=C(`<div class=muted>`),Q=C(`<div class="callout danger">`),x([`click`])})))()}export{L as n,$ as r,R as t};