var j=Object.defineProperty;var g=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(s,t,i)=>t in s?j(s,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[t]=i,u=(s,t)=>{for(var i in t||(t={}))q.call(t,i)&&b(s,i,t[i]);if(g)for(var i of g(t))C.call(t,i)&&b(s,i,t[i]);return s};import{_ as e,j as a,z as _}from"./main.2.9.0.js";import{u as N,b as d}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S}from"./Steps.BYe8zHkm.js";import{I as G,s as I}from"./Integrations.DL8wqGct.js";import w from"./GetgistAuthorization.D8CcDLMp.js";import{G as E,h as F,c as L}from"./GetgistIntegLayout.Bhn8hs2R.js";import"./react-vendor.P7K3d6op.js";import"./SnackMsg.DYSD96P4.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 Z({formFields:s,setFlow:t,flow:i,allIntegURL:f}){const y=N(),[m,r]=d.useState(!1),[o,c]=d.useState(1),[P,h]=d.useState({show:!1}),k=[{key:"name",label:e("Name","bit-integrations"),required:!1},{key:"email",label:e("Email","bit-integrations"),required:!0},{key:"phone",label:e("Phone","bit-integrations"),required:!1},{key:"gender",label:e("Gender","bit-integrations"),required:!1},{key:"country",label:e("Country","bit-integrations"),required:!1},{key:"city",label:e("City","bit-integrations"),required:!1},{key:"company_name",label:e("Company Name","bit-integrations"),required:!1},{key:"industry",label:e("Industry","bit-integrations"),required:!1},{key:"job_title",label:e("Job Title","bit-integrations"),required:!1},{key:"last_name",label:e("Last Name","bit-integrations"),required:!1},{key:"postal_code",label:e("Postal Code","bit-integrations"),required:!1},{key:"state",label:e("State","bit-integrations"),required:!1}],[n,l]=d.useState({name:"Getgist",type:"Getgist",api_key:"",field_map:[{formField:"",getgistFormField:""}],actions:{},gistFields:k}),x=()=>{r(!0),I({flow:i,setFlow:t,allIntegURL:f,conf:n,navigate:y,setIsLoading:r,setSnackbar:h})},v=p=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!L(n)){_.error(e("Please map mandatory fields","bit-integrations"));return}n.field_map.length>0&&c(p)};return a.jsxs("div",{children:[a.jsx("div",{className:"txt-center mt-2",children:a.jsx(S,{step:3,active:o})}),a.jsx(w,{getgistConf:n,setGetgistConf:l,step:o,setstep:c,isLoading:m,setIsLoading:r}),a.jsxs("div",{className:"btcd-stp-page",style:u({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:s,handleInput:p=>F(p,n,l),getgistConf:n,setGetgistConf:l,isLoading:m,setIsLoading:r}),a.jsxs("button",{onClick:()=>v(3),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[e("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(G,{step:o,saveConfig:()=>x(),isLoading:m,dataConf:n,setDataConf:l,formFields:s})]})}export{Z as default};
