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