import{aa as i,ab as s}from"./_applist-tangy-colts-beg-36.js";import{_ as n}from"./main-tangy-colts-beg.js";import{s as C}from"./machine.-tangy-colts-beg-869.js";import{a as c}from"./machineh-tangy-colts-beg-587.js";import{h as l,c as m}from"./suitedas-tangy-colts-beg-185.js";import{b 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,t){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,t),t)}};const A=i(({helpers:o})=>({states:{components:[m(o),{componentName:o.componentName.select,fieldType:"config",id:"contact-id",isLoadable:!0,label:n("Select Contact"),onChange:"SET_CONTACT_EMAIL",onLoadData:"ON_LOAD_CONTACT_DATA",onRefetch:"REFETCH_CAMPAIGN_LIST",optionFilterProp:"label",options:[],placeholder:n("Select a Contact"),render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{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("Company Field Map"),onChange:"ON_FIELD_MAP_CHANGE",path:"contacts",render:"IF_CONTACT_SELECTED",value:[]}]},actions:{SET_CONNECTION:async({$:t,e})=>{t.setThisComponent(a=>{a.value=e}),t.setDb(a=>{a.connectionId=e}),await c(t)},IF_CONNECTION_SELECTED:({$:t})=>{var e;return s((e=t.getComponent("connection-id"))==null?void 0:e.value)},IF_CONTACT_SELECTED:({$:t})=>{var e;return(e=t.getComponent("contact-id"))==null?void 0:e.value},REFETCH_CAMPAIGN_LIST:async({$:t})=>{await c(t)},ON_FIELD_MAP_CHANGE:async({$:t,e})=>{t.setThisComponent(a=>{a.value=e}),t.setDb(a=>{a.contacts=e})},SET_CONTACT_EMAIL:async({$:t,e})=>{t.setThisComponent(a=>{a.value=e}),t.setDb(a=>{a.contactId=e})},ON_LOAD_CONTACT_DATA:async({$:t,e})=>{await c(t,e.count+1)},CONNECTION_ADD_CHANGE:l,ON_MACHINE_LOAD:async({$:t})=>{var e;C(t,[{db:"connectionId",id:"connection-id"},{db:"contactId",id:"contact-id"},{db:"contacts",id:"contacts-list"}]),(e=t.db)!=null&&e.connectionId&&await c(t)}}}));export{A as default};
