UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 2.87 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{GN as t,JN as n,Js as r,Ys as i,fN as a,pN as o}from"./_2_____________________________.js";import{A as s,k as c}from"./deferred-ui-support-DZEPWjAk.js";import{C as l,F as u,U as d,d as f,g as p,gt as m,i as h,j as g,l as _,m as v,s as y,u as b,x}from"./_6____________________.js";import{Xr as S,Yr as C}from"./control-ui-boot-chat-styles-DMRbEm40.js";import{_t as w,yt as T}from"./markdown-runtime-CtlJb8xA.js";function E(e){let t=u(()=>e.client.request(`skills.files.get`,{agentId:e.agentId,path:e.path},{signal:e.signal})),i=u(()=>{let e=t().content.replace(/\r\n/g,` `).split(` `);return e.at(-1)===``&&e.pop(),e}),o=u(()=>{let e=i(),t=e[0]===`---`?e.indexOf(`---`,1):-1;return e.slice(0,j).map((e,n)=>({number:n+1,html:w(e||` `,n<=t?`yaml`:`markdown`)}))});return m(()=>e.onPosition()),[(()=>{var i=D(),o=i.firstChild,s=o.nextSibling,c=s.nextSibling,l=c.nextSibling,u=l.firstChild,d=u.nextSibling;f(o,g(a,{name:`fileText`})),f(s,()=>t().path.replaceAll(`\\`,`/`).split(`/`).at(-1)),f(c,()=>t().name),f(l,(()=>{var e=C();return g(r,{ref(t){(typeof e==`function`||Array.isArray(e))&&h(e,t)},get text(){return t().content},get idleLabel(){return n(`filePreview.copyFile`)},bare:!0})})(),u),u._$$click=()=>e.onOpen(t());var m=C();(typeof m==`function`||Array.isArray(m))&&v(()=>m,u),f(u,g(a,{name:`maximize`})),d._$$click=()=>e.onClose();var y=C();return(typeof y==`function`||Array.isArray(y))&&v(()=>y,d),f(d,g(a,{name:`x`})),_(()=>({e:n(`filePreview.skill.openTooltip`),t:n(`filePreview.skill.open`),a:n(`common.close`)}),({e,t,a:n},r)=>{e!==r?.e&&p(u,`title`,e),t!==r?.t&&p(u,`aria-label`,t),n!==r?.a&&p(d,`aria-label`,n)}),i})(),(()=>{var e=O(),t=C();return(typeof t==`function`||Array.isArray(t))&&v(()=>t,e),f(e,g(l,{get each(){return o()},children:e=>(()=>{var t=A(),n=t.firstChild;return f(n,()=>e.number),f(t,g(c,{tag:`code`,get html(){return e.html}}),null),t})()})),_(()=>n(`filePreview.skill.source`),t=>{p(e,`aria-label`,t)}),e})(),(()=>{var e=k(),r=e.firstChild,a=r.nextSibling;return f(r,()=>t().path),f(a,()=>n(`filePreview.skill.lines`,{count:String(o().length),total:String(i().length)})),_(()=>t().path,e=>{p(r,`title`,e)}),e})()]}var D,O,k,A,j;function M(){return(M=e((()=>{b(),d(),t(),T(),S(),i(),o(),s(),D=x(`<header class=skill-file-hovercard__header><span class=skill-file-hovercard__icon aria-hidden=true></span><strong></strong><span class=skill-file-hovercard__name></span><div class=skill-file-hovercard__actions><button type=button></button><button type=button>`),O=x(`<div class=skill-file-hovercard__source tabindex=0>`),k=x(`<footer class=skill-file-hovercard__footer><span class=skill-file-hovercard__path></span><span>`),A=x(`<div class=skill-file-hovercard__line><span class=skill-file-hovercard__number aria-hidden=true>`),j=400,y([`click`])})))()}M();export{E as SkillRead};