Files
Express_console_build/build/static/js/7157.a80416ea.chunk.js

1 line
15 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[7157],{56311:(e,r,o)=>{o.d(r,{A:()=>p});var t=o(89379),n=o(9950),i=o(2660),s=o(2046),l=o(83274),c=o(25333),a=o(97125),d=o(7762),x=o(52097),h=o(44414);const p=e=>{let{value:r,onChange:o,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:m}=e;const b=(0,n.useRef)(null),[A]=(0,x.d7)(r,g);return(0,n.useEffect)((()=>{p&&p(A)}),[A,p]),(0,n.useEffect)((()=>{const e=e=>{var r;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(r=b.current)||void 0===r||r.focus());"Escape"===e.key&&document.activeElement===b.current&&b.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,t.A)({},m),inputRef:b,placeholder:u,autoComplete:"off",value:r,fullWidth:!0,onChange:e=>o(e.target.value),startAdornment:(0,h.jsx)(s.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(a.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(c.A,{sx:{visibility:r?"visible":"hidden"},onClick:()=>o(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,r,o)=>{o.d(r,{A:()=>h});var t=o(89379),n=o(9950),i=o(93230),s=o(41413),l=o(77922),c=o(29925),a=o(26910),d=o(31222),x=o(44414);const h=(0,n.forwardRef)(((e,r)=>{let{setAppId:o,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:m,pill:b=!1,accentColor:A="#6366f1",icon:f,placeholder:j="Select Zone",paperComponent:v}=e;const[w,S]=(0,n.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,n.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const r=await a.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(r.data.status){const e=[...r.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const k=e=>"".concat(A).concat(e),y=k("08"),C=k("26"),I=k("55"),R=k("18"),z=b?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:y,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:I,borderWidth:1.5},"&:hover fieldset":{borderColor:A},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:A,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:A}}:{},W=b&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(s.A,{sx:{width:24,height:24,bgcolor:R,color:A,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.locationname)&&void 0!==r?r:""},PaperComponent:v,sx:(0,t.A)({},g),onChange:(e,r,t)=>{"clear"===t?(null===o||void 0===o||o(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):r&&(null===o||void 0===o||o(r.applocationid),null===h||void 0===h||h(r.locationname),null===p||void 0===p||p(0))},renderInput:e=>b?(0,x.jsx)(c.A,(0,t.A)((0,t.A)({},e),{},{inputRef:r,placeholder:j,InputProps:(0,t.A)((0,t.A)({},e.InputProps),{},{startAdornment:W}),sx:(0,t.A)((0,t.A)({},z),m||u||{})})):(0,x.jsx)(c.A,(0,t.A)((0,t.A)({},e),{},{inputRef:r,label:"Select Zones",sx:(0,t.A)({},m||u||{})}))})}))},96646:(e,r,o)=>{o.d(r,{r:()=>c});var t=o(9213),n=o(21671),i=o(82917),s=o(93230),l=o(44414);const c=e=>{let{rowsPerPage:r=5,col:o=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(r)).map(((e,r)=>(0,l.jsxs)(t.A,{children:[(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:o}).map(((e,r)=>(0,l.jsx)(n.A,{children:(0,l.jsxs)(s.A,{spacing:.5,children:[(0,l.jsx)(i.A,{variant:"text",width:100}),(0,l.jsx)(i.A,{variant:"text",width:80})]})},r))),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"text",width:150})}),(0,l.jsx)(n.A,{children:(0,l.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(n.A,{align:"center",children:(0,l.jsxs)(s.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},r)))})}},97157:(e,r,o)=>{o.r(r),o.d(r,{default:()=>_});var t=o(89379),n=o(9950),i=o(2235),s=o(41413),l=o(16491),c=o(93230),a=o(82053),d=o(60899),x=o(1320),h=o(15769),p=o(69780),g=o(9213),u=o(21671),m=o(34075),b=o(31222),A=o(36150),f=o(52351),j=o(56311),v=o(59212),w=o(96646),S=o(81425),k=o(44414);const y=16,C="0 8px 24px rgba(15, 23, 42, 0.08)",I="0 18px 50px rgba(15, 23, 42, 0.18)",R="#0f172a",z="#64748b",W="#94a3b8",L="#e2e8f0",M="#f1f5f9",P="#f8fafc",B=(e,r)=>"".concat(e).concat(r),N=e=>B(e,"08"),F=e=>B(e,"18"),T=e=>B(e,"26"),D=e=>B(e,"55"),J="#662582",E=e=>(0,k.jsx)(i.A,(0,t.A)((0,t.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:I,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),H=e=>{let{color:r,selected:o,size:t=24,children:n}=e;return(0,k.jsx)(s.A,{sx:{width:t,height:t,bgcolor:o?r:F(r),color:o?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:n})},O=e=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0),Z=e=>new Intl.NumberFormat("en-IN",{minimumFractionDigits:2}).format(Number(e)||0),K=e=>{let{color:r,icon:o,label:t,width:n}=e;return(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N(r),border:"1px solid ".concat(D(r)),color:r,fontSize:11,fontWeight:800,minWidth:n,justifyContent:"center"},children:[o,t]})},_=()=>{const e=(0,n.useRef)(),[r,o]=(0,n.useState)(0),[t,I]=(0,n.useState)("All"),[B,_]=(0,n.useState)(""),[q,$]=(0,n.useState)(""),{data:G=[],isLoading:Y}=(0,A.I)({queryKey:["getallpricing",r],queryFn:S.OM,keepPreviousData:!0}),Q=(0,n.useMemo)((()=>{if(!q)return G;const e=q.toLowerCase().trim();return G.filter((r=>[r.applocation,r.appname,r.slab,String(r.pricingid)].filter(Boolean).some((r=>String(r).toLowerCase().includes(e)))))}),[G,q]),U=(0,n.useMemo)((()=>{const e=G.length;return{total:e,tenants:new Set(G.map((e=>e.appname)).filter(Boolean)).size,avgBase:e?G.reduce(((e,r)=>e+(Number(r.baseprice)||0)),0)/e:0}}),[G]),V=[{key:"total",label:"Total Pricing Slabs",color:J,icon:b.JL6,value:U.total},{key:"tenants",label:"Tenants Priced",color:"#0ea5e9",icon:b.Itr,value:U.tenants},{key:"avg",label:"Avg Base Price",color:"#f59e0b",icon:b.H4F,value:O(U.avgBase)},{key:"zone",label:"Active Zone",color:"#10b981",icon:b.JFD,value:t||"All Zones"}];return(0,k.jsxs)(k.Fragment,{children:[Y&&(0,k.jsx)(f.A,{}),(0,k.jsx)(i.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:y/8,border:"1px solid",borderColor:L,background:"linear-gradient(135deg, ".concat(N(J)," 0%, ").concat(N("#9255AB")," 100%)"),boxShadow:C},children:(0,k.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,k.jsx)(s.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:J,color:"#fff",boxShadow:"0 6px 18px ".concat(T(J))},children:(0,k.jsx)(b.JL6,{size:22})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"h3",sx:{fontWeight:800,color:R,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Pricing"}),(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,k.jsx)(l.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,k.jsxs)(a.A,{variant:"caption",sx:{color:z,fontWeight:600},children:["Live \xb7 ",t||"All Zones"]})]})]})]}),(0,k.jsx)(v.A,{locaName:t,setAppId:o,setLocoName:I,pill:!0,accentColor:J,icon:(0,k.jsx)(b.HPi,{size:14}),placeholder:"Select Zone",paperComponent:E,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,k.jsx)(d.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:V.map((e=>{const r=e.icon;return(0,k.jsx)(d.Ay,{item:!0,xs:12,sm:6,md:3,children:(0,k.jsxs)(i.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:y/8,border:"1px solid",borderColor:L,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s","&:hover":{transform:"translateY(-3px)",boxShadow:C,borderColor:D(e.color)}},children:[(0,k.jsx)(l.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(F(e.color)," 100%)")}}),(0,k.jsxs)(c.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,k.jsxs)(c.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,k.jsx)(a.A,{variant:"caption",sx:{color:z,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),(0,k.jsx)(a.A,{sx:{fontWeight:800,color:R,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.value})]}),(0,k.jsx)(s.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:F(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(D(e.color)),flexShrink:0},children:(0,k.jsx)(r,{size:20})})]})]})},e.key)}))}),(0,k.jsx)(i.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:y/8,borderTopRightRadius:y/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:L,borderBottom:0,background:"#fff"},children:(0,k.jsxs)(c.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,k.jsx)(H,{color:J,size:32,children:(0,k.jsx)(b.JL6,{size:18})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"caption",sx:{fontWeight:800,color:z,letterSpacing:.6,textTransform:"uppercase"},children:"Pricing Catalog"}),(0,k.jsxs)(a.A,{variant:"body2",sx:{color:R,fontWeight:700},children:[G.length," total \xb7 ",Q.length," shown"]})]})]}),(0,k.jsx)(l.A,{sx:{width:{xs:"100%",sm:280,lg:340},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,k.jsx)(j.A,{value:B,onChange:_,onDebouncedChange:$,placeholder:"Search pricing (ctrl+k)",sx:{m:0,width:"100%",borderRadius:999,bgcolor:N(J),"& fieldset":{borderColor:D(J),borderWidth:1.5},"&:hover fieldset":{borderColor:J},"&.Mui-focused fieldset":{borderColor:J,borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(T(J))}}})})]})}),(0,k.jsx)(i.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:y/8,borderBottomRightRadius:y/8,border:"1px solid",borderColor:L,overflow:"hidden",background:"#fff"},children:(0,k.jsx)(x.A,{ref:e,sx:{maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:D(J),borderRadius:8,"&:hover":{backgroundColor:J}},"&::-webkit-scrollbar-track":{backgroundColor:P}},children:(0,k.jsxs)(h.A,{stickyHeader:!0,sx:{minWidth:{xs:860,md:1080}},children:[(0,k.jsx)(p.A,{children:(0,k.jsxs)(g.A,{sx:{"& th":{backgroundColor:P,color:z,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(L),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,k.jsx)(u.A,{children:"#"}),(0,k.jsx)(u.A,{children:"Tenant"}),(0,k.jsx)(u.A,{children:"Zone"}),(0,k.jsx)(u.A,{children:"Slab"}),(0,k.jsx)(u.A,{align:"center",children:"Base Price"}),(0,k.jsx)(u.A,{align:"center",children:"Min KM"}),(0,k.jsx)(u.A,{align:"center",children:"Price / KM"}),(0,k.jsx)(u.A,{align:"center",children:"Max KM"}),(0,k.jsx)(u.A,{align:"center",children:"Min Orders"})]})}),(0,k.jsxs)(m.A,{children:[Y&&(0,k.jsx)(w.r,{col:5}),0!==Q.length||Y?Q.map(((e,r)=>{var o;return(0,k.jsxs)(g.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(M),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:P}},children:[(0,k.jsx)(u.A,{children:(0,k.jsx)(a.A,{variant:"caption",sx:{fontWeight:700,color:W},children:String(r+1).padStart(2,"0")})}),(0,k.jsx)(u.A,{children:(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,k.jsx)(H,{color:J,size:36,children:(0,k.jsx)(b.Itr,{size:18})}),(0,k.jsxs)(c.A,{children:[(0,k.jsx)(a.A,{variant:"subtitle2",sx:{fontWeight:700,color:R,whiteSpace:"nowrap"},children:e.appname||"\u2014"}),(0,k.jsxs)(a.A,{variant:"caption",sx:{color:z},children:["ID #",e.pricingid]})]})]})}),(0,k.jsx)(u.A,{children:e.applocation?(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N("#10b981"),border:"1px solid ".concat(D("#10b981")),color:"#10b981",fontSize:11,fontWeight:800},children:[(0,k.jsx)(b.JFD,{size:12})," ",e.applocation]}):(0,k.jsx)(a.A,{variant:"caption",sx:{color:W},children:"\u2014"})}),(0,k.jsx)(u.A,{children:(0,k.jsxs)(l.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:N("#0ea5e9"),border:"1px solid ".concat(D("#0ea5e9")),color:"#0ea5e9",fontSize:11,fontWeight:800},children:[(0,k.jsx)(b.BJM,{size:12})," ",e.slab||"\u2014"]})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:J,icon:(0,k.jsx)(b.bmp,{size:12}),label:O(e.baseprice),width:110})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#f59e0b",icon:(0,k.jsx)(b.xI$,{size:12}),label:"".concat(Z(e.minkm)," km"),width:90})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#10b981",icon:(0,k.jsx)(b.H4F,{size:12}),label:O(e.priceperkm),width:110})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsx)(K,{color:"#ef4444",icon:(0,k.jsx)(b.xI$,{size:12}),label:"".concat(Z(e.maxkm)," km"),width:90})}),(0,k.jsx)(u.A,{align:"center",children:(0,k.jsxs)(c.A,{direction:"row",alignItems:"center",justifyContent:"center",spacing:.5,children:[(0,k.jsx)(b.GdF,{size:14,color:W}),(0,k.jsx)(a.A,{variant:"subtitle2",sx:{fontWeight:700,color:R,whiteSpace:"nowrap"},children:null!==(o=e.minorder)&&void 0!==o?o:"\u2014"})]})})]},e.pricingid||"".concat(e.appname,"-").concat(r))})):(0,k.jsx)(g.A,{children:(0,k.jsx)(u.A,{colSpan:9,sx:{py:6},children:(0,k.jsxs)(c.A,{alignItems:"center",spacing:1.5,children:[(0,k.jsx)(s.A,{sx:{width:64,height:64,bgcolor:F("#94a3b8"),color:W},children:(0,k.jsx)(b.JL6,{size:28})}),(0,k.jsx)(a.A,{variant:"subtitle1",sx:{fontWeight:700,color:R},children:"No pricing to show"}),(0,k.jsx)(a.A,{variant:"caption",sx:{color:z},children:B?"Try a different keyword.":"Pick a zone above to load the catalog."})]})})})]})]})})})]})}}}]);