var g=Object.defineProperty;var j=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var p=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,d=(r,e)=>{for(var t in e||(e={}))N.call(e,t)&&p(r,t,e[t]);if(j)for(var t of j(e))v.call(e,t)&&p(r,t,e[t]);return r};import{j as i,_ as a,L}from"./main.2.8.1.js";import"./react-router-dom.9mCuUg3q.js";import{x as A}from"./Note.BeM7sN-p.js";import{b as w}from"./Integrations.D2bgBas2.js";import{S as y,f as _,a as M,b as I}from"./SendFoxCommonFunc.DYCIjzPK.js";function E({formFields:r,handleInput:e,sendFoxConf:t,setSendFoxConf:c,isLoading:b,setIsLoading:h,setSnackbar:m}){var n;const x=(((n=t==null?void 0:t.default)==null?void 0:n.allLists)||[]).map(({id:l,name:s})=>({label:s,value:`${l}`})),u=l=>{const s=d({},t);l?s.listId=l:s.listId="",c(d({},s))};return i.jsxs(i.Fragment,{children:[i.jsx("br",{}),i.jsx("br",{}),i.jsx("b",{className:"wdt-200 d-in-b",children:a("Actions:","bit-integrations")}),i.jsxs("select",{onChange:e,name:"mainAction",value:t.mainAction,className:"btcd-paper-inp w-5",children:[i.jsx("option",{value:"",children:a("Select Actions","bit-integrations")}),$.map(({key:l,label:s})=>i.jsx("option",{value:l,children:s},l))]}),i.jsx("br",{}),i.jsx("br",{}),b&&i.jsx(L,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:100,transform:"scale(0.7)"}}),t.mainAction==="1"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mt-5",children:i.jsx("b",{className:"wdt-100",children:a("Field Map","bit-integrations")})}),i.jsx("div",{className:"btcd-hr mt-1"}),i.jsxs("div",{className:"flx flx-around mt-2 mb-2 btcbi-field-map-label",children:[i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("Form Fields","bit-integrations")})}),i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("SendFox List Fields","bit-integrations")})})]}),t==null?void 0:t.field_map_list.map((l,s)=>i.jsx(y,{i:s,field:l,sendFoxConf:t,formFields:r,setSendFoxConf:c,setSnackbar:m},`rp-m-${s+9}`))]}),t.mainAction==="2"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"d-flx",children:[i.jsx("b",{className:"wdt-200 d-in-b mt-3 mt-i-3",children:a("All List:","bit-integrations")}),i.jsx(A,{options:x,className:"btcd-paper-drpdwn w-5",defaultValue:t.listId,onChange:l=>u(l),customValue:!0}),i.jsx("button",{onClick:()=>_(t,c,h),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`'${a("Refresh SendFox List","bit-integrations")}'`},type:"button",disabled:b,children:"↻"})]}),i.jsx("br",{}),i.jsx("div",{className:"mt-5",children:i.jsx("b",{className:"wdt-100",children:a("Field Map","bit-integrations")})}),i.jsx("div",{className:"btcd-hr mt-1"}),i.jsxs("div",{className:"flx flx-around mt-2 mb-2 btcbi-field-map-label",children:[i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("Form Fields","bit-integrations")})}),i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("SendFox Fields","bit-integrations")})})]}),(t==null?void 0:t.listId)&&(t==null?void 0:t.field_map.map((l,s)=>i.jsx(M,{i:s,field:l,sendFoxConf:t,formFields:r,setSendFoxConf:c,setSnackbar:m},`rp-m-${s+9}`))),i.jsx("div",{className:"txt-center btcbi-field-map-button mt-2",children:i.jsx("button",{onClick:()=>w(t.field_map.length,t,c,!1),className:"icn-btn sh-sm",type:"button",children:"+"})})]}),t.mainAction==="3"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"mt-5",children:i.jsx("b",{className:"wdt-100",children:a("Field Map","bit-integrations")})}),i.jsx("div",{className:"btcd-hr mt-1"}),i.jsxs("div",{className:"flx flx-around mt-2 mb-2 btcbi-field-map-label",children:[i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("Form Fields","bit-integrations")})}),i.jsx("div",{className:"txt-dp",children:i.jsx("b",{children:a("SendFox Unsubscribe Fields","bit-integrations")})})]}),t==null?void 0:t.field_map_unsubscribe.map((l,s)=>i.jsx(I,{i:s,field:l,sendFoxConf:t,formFields:r,setSendFoxConf:c,setSnackbar:m},`rp-m-${s+9}`))]}),i.jsx("br",{})]})}const $=[{key:"1",label:a("Create List","bit-integrations")},{key:"2",label:a("Create Contact","bit-integrations")},{key:"3",label:a("Unsubscribe Contact","bit-integrations")}];export{E as S};
