var I=Object.defineProperty;var u=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var x=(o,t,e)=>t in o?I(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,g=(o,t)=>{for(var e in t||(t={}))y.call(t,e)&&x(o,e,t[e]);if(u)for(var e of u(t))M.call(t,e)&&x(o,e,t[e]);return o};import{v as R,w as b,r,j as a,S as Z,_}from"./main-40.js";/* empty css          */import{S as k}from"./bf-679-136.js";import{s as N,b as P}from"./bf-132-75.js";import{I as F}from"./bf-94-335.js";import{N as z}from"./bf-504-404.js";import E from"./bf-767-258.js";import{h as L,c as A}from"./bf-765-345.js";import{Z as T}from"./bf-828-346.js";import"./bf-860-126.js";import"./bf-892-199.js";import"./bf-141-80.js";import"./bf-586-70.js";import"./bf-541-403.js";import"./bf-190-73.js";import"./bf-528-128.js";import"./bf-620-81.js";import"./bf-135-338.js";import"./bf-200-122.js";import"./bf-689-131.js";function it({formFields:o,setIntegration:t,integrations:e,allIntegURL:S}){const j=R(),{formID:m}=b(),[c,p]=r.useState(!1),[n,f]=r.useState(1),[C,i]=r.useState({show:!1}),[h,v]=r.useState(0),[s,l]=r.useState({name:"Zoho CRM API",type:"Zoho CRM",clientId:"",clientSecret:"",module:"",layout:"",field_map:[{formField:"",zohoFormField:""}],relatedlists:[],actions:{}});r.useEffect(()=>{window.opener&&N("zohoCRM")},[]);const w=d=>{if(!A(s)){i({show:!0,msg:_("Please map mandatory fields")});return}s.module&&s.layout&&s.field_map.length>0&&f(d)};return a.jsxs("div",{children:[a.jsx(Z,{snack:C,setSnackbar:i}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(k,{step:3,active:n})}),a.jsx(E,{formID:m,crmConf:s,setCrmConf:l,step:n,setstep:f,isLoading:c,setisLoading:p,setSnackbar:i}),a.jsxs("div",{className:"btcd-stp-page",style:g({},n===2&&{width:900,height:"100%",overflow:"visible"}),children:[a.jsx(T,{tab:h,settab:v,formID:m,formFields:o,handleInput:d=>L(d,h,s,l,m,p,i),crmConf:s,setCrmConf:l,isLoading:c,setisLoading:p,setSnackbar:i}),a.jsx(z,{nextPageHandler:()=>w(3),disabled:s.module===""||s.layout===""||s.field_map.length<1})]}),a.jsx(F,{step:n,saveConfig:()=>P(e,t,S,s,j)})]})}export{it as default};
