import{t as e}from"./browser-1D2tZwAR.js";import{i as t}from"./socketActions-BHNJ_2Q0.js";var n=e=>typeof e==`object`&&!!e&&`path`in e&&typeof e.path==`string`&&`items`in e&&Array.isArray(e.items)&&e.items.every(e=>typeof e==`string`),r=(e,n)=>e.types.includes(t.FILE_DATA_TRANSFER_TYPES[n]),i=(e,n,r)=>{e.setData(t.FILE_DATA_TRANSFER_TYPES[n],JSON.stringify(r))},a=(r,i)=>{let a=r.getData(t.FILE_DATA_TRANSFER_TYPES[i]);try{let e=JSON.parse(a);if(!n(e))throw Error(`Data in data transfer is not of type FileDataTransferData`);return e}catch(n){e.warn(`Failed to parse data transfer data for type ${t.FILE_DATA_TRANSFER_TYPES[i]}`,a,n)}return null};export{r as n,i as r,a as t};