import{h as l,g as j,$ as C,k as I,i as w,j as s,_ as r}from"./main.2.8.10.js";import{u as _,e as S,b as c}from"./react-router.DMwpH23k.js";import{S as v}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as y,I as N,s as k}from"./Integrations.BFhED4ck.js";import{h as f,c as F}from"./ZohoCampaignsCommonFunc.B1L6y0DX.js";import{Z as E}from"./ZohoCampaignsIntegLayout.cq2Tk6UM.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:g}){const x=_(),{id:$,formID:n}=S(),[t,e]=l(j),[m,h]=l(C),[p,i]=c.useState(!1),[u,a]=c.useState({show:!1}),d=I(w),b=()=>{if(!F(t)){a({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}k({flow:m,setFlow:h,allIntegURL:g,conf:t,navigate:x,edit:1,setIsLoading:i,setSnackbar:a})};return s.jsxs("div",{style:{width:900},children:[s.jsx(v,{snack:u,setSnackbar:a}),s.jsxs("div",{className:"flx mt-3",children:[s.jsx("b",{className:"wdt-100 d-in-b",children:r("Integration Name:","bit-integrations")}),s.jsx("input",{className:"btcd-paper-inp w-7",onChange:o=>f(o,n,t,e),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),s.jsx("br",{}),s.jsx("br",{}),s.jsx(y,{entity:m.triggered_entity,setSnackbar:a}),s.jsx(E,{formID:n,formFields:d,handleInput:o=>f(o,n,t,e,i,a),campaignsConf:t,setCampaignsConf:e,isLoading:p,setIsLoading:i,setSnackbar:a}),s.jsx(N,{edit:!0,saveConfig:b,disabled:t.list===""||t.table===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:e,formFields:d})]})}export{J as default};
