import{aa as c,ab as m}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{s}from"./machine.-tangy-colts-beg-869.js";import{f as i}from"./machineh-tangy-colts-beg-587.js";import{h as p,c as l}from"./suitedas-tangy-colts-beg-185.js";import{u as C}from"./suitedas-tangy-colts-beg-927.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(n,e){return this.cache.has(n)?this.cache.get(n):(this.cache.set(n,e),e)}};const A=c(({helpers:n})=>({states:{components:[l(n),{componentName:n.componentName.select,fieldType:"config",id:"company-id",isLoadable:!0,label:t("Select Company"),onChange:"SET_COMPANY_NAME",onLoadData:"ON_LOAD_COMPANY_DATA",onRefetch:"REFETCH_COMPANY_LIST",optionFilterProp:"label",options:[],placeholder:t("Select a Company"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{addItemButtonLabel:"Add Field",componentName:n.componentName.repeaterField,fieldsMetaData:[{componentName:n.componentName.select,label:t("Field"),name:"suiteDashField",options:C,showSearch:!0,style:{width:150},value:""},{componentName:n.componentName.mixInput,label:t("Value"),name:"value",value:[],wrapperClassName:"w-100"}],id:"companies-list",label:t("Company Field Map"),onChange:"ON_FIELD_MAP_CHANGE",path:"companies",render:"IF_COMPANY_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.connectionId=a}),await i(e)},IF_CONNECTION_SELECTED:({$:e})=>{var a;return m((a=e.getComponent("connection-id"))==null?void 0:a.value)},IF_COMPANY_SELECTED:({$:e})=>{var a;return(a=e.getComponent("company-id"))==null?void 0:a.value},REFETCH_COMPANY_LIST:async({$:e})=>{await i(e)},ON_FIELD_MAP_CHANGE:async({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.companies=a})},SET_COMPANY_NAME:async({$:e,e:a})=>{e.setThisComponent(o=>{o.value=a}),e.setDb(o=>{o.companyId=a})},ON_LOAD_COMPANY_DATA:async({$:e,e:a})=>{await i(e,a.count+1)},CONNECTION_ADD_CHANGE:p,ON_MACHINE_LOAD:async({$:e})=>{var a;s(e,[{db:"connectionId",id:"connection-id"},{db:"companyId",id:"company-id"},{db:"companies",id:"companies-list"}]),(a=e.db)!=null&&a.connectionId&&await i(e)}}}));export{A as default};
