import{h as c,g as j,$ as w,k,i as I,j as e,_ as o}from"./main.2.9.0.js";import{e as _,u as C,b as l}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as v,I as y,s as N}from"./Integrations.DL8wqGct.js";import{h as p,c as D}from"./ZohoDeskCommonFunc.D793YqQj.js";import{Z as F}from"./ZohoDeskIntegLayout.BhigWi0r.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:f}){const{id:E,formID:r}=_(),g=C(),[t,n]=c(j),[m,u]=c(w),[h,i]=l.useState(!1),[x,s]=l.useState({show:!1}),d=k(I),b=()=>{var a;if(!D(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!((a=t.actions)!=null&&a.ticket_owner)){s({show:!0,msg:o("Please select a ticket owner","bit-integrations")});return}N({flow:m,setFlow:u,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-7",onChange:a=>p(a,t,n),name:"name",value:t.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx(v,{entity:m.triggered_entity,setSnackbar:s}),e.jsx(F,{formID:r,formFields:d,handleInput:a=>p(a,t,n,r,i,s),deskConf:t,setDeskConf:n,isLoading:h,setIsLoading:i,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:t.department===""||t.table===""||t.field_map.length<1,dataConf:t,setDataConf:n,formFields:d})]})}export{J as default};
