var C=Object.defineProperty;var p=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var u=(s,e,t)=>e in s?C(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,f=(s,e)=>{for(var t in e||(e={}))S.call(e,t)&&u(s,t,e[t]);if(p)for(var t of p(e))v.call(e,t)&&u(s,t,e[t]);return s};import{D as _,r as o,a as I,j as a,S as N,W as G,h as w,_ as F,V as L}from"./main-634.js";import{m as P}from"./bf-25-81.js";import{S as E}from"./bf-54-258.js";import{a7 as T}from"./bf-746-82.js";import{I as B}from"./bf-942-184.js";import D from"./bf-489-128.js";import{G as M,h as R,c as V}from"./bf-843-206.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-123-109.js";import"./bf-438-114.js";function $({formFields:s,setIntegration:e,integrations:t,allIntegURL:y}){const g=_(),[n,c]=o.useState(!1),[i,m]=o.useState(1),[h,b]=o.useState({show:!1}),{css:k}=I(),x=[{key:"name",label:"Name",required:!1},{key:"email",label:"Email",required:!0},{key:"phone",label:"Phone",required:!1},{key:"gender",label:"Gender",required:!1},{key:"country",label:"Country",required:!1},{key:"city",label:"City",required:!1},{key:"company_name",label:"Company Name",required:!1},{key:"industry",label:"Industry",required:!1},{key:"job_title",label:"Job Title",required:!1},{key:"last_name",label:"Last Name",required:!1},{key:"postal_code",label:"Postal Code",required:!1},{key:"state",label:"State",required:!1}],[r,l]=o.useState({name:"Getgist",type:"Getgist",api_key:"",field_map:[{formField:"",getgistFormField:""}],actions:{},gistFields:x}),j=()=>{T(t,e,y,r,g)},q=d=>{if(!V(r)){L.error("Please map mandatory fields");return}r.field_map.length>0&&m(d)};return document.querySelector(".btcd-s-wrp").scrollTop=0,a.jsxs("div",{children:[a.jsx(N,{snack:h,setSnackbar:b}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(E,{step:3,active:i})}),a.jsx(D,{getgistConf:r,setGetgistConf:l,step:i,setstep:m,isLoading:n,setIsLoading:c}),a.jsxs("div",{className:"btcd-stp-page",style:f({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(M,{formFields:s,handleInput:d=>R(d,r,l),getgistConf:r,setGetgistConf:l,isLoading:n,setIsLoading:c}),a.jsxs(G,{onClick:()=>q(3),className:k(w.ftRight),type:"button",children:[F("Next")," ",a.jsx(P,{className:"ml-1 rev-icn"})]})]}),a.jsx(B,{step:i,saveConfig:()=>j(),isLoading:n,dataConf:r,setDataConf:l,formFields:s})]})}export{$ as default};
