import{aa as l,ab as d}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{a as r,b as i,h,c as E}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 _=l(({helpers:t})=>({states:{components:[E(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 to add the worksheet to."),id:"workbook-id",label:a("Workbook"),onChange:"HANDLE_WORKBOOK",onRefetch:"REFETCH_WORKBOOKS",options:[],render:"IF_CONNECTION_SELECTED",required:!0,value:void 0},{componentName:t.componentName.mixInput,helperText:a("The name of the sheet to be added. The name should be unique. If not specified, Excel will determine the name of the new worksheet."),id:"worksheet-name",label:a("Worksheet Name"),onChange:"HANDLE_WORKSHEET_NAME",path:"name",render:"IF_WORKBOOK_SELECTED",required:!1,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:h,HANDLE_WORKSHEET_NAME:n("worksheetName"),IF_CONNECTION_SELECTED:({$:e})=>{var o;return d((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_WORKBOOK_SELECTED:({$:e})=>{var o;return d((o=e.getComponent("workbook-id"))==null?void 0:o.value)},REFETCH_FOLDERS:({$:e})=>i(e),REFETCH_WORKBOOKS:({$:e})=>r(e),SET_CONNECTION:({$:e,e:o})=>{n("connectionId")({$:e,e:o}),i(e)},HANDLE_FOLDER:({$:e,e:o})=>{n("folderId")({$:e,e:o}),r(e)},HANDLE_WORKBOOK:({$:e,e:o})=>{n("workbookId")({$:e,e:o})},ON_MACHINE_LOAD:async({$:e})=>{c(e,[{db:"connectionId",id:"connection-id"},{db:"folderId",id:"folder-id"},{db:"workbookId",id:"workbook-id"},{db:"worksheetName",id:"worksheet-name"}]),await Promise.all([i(e),r(e)])}}}));export{_ as default};
