import{h as m,$ as v,g as w,k as C,i as F,j as e,_ as a,z as d}from"./main.2.8.10.js";import{u as I,b as n}from"./react-router.DMwpH23k.js";import{S as _}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as N,I as k,s as y}from"./Integrations.BFhED4ck.js";import{h as p,c}from"./HubspotCommonFunc.6U9zlXn-.js";import{H as E}from"./HubspotIntegLayout.CevtojPk.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./ActionProFeatureLabels.BzMNdAoD.js";function O({allIntegURL:f}){const u=I(),[r,H]=m(v),[t,i]=m(w),[g,b]=n.useState(!1),[x,s]=n.useState({show:!1}),l=C(F),[h,j]=n.useState({auth:!1,customFields:!1,hubSpotFields:!0}),S=()=>{if(!c(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="ticket"){if(t.pipeline===void 0){d.error(a("Please select a pipeline","bit-integrations"));return}if(t.stage===void 0){d.error(a("Please select a stage","bit-integrations"));return}}y({flow:r,allIntegURL:f,conf:t,navigate:u,edit:1,setIsLoading:b,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(_,{snack:x,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=>p(o,t,i),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(N,{entity:r.triggered_entity,setSnackbar:s}),e.jsx(E,{formFields:l,handleInput:o=>p(o,t,i),hubspotConf:t,setHubspotConf:i,setSnackbar:s,loading:h,setLoading:j}),e.jsx(k,{edit:!0,saveConfig:S,disabled:!c(t),isLoading:g,dataConf:t,setDataConf:i,formFields:l}),e.jsx("br",{})]})}export{O as default};
