import{_ as t,j as i}from"./main.2.9.0.js";import{u as j,e as v,b as o}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as S}from"./BackIcn._8Wofmn2.js";import{S as C}from"./SnackMsg.DYSD96P4.js";import{S as I}from"./Steps.BYe8zHkm.js";import _ from"./ZoomWebinarAuthorization.CTIsHAdY.js";import{I as q,s as N}from"./Integrations.DL8wqGct.js";import{s as W,h as Z,c as d}from"./ZoomCommonFunc.Drz5f8AY.js";import{Z as w}from"./ZoomWebinarIntegLayout.UmjXYsos.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./TutorialLink.CFG7bS5c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({formFields:m,setFlow:u,flow:b,allIntegURL:f}){const g=j(),{formID:c}=v(),[n,l]=o.useState(!1),[s,p]=o.useState(1),[h,a]=o.useState({show:!1}),y=[{key:"first_name",label:t("First Name","bit-integrations"),required:!0},{key:"last_name",label:t("Last Name","bit-integrations"),required:!0},{key:"email",label:t("Email","bit-integrations"),required:!0},{key:"city",label:t("City","bit-integrations"),required:!1},{key:"country",label:t("Country","bit-integrations"),required:!1},{key:"phone",label:t("Phone","bit-integrations"),required:!1},{key:"job_title",label:t("Job Title","bit-integrations"),required:!1},{key:"zip",label:t("Zip","bit-integrations"),required:!1}],[e,r]=o.useState({name:"Zoom Webinar",type:"Zoom Webinar",clientId:"",clientSecret:"",zoomId:"",field_map:[{formField:"",zoomField:""}],zoomWebinarFields:y,allActions:[{value:"Create Attendee",key:1},{value:"Delete Attendee",key:2},{value:"Create User",key:3},{value:"Delete User",key:4}],selectedActions:null,actions:{}});o.useEffect(()=>{window.opener&&W("zoom")},[]);const k=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!d(e)){a({show:!0,msg:t("Please map fields to continue.","bit-integrations")});return}e.field_map.length>0&&p(3)};return i.jsxs("div",{children:[i.jsx(C,{snack:h,setSnackbar:a}),i.jsx("div",{className:"txt-center w-9 mt-2",children:i.jsx(I,{step:3,active:s})}),i.jsx(_,{formID:c,zoomWebinarConf:e,setZoomWebinarConf:r,step:s,setStep:p,setSnackbar:a,isLoading:n,setIsLoading:l}),i.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"100%"},children:[i.jsx(w,{formID:c,formFields:m,handleInput:x=>Z(x,e,r),zoomWebinarConf:e,setZoomWebinarConf:r,isLoading:n,setIsLoading:l,setSnackbar:a}),i.jsxs("button",{onClick:()=>k(),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:[t("Next","bit-integrations"),i.jsx(S,{className:"ml-1 rev-icn"})]})]}),i.jsx(q,{step:s,saveConfig:()=>N({flow:b,setFlow:u,allIntegURL:f,navigate:g,conf:e,setIsLoading:l,setSnackbar:a}),isLoading:n,dataConf:e,setDataConf:r,formFields:m})]})}export{O as default};
