import{n as l,b as r,e as m}from"./vendor-lit-BtHfzs80.js";import{au as u,av as x,aw as $,az as g}from"./index-rvuS68Al.js";import{p as s}from"./vendor-lucide-DBEJLfdn.js";import{T as f}from"./vendor-typebox-DJ_ZScJ4.js";import"./vendor-mini-lit-Cx886NBU.js";import"./vendor-marked-_iteVaMm.js";import"./vendor-sortable-B1o3v0Qs.js";f.Object({url:f.String({description:"URL of the document to extract text from (PDF, DOCX, or PPTX)"})});const b={render(o,t,v){const a=u(t,v),n=m(),d=m();if(t&&o){const e=t.details,p=e?t.isError?`Failed to extract ${e.fileName||"document"}`:`Extracted text from ${e.fileName} (${e.format.toUpperCase()}, ${(e.size/1024).toFixed(1)}KB)`:t.isError?"Failed to extract document":"Extracted text from document",i=t.content?.filter(c=>c.type==="text").map(c=>c.text).join(`
`)||"";return{content:r`
					<div>
						${x(a,s,p,n,d,!1)}
						<div ${l(n)} class="max-h-0 overflow-hidden transition-all duration-300 space-y-3">
							${o.url?r`<div class="text-sm text-gray-600 dark:text-gray-400">
										<strong>URL:</strong> ${o.url}
								  </div>`:""}
							${i&&!t.isError?r`<code-block .code=${i} language="plaintext"></code-block>`:""}
							${t.isError&&i?r`<console-block .content=${i} .variant=${"error"}></console-block>`:""}
						</div>
					</div>
				`,isCustom:!1}}return o?{content:r`
					<div>
						${x(a,s,"Extracting document...",n,d,!1)}
						<div ${l(n)} class="max-h-0 overflow-hidden transition-all duration-300">
							<div class="text-sm text-gray-600 dark:text-gray-400"><strong>URL:</strong> ${o.url}</div>
						</div>
					</div>
				`,isCustom:!1}:{content:$(a,s,"Preparing extraction..."),isCustom:!1}}};g("extract_document",b);export{b as extractDocumentRenderer};
