import{r as e}from"./norm-CeclA1Tu.js";import{t}from"./pdfUtils-Bnt45Amd.js";import{c as n,t as r}from"./proxyOps-Bu_E5G0s.js";var i=e=>/\.txt$|\.md$|\.markdown$|\.json$|\.csv$/i.test(e),a=(e,t)=>/\.pdf$/i.test(e)||t===`application/pdf`,o=async(o,s)=>{let c=e(o?.name)||`附件`,l=e(o?.type).toLowerCase();return i(c)?e(await o.text().catch(()=>``)):a(c,l)?await n({fileDataUrl:await r(o),fileName:c,pages:await t(o).catch(()=>1),minLength:s?.minLength,signal:s?.signal,onStage:s?.onStage}):``};export{o as t};