import{validation}from"../../Validation.js";class GetTextFromFile{async execute(e){var t=validation.exists("file",e.file),e=validation.string("encoding",e.encoding);return{result:await this.getText(t,e)}}async getText(r,o){return new Promise((e,t)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=e=>t(e),i.readAsText(r,o)})}}GetTextFromFile.action="gcx:wf:core::GetTextFromFile",GetTextFromFile.suite="gcx:wf:builtin";export{GetTextFromFile};