import{aa as d,ab as r}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as n,s as c}from"./machine.-tangy-colts-beg-869.js";import{f as i,a as E,b as l,h,c as s}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 R=d(({helpers:t})=>({states:{components:[s(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the folder where the workbook is located. Leave empty for root folder."),id:"folder-id",label:a("Folder"),onChange:"HANDLE_FOLDER",onRefetch:"REFETCH_FOLDERS",options:[{label:a("Root"),value:"root"}],render:"IF_CONNECTION_SELECTED",showSearch:!0,value:"root"},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the workbook."),id:"workbook-id",label:a("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_FOLDER_SELECTED",required:!0,value:void 0},{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:a("Select the worksheet."),id:"worksheet-id",label:a("Worksheet"),onChange:"HANDLE_WORKSHEET",onRefetch:"REFETCH_WORKSHEETS",options:[],render:"IF_WORKBOOK_SELECTED",required:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:a("The range where the new row will be added, e.g., A1:C1."),id:"target-range",label:a("Range"),onChange:"HANDLE_TARGET_RANGE",path:"targetRange",render:"IF_WORKSHEET_SELECTED",required:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_TARGET_RANGE:n("targetRange"),HANDLE_WORKSHEET:n("worksheetId"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_FOLDER_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("folder-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("workbook-id"))==null?void 0:o.value)},IF_WORKSHEET_SELECTED:({$:e})=>{var o;return r((o=e.getComponent("worksheet-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>l(e),REFETCH_WORKBOOKS:({$:e})=>E(e),REFETCH_WORKSHEETS:({$:e})=>i(e),SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),Promise.all([l(e),E(e)])},HANDLE_FOLDER:({$:e,e:o})=>{n("folderId")({$:e,e:o}),E(e)},HANDLE_WORKBOOK:({$:e,e:o})=>{n("workbookId")({$:e,e:o}),i(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"},{db:"targetRange",id:"target-range"}]),await Promise.all([l(e),E(e),i(e)])}}}));export{R as default};
