import{h as d,$ as B,g as I,k as v,i as _,j as e,_ as l}from"./main.2.9.0.js";import{u as k,e as y,b as a}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as F}from"./SnackMsg.DYSD96P4.js";import{S as N}from"./Steps.BYe8zHkm.js";import{l as Z,I as C,s as E}from"./Integrations.DL8wqGct.js";import{h as L,c as P}from"./ZohoBiginCommonFunc.K2WQPoG_.js";import{Z as R}from"./ZohoBiginIntegLayout.CkLCOMBu.js";import T from"./ZohoBiginAuthorization.tZZQ8xKT.js";import{B as $}from"./BackIcn._8Wofmn2.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TabPanel.BxisqkXJ.js";import"./ActionProFeatureLabels.gUp7_RXn.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./TutorialLink.CFG7bS5c.js";function ot({allIntegURL:f}){const u=k(),{formID:r}=y(),[h,g]=d(B),[m,i]=a.useState(!1),[o,c]=a.useState(1),[x,s]=a.useState({show:!1}),[p,j]=a.useState(0),[t,n]=d(I),b=v(_);a.useEffect(()=>{window.opener&&Z("zohoBigin"),n({name:"Zoho Bigin",type:"Zoho Bigin",clientId:"",clientSecret:"",module:"",field_map:[{formField:"",zohoFormField:""}],relatedlists:[],actions:{}})},[]);const w=()=>{if(!P(t)){s({show:!0,msg:l("Please map mandatory fields","bit-integrations")});return}if((t==null?void 0:t.module)==="Deals"&&!(t!=null&&t.pLayout)){s({show:!0,msg:l("Please select a layout","bit-integrations")});return}setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t.module!==""&&t.field_map.length>0&&c(3)};return e.jsxs("div",{children:[e.jsx(F,{snack:x,setSnackbar:s}),e.jsx("div",{className:"txt-center mt-2",children:e.jsx(N,{step:3,active:o})}),e.jsx(T,{formID:r,biginConf:t,setBiginConf:n,step:o,setstep:c,isLoading:m,setIsLoading:i,setSnackbar:s}),e.jsxs("div",{className:"btcd-stp-page",style:{width:o===2&&900,height:o===2&&"auto"},children:[e.jsx(R,{tab:p,settab:j,formID:r,handleInput:S=>L(S,p,t,n,r,i,s),isLoading:m,setIsLoading:i,setSnackbar:s}),e.jsxs("button",{onClick:()=>w(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),e.jsx($,{className:"ml-1 rev-icn"})]})]}),e.jsx(C,{step:o,saveConfig:()=>E({flow:h,setFlow:g,allIntegURL:f,conf:t,navigate:u,setIsLoading:i,setSnackbar:s}),isLoading:m,dataConf:t,setDataConf:n,formFields:b})]})}export{ot as default};
