import{aa as m,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as t}from"./main-tangy-colts-beg.js";import{s as p}from"./machine.-tangy-colts-beg-869.js";import{f as i}from"./machineh-tangy-colts-beg-587.js";import{h as C,c as s}from"./suitedas-tangy-colts-beg-185.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 u=m(({helpers:n})=>({states:{components:[s(n),{componentName:n.componentName.select,fieldType:"config",id:"chose-company-id",label:t("Chose Company"),onChange:"COMPANIES",optionFilterProp:"label",options:[{label:t("Get all Company"),value:"getAllCompanies"},{label:t("Get Specific Company"),value:"getSpecificCompany"}],placeholder:t("Chose Company type"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,style:{width:180},value:"getAllCompanies"},{componentName:n.componentName.mixInput,fieldType:"config",helperText:t("Page number must be a numeric value."),id:"page-number",label:t("Page Number"),onChange:"SET_PAGE_NUMBER",render:"IF_ALL_COMPANY_SELECTED",value:[]},{componentName:n.componentName.select,fieldType:"config",id:"company-id",isLoadable:!0,label:t("Select Company"),onChange:"SET_COMPANY",onLoadData:"ON_LOAD_COMPANY_DATA",onRefetch:"REFETCH_COMPANY_LIST",optionFilterProp:"label",options:[],placeholder:t("Select a Company"),render:"IF_COMPANY_SELECTED",required:!0,showSearch:!0,value:void 0}]},actions:{SET_CONNECTION:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.connectionId=o}),await i(e)},IF_CONNECTION_SELECTED:({$:e})=>{var o;return c((o=e.getComponent("connection-id"))==null?void 0:o.value)},IF_COMPANY_SELECTED:({$:e})=>{var o;return((o=e.getComponent("chose-company-id"))==null?void 0:o.value)==="getSpecificCompany"},IF_ALL_COMPANY_SELECTED:({$:e})=>{var o,a;if(((o=e.getComponent("chose-company-id"))==null?void 0:o.value)==="getAllCompanies"&&c((a=e.getComponent("connection-id"))==null?void 0:a.value))return!0},REFETCH_COMPANY_LIST:async({$:e})=>{await i(e)},SET_COMPANY:({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.companyId=o})},COMPANIES:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.addTo=o}),await i(e)},SET_PAGE_NUMBER:async({$:e,e:o})=>{e.setThisComponent(a=>{a.value=o}),e.setDb(a=>{a.pageNumber=o})},ON_LOAD_COMPANY_DATA:async({$:e,e:o})=>{await i(e,o.count+1)},CONNECTION_ADD_CHANGE:C,ON_MACHINE_LOAD:async({$:e})=>{p(e,[{db:"connectionId",id:"connection-id"},{db:"companyId",id:"company-id"},{db:"choseCompanyId",id:"chose-company-id"},{db:"pageNumber",id:"page-number"}])}}}));export{u as default};
