import{d as e}from"./subsystem-BQ1073Mu.js";import{r as t}from"./prompt-style-DpAh867d.js";import{note as n}from"@clack/prompts";const r=/^(https?:\/\/|file:\/\/)/i,i=/^[a-zA-Z]:[\\/]/,a=/^[a-zA-Z0-9._-]+$/;function o(e){if(!e)return!1;let t=e.trim().toLowerCase();return t?t!==`0`&&t!==`false`&&t!==`off`:!1}function s(e,t){if(t<=0)return[e];let n=Array.from(e),r=[];for(let e=0;e<n.length;e+=t)r.push(n.slice(e,e+t).join(``));return r.length>0?r:[e]}function c(e){return e?r.test(e)||e.startsWith(`/`)||e.startsWith(`~/`)||e.startsWith(`./`)||e.startsWith(`../`)||i.test(e)||e.startsWith(`\\\\`)||e.includes(`/`)||e.includes(`\\`)?!0:e.includes(`_`)&&a.test(e):!1}function l(t,n){if(t.trim().length===0)return[t];let r=t.match(/^(\s*)([-*\u2022]\s+)?(.*)$/),i=r?.[1]??``,a=r?.[2]??``,o=r?.[3]??``,l=`${i}${a}`,u=`${i}${a?` `.repeat(a.length):``}`,d=Math.max(10,n-e(l)),f=Math.max(10,n-e(u)),p=o.split(/\s+/).filter(Boolean),m=[],h=``,g=l,_=d;for(let t of p){if(!h){if(e(t)>_){if(c(t)){h=t;continue}let e=s(t,_),n=e.shift()??``;m.push(g+n),g=u,_=f;for(let t of e)m.push(g+t);continue}h=t;continue}let n=`${h} ${t}`;if(e(n)<=_){h=n;continue}if(m.push(g+h),g=u,_=f,e(t)>_){if(c(t)){h=t;continue}let e=s(t,_),n=e.shift()??``;m.push(g+n);for(let t of e)m.push(g+t);h=``;continue}h=t}return(h||p.length===0)&&m.push(g+h),m}function u(e,t={}){let n=t.columns??process.stdout.columns??80,r=t.maxWidth??Math.max(40,Math.min(88,n-10));return e.split(`
`).flatMap(e=>l(e,r)).join(`
`)}function d(e,r){o(process.env.OPENCLAW_SUPPRESS_NOTES)||n(u(e),t(r))}export{d as t};
