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