import{j as t,_ as g}from"./main.2.8.10.js";import{u as h,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as j}from"./BackIcn.BFDZx8No.js";import{S as k}from"./SnackMsg.7BjcJK1j.js";import{I as B,g as P}from"./Integrations.BFhED4ck.js";import S from"./BookingPressAuthorization.D29OhvzH.js";import{B as I,c as v}from"./BookingPressIntegLayout.DBCsstfv.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function J({formFields:l,setFlow:d,flow:f,allIntegURL:u}){const x=h(),[n,r]=i.useState(!1),[e,m]=i.useState(1),[b,o]=i.useState({show:!1}),[s,p]=i.useState({name:"BookingPress",type:"BookingPress",field_map:[{formField:"",bookingPressField:""}],mainAction:""}),c=a=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),a===3){if(!v(s)){o({show:!0,msg:g("Please map all required fields to continue.","bit-integrations")});return}s.name!==""&&s.field_map.length>0&&m(a)}else m(a)};return t.jsxs("div",{children:[t.jsx(k,{snack:b,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(S,{bookingPressConf:s,setBookingPressConf:p,step:e,nextPage:c,isLoading:n,setIsLoading:r,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[t.jsx(I,{formFields:l,bookingPressConf:s,setBookingPressConf:p,setSnackbar:o,setIsLoading:r,isLoading:n}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>c(3),disabled:s.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[g("Next","bit-integrations"),t.jsx(j,{className:"ml-1 rev-icn"})]})]}),t.jsx(B,{step:e,saveConfig:()=>P(f,d,u,s,x,"","",r),isLoading:n})]})}export{J as default};
