import{b as p,$ as j,h as C,k as w,i as I,j as t,_ as o,q as k}from"./main.2.8.1.js";import{u as S,h as v,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as y}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as F,I as N,s as E}from"./Integrations.D2bgBas2.js";import{h as l,c as f}from"./WoodpeckerCommonFunc.dq-IRStb.js";import{W as L}from"./WoodpeckerIntegLayout.Bx_foKNK.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function H({allIntegURL:g}){const u=S(),{id:W}=v(),[n,$]=p(j),[e,a]=p(C),[d,m]=r.useState(!1),[x,h]=r.useState({}),[_,s]=r.useState({show:!1}),c=w(I),b=()=>{if(!f(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="adding_prospects_to_the_campaign"&&!e.selectedCampaign){k.error(o("Please select a Campaign","bit-integrations"));return}E({flow:n,allIntegURL:g,conf:e,navigate:u,edit:1,setIsLoading:m,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(y,{snack:_,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>l(i,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(F,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:n.triggered_entity_id,formFields:c,handleInput:i=>l(i,e,a),woodpeckerConf:e,setWoodpeckerConf:a,loading:x,setLoading:h,isLoading:d,setIsLoading:m,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:b,disabled:!f(e),isLoading:d,dataConf:e,setDataConf:a,formFields:c}),t.jsx("br",{})]})}export{H as default};
