var q=Object.defineProperty;var u=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var f=(a,t,i)=>t in a?q(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,g=(a,t)=>{for(var i in t||(t={}))C.call(t,i)&&f(a,i,t[i]);if(u)for(var i of u(t))S.call(t,i)&&f(a,i,t[i]);return a};import{_ as e,j as r}from"./main.2.8.10.js";import{u as N,b as m}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as R}from"./SnackMsg.7BjcJK1j.js";import{S as L}from"./Steps.B84Ui3GU.js";import{I,s as w}from"./Integrations.BFhED4ck.js";import A from"./RestrictContentAuthorization.BwSlk3mY.js";import{R as E}from"./RestrictContentIntegLayout.B0h2T3g3.js";import{h as F}from"./RestrictContentCommonFunc.pQlV4nWE.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./BackIcn.BFDZx8No.js";import"./TutorialLink.D6K_DiHL.js";import"./lodash.DCvQBX3r.js";function Y({formFields:a,setFlow:t,flow:i,allIntegURL:y}){const v=N(),[b,n]=m.useState(!1),[o,p]=m.useState(1),[k,l]=m.useState({show:!1}),x=[{key:"user_login",label:e("User Name","bit-integrations"),required:!0},{key:"user_email",label:e("Email","bit-integrations"),required:!0},{key:"user_pass",label:e("User Password","bit-integrations"),required:!1},{key:"first_name",label:e("First Name","bit-integrations"),required:!1},{key:"last_name",label:e("Last Name","bit-integrations"),required:!1},{key:"company",label:e("Company","bit-integrations"),required:!1},{key:"address1",label:e("Address Line 1","bit-integrations"),required:!1},{key:"address2",label:e("Address Line 2","bit-integrations"),required:!1},{key:"city",label:e("City","bit-integrations"),required:!1},{key:"state",label:e("State","bit-integrations"),required:!1},{key:"zip",label:e("Zip","bit-integrations"),required:!1},{key:"country",label:e("Country","bit-integrations"),required:!1}],h=[{key:"add-member-level",label:e("Add the user to a level","bit-integrations")},{key:"remove-member-level",label:e("Remove the user to a level","bit-integrations")}],[s,d]=m.useState({name:"Restrict Content",type:"RestrictContent",field_map:[{formField:"",restrictField:""}],exp_date:"",memberFields:x,actionLists:h,actions:{}}),_=()=>{n(!0),w({flow:i,setFlow:t,allIntegURL:y,conf:s,navigate:v,setIsLoading:n,setSnackbar:l})},j=c=>{s.field_map.length>0&&p(c)};return r.jsxs("div",{children:[r.jsx(R,{snack:k,setSnackbar:l}),r.jsx("div",{className:"txt-center mt-2",children:r.jsx(L,{step:3,active:o})}),r.jsx(A,{restrictConf:s,setRestrictConf:d,step:o,setStep:p,isLoading:b,setIsLoading:n,setSnackbar:l}),r.jsxs("div",{className:"btcd-stp-page",style:g({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[r.jsx(E,{formFields:a,handleInput:c=>F(c,s,d),restrictConf:s,setRestrictConf:d,isLoading:b,setIsLoading:n,setSnackbar:l}),r.jsxs("button",{onClick:()=>j(3),disabled:!(s!=null&&s.level_id)&&!(s!=null&&s.member_id),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[e("Next","bit-integrations"),"  ",r.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),r.jsx(I,{step:o,saveConfig:()=>_(),isLoading:b,dataConf:s,setDataConf:d,formFields:a})]})}export{Y as default};
