var h=Object.defineProperty;var o=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var f=(s,t,e)=>t in s?h(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,l=(s,t)=>{for(var e in t||(t={}))u.call(t,e)&&f(s,e,t[e]);if(o)for(var e of o(t))c.call(t,e)&&f(s,e,t[e]);return s};import{d as m,p as d}from"./main.2.8.1.js";const _=(s,t,e)=>{const i=l({},t);i.name=s.target.value,e(l({},i))},F=(s,t,e,i)=>{e(!0);const n={client_id:s.client_id,api_key:s.api_key};m(n,"campaign_monitor_lists").then(r=>{if(r&&r.success){const a=l({},s);r.data?(a.default||(a.default={}),a.default.campaignMonitorLists=r.data,i({show:!0,msg:d("CampaignMonitor Lists refreshed","bit-integrations")})):i({show:!0,msg:d("No CampaignMonitor Lists found. Try changing the header row number or try again","bit-integrations")}),t(l({},a))}else i({show:!0,msg:d("CampaignMonitor Lists refresh failed. please try again","bit-integrations")});e(!1)}).catch(()=>e(!1))},y=(s,t,e,i)=>{e(!0);const n={client_id:s.client_id,api_key:s.api_key,listId:s.listId};m(n,"campaign_monitor_custom_fields").then(r=>{r&&r.success?(t(a=>(a.customFields=r.data?r.data:[],a)),i({show:!0,msg:d("CampaignMonitor Custom fields refreshed.","bit-integrations")})):i({show:!0,msg:d("CampaignMonitor Custom fields refresh failed. please try again","bit-integrations")}),e(!1)}).catch(()=>e(!1))},w=s=>{let t=s.subscriberFields;const e=t&&t.filter(i=>i.required===!0);return e.length>0?e.map(i=>({formField:"",campaignMonitorField:i.key})):[{formField:"",campaignMonitorField:""}]},b=s=>!((s!=null&&s.field_map?s.field_map.filter(e=>!e.formField&&e.campaignMonitorField&&e.required):[]).length>0);export{y as a,b as c,w as g,_ as h,F as r};
