var y=Object.defineProperty;var h=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(s,e,t)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,u=(s,e)=>{for(var t in e||(e={}))A.call(e,t)&&f(s,t,e[t]);if(h)for(var t of h(e))C.call(e,t)&&f(s,t,e[t]);return s};import{_ as d,j as i}from"./main.2.8.1.js";import{u as I,h as N,d as c}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as w}from"./SnackMsg.S8DrwLlT.js";import{S as _}from"./Steps.1hz7v9Vj.js";import{I as E,s as T}from"./Integrations.D2bgBas2.js";import{P as D,h as F}from"./PaidMembershipProIntegLayout.Bp_SPT83.js";import L from"./PaidMembershipProAuthorization.Cho4w9EA.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./BackIcn._kGL_vVw.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function $({formFields:s,setFlow:e,flow:t,allIntegURL:l,isInfo:x,edit:g}){const P=I(),{formID:v}=N(),[a,r]=c.useState(!1),[n,b]=c.useState(1),[j,m]=c.useState({show:!1}),S=[{key:"1",label:d("Add the user to a membership","bit-integrations")},{key:"2",label:d("Remove the user from a membership","bit-integrations")}],[o,p]=c.useState({name:"Paid Membership Pro",type:"PaidMembershipPro",mainAction:"",field_map:[{formField:"",paidmembershipproFormField:""}],allActions:S,actions:{}}),M=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),o.mainAction!==""&&b(3)};return i.jsxs("div",{children:[i.jsx(w,{snack:j,setSnackbar:m}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(_,{step:3,active:n})}),i.jsx(L,{formID:v,paidMembershipProConf:o,setPaidMembershipProConf:p,step:n,setStep:b,isLoading:a,setIsLoading:r,setSnackbar:m}),i.jsxs("div",{className:"btcd-stp-page",style:u({},n===2&&{width:900,minHeight:"350px",overflow:"visible"}),children:[i.jsx(D,{formFields:s,handleInput:k=>F(k,o,p,r),paidMembershipProConf:o,setPaidMembershipProConf:p,isLoading:a,setIsLoading:r,setSnackbar:m,allIntegURL:l,isInfo:x,edit:g}),i.jsxs("button",{onClick:()=>M(),disabled:!o.mainAction||a||o.selectedMembership===void 0,className:"btn f-left btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),i.jsx(E,{step:n,saveConfig:()=>T({flow:t,setFlow:e,allIntegURL:l,navigate:P,conf:o,setIsLoading:r,setSnackbar:m}),isLoading:a,dataConf:o,setDataConf:p,formFields:s})]})}export{$ as default};
