import{aa as d,ab as l}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as a,s as c}from"./machine.-tangy-colts-beg-869.js";import{h as E,c as h}from"./commons.-tangy-colts-beg-359.js";import{f as r,b as i,h as C}from"./machineh-tangy-colts-beg-169.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const T=d(({helpers:o})=>({states:{components:[h(o),{componentName:o.componentName.mixInput,fieldType:"config",helperText:n("The name of the new folder. If not set, 'Untitled' will be used."),id:"folder-name",label:n("Folder Name"),onChange:"SET_FOLDER_NAME",render:"IF_CONNECTION_SELECTED",required:!1,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:n("Select the drive where to create the new folder."),id:"drive-id",label:n("Parent Drive"),onChange:"SELECT_DRIVE",onRefetch:"REFETCH_DRIVES",options:[],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0},{allowClear:!0,componentName:o.componentName.select,fieldType:"config",helperText:n("Select the parent folder where to create the new folder."),id:"parent-folder-id",label:n("Parent Folder"),onChange:"SELECT_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:t})=>{a("connectionId")({$:e,e:t}),await Promise.all([i(e),r(e)]),C(e,o)},CONNECTION_ADD_CHANGE:E,IF_CONNECTION_SELECTED:({$:e})=>{var t;return l((t=e.getComponent("connection-id"))==null?void 0:t.value)},REFETCH_DRIVES:({$:e})=>i(e),REFETCH_FOLDERS:({$:e})=>r(e),SELECT_DRIVE:a("driveId"),SELECT_FOLDER:a("parentFolderId"),SET_FOLDER_NAME:a("folderName"),ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"folderName",id:"folder-name"},{db:"driveId",id:"drive-id"},{db:"parentFolderId",id:"parent-folder-id"}]),await Promise.all([i(e),r(e)])}}}));export{T as default};
