import{h as m,$ as j,g as I,k as _,i as w,j as t,_ as a,q as d}from"./main.2.9.0.js";import{u as y,e as R,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as M,I as N,s as v}from"./Integrations.DL8wqGct.js";import{h as l,c}from"./CopperCRMCommonFunc.DJ50Pbks.js";import{C as F}from"./CopperCRMIntegLayout.BlAfvQDq.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function Q({allIntegURL:f}){const g=y(),{id:P}=R(),[o,k]=m(j),[e,i]=m(I),[u,E]=r.useState(!1),[C,x]=r.useState({}),[h,s]=r.useState({show:!1}),p=_(w),b=()=>{if(!c(e)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="opportunity"){if(!e.selectedCRMPeople){d.error(a("Please select a people","bit-integrations"));return}if(!e.selectedCRMPipelines&&e.actionName==="opportunity"){d.error(a("Please select a Pipeline","bit-integrations"));return}}v({flow:o,allIntegURL:f,conf:e,navigate:g,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:h,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>l(n,e,i),name:"name",value:e.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(M,{entity:o.triggered_entity,setSnackbar:s}),t.jsx(F,{formID:o.triggered_entity_id,formFields:p,handleInput:n=>l(n,e,i),copperCRMConf:e,setCopperCRMConf:i,loading:C,setLoading:x,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:b,disabled:!c(e),isLoading:u,dataConf:e,setDataConf:i,formFields:p}),t.jsx("br",{})]})}export{Q as default};
