var q=Object.defineProperty;var f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(s,e,i)=>e in s?q(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i,g=(s,e)=>{for(var i in e||(e={}))v.call(e,i)&&b(s,i,e[i]);if(f)for(var i of f(e))C.call(e,i)&&b(s,i,e[i]);return s};import{_ as t,j as a}from"./main.2.8.1.js";import{u as _,h as I,d as u}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as N}from"./SnackMsg.S8DrwLlT.js";import{S as w}from"./Steps.1hz7v9Vj.js";import{I as E,s as L}from"./Integrations.D2bgBas2.js";import T from"./FluentSupportAuthorization.BsaBjY_H.js";import{h as D,c as S}from"./FluentSupportCommonFunc.CaYVWEWn.js";import{F as P}from"./FluentSupportIntegLayout.DQTxeWci.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./ActionProFeatureLabels.CuihmlQ8.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function tt({formFields:s,setFlow:e,flow:i,allIntegURL:h}){const y=_(),{formID:m}=I(),[o,d]=u.useState(!1),[l,c]=u.useState(1),[x,n]=u.useState({show:!1}),k=[{key:"title",label:t("Title","bit-integrations"),required:!0},{key:"content",label:t("Content","bit-integrations"),required:!0},{key:"first_name",label:t("First Name","bit-integrations"),required:!0},{key:"last_name",label:t("Last Name","bit-integrations"),required:!0},{key:"email",label:t("Email","bit-integrations"),required:!0},{key:"city",label:t("City","bit-integrations"),required:!1},{key:"zip",label:t("Zip","bit-integrations"),required:!1},{key:"state",label:t("State","bit-integrations"),required:!1},{key:"country",label:t("Country","bit-integrations"),required:!1},{key:"note",label:t("Note","bit-integrations"),required:!1},{key:"description",label:t("Description","bit-integrations"),required:!1}],[r,p]=u.useState({name:"Fluent Support",type:"Fluent Support",field_map:[{formField:"",fluentSupportFormField:""}],basicFields:k,fluentSupportFields:[],address_field:[],actions:{}}),F=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!S(r)){n({show:!0,msg:t("Please map fields to continue.","bit-integrations")});return}if(!r.actions.support_staff){n({show:!0,msg:t("Support Staff is required!","bit-integrations")});return}r.listId!==""&&c(3)};return a.jsxs("div",{children:[a.jsx(N,{snack:x,setSnackbar:n}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(w,{step:3,active:l})}),a.jsx(T,{formID:m,fluentSupportConf:r,setFluentSupportConf:p,step:l,setstep:c,isLoading:o,setIsLoading:d,setSnackbar:n}),a.jsxs("div",{className:"btcd-stp-page",style:g({},l===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(P,{formID:m,formFields:s,handleInput:j=>D(j,r,p),fluentSupportConf:r,setFluentSupportConf:p,isLoading:o,setIsLoading:d,setSnackbar:n}),a.jsxs("button",{onClick:()=>F(),disabled:o||r.field_map.length<1||!S(r),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[t("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(E,{step:l,saveConfig:()=>L({flow:i,setFlow:e,allIntegURL:h,navigate:y,conf:r,setIsLoading:d,setSnackbar:n}),isLoading:o,dataConf:r,setDataConf:p,formFields:s})]})}export{tt as default};
