HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/assets/bi.582.963.js
var J=Object.defineProperty;var U=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var B=(a,d,s)=>d in a?J(a,d,{enumerable:!0,configurable:!0,writable:!0,value:s}):a[d]=s,j=(a,d)=>{for(var s in d||(d={}))Q.call(d,s)&&B(a,s,d[s]);if(U)for(var s of U(d))X.call(d,s)&&B(a,s,d[s]);return a};import{r as Y,j as t,L as W,f as Z}from"./main-685.js";import{x as w,u as x}from"./bi.451.455.js";import{_ as e,d as M}from"./bi.878.0.js";import{a as F}from"./bi.327.9.js";import{b as S}from"./bi.601.11.js";import{g as A,a as p,r as G,b as R}from"./bi.784.962.js";import{a as f}from"./bi.776.3.js";import{T as C}from"./bi.768.751.js";const z=(a,d,s)=>{const i=j({},d);i.field_map.splice(a,0,{}),s(j({},i))},tt=(a,d,s)=>{const i=j({},d);i.field_map.length>1&&i.field_map.splice(a,1),s(j({},i))},K=(a,d,s,i)=>{const n=j({},s);n.field_map[d][a.target.name]=a.target.value,a.target.value==="custom"&&(n.field_map[d].customValue=""),a.target.value==="customFieldKey"&&(n.field_map[d].customFieldKey=""),i(j({},n))},st=(a,d,s,i)=>{var o;const n=j({},s);n.field_map[d].customValue=((o=a==null?void 0:a.target)==null?void 0:o.value)||a,i(j({},n))};function at({perfexCRMConf:a,setPerfexCRMConf:d,loading:s,setLoading:i}){var y,m,T,I,P,l,N,h,k,_;const[n,o]=Y.useState({show:!1,action:()=>{}}),b=(c,v)=>{var V,O,L,$,D,H,q,E;const r=j({},a);v==="direction"?(V=c.target)!=null&&V.checked?r.actions.direction=!0:(o({show:!1}),delete r.actions.direction):v==="contactIsPrimary"?(O=c.target)!=null&&O.checked?r.actions.contactIsPrimary=!0:delete r.actions.contactIsPrimary:v==="permission"?(L=c.target)!=null&&L.checked?(r.permissions=[{id:1,name:e("Invoices permission","bit-integrations")},{id:2,name:e("Estimates permission","bit-integrations")},{id:3,name:e("Contracts permission","bit-integrations")},{id:4,name:e("Proposals permission","bit-integrations")},{id:5,name:e("Support permission","bit-integrations")},{id:6,name:e("Projects permission","bit-integrations")}],r.actions.permission=!0):(o({show:!1}),delete r.actions.permission):v==="leadIsPublic"?($=c.target)!=null&&$.checked?r.actions.leadIsPublic=!0:delete r.actions.leadIsPublic:v==="contactedToday"?(D=c.target)!=null&&D.checked?r.actions.contactedToday=!0:delete r.actions.contactedToday:v==="leadStatus"?(H=c.target)!=null&&H.checked?r.actions.leadStatus=!0:delete r.actions.leadStatus:v==="leadSource"?(q=c.target)!=null&&q.checked?r.actions.leadSource=!0:delete r.actions.leadSource:v==="projectMembers"&&((E=c.target)!=null&&E.checked?(A(r,d,s,i),r.actions.projectMembers=!0):delete r.actions.projectMembers),o({show:v}),d(j({},r))},u=()=>{o({show:!1})},g=(c,v)=>{const r=j({},a);r[v]=c,d(j({},r))};return t.jsxs("div",{className:"pos-rel d-flx flx-wrp",children:[a.actionName==="contact"&&t.jsx(S,{checked:(a==null?void 0:a.selectedDirection)||!1,onChange:c=>b(c,"direction"),className:"wdt-200 mt-4 mr-2",value:"direction",title:e("Add Direction","bit - integrations"),subTitle:e("Add Direction")}),a.actionName==="contact"&&t.jsx(S,{checked:((y=a==null?void 0:a.selectedPermission)==null?void 0:y.length)||!1,onChange:c=>b(c,"permission"),className:"wdt-200 mt-4 mr-2",value:"permission",title:e("Add Permissions","bit - integrations"),subTitle:e("Add Permissions for this contact")}),a.actionName==="contact"&&t.jsx(S,{checked:((m=a.actions)==null?void 0:m.contactIsPrimary)||!1,onChange:c=>b(c,"contactIsPrimary"),className:"wdt-200 mt-4 mr-2",value:"contactIsPrimary",title:e("Is it Primary Contact?","bit-integrations"),subTitle:e("Is it Primary Contact?","bit-integrations")}),a.actionName==="lead"&&t.jsx(S,{checked:((T=a.actions)==null?void 0:T.leadIsPublic)||!1,onChange:c=>b(c,"leadIsPublic"),className:"wdt-200 mt-4 mr-2",value:"leadIsPublic",title:e("Public","bit-integrations"),subTitle:e("Is it Public?","bit-integrations")}),a.actionName==="lead"&&t.jsx(S,{checked:((I=a.actions)==null?void 0:I.contactedToday)||!1,onChange:c=>b(c,"contactedToday"),className:"wdt-200 mt-4 mr-2",value:"contactedToday",title:e("Contacted Today","bit-integrations"),subTitle:e("Contacted Today","bit-integrations")}),a.actionName==="lead"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx(S,{checked:((P=a.actions)==null?void 0:P.leadStatus)||!1,onChange:c=>b(c,"leadStatus"),className:"wdt-200 mt-4 mr-2",value:"leadStatus",title:e("Add Lead Status Id","bit-integrations"),subTitle:e("Add Lead Status Id","bit-integrations")}),!((l=a.actions)!=null&&l.leadStatus)&&t.jsx("small",{style:{marginLeft:30,marginTop:10,color:"red"},children:e("Lead Status is required","bit-integrations")})]}),a.actionName==="lead"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx(S,{checked:((N=a.actions)==null?void 0:N.leadSource)||!1,onChange:c=>b(c,"leadSource"),className:"wdt-200 mt-4 mr-2",value:"leadSource",title:e("Add Lead Source Id","bit-integrations"),subTitle:e("Add Lead Source Id","bit-integrations")}),!((h=a.actions)!=null&&h.leadSource)&&t.jsx("small",{style:{marginLeft:30,marginTop:10,color:"red"},children:e("Lead Source is required","bit-integrations")})]}),a.actionName==="project"&&t.jsx(S,{checked:(a==null?void 0:a.selectedProjectMembers)||!1,onChange:c=>b(c,"projectMembers"),className:"wdt-200 mt-4 mr-2",value:"projectMembers",title:e("Add Project Members","bit-integrations"),subTitle:e("Add Project Members","bit-integrations")}),t.jsxs(F,{className:"custom-conf-mdl",mainMdlCls:"o-v",btnClass:"purple",btnTxt:e("Ok","bit-integrations"),show:n.show==="direction",close:u,action:u,title:e("Direction","bit-integrations"),children:[t.jsx("div",{className:"btcd-hr mt-2 mb-2"}),t.jsx("div",{className:"mt-2",children:e("Select Direction","bit-integrations")}),t.jsx("div",{className:"flx flx-between mt-2",children:t.jsx(w,{options:["rtl","ltr"].map(c=>({label:c,value:c})),className:"msl-wrp-options",defaultValue:a==null?void 0:a.selectedDirection,onChange:c=>g(c,"selectedDirection"),singleSelect:!0,closeOnSelect:!0})})]}),t.jsxs(F,{className:"custom-conf-mdl",mainMdlCls:"o-v",btnClass:"purple",btnTxt:e("Ok","bit-integrations"),show:n.show==="leadStatus",close:u,action:u,title:e("Add Lead Status Id","bit-integrations"),children:[t.jsx("div",{className:"btcd-hr mt-2 mb-2"}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Lead Status Id:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:c=>g(c.target.value,"selectedLeadStatusId"),name:"selectedLeadStatusId",value:(a==null?void 0:a.selectedLeadStatusId)||"",type:"number",placeholder:e("Lead Status Id...","bit-integrations")}),t.jsx("span",{className:"icn-btn sh-sm ml-2 mr-2 tooltip info-view mt-1",style:{"--tooltip-txt":`'${e('Go to PerfexCRM Admin area & select the following menu: "SETUP → Leads → Statuses".',"bit-integrations")}'`},children:"!"})]})]}),t.jsxs(F,{className:"custom-conf-mdl",mainMdlCls:"o-v",btnClass:"purple",btnTxt:e("Ok","bit-integrations"),show:n.show==="leadSource",close:u,action:u,title:e("Add Lead Source Id","bit-integrations"),children:[t.jsx("div",{className:"btcd-hr mt-2 mb-2"}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Lead Source Id:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:c=>g(c.target.value,"selectedLeadSourceId"),name:"selectedLeadSourceId",value:(a==null?void 0:a.selectedLeadSourceId)||"",type:"number",placeholder:e("Lead Source Id...","bit-integrations")}),t.jsx("span",{className:"icn-btn sh-sm ml-2 mr-2 tooltip info-view mt-1",style:{"--tooltip-txt":`'${e('Go to PerfexCRM Admin area & select the following menu: "SETUP → Leads → Sources".',"bit-integrations")}'`},children:"!"})]})]}),t.jsxs(F,{className:"custom-conf-mdl",mainMdlCls:"o-v",btnClass:"purple",btnTxt:e("Ok","bit-integrations"),show:n.show==="permission",close:u,action:u,title:e("Add Permission","bit-integrations"),children:[t.jsx("div",{className:"btcd-hr mt-2 mb-2"}),t.jsx("div",{className:"mt-2",children:e("Select Permission","bit-integrations")}),t.jsx("div",{className:"flx flx-between mt-2",children:t.jsx(w,{options:(k=a==null?void 0:a.permissions)==null?void 0:k.map(c=>({label:c.name,value:c.id.toString()})),className:"msl-wrp-options",defaultValue:a==null?void 0:a.selectedPermission,onChange:c=>g(c,"selectedPermission")})})]}),t.jsxs(F,{className:"custom-conf-mdl",mainMdlCls:"o-v",btnClass:"purple",btnTxt:e("Ok","bit-integrations"),show:n.show==="projectMembers",close:u,action:u,title:e("Add Project Members","bit-integrations"),children:[t.jsx("div",{className:"btcd-hr mt-2 mb-2"}),t.jsx("div",{className:"mt-2",children:e("Select Project Member","bit-integrations")}),s.staffs?t.jsx(W,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:45,transform:"scale(0.5)"}}):t.jsxs("div",{className:"flx flx-between mt-2",children:[t.jsx(w,{options:(_=a==null?void 0:a.staffs)==null?void 0:_.map(c=>({label:c.name,value:c.id.toString()})),className:"msl-wrp-options",defaultValue:a==null?void 0:a.selectedProjectMembers,onChange:c=>g(c,"selectedProjectMembers")}),t.jsx("button",{onClick:()=>A(a,d,s,i),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`${e("Refresh Project Members","bit-integrations")}'`},type:"button",children:"↻"})]})]})]})}function et({i:a,formFields:d,field:s,perfexCRMConf:i,setPerfexCRMConf:n}){var y;const o=(i==null?void 0:i.perfexCRMFields)&&(i==null?void 0:i.perfexCRMFields.filter(m=>m.required===!0))||[],b=(i==null?void 0:i.perfexCRMFields)&&(i==null?void 0:i.perfexCRMFields.filter(m=>m.required===!1))||[],u=Z(M),{isPro:g}=u;return t.jsx("div",{className:"flx mt-2 mb-2 btcbi-field-map",children:t.jsxs("div",{className:"pos-rel flx",children:[t.jsxs("div",{className:"flx integ-fld-wrp",children:[t.jsxs("select",{className:"btcd-paper-inp mr-2",name:"formField",value:s.formField||"",onChange:m=>K(m,a,i,n),children:[t.jsx("option",{value:"",children:e("Select Field","bit-integrations")}),t.jsx("optgroup",{label:e("Form Fields","bit-integrations"),children:d==null?void 0:d.map(m=>t.jsx("option",{value:m.name,children:m.label},`ff-rm-${m.name}`))}),t.jsx("option",{value:"custom",children:e("Custom...","bit-integrations")}),t.jsx("optgroup",{label:sprintf(e("General Smart Codes %s","bit-integrations"),g?"":`(${e("Pro","bit-integrations")})`),children:g&&((y=f)==null?void 0:y.map(m=>t.jsx("option",{value:m.name,children:m.label},`ff-rm-${m.name}`)))})]}),s.formField==="custom"&&t.jsx(C,{onChange:m=>st(m,a,i,n),label:e("Custom Value","bit-integrations"),className:"mr-2",type:"text",value:(s==null?void 0:s.customValue)||"",placeholder:e("Custom Value","bit-integrations"),formFields:d}),t.jsxs("select",{className:"btcd-paper-inp",disabled:a<o.length,name:"perfexCRMFormField",value:a<o.length?o[a].key||"":s.perfexCRMFormField||"",onChange:m=>K(m,a,i,n),children:[t.jsx("option",{value:"",children:e("Select Field","bit-integrations")}),a<o.length?t.jsx("option",{value:o[a].key,children:o[a].label},o[a].key):b.map(({key:m,label:T})=>t.jsx("option",{value:m,children:T},m))]})]}),a>=o.length&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:()=>z(a,i,n),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}),t.jsx("button",{onClick:()=>tt(a,i,n),className:"icn-btn sh-sm ml-1",type:"button","aria-label":"btn",children:t.jsx("span",{className:"btcd-icn icn-trash-2"})})]})]})})}function ut({formFields:a,handleInput:d,perfexCRMConf:s,setPerfexCRMConf:i,loading:n,setLoading:o,isLoading:b,setIsLoading:u,setSnackbar:g}){var T,I,P;const y=l=>{i(N=>x(N,h=>{const{name:k}=l.target;l.target.value!==""?(h.actionName=l.target.value,(l.target.value==="contact"||l.target.value==="lead")&&p(h,i,n,o),l.target.value==="lead"&&(p(h,i,n,o),A(h,i,n,o)),l.target.value==="project"&&(h.billingTypes=[{id:1,name:e("Fixed Rate","bit-integrations")},{id:2,name:e("Project Hours","bit-integrations")},{id:3,name:e("Task Hours","bit-integrations")}],h.projectStatus=[{id:2,name:e("In Progress","bit-integrations")},{id:3,name:e("On Hold","bit-integrations")},{id:4,name:e("Finished","bit-integrations")},{id:5,name:e("Cancelled","bit-integrations")}]),G(h,i,u,g)):(delete h[k],delete h.actionId)}))},m=(l,N)=>{const h=j({},s);h[N]=l,N==="selectedProjectType"&&l==="customer"?p(s,i,n,o):N==="selectedProjectType"&&l==="lead"&&R(s,i,n,o),i(j({},h))};return t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsx("b",{className:"wdt-200 d-in-b",children:e("Select Action:","bit-integrations")}),t.jsxs("select",{onChange:y,name:"actionName",value:s.actionName,className:"btcd-paper-inp w-5",children:[t.jsx("option",{value:"",children:e("Select an action","bit-integrations")}),t.jsx("option",{value:"customer","data-action_name":"customer",children:e("Create Customer","bit-integrations")}),t.jsx("option",{value:"contact","data-action_name":"contact",children:e("Create Contact","bit-integrations")}),t.jsx("option",{value:"lead","data-action_name":"lead",children:e("Create Lead","bit-integrations")}),t.jsx("option",{value:"project","data-action_name":"project",children:e("Create project","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),s.actionName==="project"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Project Status:","bit-integrations")}),t.jsx(w,{options:s==null?void 0:s.projectStatus.map(l=>({label:l.name,value:l.id.toString()})),className:"msl-wrp-options dropdown-custom-width",defaultValue:s==null?void 0:s.selectedProjectStatus,onChange:l=>m(l,"selectedProjectStatus"),disabled:b,singleSelect:!0,closeOnSelect:!0})]})]}),s.actionName==="project"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Project Related With:","bit-integrations")}),t.jsx(w,{options:["customer","lead"].map(l=>({label:l.charAt(0).toUpperCase()+l.slice(1),value:l})),className:"msl-wrp-options dropdown-custom-width",defaultValue:s==null?void 0:s.selectedProjectType,onChange:l=>m(l,"selectedProjectType"),disabled:b,singleSelect:!0,closeOnSelect:!0})]})]}),(s.actionName==="contact"||s.actionName==="lead"||s.actionName==="project")&&(s==null?void 0:s.customers)&&!n.customers&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Select Customer:","bit-integrations")}),t.jsx(w,{options:(T=s==null?void 0:s.customers)==null?void 0:T.map(l=>({label:l.name,value:l.id.toString()})),className:"msl-wrp-options dropdown-custom-width",defaultValue:s==null?void 0:s.selectedCustomer,onChange:l=>m(l,"selectedCustomer"),disabled:n.customers,singleSelect:!0,closeOnSelect:!0}),t.jsx("button",{onClick:()=>p(s,i,n,o),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`'${e("Refresh Customers","bit-integrations")}'`},type:"button",disabled:n.customers,children:"↻"})]})]}),s.actionName==="lead"&&(s==null?void 0:s.staffs)&&!n.staffs&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Assigned By:","bit-integrations")}),t.jsx(w,{options:(I=s==null?void 0:s.staffs)==null?void 0:I.map(l=>({label:l.name,value:l.id.toString()})),className:"msl-wrp-options dropdown-custom-width",defaultValue:s==null?void 0:s.selectedStaff,onChange:l=>m(l,"selectedStaff"),disabled:n.staffs,singleSelect:!0,closeOnSelect:!0}),t.jsx("button",{onClick:()=>A(s,i,n,o),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`'${e("Refresh Staffs","bit-integrations")}'`},type:"button",disabled:n.staffs,children:"↻"})]})]}),s.actionName==="project"&&(s==null?void 0:s.billingTypes)&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Select Billing Type:","bit-integrations")}),t.jsx(w,{options:(P=s==null?void 0:s.billingTypes)==null?void 0:P.map(l=>({label:l.name,value:l.id.toString()})),className:"msl-wrp-options dropdown-custom-width",defaultValue:s==null?void 0:s.selectedbillingType,onChange:l=>m(l,"selectedbillingType"),disabled:b,singleSelect:!0,closeOnSelect:!0})]})]}),s.actionName==="project"&&(s==null?void 0:s.selectedbillingType)==="1"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Total Rate:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:l=>m(l.target.value,"totalRate"),name:"totalRate",value:s.totalRate||" ",type:"text",placeholder:e("Total Rate...","bit-integrations"),disabled:b})]})]}),s.actionName==="project"&&(s==null?void 0:s.selectedbillingType)==="2"&&t.jsxs(t.Fragment,{children:[t.jsx("br",{}),t.jsxs("div",{className:"flx",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:e("Rate Per Hour:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:l=>m(l.target.value,"ratePerHour"),name:"ratePerHour",value:s.ratePerHour||" ",type:"text",placeholder:e("Rate Per Hour...","bit-integrations"),disabled:b})]})]}),(b||n.customers||n.staffs||n.leads)&&t.jsx(W,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:100,transform:"scale(0.7)"}}),s.actionName&&!b&&t.jsxs("div",{children:[t.jsx("br",{}),t.jsxs("div",{className:"mt-5",children:[t.jsx("b",{className:"wdt-100",children:e("Field Map","bit-integrations")}),t.jsx("button",{onClick:()=>G(s,i,u,g),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`'${e("Refresh custom fields","bit-integrations")}'`},type:"button",disabled:b,children:"↻"})]}),t.jsx("br",{}),t.jsx("div",{className:"btcd-hr mt-1"}),t.jsxs("div",{className:"flx flx-around mt-2 mb-2 btcbi-field-map-label",children:[t.jsx("div",{className:"txt-dp",children:t.jsx("b",{children:e("Form Fields","bit-integrations")})}),t.jsx("div",{className:"txt-dp",children:t.jsx("b",{children:e("PerfexCRM Fields","bit-integrations")})})]}),s==null?void 0:s.field_map.map((l,N)=>t.jsx(et,{i:N,field:l,perfexCRMConf:s,formFields:a,setPerfexCRMConf:i,setSnackbar:g},`rp-m-${N+9}`)),t.jsx("div",{className:"txt-center btcbi-field-map-button mt-2",children:t.jsx("button",{onClick:()=>z(s.field_map.length,s,i),className:"icn-btn sh-sm",type:"button",children:"+"})}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("div",{className:"mt-4",children:t.jsx("b",{className:"wdt-100",children:e("Utilities","bit-integrations")})}),t.jsx("div",{className:"btcd-hr mt-1"}),t.jsx(at,{perfexCRMConf:s,setPerfexCRMConf:i,formFields:a,loading:n,setLoading:o})]})]})}export{ut as P};