PageSourceSearch

https://umeindia.in/_next/static/chunks/pages/cmadmin/filteragent-ebfb986ecf294dd1.js

js umeindia.in collected 2026-10-02 01:05:20 UTC 12,321 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8531],{83368:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cmadmin/filteragent",function(){return t(30585)}])},30585:function(e,n,t){"use strict";t.r(n);var r=t(47568),s=t(828),a=t(29815),i=t(97582),o=t(85893),l=t(67294),c=t(82175),u=t(69160),d=t(46147),m=t(78366),p=t(13679),f=t(71791),x=t(24137),h=t(11163),y=t.n(h),g=t(46667),b=(t(48210),t(28582)),v=t(32655),j=t(77376),N=t(9198),k=t.n(N),w=(t(18698),t(58311));console.log((function(e){if(!e)return"";var n=e.split("-");if(3!==n.length)return"";var t=(0,s.Z)(n,3),r=t[0],a=t[1],i=t[2];return"".concat(i,"-").concat(a,"-").concat(r)}));n.default=function(){var e=function(e){var n=(0,s.Z)(e.split("-"),3),t=n[0],r=n[1],a=n[2];return new Date(a,r-1,t)},n=(0,l.useState)([]),t=n[0],N=n[1],D=(0,l.useState)(""),A=D[0],Z=D[1],_=(0,l.useState)(!1),C=_[0],E=_[1],S=(0,h.useRouter)(),I=(0,l.useState)(null),T=I[0],R=I[1],F=(0,l.useState)(""),P=F[0],M=F[1],L=(0,l.useState)([]),z=L[0],Y=L[1],V=(0,l.useState)(!1),O=V[0],B=V[1];console.log(M),console.log(O),console.log(z);var H=function(e){if(!e)return"";var n=String(e.getDate()).padStart(2,"0"),t=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return"".concat(n,"-").concat(t,"-").concat(r)},X=function(){var e=(0,r.Z)((function(){var e,n,t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),E(!0),[4,fetch("".concat(g.F,"/cm/api/v1/person/getPersonByType/").concat(1,"/").concat("Agent"))];case 1:if(!(e=r.sent()).ok)throw new Error("Network response not ok");return[4,e.json()];case 2:return n=r.sent(),Array.isArray(n)&&n.length>0?(N(n),Z("")):(N([]),Z("No customer details found.")),[3,5];case 3:return t=r.sent(),console.error(t),Z("Error fetching latest customers."),[3,5];case 4:return E(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){document.querySelectorAll(".react-datepicker__calendar-icon").forEach((function(e,n){e.addEventListener("click",(function(){var e,t;0===n&&(null===(e=K.current)||void 0===e||e.setOpen(!0));1===n&&(null===(t=U.current)||void 0===t||t.setOpen(!0))}))})),X()}),[]);var q=new Date,J=(0,c.TA)({initialValues:{fromDate:q,toDate:q,type:"Admin",companyId:1},onSubmit:function(){var n=(0,r.Z)((function(n){var t,r,s,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(!n.fromDate||!n.toDate)return alert("Please select both From and To dates"),[2];if((t={fromDate:H(n.fromDate),toDate:H(n.toDate),type:n.type,companyId:n.companyId}).fromDate&&t.toDate&&e(t.toDate)<e(t.fromDate))return alert("To date must be greater than from date."),[2];i.label=1;case 1:return i.trys.push([1,4,5,6]),E(!0),Z(""),[4,fetch("".concat(g.F,"/cm/api/v1/person/getAllPersonsByFromDateToDate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 2:return[4,(r=i.sent()).json()];case 3:return s=i.sent(),r.ok&&Array.isArray(s)&&s.length>0?N(s):(N([]),Z("No customer details found.")),[3,6];case 4:return a=i.sent(),console.error(a),Z("Error fetching data."),[3,6];case 5:return E(!1),[7];case 6:return[2]}}
1))}));return function(e){return n.apply(this,arguments)}}()}),K=(0,l.useRef)(null),U=(0,l.useRef)(null);(0,l.useEffect)((function(){if(!P)return Y([]),void B(!1);var e=setTimeout((0,r.Z)((function(){var e,n,t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch("".concat(g.F,"/api/v2/user/getallcustomerloginids"))];case 1:return[4,r.sent().json()];case 2:return e=r.sent(),n=(e||[]).map((function(e){return e.Id})).filter((function(e){return e.toLowerCase().includes(P.toLowerCase())})),Y(n),B(n.length>0),[3,4];case 3:return t=r.sent(),console.error(t),Y([]),B(!1),[3,4];case 4:return[2]}}))})),300);return function(){return clearTimeout(e)}}),[P]);var G=function(){var e=(0,r.Z)((function(e){var n,t,r;return(0,i.__generator)(this,(function(s){switch(s.label){case 0:if(console.log("DELETE CLICKED ID =",e),!window.confirm("Are you sure you want to remove the agent?"))return[2];s.label=1;case 1:return s.trys.push([1,4,,5]),[4,fetch("".concat(g.F,"/cm/api/v1/person/deletePersonbyId/").concat(e),{method:"DELETE"})];case 2:return n=s.sent(),console.log("STATUS =",n.status),[4,n.text()];case 3:return t=s.sent(),console.log("RESPONSE =",t),n.ok?(alert("Agent removed successfully."),X()):alert("Failed to removed agent."),[3,5];case 4:return r=s.sent(),console.error("ERROR =",r),[3,5];case 5:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),Q=null!==T&&void 0!==T?T:{key:"",direction:"asc"};console.log(Q);return(0,o.jsx)(l.Fragment,{children:(0,o.jsxs)(u.Z,{children:[(0,o.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.2rem"},children:[(0,o.jsx)(w.Z,{title:" Agents List",iconName:"bi bi-people-fill",button:(0,o.jsx)("div",{className:"Media"})}),(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,o.jsx)(x.z,{color:"primary",bg:"primary.light",onClick:function(){return y().push("/cmadmin/filteragent/create")},mr:"0.5rem",children:"Add Agent"}),(0,o.jsx)(x.z,{color:"primary",bg:"primary.light",type:"button",px:"1rem",onClick:function(){return S.replace(S.asPath)},children:(0,o.jsx)("img",{width:"25px",src:"/assets/images/Refresh_icon.png"})})]})]}),C&&(0,o.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(255,255,255,0.5)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:9999},children:(0,o.jsx)(b.Z,{})}),(0,o.jsx)("form",{onSubmit:J.handleSubmit,children:(0,o.jsx)(p.Z,{mb:"20px",children:(0,o.jsxs)(f.Z,{container:!0,spacing:2,alignItems:"center",style:{gap:"15px"},children:[(0,o.jsxs)("div",{className:"form-group",children:[(0,o.jsx)("label",{children:"From Date : "}),(0,o.jsx)("br",{}),(0,o.jsx)(k(),{ref:K,selected:J.values.fromDate,onChange:function(e){return J.setFieldValue("fromDate",e)},dateFormat:"dd-MM-yyyy",placeholderText:"DD-MM-YYYY",className:"form-control",showIcon:!0})]}),(0,o.jsxs)("div",{className:"form-group",children:[(0,o.jsx)("label",{children:"To Date : "}),(0,o.jsx)("br",{}),(0,o.jsx)(k(),{ref:U,selected:J.values.toDate,onChange:function(e){return J.setFieldValue("toDate",e)},dateFormat:"dd-MM-yyyy",placeholderText:"DD-MM-YYYY",className:"form-control",showIcon:!0,minDate:J.values.fromDate})]}),(0,o.jsx)(f.Z,{item:!0,children:(0,o.jsx)(x.z,{type:"submit",color:"primary",variant:"contained",style:{marginTop:"25px"},children:"Submit"})})]})})}),(0,o.jsx)("style",{children:"\n@media screen and (max-width: 426px) {\n  .DeskTopViEw {\n    display: none;\n  }\n    /* Move calendar icon to the right */\n.react-datepicker__calendar-icon {\n  position: absolute;\n  right: 10px;\n  left: auto;\n  top: 50%;\n  transform: translateY(-50%);\n  cursor: pointer;\n}\n}\n"}),(0,o.jsx)("style",{children:"\n\n  .MobileRes {\n    display: none;\n  }\n/* Move calendar icon to the right */\n.react-datepicker__calendar-icon {\n  position: absolute;\n  right: 10px;\n  left: auto;\n  top: 50%;\n  transform: translateY(-50%);\n  cursor: pointer;\n}\n  @media screen and (max-width: 426px) {\n    .MobileRes {\n      display: block;\n      padding: 10px;\n    }\n\n    @media screen and (max-width: 768px) {\n  .MobileRes {\n    display: block;\n    padding: 10px;\n  }\n\n  .mobileCard {\n    background: #fff;\n    border-radius: 12px;\n    padding: 16px;\n    margin-bottom: 16px;\n    box-shadow: 0 4px 12px rgba(0,0,0,0.08);\n  }\n\n  .mobileRow {\n    display: flex;\n    justify-content: space-between;\n    margin-bottom: 8px;\n    font-size: 14px;\n    flex-wrap: wrap;\n  }\n\n  .mobileLabel {\n    font-weight: 600;\n    color: #555;\n    margin-right: 6px;\n  }\n\n  .mobileValue {\n    color: #111;\n    text-align: right;\n    word-break: break-word; /* ensure long emails wrap */\n  }\n\n  .statusActive {\n    color: #16a34a;\n    font-weight: 600;\n  }\n\n  .statusInactive {\n    color: #dc2626;\n    font-weight: 600;\n  }\n\n  .mobileActions {\n    display: flex;\n    justify-content: flex-end;\n    gap: 12px;\n    margin-top: 12px;\n  }\n"}),(0,o.jsx)("style",{children:"\n  .AletnativeColr:nth-child(odd) {\n  background-color: #F9FAFB;\n}\n.AletnativeColr:nth-child(even) {\n  background-color: #c6d1df;\n}\n  "}),(0,o.jsx)(p.Z,{mb:"30px",className:"DeskTopViEw",children:(0,o.jsx)(f.Z,{container:!0,children:(0,o.jsxs)(f.Z,{item:!0,md:12,xs:12,children:[(0,o.jsx)(m.Z,{bg:"#BE7374",color:"white",padding:"6px 18px",style:{display:"flex",justifyContent:"center",textAlign:"center"},children:[{label:"Agent Id",key:"id"},{label:"Agent Name",key:"firstName"},{label:"Phone",key:"phoneNumber"},{label:"Email",key:"userName"},{label:"Status",key:"status"},{label:"Action",key:"action"}].map((function(e){return(0,o.jsxs)(d.H5,{mx:"6px",style:{flex:1,textAlign:"center",cursor:"action"!==e.key?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},onClick:function(){return"action"!==e.key&&function(e){var n="asc";T&&T.key===e&&"asc"===T.direction&&(n="desc"),R({key:e,direction:n});var r=(0,a.Z)(t).sort((function(t,r){var s,a,i=null!==(s=t[e])&&void 0!==s?s:"",o=null!==(a=r[e])&&void 0!==a?a:"";return i<o?"asc"===n?-1:1:i>o?"asc"===n?1:-1:0}));N(r)}
1(e.key)},children:[e.label,"action"!==e.key&&(0,o.jsxs)("span",{style:{display:"flex",flexDirection:"column",lineHeight:"1"},children:[(0,o.jsx)("i",{className:"bi bi-caret-up-fill ".concat((null===T||void 0===T?void 0:T.key)===e.key&&"asc"===(null===T||void 0===T?void 0:T.direction)?"":"opacity-50"),style:{fontSize:"10px"}}),(0,o.jsx)("i",{className:"bi bi-caret-down-fill ".concat((null===T||void 0===T?void 0:T.key)===e.key&&"desc"===(null===T||void 0===T?void 0:T.direction)?"":"opacity-50"),style:{fontSize:"10px"}})]})]},e.key)}))}),A&&(0,o.jsx)(d.ZP,{m:"6px",textAlign:"center",children:A}),t.map((function(e){return(0,o.jsxs)(m.Z,{className:"AletnativeColr",my:"1rem",padding:"6px 18px",style:{display:"flex",alignItems:"center",textAlign:"center"},children:[(0,o.jsx)(d.ZP,{style:{flex:1},children:e.id}),(0,o.jsx)(d.ZP,{style:{flex:1},children:e.firstName}),(0,o.jsx)(d.ZP,{style:{flex:1},children:e.phoneNumber}),(0,o.jsx)(d.ZP,{style:{flex:1},children:e.userName}),(0,o.jsx)(d.ZP,{style:{flex:1},children:!0===e.status||"Active"===e.status?"Active":"Inactive"}),(0,o.jsxs)(d.ZP,{style:{flex:1,display:"flex",justifyContent:"center",gap:"12px"},children:[(0,o.jsx)(v.Z,{size:20,style:{cursor:"pointer"},onClick:function(){return y().push("/cmadmin/filteragent/update-agent?id=".concat(e.id))}}),(0,o.jsx)(j.Z,{size:20,style:{cursor:"pointer",color:"red"},onClick:function(){return G(e.id)}})]})]},e.id)}))]})})}),(0,o.jsx)("div",{className:"MobileRes",children:t.map((function(e){return(0,o.jsxs)(p.Z,{className:"mobileCard",children:[(0,o.jsxs)("div",{className:"mobileRow",children:[(0,o.jsx)("span",{className:"mobileLabel",children:"ID:"}),(0,o.jsx)("span",{className:"mobileValue",children:e.id})]}),(0,o.jsxs)("div",{className:"mobileRow",children:[(0,o.jsx)("span",{className:"mobileLabel",children:"Name:"}),(0,o.jsx)("span",{className:"mobileValue",children:e.firstName})]}),(0,o.jsxs)("div",{className:"mobileRow",children:[(0,o.jsx)("span",{className:"mobileLabel",children:"??"}),(0,o.jsx)("span",{className:"mobileValue",children:e.phoneNumber})]}),(0,o.jsxs)("div",{className:"mobileRow",children:[(0,o.jsx)("span",{className:"mobileLabel",children:"??"}),(0,o.jsx)("span",{className:"mobileValue",children:e.userName})]}),(0,o.jsxs)("div",{className:"mobileRow",children:[(0,o.jsx)("span",{className:"mobileLabel",children:"Status:"}),(0,o.jsx)("span",{className:!0===e.status||"Active"===e.status?"statusActive":"statusInactive",children:!0===e.status||"Active"===e.status?"Active":"Inactive"})]}),(0,o.jsxs)("div",{className:"mobileActions",children:[(0,o.jsx)(v.Z,{size:18,style:{cursor:"pointer",color:"#0ea5e9"},onClick:function(){return y().push("/cmadmin/filteragent/update-agent?id=".concat(e.id))}}),(0,o.jsx)(j.Z,{size:18,style:{cursor:"pointer",color:"#dc2626"},onClick:function(){return G(e.id)}})]})]},e.id)}))})]})})}}},function(e){e.O(0,[2175,6678,3638,1664,6037,696,4544,9160,1641,9774,2888,179],(function(){return n=83368,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.