f7cloud_client/apps/whiteboard/js/file-save-745eba88-K5rvyIiP.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

4 lines
981 B
JavaScript

/*! third party licenses: js/vendor.LICENSE.txt */
var w=async(e,t=[{}],n=null,l=!1,p=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const c=[];let a=null;if(e instanceof Blob&&e.type?a=e.type:e.headers&&e.headers.get("content-type")&&(a=e.headers.get("content-type")),t.forEach((i,o)=>{c[o]={description:i.description||"",accept:{}},i.mimeTypes?(o===0&&a&&i.mimeTypes.push(a),i.mimeTypes.map(d=>{c[o].accept[d]=i.extensions||[]})):a&&(c[o].accept[a]=i.extensions||[])}),n)try{await n.getFile()}catch(i){if(n=null,l)throw i}const r=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:c,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&p&&p();const s=await r.createWritable();return"stream"in e?(await e.stream().pipeTo(s),r):"body"in e?(await e.body.pipeTo(s),r):(await s.write(await e),await s.close(),r)};export{w as default};
//# sourceMappingURL=file-save-745eba88-K5rvyIiP.chunk.mjs.map