import{assert}from"./assert.js";export class FileChooser{constructor(e,s){this._handled=!1,this._element=e,this._multiple="selectSingle"!==s.mode}isMultiple(){return this._multiple}async accept(e){assert(!this._handled,"Cannot accept FileChooser which is already handled!"),this._handled=!0,await this._element.uploadFile(...e)}async cancel(){assert(!this._handled,"Cannot cancel FileChooser which is already handled!"),this._handled=!0}}