import{aa as l,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{s as i}from"./machine.-tangy-colts-beg-869.js";import{h as c,c as m}from"./suitedas-tangy-colts-beg-185.js";import{a as d}from"./suitedas-tangy-colts-beg-927.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,e){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,e),e)}};const r=["first_name","last_name","email"],E=l(({helpers:o})=>({states:{components:[m(o),{componentName:o.componentName.select,fieldType:"config",id:"role-id",label:n("Select Role"),onChange:"SET_ROLE_NAME",optionFilterProp:"label",options:[{label:n("Lead"),value:"Lead"},{label:n("Client"),value:"Client"},{label:n("Prospect"),value:"Prospect"}],placeholder:n("Select a Role"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:"Lead"},{addItemButtonLabel:"Add Field",componentName:o.componentName.repeaterField,fieldsMetaData:[{componentName:o.componentName.select,label:n("Field"),name:"suiteDashField",options:d,showSearch:!0,style:{width:150},value:""},{componentName:o.componentName.mixInput,label:n("Value"),name:"value",value:[],wrapperClassName:"w-100"}],id:"contacts-list",label:n("Contact Field Map"),nonRemovableRows:[0,1,2],onChange:"ON_FIELD_MAP_CHANGE",path:"contacts",render:"IF_CONNECTION_SELECTED",value:r.map(e=>[{disabled:!0,name:"suiteDashField",value:e},{name:"value",value:[]}])}]},actions:{SET_CONNECTION:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.connectionId=a})},IF_CONNECTION_SELECTED:({$:e})=>{var a;return s((a=e.getComponent("connection-id"))==null?void 0:a.value)},ON_FIELD_MAP_CHANGE:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.contacts=a})},CONNECTION_ADD_CHANGE:c,SET_ROLE_NAME:async({$:e,e:a})=>{e.setThisComponent(t=>{t.value=a}),e.setDb(t=>{t.roleId=a})},ON_MACHINE_LOAD:async({$:e})=>{i(e,[{db:"connectionId",id:"connection-id"},{db:"contacts",id:"contacts-list"},{db:"roleId",id:"role-id"}])}}}));export{E as default};
