var k=Object.defineProperty;var b=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var g=(o,s,e)=>s in o?k(o,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[s]=e,x=(o,s)=>{for(var e in s||(s={}))B.call(s,e)&&g(o,e,s[e]);if(b)for(var e of b(s))I.call(s,e)&&g(o,e,s[e]);return o};import{k as C,f as w,j as t,_ as l}from"./main.2.9.0.js";import{u as N,e as y,b as p}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as L}from"./SnackMsg.DYSD96P4.js";import{S as M}from"./Steps.BYe8zHkm.js";import{I as P,s as R}from"./Integrations.DL8wqGct.js";import A from"./BitFormAuthorization.B0ApIsjC.js";import{h as E,c as T,b as q}from"./BitFormCommonFunc.C5tTEqEc.js";import{B as D}from"./BitFormIntegLayout.essuObX1.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./BackIcn._8Wofmn2.js";import"./TutorialLink.CFG7bS5c.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function ot({formFields:o,setFlow:s,flow:e,allIntegURL:h}){const j=N(),{formID:f}=y(),v=C(w),{siteURL:F}=v,[r,n]=p.useState(!1),[m,u]=p.useState(1),[S,a]=p.useState({show:!1}),[i,c]=p.useState({name:"Bit Form",type:"Bit Form",domainName:F,api_key:"",id:"",field_map:[{formField:"",BitFormMapField:""}],address_field:[],actions:{}}),_=()=>{var d;if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),(d=i.actions)!=null&&d.address&&!T(i)){a({show:!0,msg:l("Please map address required fields to continue.","bit-integrations")});return}if(!q(i)){a({show:!0,msg:l("Please map fields to continue.","bit-integrations")});return}i.listId!==""&&u(3)};return t.jsxs("div",{children:[t.jsx(L,{snack:S,setSnackbar:a}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(M,{step:3,active:m})}),t.jsx(A,{formID:f,bitFormConf:i,setBitFormConf:c,step:m,setstep:u,isLoading:r,setIsLoading:n,setSnackbar:a}),t.jsxs("div",{className:"btcd-stp-page",style:x({},m===2&&{width:900,height:"auto",overflow:"visible"}),children:[t.jsx(D,{formFields:o,handleInput:d=>E(d,i,c,f,n),bitFormConf:i,setBitFormConf:c,isLoading:r,setIsLoading:n,setSnackbar:a}),!i.id&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{})]}),t.jsxs("button",{onClick:()=>_(),disabled:i.field_map.length<2||r,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),"  ",t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(P,{step:m,saveConfig:()=>R({flow:e,setFlow:s,allIntegURL:h,navigate:j,conf:i,setIsLoading:n,setSnackbar:a}),isLoading:r,dataConf:i,setDataConf:c,formFields:o})]})}export{ot as default};
