var o=class{constructor(e){this.callbacks=new Map;this.model=e,this.model.on("msg:custom",t=>{if(t.hasOwnProperty("type")){let s=t.key,r=this.callbacks.get(t.type)?.get(s);r&&r(t.payload);return}console.warn(`Unknown message type: ${t}`)})}sendReqInspectFile(e,t){this.model.send({type:"req:inspect-file",key:e,payload:t})}onResInspectFile(e,t){this.getForMethod("res:inspect-file").set(e,t)}offResInspectFile(e){this.getForMethod("res:inspect-file").delete(e)}sendReqBrowseFiles(e,t){this.model.send({type:"req:browse-files",key:e,payload:t})}onResBrowseFiles(e,t){this.getForMethod("res:browse-files").set(e,t)}offResBrowseFiles(e){this.getForMethod("res:browse-files").delete(e)}sendReqUploadDataset(e,t){this.model.send({type:"req:upload-dataset",key:e,payload:t})}onResUploadDataset(e,t){this.getForMethod("res:upload-dataset").set(e,t)}getForMethod(e){let t=this.callbacks.get(e);if(t!==void 0)return t;let s=new Map;return this.callbacks.set(e,s),s}};export{o as BackendComm};
