var w=Object.defineProperty;var u=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var f=(a,t,e)=>t in a?w(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,h=(a,t)=>{for(var e in t||(t={}))S.call(t,e)&&f(a,e,t[e]);if(u)for(var e of u(t))v.call(t,e)&&f(a,e,t[e]);return a};import{g as N,D as y,r as c,j as n,S as C,_ as i}from"./main-634.js";import{a7 as _}from"./bf-746-82.js";import{I as D}from"./bf-942-184.js";import{h as g,c as E}from"./bf-705-95.js";import{Z as L}from"./bf-861-191.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-25-81.js";import"./bf-438-114.js";function G({formFields:a,setIntegration:t,integrations:e,allIntegURL:x}){const{id:d,formID:p}=N(),j=y(),[s,m]=c.useState(h({},e[d])),[k,l]=c.useState(!1),[I,r]=c.useState({show:!1}),b=()=>{var o;if(!E(s)){r({show:!0,msg:i("Please map mandatory fields")});return}if(!((o=s.actions)!=null&&o.ticket_owner)){r({show:!0,msg:i("Please select a ticket owner")});return}_(e,t,x,s,j,d,1)};return n.jsxs("div",{style:{width:900},children:[n.jsx(C,{snack:I,setSnackbar:r}),n.jsxs("div",{className:"flx mt-3",children:[n.jsx("b",{className:"wdt-100 d-in-b",children:i("Integration Name:")}),n.jsx("input",{className:"btcd-paper-inp w-7",onChange:o=>g(o,s,m),name:"name",value:s.name,type:"text",placeholder:i("Integration Name...")})]}),n.jsx("br",{}),n.jsx("br",{}),n.jsx(L,{formID:p,formFields:a,handleInput:o=>g(o,s,m,p,l,r),deskConf:s,setDeskConf:m,isLoading:k,setisLoading:l,setSnackbar:r}),n.jsx(D,{edit:!0,saveConfig:b,disabled:s.department===""||s.table===""||s.field_map.length<1})]})}export{G as default};
