Files
dailygrubs_console_build/build/static/js/1049.5fef6c6e.chunk.js

1 line
16 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1049],{62180:function(t,e,r){r.d(e,{y:function(){return a}});var n=r(90842),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3;(0,n.yv)(t,{variant:e,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:r})}},71049:function(t,e,r){r.d(e,{$w:function(){return w},N4:function(){return x},OA:function(){return M},RO:function(){return l},RQ:function(){return y},Sr:function(){return O},TG:function(){return h},UV:function(){return q},Vf:function(){return g},Wo:function(){return d},Ye:function(){return b},bI:function(){return f},bc:function(){return j},f2:function(){return _},gO:function(){return m},hG:function(){return k},iI:function(){return Z},kc:function(){return v},n7:function(){return A},p7:function(){return P},vE:function(){return z},wf:function(){return K},wj:function(){return S}});var n=r(1413),a=r(93433),c=r(74165),o=r(29439),i=r(15861),u=r(56573),s=r(62180),p=localStorage.getItem("tenantid"),d=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,6),a=n[1],i=n[2],s=n[3],p=n[4],d=n[5],t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/getordersummary/?applocationid=").concat(a,"&tenantid=").concat(p,"&locationid=").concat(d,"&fromdate=").concat(i,"&todate=").concat(s));case 4:return l=t.sent,f=l.data.details,t.abrupt("return",{created:f.created.toString(),uncoveredOrders:f.pending.toString(),coveredOrders:f.delivered.toString(),cancelled:f.cancelled.toString(),percentage1:(Math.round(f.created/f.total*100)||0).toString(),percentage2:(Math.round(f.pending/f.total*100)||0).toString(),percentage3:(Math.round(f.delivered/f.total*100)||0).toString(),percentage4:(Math.round(f.cancelled/f.total*100)||0).toString()});case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),l=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f,v;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,7),a=n[1],i=n[2],s=n[3],p=n[4],d=n[5],l=n[6],f="".concat("https://jupiter.nearle.app/live/api/v1","/orders/getordersummary/?applocationid=").concat(a,"&tenantid=").concat(d,"&locationid=").concat(l,"&fromdate=").concat(i,"&todate=").concat(s,"&status=").concat(p),t.next=5,u.Z.get(f);case 5:return v=t.sent,t.abrupt("return",v.data.details);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f,v,Z,h;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,8),i[0],s=i[1],p=i[2],d=i[3],l=i[4],f=i[5],v=i[6],Z=i[7],t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/orders/tenant/getorders/?tenantid=").concat(s,"&locationid=").concat(p,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(Z,"&keyword=").concat(v));case 4:return h=t.sent,t.abrupt("return",{details:h.data.details,nextPage:h.data.details.length===Z?n+1:void 0});case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),v=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,d,l,f,v,Z;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,3),d=i[1],l=i[2],t.prev=2,t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(p,"&pageno=").concat(n,"&pagesize=").concat(d,"&keyword=").concat(l));case 5:return v=t.sent,Z=null!==(f=v.data.details)&&void 0!==f?f:[],t.abrupt("return",{details:Z,nextPage:Z.length===d?n+1:void 0});case 10:return t.prev=10,t.t0=t.catch(2),(0,s.y)(t.t0.message,"error",1e3),t.abrupt("return",{details:[],nextPage:void 0});case 14:case"end":return t.stop()}}),t,null,[[2,10]])})));return function(e){return t.apply(this,arguments)}}(),Z=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,console.log("queryKey for getreportlocationsummary",r),n=(0,o.Z)(r,4),a=n[0],i=n[1],s=n[2],d=n[3],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getreportlocationsummary/?tenantid=").concat(p,"&locationid=").concat(s,"&fromdate=").concat(a,"&todate=").concat(i,"&keyword=").concat(d));case 5:return l=t.sent,console.log("getreportlocationsummary",l.data.details),t.abrupt("return",l.data.details);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),h=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,2),a=n[1],t.prev=2,t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations?tenantid=").concat(p,"&keyword=").concat(a));case 5:return s=t.sent,t.abrupt("return",(null===(i=s.data)||void 0===i?void 0:i.details)||[]);case 9:return t.prev=9,t.t0=t.catch(2),console.error("Error fetching tenant locations:",t.t0),t.abrupt("return",[]);case 13:case"end":return t.stop()}}),t,null,[[2,9]])})));return function(e){return t.apply(this,arguments)}}(),g=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,5),a=n[1],i=n[2],n[3],s=n[4],t.next=4,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary?tenantid=").concat(p,"&locationid=").concat(s,"&fromdate=").concat(a,"&todate=").concat(i));case 4:return d=t.sent,console.log("fetchDeliverySummary",d.data.details),t.abrupt("return",d.data.details);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(){var e,r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getpartners"));case 2:return e=t.sent,r=[].concat((0,a.Z)(e.data.details),[{partnername:"All",applocationid:-1}]),console.log("fetchAppLocations",r),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),y=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,console.log("queryKey for fetchRidersSummary",r),n=(0,o.Z)(r,3),a=n[0],i=n[1],s=n[2],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getridersummary/?tenantid=").concat(a,"&fromdate=").concat(i,"&todate=").concat(s));case 5:return p=t.sent,console.log("fetchRidersSummary",p.data.details),t.abrupt("return",p.data.details);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),w=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,d,l,f,v,Z,h,g,m,y;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?0:r,a=e.queryKey,i=(0,o.Z)(a,5),s=i[0],d=i[1],l=i[2],f=i[3],v=i[4],Z=10,h=n+1,t.next=6,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?tenantid=").concat(p,"&locationid=").concat(f,"&fromdate=").concat(s,"&todate=").concat(d,"&status=").concat("All"===l?"":l,"&pageno=").concat(h,"&pagesize=").concat(Z,"&keyword=").concat(v));case 6:return g=t.sent,m=g.data.details||[],y=m.length===Z,t.abrupt("return",{details:m,nextPage:y?n+1:void 0});case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),x=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,n=(0,o.Z)(r,3),a=n[0],i=n[1],s=n[2],p=void 0===s?"":s,t.next=4,u.Z.get("https://jupiter.nearle.app/live/api/v2/partners/getriderlogs/?applocationid=".concat(a,"&fromdate=").concat(i||"","&todate=").concat(i||"","&keyword=").concat(p||""));case 4:return d=t.sent,console.log("fetchRidersLogs",d.data.details),t.abrupt("return",d.data.details);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),k=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="".concat("https://jupiter.nearle.app/live/api/v1","/utils/getriderperiodiclogs").concat(e?"?userid=".concat(e):""),t.next=3,u.Z.get(r);case 3:if(!(n=t.sent).data||!n.data.status){t.next=6;break}return t.abrupt("return",n.data.data);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),b=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,i,p,d,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.queryKey,t.prev=1,a=(0,o.Z)(r,2),i=a[1],t.next=5,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getriders/?applocationid=").concat(i));case 5:return p=t.sent,d=p.data,l=null!==d&&void 0!==d&&d.details?d.details.map((function(t){return(0,n.Z)((0,n.Z)({},t),{},{label:"".concat(t.firstname," ").concat(t.lastname," | ").concat(t.contactno)})})):[],t.abrupt("return",l);case 11:throw t.prev=11,t.t0=t.catch(1),(0,s.y)(t.t0.message,"error",2e3),t.t0;case 15:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}(),j=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.post("https://routes.workolik.com/api/v1/optimization/createdeliveries",e.deliveries);case 2:return r=t.sent,t.abrupt("return",r.data);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),K=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.riders,t.next=3,u.Z.post("https://routes.workolik.com/api/v1/optimization/reconcile-steps",{riders:r});case 3:return n=t.sent,t.abrupt("return",n.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),q=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.batch,n=e.tenantId,t.next=3,u.Z.post("https://routes.workolik.com/api/v1/batch/efficiency",{batch:r,tenant_id:n},{headers:{"Content-Type":"application/json"},validateStatus:function(){return!0}});case 3:return a=t.sent,t.abrupt("return",a.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),S=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=function(t){var e=Number(t);return Number.isFinite(e)?e:t},a=(e.deliveries||[]).map((function(t){return(0,n.Z)((0,n.Z)({},t),{},{userid:r(t.userid),rider_id:r(t.rider_id)})})),t.next=4,u.Z.post("https://jupiter.nearle.app/live/api/v1/deliveries/createdeliveries",a);case 4:return o=t.sent,t.abrupt("return",o.data);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),_=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,a,o,i,s,p;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Array.isArray(e.absent_riders)?e.absent_riders:[],i=1==(null===(r=e.selectedMode)||void 0===r?void 0:r.value)?"https://routes.workolik.com/api/v1/optimization/riderassign?hypertuning_params=".concat(e.hypertuning_params):"https://routemate.workolik.com/api/v1/optimization/riderassign?strategy=multi_trip",s=1==(null===(a=e.selectedMode)||void 0===a?void 0:a.value)?{deliveries:e.deliveries,absent_riders:o}:(0,n.Z)((0,n.Z)({},e.data||{}),{},{absent_riders:o}),t.next=5,u.Z.post(i,s);case 5:return p=t.sent,t.abrupt("return",p.data);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),z=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Invalid rider token");case 2:return t.next=4,u.Z.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/notifyuser"),{token:e,notification:{title:"NearleXpress",body:"Orders have been placed for delivery. Kindly accept and process deliveries",sound:"ring",image:""}});case 4:return r=t.sent,t.abrupt("return",r.data);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),P=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n,a,i,s,p,d,l,f,v,Z,h,g,m,y,w;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pageParam,n=void 0===r?1:r,a=e.queryKey,i=(0,o.Z)(a,11),s=i[1],p=i[2],d=i[3],l=i[4],f=i[5],v=i[6],Z=i[7],h=i[8],g=i[9],m=i[10],d="All"==d?"all":d,y=0===s?"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?appuserid=").concat(p,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(v,"&keyword=").concat(Z,"&tenantid=").concat(h,"&locationid=").concat(g,"&userid=").concat(m):"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getdeliveries/?applocationid=").concat(s,"&status=").concat(d,"&fromdate=").concat(l,"&todate=").concat(f,"&pageno=").concat(n,"&pagesize=").concat(v,"&keyword=").concat(Z,"&tenantid=").concat(h,"&locationid=").concat(g,"&userid=").concat(m),t.next=6,u.Z.get(y);case 6:return w=t.sent,t.abrupt("return",{rows:w.data.details,nextPage:w.data.details.length===Number(v)?n+1:void 0});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),M=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(){var e,r;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapptypes/?tag=paymentmode"));case 2:return e=t.sent,r=e.data,t.abrupt("return",r.details.map((function(t){return(0,n.Z)((0,n.Z)({},t),{},{label:t.typename})})));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),A=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(){var e;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getallriders?partnerid=64"));case 3:return e=t.sent,t.abrupt("return",e.data.details);case 7:t.prev=7,t.t0=t.catch(0),console.log("getallriders",t.t0.message);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}(),O=function(){var t=(0,i.Z)((0,c.Z)().mark((function t(e){var r,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null===e||void 0===e?void 0:e.map((function(t){return{orderheaderid:t.orderheaderid,orderstatus:"cancelled",cancelled:dayjs().format("YYYY-MM-DD HH:mm:ss")}})),t.next=3,u.Z.put("".concat("https://jupiter.nearle.app/live/api/v1","/orders/updatemultipleorders"),r);case 3:return n=t.sent,t.abrupt("return",n.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}]);