import{h as c,$ as S,g as I,k as _,i as w,j as e,_ as a,q as d}from"./main.2.9.0.js";import{u as C,e as N,b as r}from"./react-router.DMwpH23k.js";import{S as k}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as v,I as y,s as F}from"./Integrations.DL8wqGct.js";import{h as l,c as f}from"./AsanaCommonFunc.CeZgRdAM.js";import{A}from"./AsanaIntegLayout.z2R4YaPL.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function Q({allIntegURL:p}){const g=C(),{id:P}=N(),[i,E]=c(S),[t,n]=c(I),[u,L]=r.useState(!1),[x,h]=r.useState({}),[j,s]=r.useState({show:!1}),m=_(w),b=()=>{if(!f(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="task"){if(!t.selectedProject){d.error(a("Please select a project","bit-integrations"));return}if(!t.selectedSections&&t.actionName==="task"){d.error(a("Please select a Section","bit-integrations"));return}}F({flow:i,allIntegURL:p,conf:t,navigate:g,edit:1,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(k,{snack:j,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,t,n),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:i.triggered_entity,setSnackbar:s}),e.jsx(A,{formID:i.triggered_entity_id,formFields:m,handleInput:o=>l(o,t,n),asanaConf:t,setAsanaConf:n,loading:x,setLoading:h,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:!f(t),isLoading:u,dataConf:t,setDataConf:n,formFields:m}),e.jsx("br",{})]})}export{Q as default};
