import{h as m,$ as j,g as I,k as y,i as S,j as t,_ as i,q as n}from"./main.2.9.0.js";import{u as w,b as r}from"./react-router.DMwpH23k.js";import{S as C}from"./SnackMsg.DYSD96P4.js";import{S as v,I as F,s as N}from"./Integrations.DL8wqGct.js";import{h as k,c}from"./ACPTCommonFunc.Bfrokijl.js";import{A}from"./ACPTIntegLayout.Do-xCkY3.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./ProUtilHelpers.CHf_DzPf.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({allIntegURL:l}){const g=w(),[s,P]=m(j),[e,o]=m(I),[f,d]=r.useState(!1),[u,_]=r.useState({}),[x,a]=r.useState({show:!1}),p=y(S),b=()=>{if(!c(e)){n.error(i("Please map mandatory fields","bit-integrations"));return}if(["create_cpt","update_cpt","create_option_page","update_option_page"].includes(e.module)&&!(e!=null&&e.icon)){n.error(i("Please select Icon","bit-integrations"));return}if(["create_option_page","update_option_page"].includes(e.module)&&!(e!=null&&e.capability)){n.error(i("Please select Capability","bit-integrations"));return}N({flow:s,allIntegURL:l,conf:e,navigate:g,edit:1,setIsLoading:d,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:x,setSnackbar:a}),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:h=>k(h,e,o),name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:s.triggered_entity,setSnackbar:a}),t.jsx(A,{formID:s.triggered_entity_id,formFields:p,acptConf:e,setAcptConf:o,loading:u,setLoading:_,setIsLoading:d,setSnackbar:a}),t.jsx(F,{edit:!0,saveConfig:b,disabled:!c(e),isLoading:f,dataConf:e,setDataConf:o,formFields:p}),t.jsx("br",{})]})}export{O as default};
