import{_ as e}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,t){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,t),t)}};const d=[{label:e("Subscribe to List"),value:"subscribe"},{label:e("Unsubscribe from List"),value:"unsubscribe"},{label:e("Email Opened"),value:"open"},{label:e("Link Clicked"),value:"click"},{label:e("Email Forwarded"),value:"forward"},{label:e("Email Shared"),value:"share"},{label:e("Hard Bounce"),value:"bounce"},{label:e("Contact Updated"),value:"update"},{label:e("New Contact Added"),value:"add"},{label:e("Contact Note Added"),value:"note_add"},{label:e("Contact Tag Added"),value:"tag_add"},{label:e("Contact Tag Removed"),value:"tag_remove"},{label:e("Deal Added"),value:"deal_add"},{label:e("Deal Updated"),value:"deal_update"},{label:e("Deal Deleted"),value:"deal_delete"},{label:e("Account Added"),value:"account_add"},{label:e("Account Updated"),value:"account_update"},{label:e("Account Deleted"),value:"account_delete"}],u=a=>({addConnectionHelpingText:e("You can get your API key in your activeCampaign settings tab, developer sections"),componentName:a.componentName.connection,connectionsTypes:[{encryptKeys:["value"],label:e("API Key"),showKey:!1,type:"api_key",verifyConnection:{headers:{"Api-Token":"","Content-Type":"application/json"},method:"GET",responseKeyMatch:["user"],url:""}}],extraComponents:[{componentName:a.componentName.input,id:"url",label:e("Url"),onChange:"HANDLE_URL",placeholder:e("Enter Url"),render:!0,required:!0,value:void 0,wrapperClassName:"mb-2"}],extraData:{},fieldType:"config",id:"connection-id",label:e("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}),s=({$:a,e:t})=>{a.setThisComponent(n=>{a.util.isConnectionComponent(n)&&n.connectionsTypes.forEach(o=>{var l;o.type==="api_key"&&((l=o.verifyConnection)!=null&&l.headers)&&(o.verifyConnection.headers["Api-Token"]=`${t.value}`)})})},r=({$:a,e:t})=>{a.setThisComponent(n=>{a.util.isInputComponent(n)&&(n.value=t.target.value,n.status=void 0)}),a.setComponent("connection-id",n=>{var o;a.util.isConnectionComponent(n)&&((o=n.connectionsTypes[0])!=null&&o.verifyConnection&&(n.connectionsTypes[0].verifyConnection.url=`${t.target.value}/api/3/users/me`),n.extraData||(n.extraData={}),n.extraData.url=t.target.value)}),a.setDb(n=>{n.urlDb=t.target.value})},C=({$:a})=>{var t;((t=a.db)==null?void 0:t.urlDb)!==void 0&&a.setComponent("connection-id",n=>{var o,l,i;a.util.isConnectionComponent(n)&&((o=n.connectionsTypes[0])!=null&&o.verifyConnection&&(n.connectionsTypes[0].verifyConnection.url=`${(l=a.db)==null?void 0:l.urlDb}/api/3/users/me`),n.extraData||(n.extraData={}),n.extraData.url=(i=a.db)==null?void 0:i.urlDb)})};export{s as a,u as c,r as h,C as u,d as w};
