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