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