var k=Object.defineProperty;var b=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var j=(e,n,s)=>n in e?k(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,m=(e,n)=>{for(var s in n||(n={}))v.call(n,s)&&j(e,s,n[s]);if(b)for(var s of b(n))y.call(n,s)&&j(e,s,n[s]);return e};import{u as _,j as r,_ as d,z as $,$ as M}from"./main-40.js";import{S as P}from"./bf-200-122.js";const F=(e,n,s,t)=>{const o=m({},s);o[e].splice(n,0,{}),t(m({},o))},S=(e,n,s,t)=>{const o=m({},s);o[e].length>1&&o[e].splice(n,1),t(m({},o))},g=(e,n,s,t,o)=>{const i=m({},t);i[e][s][n.target.name]=n.target.value,o(m({},i))},T=e=>!((e!=null&&e.post_map?e.post_map.filter(s=>!s.formField&&s.postFormField&&s.required):[]).length>0),z=e=>!((e!=null&&e.pod_map?e.pod_map.filter(s=>!s.formField&&s.podFormField&&s.required):[]).length>0);function C({i:e,type:n,formFields:s,field:t,dataConf:o,setDataConf:i,podFields:p}){var x;const N={pod:{propName:"pod_map",fldName:"podFormField"},post:{propName:"post_map",fldName:"postFormField"}},f=_(M),{isPro:u}=f,{propName:c,fldName:a}=N[n],h=!!p.find(l=>l.key===t[a]&&l.required);return r.jsxs("div",{className:"flx mt-2 mr-1",children:[r.jsxs("div",{className:"flx integ-fld-wrp",children:[r.jsxs("select",{className:"btcd-paper-inp mr-2",name:"formField",value:t.formField||"",onChange:l=>g(c,l,e,o,i),children:[r.jsx("option",{value:"",children:d("Select Field")}),r.jsx("optgroup",{label:"Form Fields",children:s.map(l=>l.type!=="signature"&&r.jsx("option",{value:l.key,children:l.name},`ff-zhcrm-${l.key}`))}),r.jsx("option",{value:"custom",children:d("Custom...")}),r.jsx("optgroup",{label:`General Smart Codes ${u?"":"(PRO)"}`,children:u&&((x=P)==null?void 0:x.map(l=>r.jsx("option",{value:l.name,children:l.label},`ff-rm-${l.name}`)))})]}),r.jsxs("select",{className:"btcd-paper-inp",name:a,value:t[a]||"",onChange:l=>g(c,l,e,o,i),disabled:h,children:[r.jsx("option",{value:"",children:d("Select Field")}),p==null?void 0:p.map(l=>r.jsx("option",{value:l.key,children:`${l.name}`},`${l.key}-1`))]})]}),h?r.jsx("button",{onClick:()=>F(c,e,o,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}):r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>F(c,e,o,i),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}),r.jsx("button",{onClick:()=>S(c,e,o,i),className:"icn-btn sh-sm ml-1",type:"button","aria-label":"btn",children:r.jsx($,{})})]})]})}export{C as P,F as a,z as b,T as c};
