UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 1.97 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deferred-ui-support-DZEPWjAk.js","./_1____________________________.css","./_0____________________________________.css"])))=>i.map(i=>d[i]); import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{$u as t,Bl as n,Qu as r,Rl as i,Wo as a}from"./_4____________________________.js";import{GN as o,JN as s,S as c,qN as l,x as u}from"./_2_____________________________.js";import{n as d,t as f}from"./en-plugin-management-D2xHjJYC.js";function p(e,t){return e.section===t.section&&e.panel===t.panel&&(e.section!==`channels`||t.section===`channels`&&e.channelId===t.channelId)}async function m(e,t,i){t.throwIfAborted();let o=u.filter(t=>t.settingsViews?.some(t=>p(t,e)));if(o.length!==1)throw Error(`Settings presentation requires one packaged owner.`);let c=o[0],l=new AbortController,d=AbortSignal.any([t,l.signal]),f=new Set,m=!1,h=()=>{if(!m){m=!0,l.abort();for(let e of f)e();f.clear(),i.delete(l)}};i.add(l),f.add(a(d,`abort`,h,{once:!0}));let g=[];try{let{loadControlUiPluginAssets:t}=await r(async()=>{let{loadControlUiPluginAssets:e}=await import(`./control-ui-loader-DXiEkjvv.js`);return{loadControlUiPluginAssets:e}},__vite__mapDeps([0,1,2]),import.meta.url),i=await n(t(c.pluginId,c,d,e=>f.add(e),g),15e3,()=>{throw Error(s(`pluginUi.settingsTimedOut`))});if(d.throwIfAborted(),i.pluginId!==c.pluginId||!Array.isArray(i.settingsViews)||i.settingsViews.length!==c.settingsViews?.length)throw Error(`Settings presentation does not match its packaged owner and placements.`);let a=i.settingsViews.every(e=>typeof e.mount==`function`&&c.settingsViews?.some(t=>p(t,e.placement))),o=i.settingsViews.filter(t=>p(t.placement,e)),l=o[0];if(!a||o.length!==1||!l)throw Error(`Invalid or duplicate Settings presentation.`);for(let e of g)e.media=`all`;return{view:l,signal:d,dispose:h}}catch(e){throw h(),e}}function h(){return(h=e((()=>{i(),f(),o(),c(),t(),l(d)})))()}h();export{m as loadPackagedSettingsView};