import{u as w,d as l,r as i,h as C,j as t}from"./main-406.js";import{$ as F,g as I,h as _,d as S,_ as o,i as N,I as y,c,s as k}from"./bi.394.85.js";import{h as p,c as m}from"./bi.995.772.js";import{H as E}from"./bi.884.773.js";import"./bi.704.707.js";import"./bi.701.708.js";function D({allIntegURL:f}){const u=w(),[r,H]=l(F),[e,a]=l(I),[g,h]=i.useState(!1),[x,s]=i.useState({show:!1}),d=C(_),[b,j]=i.useState({auth:!1,customFields:!1,hubSpotFields:!0}),v=()=>{if(!m(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="ticket"){if(e.pipeline===void 0){c.error("Please select a pipeline");return}if(e.stage===void 0){c.error("Please select a stage");return}}k({flow:r,allIntegURL:f,conf:e,navigate:u,edit:1,setIsLoading:h,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:x,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:n=>p(n,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(N,{entity:r.triggered_entity,setSnackbar:s}),t.jsx(E,{formFields:d,handleInput:n=>p(n,e,a),hubspotConf:e,setHubspotConf:a,setSnackbar:s,loading:b,setLoading:j}),t.jsx(y,{edit:!0,saveConfig:v,disabled:!m(e),isLoading:g,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{D as default};
