var j=Object.defineProperty;var g=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var d=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,v=(s,e)=>{for(var t in e||(e={}))S.call(e,t)&&d(s,t,e[t]);if(g)for(var t of g(e))D.call(e,t)&&d(s,t,e[t]);return s};import{j as o,_ as G}from"./main.2.8.1.js";import{u as w,h as k,d as i}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as C}from"./SnackMsg.S8DrwLlT.js";import{S as I}from"./Steps.1hz7v9Vj.js";import{s as N}from"./GoogleIntegrationHelpers.BGadhjz3.js";import{I as _,s as y}from"./Integrations.D2bgBas2.js";import L from"./GoogleDriveAuthorization.O6FAE5HS.js";import{G as E}from"./GoogleDriveIntegLayout.ByrT2Wt8.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./GoogleDriveCommonFunc.CvKuNgzJ.js";import"./TutorialLink.BAFX--T3.js";import"./tutorialLinks.kMkIDzcD.js";function W({formFields:s,setFlow:e,flow:t,allIntegURL:u}){const x=w(),{flowID:c}=k(),[l,m]=i.useState(!1),[r,p]=i.useState(1),[h,n]=i.useState({show:!1}),[a,f]=i.useState({name:"Google Drive",type:"Google Drive",clientId:"",clientSecret:"",field_map:[{formField:"",googleDriveFormField:""}],foldersList:[],actions:{}});i.useEffect(()=>{window.opener&&N("googleDrive")},[]);const b=()=>{y({flow:t,setFlow:e,allIntegURL:u,conf:a,navigate:x,setIsLoading:m,setSnackbar:n})};return o.jsxs("div",{children:[o.jsx(C,{snack:h,setSnackbar:n}),o.jsx("div",{className:"txt-center mt-2",children:o.jsx(I,{step:3,active:r})}),o.jsx(L,{flowID:c,googleDriveConf:a,setGoogleDriveConf:f,step:r,setStep:p,isLoading:l,setIsLoading:m,setSnackbar:n}),o.jsxs("div",{className:"btcd-stp-page",style:v({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[o.jsx(E,{flowID:c,formFields:s,googleDriveConf:a,setGoogleDriveConf:f}),o.jsxs("button",{onClick:()=>p(3),disabled:a.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[G("Next","bit-integrations")," ",o.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),o.jsx(_,{step:r,saveConfig:()=>b(),isLoading:l})]})}export{W as default};
