import{aa as c,ab as m}from"./_applist-tangy-colts-beg-36.js";import{_ as a}from"./main-tangy-colts-beg.js";import{h as i,s as d}from"./machine.-tangy-colts-beg-869.js";import{h as C,a as N,c as l,u as h}from"./commonut-tangy-colts-beg-567.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 I=c(({helpers:o})=>({states:{components:[l(o),{componentName:o.componentName.mixInput,helperText:a("Enter contact ID, for the automation"),id:"contact-id",label:a("Contact ID"),onChange:"HANDLE_CONTACT_ID",path:"contact",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:o.componentName.mixInput,helperText:a("Enter automation ID, of the automation"),id:"automation-id",label:a("Automation ID"),onChange:"HANDLE_AUTOMATION_ID",path:"automation",render:"IF_CONNECTION_SELECTED",value:void 0},{componentName:o.componentName.select,helperText:a("Choose the action for the automation"),id:"action-type",label:a("Action"),onChange:"SELECT_ACTION",options:[{label:a("Add"),value:"add"},{label:a("Remove"),value:"remove"}],path:"action-type",render:"IF_CONNECTION_SELECTED",showSearch:!0,value:void 0}]},actions:{CONNECTION_ADD_CHANGE:N,IF_CONNECTION_SELECTED:({$:t})=>{var e;return m((e=t.getComponent("connection-id"))==null?void 0:e.value)},ON_MACHINE_LOAD:({$:t})=>{d(t,[{db:"connectionId",id:"connection-id"},{db:"urlDb",id:"url"},{db:"contactId",id:"contact-id"},{db:"automationId",id:"automation-id"},{db:"actionType",id:"action-type"}]),h({$:t})},SET_CONNECTION:async({$:t,e})=>{t.setThisComponent(n=>{n.value=e}),t.setDb(n=>{n.connectionId=e,n.urlDb=""})},HANDLE_AUTOMATION_ID:i("automationId"),HANDLE_CONTACT_ID:i("contactId"),HANDLE_URL:C,SELECT_ACTION:i("actionType")}}));export{I as default};
