import{ai as I,u as E,R as e,aj as u,a6 as N,r as a,ak as h,al as y,am as F,af as v,an as w,ao as S}from"./index-DH3zn7Tz.js";const f=25*1024*1024,m=1e3,g=1e4,_=t=>{const l=a.useRef(null);a.useEffect(()=>{l.current!=null&&h.highlightElement(l.current)});const s=t.input,n=y(s.type),r=F(n)&&n.extension?n.extension:"",x=a.useMemo(()=>v({file:t.input}),[t.input]),i=E(x),o=i.loading,c=a.useMemo(()=>o?null:w(r,i.result,m,g),[o,r,i.result]);if(o)return e.createElement("div",null);const p=c?.truncatedTotalLines,L=c?.truncatedLineLength,T=c?.text,d=M(r);return e.createElement("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},L&&e.createElement(u,{textAlign:"center"},"Warning: some lines truncated to ",m," characters for display"),p&&e.createElement(u,{textAlign:"center"},"Warning: truncated to ",g," lines for display"),e.createElement("div",{style:{background:"white",border:"1px solid #eee",padding:16,flexGrow:1,overflow:"auto"}},e.createElement("pre",{style:{maxWidth:"100%",overflowX:"hidden",textOverflow:"ellipsis"}},e.createElement("code",{ref:l,className:d!=null?`language-${d}`:void 0},T))))},b=t=>{const l=t.input,s=I({file:l}),n=E(s);return n.loading?e.createElement("div",null):(n.result??0)>f?e.createElement(u,{textAlign:"center"},"Text view limited to files less than"," ",N(f).format("0.0b")):e.createElement(_,{...t})};function M(t){return S[t]??null}export{b as default};
//# sourceMappingURL=Component-BGmxboUF.js.map
