var h=Object.defineProperty;var u=Object.getOwnPropertySymbols;var i=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var w=(r,n,a)=>n in r?h(r,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[n]=a,g=(r,n)=>{for(var a in n||(n={}))i.call(n,a)&&w(r,a,n[a]);if(u)for(var a of u(n))x.call(n,a)&&w(r,a,n[a]);return r};var p=(r,n,a)=>new Promise((s,e)=>{var c=o=>{try{t(a.next(o))}catch(l){e(l)}},F=o=>{try{t(a.throw(o))}catch(l){e(l)}},t=o=>o.done?s(o.value):Promise.resolve(o.value).then(c,F);t((a=a.apply(r,n)).next())});import{D as y,E as d,F as O}from"./index.9fabe127.js";const b=(r,n,a,s)=>{if(r.code!==200){d.error("\u4E0A\u4F20\u5931\u8D25!");const e=n.findIndex(c=>c.response.code!==200);n.splice(e,1)}a&&n.length>1&&(d.error("\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6!"),n.shift()),s&&s()},L=r=>{d.error(r.message?JSON.parse(r.message):"\u4E0A\u4F20\u5931\u8D25\uFF01")},P=["wps","pdf","doc","docx"],T="pdf\u3001word",f=(r,{types:n,size:a})=>{const s=r.name.substring(r.name.lastIndexOf(".")+1).toLocaleLowerCase(),e=n.indexOf(s)!==-1,c=a?r.size/1024<=a:!0;return e||d.error("\u4E0A\u4F20\u6587\u4EF6\u683C\u5F0F\u9519\u8BEF!"),c||d.error(`\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 ${a>=1024?a/1024:a}${a>=1024?"M":"KB"}!`),e&&c},E=r=>{d.warning(`\u8BE5\u5904\u53EA\u53EF\u4E0A\u4F20${r.length}\u4E2A\u6587\u4EF6`)},N=r=>{var n,a;window.open(`/fileView?id=${(a=(n=r==null?void 0:r.response)==null?void 0:n.data)==null?void 0:a.id}`,"_blank")},R=r=>{var a;let n=[];return r&&(n=((a=r==null?void 0:r.map)==null?void 0:a.call(r,s=>({uid:s==null?void 0:s.id,name:s==null?void 0:s.originalFileName,status:"success",url:s==null?void 0:s.url,response:{data:s}})))||[]),JSON.parse(JSON.stringify(n))},$=r=>{let n=[];return r&&r.length&&(n=r.map(a=>{var s;return a.response?(s=a.response)==null?void 0:s.data:g({},a)})),n},j=r=>p(void 0,null,function*(){const n=yield O({fileId:r});return URL.createObjectURL(n)}),I=r=>p(void 0,null,function*(){const n=yield y({fileId:r});return URL.createObjectURL(n)});export{j as a,N as b,P as c,I as d,T as e,f,$ as g,b as h,L as i,E as j,R as r};
