import{b as c,h as j,$ as I,k,i as w,j as e,_ as r}from"./main.2.8.1.js";import{u as C,h as _,d as p}from"./react-router-dom.9mCuUg3q.js";import{S}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as v,I as y,s as N}from"./Integrations.D2bgBas2.js";import{h as f,c as F}from"./ZohoMarketingHubCommonFunc.jxunAV-M.js";import{Z as M}from"./ZohoMarketingHubIntegLayout.CKh_6uFZ.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function G({allIntegURL:g}){const u=C(),{id:E,formID:n}=_(),[t,a]=c(j),[m,h]=c(I),[d,i]=p.useState(!1),[x,s]=p.useState({show:!1}),l=k(w),b=()=>{if(!F(t)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}N({flow:m,setFlow:h,allIntegURL:g,conf:t,navigate:u,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>f(o,n,t,a),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:m.triggered_entity,setSnackbar:s}),e.jsx(M,{formID:n,formFields:l,handleInput:o=>f(o,n,t,a,i,s),marketingHubConf:t,setMarketingHubConf:a,isLoading:d,setIsLoading:i,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:t.list===""||t.table===""||t.field_map.length<1,isLoading:d,dataConf:t,setDataConf:a,formFields:l})]})}export{G as default};
