import{aa as E,ab as d}from"./_applist-tangy-colts-beg-36.js";import{_ as e}from"./main-tangy-colts-beg.js";import{h as n,s as r}from"./machine.-tangy-colts-beg-869.js";import{h as m,c}from"./dropboxc-tangy-colts-beg-404.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,t){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,t),t)}};const N=E(({helpers:o})=>({states:{components:[c(o),{componentName:o.componentName.mixInput,fieldType:"config",helperText:e("Enter the destination path where the file should be uploaded (e.g., /Documents/file.txt)."),id:"file-path",label:e("File Path"),onChange:"SET_FILE_PATH",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:o.componentName.mixInput,fieldType:"config",helperText:e("Enter the file content or URL to upload."),id:"file-content",label:e("File Content"),onChange:"SET_FILE_CONTENT",render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:o.componentName.select,fieldType:"config",helperText:e("Select how to handle existing files."),id:"upload-mode",label:e("Upload Mode"),onChange:"SET_UPLOAD_MODE",options:[{label:e("Add"),value:"add"},{label:e("Overwrite"),value:"overwrite"},{label:e("Update"),value:"update"}],render:"IF_CONNECTION_SELECTED",value:"add"},{componentName:o.componentName.mixInput,fieldType:"config",helperText:e("Enter the revision (rev) of the file to update. Required when Upload Mode is set to Update."),id:"file-rev",label:e("File Revision"),onChange:"SET_FILE_REV",render:"IF_UPDATE_MODE",required:!0,value:void 0},{componentName:o.componentName.switch,fieldType:"config",helperText:e("If enabled, automatically rename the file if a file with the same name already exists."),id:"auto-rename",label:e("Auto Rename"),onChange:"SET_AUTO_RENAME",render:"IF_CONNECTION_SELECTED",size:"small",value:!1}]},actions:{SET_CONNECTION:n("connection"),IF_CONNECTION_SELECTED:({$:t})=>{var a;return d((a=t.getComponent("connection-id"))==null?void 0:a.value)},IF_UPDATE_MODE:({$:t})=>{var i,l;const a=(i=t.getComponent("upload-mode"))==null?void 0:i.value;return d((l=t.getComponent("connection-id"))==null?void 0:l.value)&&a==="update"},CONNECTION_ADD_CHANGE:m,SET_FILE_PATH:n("filePath"),SET_FILE_CONTENT:n("fileContent"),SET_UPLOAD_MODE:n("uploadMode"),SET_FILE_REV:n("fileRev"),SET_AUTO_RENAME:n("autoRename"),ON_MACHINE_LOAD:({$:t})=>{r(t,[{db:"connection",id:"connection-id"},{db:"filePath",id:"file-path"},{db:"fileContent",id:"file-content"},{db:"uploadMode",id:"upload-mode"},{db:"fileRev",id:"file-rev"},{db:"autoRename",id:"auto-rename"}])}}}));export{N as default};
