import{j as t,_ as p}from"./main.2.8.10.js";import{u as j,e as S,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as k}from"./BackIcn.BFDZx8No.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{S as y}from"./Steps.B84Ui3GU.js";import C from"./ZoomAuthorization.DoobFb05.js";import{I as A,s as Z}from"./Integrations.BFhED4ck.js";import{s as w,h as z,c as d}from"./ZoomCommonFunc.Cm2VSnt4.js";import{Z as N}from"./ZoomIntegLayout.CWCME4eq.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./TutorialLink.D6K_DiHL.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function O({formFields:l,setFlow:f,flow:u,allIntegURL:g}){const h=j(),{formID:m}=S(),[n,i]=a.useState(!1),[o,c]=a.useState(1),[x,s]=a.useState({show:!1}),[e,r]=a.useState({name:"Zoom",type:"Zoom",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomFields:[],allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});a.useEffect(()=>{window.opener&&w("zoom")},[]);const v=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!d(e)){s({show:!0,msg:p("Please map fields to continue.","bit-integrations")});return}e.field_map.length>0&&c(3)};return t.jsxs("div",{children:[t.jsx(I,{snack:x,setSnackbar:s}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(y,{step:3,active:o})}),t.jsx(C,{formID:m,zoomConf:e,setZoomConf:r,step:o,setStep:c,setSnackbar:s,isLoading:n,setIsLoading:i}),t.jsxs("div",{className:"btcd-stp-page",style:{width:o===2&&900,height:o===2&&"100%"},children:[t.jsx(N,{formID:m,formFields:l,handleInput:b=>z(b,e,r,m,i,s),zoomConf:e,setZoomConf:r,isLoading:n,setIsLoading:i,setSnackbar:s}),t.jsxs("button",{onClick:()=>v(),disabled:e.field_map.length<2||n||!e.id||!d(e)||e.selectedActions==null,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[p("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]}),t.jsx(A,{step:o,saveConfig:()=>Z({flow:u,setFlow:f,allIntegURL:g,navigate:h,conf:e,setIsLoading:i,setSnackbar:s}),isLoading:n,dataConf:e,setDataConf:r,formFields:l})]})}export{O as default};
