import{h as c,$ as j,g as y,k as w,i as I,j as t,_ as s,q as i}from"./main.2.9.0.js";import{u as v,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.DYSD96P4.js";import{S as _,I as F,s as M}from"./Integrations.DL8wqGct.js";import{h as N,c as p,n as k,a as E}from"./MondayComCommonFunc.DQtOOEq6.js";import{M as L}from"./MondayComIntegLayout.DNmhbECi.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./FieldMapHelper.D-WuI2oA.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./ProUtilHelpers.CHf_DzPf.js";function V({allIntegURL:f}){const g=v(),[m,P]=c(j),[e,n]=c(y),[d,u]=r.useState(!1),[x,b]=r.useState({}),[h,o]=r.useState({show:!1}),l=w(I),C=()=>{if(!p(e)){o({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}const a=e.mainAction;if(k.includes(a)&&!e.selectedBoard){i.error(s("Please select a board","bit-integrations"));return}if(E.includes(a)&&!e.selectedItem){i.error(s("Please select an item","bit-integrations"));return}if(a==="create_column"&&!e.columnType){i.error(s("Please select a column type","bit-integrations"));return}M({flow:m,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:u,setSnackbar:o})};return t.jsxs("div",{style:{width:900,minHeight:500,overflow:"visible"},children:[t.jsx(S,{snack:h,setSnackbar:o}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:a=>N(a,e,n),name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(_,{entity:m.triggered_entity,setSnackbar:o}),t.jsx(L,{formFields:l,mondayComConf:e,setMondayComConf:n,loading:x,setLoading:b,isLoading:d}),t.jsx(F,{edit:!0,saveConfig:C,disabled:!p(e),isLoading:d,dataConf:e,setDataConf:n,formFields:l}),t.jsx("br",{})]})}export{V as default};
