var j=Object.defineProperty;var d=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var v=(o,e,t)=>e in o?j(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,u=(o,e)=>{for(var t in e||(e={}))S.call(e,t)&&v(o,t,e[t]);if(d)for(var t of d(e))D.call(e,t)&&v(o,t,e[t]);return o};import{j as s,_ as O}from"./main.2.8.1.js";import{u as w,h as k,d as n}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"./OneDriveAuthorization.BOx5yQin.js";import{O as E}from"./OneDriveIntegLayout.BQEbXn1H.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./OneDriveCommonFunc.Cm_dWfyv.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function W({formFields:o,setFlow:e,flow:t,allIntegURL:x}){const g=w(),{flowID:p}=k(),[c,m]=n.useState(!1),[r,f]=n.useState(1),[h,a]=n.useState({show:!1}),[i,l]=n.useState({name:"OneDrive",type:"OneDrive",clientId:"",clientSecret:"",field_map:[{formField:"",OneDriveFormField:""}],folder:"",folderMap:[],foldersList:[],actions:{}});n.useEffect(()=>{window.opener&&N("oneDrive")},[]);const b=()=>{y({flow:t,setFlow:e,allIntegURL:x,conf:i,navigate:g,setIsLoading:m,setSnackbar:a})};return s.jsxs("div",{children:[s.jsx(C,{snack:h,setSnackbar:a}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(I,{step:3,active:r})}),s.jsx(L,{flowID:p,oneDriveConf:i,setOneDriveConf:l,step:r,setStep:f,isLoading:c,setIsLoading:m,setSnackbar:a}),s.jsxs("div",{className:"btcd-stp-page",style:u({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(E,{flowID:p,formFields:o,oneDriveConf:i,setOneDriveConf:l,isLoading:c,setIsLoading:m,setSnackbar:a}),s.jsxs("button",{onClick:()=>f(3),disabled:!i.actions.attachments||!i.folder,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[O("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(_,{step:r,saveConfig:()=>b(),isLoading:c})]})}export{W as default};
