var v=Object.defineProperty;var f=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var u=(e,t,s)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,x=(e,t)=>{for(var s in t||(t={}))j.call(t,s)&&u(e,s,t[s]);if(f)for(var s of f(t))S.call(t,s)&&u(e,s,t[s]);return e};import{j as o,_ as P}from"./main.2.9.0.js";import{u as k,e as w,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as I}from"./SnackMsg.DYSD96P4.js";import{S as N}from"./Steps.BYe8zHkm.js";import{s as _}from"./GoogleIntegrationHelpers.C5BmN2Z3.js";import{I as y,s as L}from"./Integrations.DL8wqGct.js";import E from"./PCloudAuthorization.20Olu0fM.js";import{c as F}from"./PCloudCommonFunc.C4W2SJmV.js";import{P as A}from"./PCloudIntegLayout.BAzk10UA.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";function X({formFields:e,setFlow:t,flow:s,allIntegURL:C}){const b=k(),{flowID:p}=w(),[d,l]=i.useState(!1),[n,m]=i.useState(1),[g,r]=i.useState({show:!1}),[a,c]=i.useState({name:"PCloud",type:"PCloud",clientId:"",clientSecret:"",field_map:[{formField:"",pCloudFormField:""}],foldersList:[],actions:{}});i.useEffect(()=>{window.opener&&_("pCloud")},[]);const h=()=>{L({flow:s,setFlow:t,allIntegURL:C,conf:a,navigate:b,setIsLoading:l,setSnackbar:r})};return o.jsxs("div",{children:[o.jsx(I,{snack:g,setSnackbar:r}),o.jsx("div",{className:"txt-center mt-2",children:o.jsx(N,{step:3,active:n})}),o.jsx(E,{flowID:p,pCloudConf:a,setPCloudConf:c,step:n,setStep:m,isLoading:d,setIsLoading:l,setSnackbar:r}),o.jsxs("div",{className:"btcd-stp-page",style:x({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[o.jsx(A,{flowID:p,formFields:e,pCloudConf:a,setPCloudConf:c}),o.jsxs("button",{onClick:()=>m(3),disabled:!F(a),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[P("Next","bit-integrations")," ",o.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),o.jsx(y,{step:n,saveConfig:()=>h(),isLoading:d,dataConf:a,setDataConf:c,formFields:e})]})}export{X as default};
