import{h as m,$ as I,g as _,k,i as w,j as t,_ as o}from"./main.2.8.10.js";import{u as C,e as S,b as r}from"./react-router.DMwpH23k.js";import{S as L}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as v,I as y,s as F}from"./Integrations.BFhED4ck.js";import{h as l,c}from"./LionDeskCommonFunc.DwvMlrLg.js";import{L as D}from"./LionDeskIntegLayout.CEQ6z10E.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";function J({allIntegURL:f}){const p=C(),{id:N}=S(),[n,E]=m(I),[e,a]=m(_),[g,u]=r.useState(!1),[x,h]=r.useState({}),[j,s]=r.useState({show:!1}),d=k(w),b=()=>{if(!c(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}F({flow:n,allIntegURL:f,conf:e,navigate:p,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(L,{snack:j,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:i=>l(i,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(D,{formID:n.triggered_entity_id,formFields:d,handleInput:i=>l(i,e,a),lionDeskConf:e,setLionDeskConf:a,loading:x,setLoading:h,setIsLoading:u,setSnackbar:s}),t.jsx(y,{edit:!0,saveConfig:b,disabled:!c(e),isLoading:g,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{J as default};
