import{aa as d,ab as a}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{h as r,s as c}from"./machine.-tangy-colts-beg-869.js";import{f as E,a as l,b as i,h as s,c as h}from"./microsof-tangy-colts-beg-277.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const T=d(({helpers:t})=>({states:{components:[h(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:n("Select the folder where the workbook is located. Leave empty for root folder."),id:"folder-id",label:n("Folder"),onChange:"HANDLE_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[{label:n("Root"),value:"root"}],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"root"},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:n("Select the workbook."),id:"workbook-id",label:n("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:n("Select the worksheet to delete."),id:"worksheet-id",label:n("Worksheet"),onChange:"HANDLE_WORKSHEET",onRefetch:"REFETCH_WORKSHEETS",options:[],render:"IF_WORKBOOK_SELECTED",required:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:s,HANDLE_WORKSHEET:r("worksheetId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return a((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return a((o=e.getComponent("workbook-id"))==null?void 0:o.value)},IF_WORKSHEET_SELECTED:({$:e})=>{var o;return a((o=e.getComponent("worksheet-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>i(e),REFETCH_WORKBOOKS:({$:e})=>l(e),REFETCH_WORKSHEETS:({$:e})=>E(e),SET_CONNECTION:({$:e,e:o})=>{r("connectionId")({$:e,e:o}),i(e)},HANDLE_FOLDER:({$:e,e:o})=>{r("folderId")({$:e,e:o}),l(e)},HANDLE_WORKBOOK:({$:e,e:o})=>{r("workbookId")({$:e,e:o}),E(e)},ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"folderId",id:"folder-id"},{db:"workbookId",id:"workbook-id"},{db:"worksheetId",id:"worksheet-id"}]),await Promise.all([i(e),l(e),E(e)])}}}));export{T as default};
