1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[8716],{68716(e,n,a){a.r(n),a.d(n,{default:()=>O});var s,t,r,l,o,c,i,d,p,m=a(89379),h=a(57528),x=a(9950),u=a(54826),g=a(1201),b=a(4695),j=a.n(b),f=a(67079),v=(a(12279),a(32741)),w=(a(53149),a(59101)),C=a(64877),N=a(82569),A=a(44414);const k=(0,f.default)(C.A.Header)(s||(s=(0,h.A)(["\n border-bottom: none;\n padding: 24px 32px;\n background: #fdfdfd;\n \n .modal-title {\n font-weight: 700;\n color: #1a202c;\n font-size: 1.5rem;\n font-family: 'Inter', sans-serif;\n }\n"]))),S=(0,f.default)(C.A.Body)(t||(t=(0,h.A)(["\n padding: 0 32px 32px 32px;\n background: #fdfdfd;\n"]))),E=f.default.div(r||(r=(0,h.A)(["\n margin-bottom: 24px;\n"]))),R=f.default.h6(l||(l=(0,h.A)(["\n font-size: 0.85rem;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n color: #718096;\n font-weight: 600;\n margin-bottom: 16px;\n border-bottom: 1px solid #e2e8f0;\n padding-bottom: 8px;\n"]))),I=f.default.div(o||(o=(0,h.A)(["\n position: relative;\n margin-bottom: 20px;\n\n label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #4a5568;\n font-size: 0.95rem;\n \n span.required {\n color: #e53e3e;\n }\n }\n\n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .icon {\n position: absolute;\n left: 12px;\n color: #a0aec0;\n z-index: 2;\n }\n"]))),y=f.default.input(c||(c=(0,h.A)(["\n width: 100%;\n padding: 10px 12px 10px 40px;\n border: 1px solid ",";\n border-radius: 8px;\n font-size: 1rem;\n color: #2d3748;\n transition: all 0.2s ease;\n background: #fff;\n\n &:focus {\n border-color: #2eb086;\n box-shadow: 0 0 0 3px rgba(46, 176, 134, 0.1);\n outline: none;\n }\n\n &::placeholder {\n color: #cbd5e0;\n }\n"])),e=>e.$hasError?"#e53e3e":"#e2e8f0"),B=f.default.select(i||(i=(0,h.A)(["\n width: 100%;\n padding: 10px 12px 10px 40px;\n border: 1px solid ",";\n border-radius: 8px;\n font-size: 1rem;\n color: #2d3748;\n transition: all 0.2s ease;\n background: #fff;\n appearance: none;\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n background-position: right 12px center;\n background-size: 16px;\n\n &:focus {\n border-color: #2eb086;\n box-shadow: 0 0 0 3px rgba(46, 176, 134, 0.1);\n outline: none;\n }\n"])),e=>e.$hasError?"#e53e3e":"#e2e8f0"),P=f.default.div(d||(d=(0,h.A)(["\n color: #e53e3e;\n font-size: 0.8rem;\n margin-top: 4px;\n"]))),F=f.default.button(p||(p=(0,h.A)(["\n padding: 10px 24px;\n border-radius: 8px;\n font-weight: 600;\n font-size: 0.95rem;\n transition: all 0.2s;\n border: none;\n box-shadow: 0 2px 4px rgba(0,0,0,0.05);\n\n &.primary {\n background: #2eb086;\n color: white;\n &:hover { background: #279773; }\n }\n\n &.secondary {\n background: #edf2f7;\n color: #4a5568;\n &:hover { background: #e2e8f0; }\n }\n \n &.danger {\n background: #fff5f5;\n color: #c53030;\n border: 1px solid #fed7d7;\n &:hover { background: #fed7d7; }\n }\n"]))),z=RegExp(/^[6-9]\d{9}$/),$=RegExp(/^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-]+)(\.[a-zA-Z]{2,5}){1,2}$/),_=/^[0-9\b]+$/,L=/^[a-zA-Z ]*$/;const O=function(){let[e,n]=(0,x.useState)(!1);const[a,s]=(0,x.useState)({name:"",email:"",phone:"",gender:"",occupation:"",dob:"",clientId:"",referenceConnectorId:""}),[t,r]=(0,x.useState)({name:"",email:"",phone:"",gender:"",occupation:"",dob:"",clientId:"",referenceConnectorId:""}),[l,o]=(0,x.useState)([]),[c,i]=(0,x.useState)([]),[d,p]=(0,x.useState)([]),[h,b]=(0,x.useState)(!1),[f,O]=(0,x.useState)(!1),q=e=>{let{name:n,value:l}=e.target;if("phone"===n)(_.test(l)&&l[0]>6||""==l)&&(r((0,m.A)((0,m.A)({},t),{},{phone:""===l||l.length<10?"Please enter a valid mobile number.":""})),s((0,m.A)((0,m.A)({},a),{},{[e.target.name]:" "===e.target.value[0]?"":e.target.value})));else switch(s((0,m.A)((0,m.A)({},a),{},{[e.target.name]:" "===e.target.value[0]?"":e.target.value})),n){case"phone":r((0,m.A)((0,m.A)({},t),{},{phone:z.test(l)?"":" Enter valid mobile number"}));break;case"name":r((0,m.A)((0,m.A)({},t),{},{name:0!==l.length&&L.test(l)?"":"Enter valid Name "}));break;case"gender":r((0,m.A)((0,m.A)({},t),{},{gender:0===l.length?"Please Select a Gender":""}));break;case"occupation":r((0,m.A)((0,m.A)({},t),{},{occupation:0===l.length?"Please Select a Occupation":""}));break;case"clientId":r((0,m.A)((0,m.A)({},t),{},{clientId:0===l.length?"Please Select a Client":""}));break;case"referenceConnectorId":r((0,m.A)((0,m.A)({},t),{},{referenceConnectorId:0===l.length?"Please Select a Reference Connector":""}));break;case"dob":r((0,m.A)((0,m.A)({},t),{},{dob:""===l?"Field is required":""}));break;case"email":l.length>0?r((0,m.A)((0,m.A)({},t),{},{email:$.test(l)?"":"Enter valid email"})):r((0,m.A)((0,m.A)({},t),{},{email:""}))}},D=[{name:"Connector ID",selector:e=>e._id?(0,A.jsx)("span",{className:"fw600","data-tag":"allowRowEvents",title:e._id,children:e._id}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e._id},{name:"Name",selector:e=>e.name?(0,A.jsx)("span",{className:"fw600","data-tag":"allowRowEvents",children:e.name}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e.name},{name:"Aggregator",selector:e=>e.isAggregator?(0,A.jsx)("span",{className:"badge bg-success","data-tag":"allowRowEvents",children:"Aggregator"}):(0,A.jsx)("span",{className:"badge bg-secondary",style:{color:"black"},"data-tag":"allowRowEvents",children:"Connector"}),exportSelector:e=>e.isAggregator?"Aggregator":"Not an Aggregator",sortable:!0},{name:"Customer",selector:e=>e.assignedUsers?(0,A.jsx)("span",{className:"fw600","data-tag":"allowRowEvents",children:e.assignedUsers}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e.name}
1,{name:"Disbursed",selector:e=>e.disbursed?(0,A.jsx)("span",{className:"fw600 ","data-tag":"allowRowEvents",children:e.disbursed}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e.disbursed},{name:"Lost",selector:e=>e.lost?(0,A.jsx)("span",{className:"fw600 text-danger",children:e.lost}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e.lost},{name:"Agent",selector:e=>e.agentid?(0,A.jsx)("span",{className:"fw600","data-tag":"allowRowEvents",children:e.agentid.name}):(0,A.jsx)("span",{className:"text-danger",children:"-"}),exportSelector:e=>e.name},{name:"Client",selector:e=>{var n,a;return null!==(n=e.clientId)&&void 0!==n&&n.name?(0,A.jsx)("span",{className:"fw600","data-tag":"allowRowEvents",children:null===(a=e.clientId)||void 0===a?void 0:a.name}):(0,A.jsx)("span",{className:"text-danger",children:"-"})},exportSelector:e=>{var n;return null===(n=e.clientId)||void 0===n?void 0:n.name}},{name:"Status",selector:e=>(0,A.jsx)("span",{className:"badge ".concat(e.isBlocked?"bg-danger":"bg-success"),children:e.isBlocked?"Blocked":"Active"}),sortable:!0}],T=(0,N.d4)(e=>e.user.user.role);return(0,x.useEffect)(()=>{v.A.get("/admin/getAllClient").then(e=>{e.data.success&&o(e.data.clients)}),v.A.get("/admin/getallconnectordata").then(e=>{e.data.success&&i(e.data.data)})},[]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(w.default,{heading:"Connectors",selector:"connector",columns:D,detailpageurl:"/panel/assignedconnectors/",rowClickUrl:"/panel/assignedconnectors/",url:"/admin/getConnector",editurl:"/panel/editConnector/",deleteurl:"/admin/deleteConnector/",selectableRows:!0,onSelectedRowsChange:e=>{let{selectedRows:n}=e;p(n)},clearSelectedRows:h,dataChanged:f,removeTotalRow:!0,customComponent:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("button",{className:"smallbtn mx-2 bg-danger",onClick:async()=>{if(0===d.length)return g.oR.error("Please select connectors to block");const{value:e}=await j().fire({title:"Block Connector(s)",input:"text",inputLabel:"Reason for blocking",inputPlaceholder:"Enter reason...",inputValidator:e=>{if(!e)return"Reason is required!"},showCancelButton:!0,confirmButtonColor:"#d33",confirmButtonText:"Block"});if(e)try{const n=await v.A.post("/admin/updateConnectorBlockStatus",{connectorIds:d.map(e=>e._id),isBlocked:!0,blockReason:e});n.data.success?(g.oR.success(n.data.message),b(!h),O(!f)):g.oR.error(n.data.message)}catch(n){g.oR.error("Error updating status")}},children:"Blocklist"}),(0,A.jsx)("button",{className:"smallbtn mx-2 bg-success",onClick:async()=>{if(0===d.length)return g.oR.error("Please select connectors to unblock");const{value:e}=await j().fire({title:"Unblock Connector(s)",input:"text",inputLabel:"Reason for unblocking",inputPlaceholder:"Enter reason...",inputValidator:e=>{if(!e)return"Reason is required!"},showCancelButton:!0,confirmButtonColor:"#28a745",confirmButtonText:"Unblock"});if(e)try{const n=await v.A.post("/admin/updateConnectorBlockStatus",{connectorIds:d.map(e=>e._id),isBlocked:!1,blockReason:e});n.data.success?(g.oR.success(n.data.message),b(!h),O(!f)):g.oR.error(n.data.message)}catch(n){g.oR.error("Error updating status")}},children:"Unblocklist"}),"sellDo"!==T&&(0,A.jsx)("button",{className:"smallbtn mx-2","data-toggle":"modal","data-target":"#exampleModal",onClick:()=>n(!0),children:"Create"})]})}),(0,A.jsxs)(C.A,{show:e,size:"lg",centered:!0,onHide:()=>{n(!1),r(""),s("")},backdrop:"static",keyboard:!1,children:[(0,A.jsx)(k,{closeButton:!0,children:(0,A.jsx)(C.A.Title,{children:"Create Connector"})}),(0,A.jsx)(S,{children:(0,A.jsxs)("div",{className:"row g-4",children:[(0,A.jsx)("div",{className:"col-12",children:(0,A.jsxs)(E,{children:[(0,A.jsx)(R,{children:"Personal Information"}),(0,A.jsxs)("div",{className:"row",children:[(0,A.jsx)("div",{className:"col-md-6",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Full Name ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaUser,{className:"icon"}),(0,A.jsx)(y,{type:"text",name:"name",placeholder:"Enter full name",$hasError:!!t.name,value:a.name,onChange:q,maxLength:"40"})]}),t.name&&(0,A.jsx)(P,{children:t.name})]})}),(0,A.jsx)("div",{className:"col-md-6",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Mobile Number ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaPhone,{className:"icon",style:{transform:"rotate(90deg)"}}),(0,A.jsx)(y,{type:"text",name:"phone",placeholder:"Enter 10-digit mobile number",$hasError:!!t.phone,value:a.p
1hone,onChange:q,maxLength:10})]}),t.phone&&(0,A.jsx)(P,{children:t.phone})]})}),(0,A.jsx)("div",{className:"col-md-6",children:(0,A.jsxs)(I,{children:[(0,A.jsx)("label",{children:"Email Address"}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaEnvelope,{className:"icon"}),(0,A.jsx)(y,{type:"email",name:"email",placeholder:"Enter email address",$hasError:!!t.email,value:a.email,onChange:q})]}),t.email&&(0,A.jsx)(P,{children:t.email})]})}),(0,A.jsx)("div",{className:"col-md-3",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Gender ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaMars,{className:"icon"}),(0,A.jsxs)(B,{name:"gender",value:a.gender,onChange:q,$hasError:!!t.gender,children:[(0,A.jsx)("option",{value:"",hidden:!0,children:"Select"}),(0,A.jsx)("option",{value:"Male",children:"Male"}),(0,A.jsx)("option",{value:"Female",children:"Female"})]})]}),t.gender&&(0,A.jsx)(P,{children:t.gender})]})}),(0,A.jsx)("div",{className:"col-md-3",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Date of Birth ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaCalendarAlt,{className:"icon"}),(0,A.jsx)(y,{type:"date",name:"dob",max:new Date("2004-01-01").toISOString().split("T")[0],value:a.dob,onChange:q,$hasError:!!t.dob,style:{paddingLeft:"40px"}})]}),t.dob&&(0,A.jsx)(P,{children:t.dob})]})})]})]})}),(0,A.jsx)("div",{className:"col-12",children:(0,A.jsxs)(E,{children:[(0,A.jsx)(R,{children:"Professional Details"}),(0,A.jsxs)("div",{className:"row",children:[(0,A.jsx)("div",{className:"col-md-6",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Occupation ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaUserTie,{className:"icon"}),(0,A.jsxs)(B,{name:"occupation",value:a.occupation,onChange:q,$hasError:!!t.occupation,children:[(0,A.jsx)("option",{value:"",hidden:!0,children:"Select Occupation"}),(0,A.jsx)("option",{value:"Real Estate Channel Partner",children:"Real Estate Channel Partner"}),(0,A.jsx)("option",{value:"Fintech Affiliates/Partner",children:"Fintech Affiliates/Partner"}),(0,A.jsx)("option",{value:"Salaried Employee",children:"Salaried Employee"}),(0,A.jsx)("option",{value:"Self Employed",children:"Self Employed"}),(0,A.jsx)("option",{value:"Lawyer",children:"Lawyer"}),(0,A.jsx)("option",{value:"CA",children:"CA"}),(0,A.jsx)("option",{value:"Others",children:"Others"})]})]}),t.occupation&&(0,A.jsx)(P,{children:t.occupation})]})}),(0,A.jsx)("div",{className:"col-md-6",children:(0,A.jsxs)(I,{children:[(0,A.jsxs)("label",{children:["Client ",(0,A.jsx)("span",{className:"required",children:"*"})]}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaBuilding,{className:"icon"}),(0,A.jsxs)(B,{name:"clientId",value:a.clientId,onChange:q,$hasError:!!t.clientId,children:[(0,A.jsx)("option",{value:"",hidden:!0,children:"Select Client"}),l.map(e=>(0,A.jsx)("option",{value:e._id,children:e.name},e._id))]})]}),t.clientId&&(0,A.jsx)(P,{children:t.clientId})]})}),(0,A.jsx)("div",{className:"col-md-12",children:(0,A.jsxs)(I,{children:[(0,A.jsx)("label",{children:"Reference Connector"}),(0,A.jsxs)("div",{className:"input-wrapper",children:[(0,A.jsx)(u.FaLink,{className:"icon"}),(0,A.jsxs)(B,{name:"referenceConnectorId",value:a.referenceConnectorId,onChange:q,$hasError:!!t.referenceConnectorId,children:[(0,A.jsx)("option",{value:"",hidden:!0,children:"Select Reference Connector (Optional)"}),c.filter(e=>e.clientId===a.clientId).map(e=>(0,A.jsxs)("option",{value:e._id,children:[e.name," - ",e.phone]},e._id))]})]}),t.referenceConnectorId&&(0,A.jsx)(P,{children:t.referenceConnectorId})]})})]})]})}),(0,A.jsxs)("div",{className:"col-12 mt-4 d-flex justify-content-end gap-3 border-top pt-4",children:[(0,A.jsx)(F,{className:"secondary",onClick:()=>{n(!1),r(""),s("")},children:"Cancel"}),(0,A.jsx)(F,{className:"primary",onClick:async()=>{const e=(0,m.A)({},t);let l=!0;if(0===a.name.length&&(l=!1,e.name="Enter valid Name"),0===a.phone.length?(l=!1,e.phone="Enter valid mobile number"):e.phone="",0===a.gender.length?(l=!1,e.gender="Please Select a Gender"):e.gender="",0===a.occupation.length?(l=!1,e.occupation="Please Select a Occupation"):e.occupation="",0===a.clientId.length?(l=!1,e.clientId="Please Select a Client"):e.clientId="",a.dob?new Date("2004-01-02").toISOString().split("T")[0]<=new Date(a.dob).toISOString().split("T")[0]?(l=!1,e.dob="Please select the correct Date of birth"):e.dob="":(l=!1,e.dob="Please Select a Date of birth"),l||r(e),t.name||t.phone||t.email);else{let e=await v.A.post("/admin/createConnectorClient",a);e.data.success?(g.oR.success(e.data.message),n(!1),r(""),s("")):g.oR.error(e.data.message)}},children:"Create Connector"})]})]})})]})]})}},53149(e,n,a){a.d(n,{A:()=>o});var s=a(9950),t=a(64877),r=a(31222),l=(a(80592),a(44414));const o=function(e){let{show:n,setIsOpen:a,token:o}=e;
1const[c,i]=(0,s.useState)(""),d=(0,s.useRef)(null),p=window.location;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(t.A,{show:n,onHide:()=>{a(!1),i("")},children:[(0,l.jsx)(t.A.Header,{closeButton:!0,className:"refer-modal-bg",children:(0,l.jsx)(t.A.Title,{children:"Referral Link"})}),(0,l.jsx)(t.A.Body,{children:(0,l.jsx)("div",{className:"d-flex",children:o&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("input",{className:"form-control",ref:d,value:"".concat(p.origin,"/connectorSignup/").concat(o.id),placeholder:"Link here"}),(0,l.jsx)(r.MdContentCopy,{onClick:function(e){d.current.select(),document.execCommand("copy"),e.target.focus(),i("Copied!")},className:"m-2"}),c]})})})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.