const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./util.BQqrH4rd.js","./rolldown-runtime.C0FnF6B9.js","./preload-helper.HclGiUj8.js","./FileSystemFileHandle.4sVW5ZPT.js","./FileSystemHandle.CFTLjada.js","./config.Mbx-WYSj.js","./downloader.Cq4XXgR9.js","./sandbox.BKQb5R92.js","./FileSystemDirectoryHandle.Dd5S4jVZ.js"])))=>i.map(i=>d[i]);
import{t as e}from"./preload-helper.HclGiUj8.js";import{t}from"./FileSystemHandle.CFTLjada.js";import{FileSystemDirectoryHandle as n}from"./FileSystemDirectoryHandle.Dd5S4jVZ.js";import{FileSystemFileHandle as r,t as i}from"./FileSystemFileHandle.4sVW5ZPT.js";var a=globalThis.showDirectoryPicker;async function o(t={}){if(a&&!t._preferPolyfill)return a(t);let n=document.createElement(`input`);n.type=`file`,n.webkitdirectory=!0,n.multiple=!0,n.style.position=`fixed`,n.style.top=`-100000px`,n.style.left=`-100000px`,document.body.appendChild(n);let r=e(()=>import(`./util.BQqrH4rd.js`).then(e=>e.n),__vite__mapDeps([0,1,2]),import.meta.url);return await new Promise(e=>{n.addEventListener(`change`,e),n.click()}),r.then(e=>e.getDirHandlesFromInput(n))}var s={accepts:[]},c=globalThis.showOpenFilePicker;async function l(t={}){let n={...s,...t};if(c&&!t._preferPolyfill)return c(n);let r=document.createElement(`input`);r.type=`file`,r.multiple=n.multiple,r.accept=(n.accepts||[]).map(e=>[...(e.extensions||[]).map(e=>`.`+e),...e.mimeTypes||[]]).flat().join(`,`),Object.assign(r.style,{position:`fixed`,top:`-100000px`,left:`-100000px`}),document.body.appendChild(r);let i=e(()=>import(`./util.BQqrH4rd.js`).then(e=>e.n),__vite__mapDeps([0,1,2]),import.meta.url);return await new Promise(e=>{r.addEventListener(`change`,e,{once:!0}),r.click()}),r.remove(),i.then(e=>e.getFileHandlesFromInput(r))}var u=globalThis.showSaveFilePicker;async function d(t={}){if(u&&!t._preferPolyfill)return u(t);t._name&&(console.warn("deprecated _name, spec now have `suggestedName`"),t.suggestedName=t._name);let{FileSystemFileHandle:n}=await e(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.4sVW5ZPT.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([3,4,0,1,2,5]),import.meta.url),{FileHandle:r}=await e(async()=>{let{FileHandle:e}=await import(`./downloader.Cq4XXgR9.js`);return{FileHandle:e}},__vite__mapDeps([6,0,1,2,5]),import.meta.url);return new n(new r(t.suggestedName))}globalThis.DataTransferItem&&!DataTransferItem.prototype.getAsFileSystemHandle&&(DataTransferItem.prototype.getAsFileSystemHandle=async function(){let t=this.webkitGetAsEntry(),[{FileHandle:n,FolderHandle:r},{FileSystemDirectoryHandle:i},{FileSystemFileHandle:a}]=await Promise.all([e(()=>import(`./sandbox.BKQb5R92.js`),__vite__mapDeps([7,0,1,2]),import.meta.url),e(()=>import(`./FileSystemDirectoryHandle.Dd5S4jVZ.js`),__vite__mapDeps([8,2,4,0,1]),import.meta.url),e(()=>import(`./FileSystemFileHandle.4sVW5ZPT.js`),__vite__mapDeps([3,4,0,1,2,5]),import.meta.url)]);return t.isFile?new a(new n(t,!1)):new i(new r(t,!1))});async function f(t,n={}){if(!t)return globalThis.navigator?.storage?.getDirectory()||globalThis.getOriginPrivateDirectory();let{FileSystemDirectoryHandle:r}=await e(async()=>{let{FileSystemDirectoryHandle:e}=await import(`./FileSystemDirectoryHandle.Dd5S4jVZ.js`);return{FileSystemDirectoryHandle:e}},__vite__mapDeps([8,2,4,0,1]),import.meta.url),i=await t;return new r(await(i.default?i.default(n):i(n)))}export{n as FileSystemDirectoryHandle,r as FileSystemFileHandle,t as FileSystemHandle,i as FileSystemWritableFileStream,f as getOriginPrivateDirectory,o as showDirectoryPicker,l as showOpenFilePicker,d as showSaveFilePicker};