1 line
44 KiB
JavaScript
1 line
44 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1504],{23787:(e,t,i)=>{i.d(t,{FG:()=>p,nV:()=>x,pY:()=>g,pg:()=>h});var n=i(89379),s=i(80045),o=i(93230),r=i(2235),l=i(16491),a=i(82053),c=i(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:i=!1,onScroll:r,sx:l}=e,a=(0,s.A)(e,d);return(0,c.jsx)(o.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:r,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},h=e=>{let{accent:t="#662582",header:i,footer:s,selected:o=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(r.A,{elevation:0,onClick:a,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:o?t:"#e2e8f0",background:o?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[i,d,s]})]})},p=e=>{let{children:t,columns:i=2,sx:s}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},s),children:t})},g=e=>{let{label:t,value:i,children:n,full:s=!1,align:o="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:s?"1 / -1":"auto",minWidth:0,textAlign:o},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},27001:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(93230),s=i(16491),o=i(82053),r=i(44414);function l(e){let{title:t,subtitle:i,live:l=!1,action:a}=e;return(0,r.jsxs)(n.A,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:{xs:2,md:2.5}},children:[(0,r.jsxs)(s.A,{sx:{minWidth:0},children:[(0,r.jsx)(o.A,{variant:"h3",sx:{fontWeight:700,letterSpacing:"-0.02em",color:"grey.800"},children:t}),i&&(0,r.jsxs)(n.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[l&&(0,r.jsx)(s.A,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"success.main",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,r.jsx)(o.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:i})]})]}),a&&(0,r.jsx)(s.A,{sx:{flexShrink:0,width:{xs:"100%",sm:"auto"}},children:a})]})}},36803:(e,t,i)=>{i.d(t,{A:()=>x});var n=i(48089),s=i(50704),o=i(93230),r=i(16491),l=i(82053),a=i(82917),c=i(41413),d=i(44414);function x(e){let{title:t,value:i,icon:x,color:h="#662582",caption:p,loading:g=!1}=e;return(0,d.jsx)(n.A,{sx:{height:"100%"},children:(0,d.jsx)(s.A,{sx:{p:{xs:1.75,md:2},"&:last-child":{pb:{xs:1.75,md:2}}},children:(0,d.jsxs)(o.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,d.jsxs)(r.A,{sx:{minWidth:0,flex:1},children:[(0,d.jsx)(l.A,{variant:"body2",sx:{fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),g?(0,d.jsx)(a.A,{variant:"rounded",sx:{width:72,height:30,mt:.5},animation:"wave"}):(0,d.jsx)(l.A,{sx:{mt:.25,fontWeight:700,letterSpacing:"-0.015em",color:"grey.800",lineHeight:1.15,fontSize:{xs:"1.375rem",md:"1.5rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i}),p&&(0,d.jsx)(l.A,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary"},children:p})]}),x&&(0,d.jsx)(c.A,{variant:"rounded",sx:{width:42,height:42,borderRadius:2,bgcolor:"".concat(h,"14"),color:h,flexShrink:0},children:x})]})})})}},56311:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(89379),s=i(9950),o=i(2660),r=i(2046),l=i(83274),a=i(25333),c=i(97125),d=i(7762),x=i(52097),h=i(44414);const p=e=>{let{value:t,onChange:i,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:A}=e;const j=(0,s.useRef)(null),[m]=(0,x.d7)(t,g);return(0,s.useEffect)((()=>{p&&p(m)}),[m,p]),(0,s.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=j.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===j.current&&j.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(o.A,{sx:(0,n.A)({},A),inputRef:j,placeholder:u,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>i(e.target.value),startAdornment:(0,h.jsx)(r.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>i(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,i)=>{i.d(t,{A:()=>h});var n=i(89379),s=i(9950),o=i(93230),r=i(41413),l=i(77922),a=i(29925),c=i(26910),d=i(31222),x=i(44414);const h=(0,s.forwardRef)(((e,t)=>{let{setAppId:i,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:A,pill:j=!1,accentColor:m="#6366f1",icon:f,placeholder:b="Select Zone",paperComponent:v}=e;const[y,S]=(0,s.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,s.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const w=e=>"".concat(m).concat(e),C=w("26"),k=w("18"),z=j?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"10px",bgcolor:"#ffffff",fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:m,borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:"#94a3b8"}}:{},W=j&&(0,x.jsx)(o.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(r.A,{sx:{width:24,height:24,bgcolor:k,color:m,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:y||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,n.A)({},g),onChange:(e,t,n)=>{"clear"===n?(null===i||void 0===i||i(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):t&&(null===i||void 0===i||i(t.applocationid),null===h||void 0===h||h(t.locationname),null===p||void 0===p||p(0))},renderInput:e=>j?(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:W}),sx:(0,n.A)((0,n.A)({},z),A||u||{})})):(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,n.A)({},A||u||{})}))})}))},71504:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ke});var n=i(89379),s=i(9950),o=i(50027),r=i(26910),l=i(14857),a=i(52351),c=i(13838),d=i(4159),x=i.n(d),h=i(8881),p=i(99459),g=i(28217),u=i(55471),A=i.n(u),j=i(21209),m=i(2235),f=i(41413),b=i(47223),v=i(60899),y=i(16491),S=i(93230),w=i(82053),C=i(82917),k=i(1320),z=i(15769),W=i(69780),I=i(9213),P=i(21671),M=i(34075),R=i(83274),Y=i(25333),L=i(33738),_=i(48159),E=i(84142),K=i(48089),T=i(82223),D=i(50704),O=i(29925),H=i(77922),B=i(25713),F=i(74745),q=i(6258),N=i(96583),V=i(40033),X=i(28170),J=i(29277),G=i(79739),U=i(23787),Z=i(9083),Q=i(8203),$=i(4729),ee=i(12678),te=i(94118),ie=i(24513),ne=i(37476),se=i(54826),oe=i(63057),re=i(85527),le=i(74930),ae=i(31222),ce=i(21636),de=i(39174),xe=i(59212),he=i(56311),pe=i(27001),ge=i(36803),ue=i(36150),Ae=i(81425),je=i(96646),me=i(44414);const fe=14,be="0 12px 32px rgba(15, 23, 42, 0.12)",ve="#0f172a",ye="#64748b",Se="#94a3b8",we="#e2e8f0",Ce="#f1f5f9",ke="#f8fafc",ze=(e,t)=>"".concat(e).concat(t),We=e=>ze(e,"08"),Ie=e=>ze(e,"18"),Pe=e=>ze(e,"26"),Me=e=>ze(e,"55"),Re={active:{label:"Active",color:"#10b981",icon:ae.mU9,statusKey:"active"},pending:{label:"Pending",color:"#f59e0b",icon:ae.tX0,statusKey:"pending"},inactive:{label:"Inactive",color:"#ef4444",icon:ae.uDv,statusKey:"inactive"}},Ye=[{status:"active",countKey:"active",tabStatus:"Active"},{status:"pending",countKey:"pending",tabStatus:"Pending"},{status:"inactive",countKey:"inactive",tabStatus:"InActive"}],Le=[{key:"active",label:"Active Tenants",color:"#10b981",icon:ae.cAP,countKey:"active"},{key:"pending",label:"Pending Approval",color:"#f59e0b",icon:ae.G6c,countKey:"pending"},{key:"inactive",label:"Inactive Tenants",color:"#ef4444",icon:ae.qiG,countKey:"inactive"}],_e=e=>(0,me.jsx)(m.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:be,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Ee=e=>{let{color:t,selected:i,size:n=24,children:s}=e;return(0,me.jsx)(f.A,{sx:{width:n,height:n,bgcolor:i?t:Ie(t),color:i?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:s})},Ke=()=>{var e;const t=(0,s.useRef)(null),[i,d]=(0,s.useState)(""),[u,be]=(0,s.useState)(""),[ze,Ke]=s.useState(10),Te=(0,l.A)(),De=(0,b.A)(Te.breakpoints.down("md")),[Oe,He]=(0,s.useState)(!1),[Be,Fe]=(0,s.useState)(0),[qe,Ne]=(0,s.useState)(""),[Ve]=(0,s.useState)("All"),[Xe,Je]=s.useState(null),[Ge,Ue]=(0,s.useState)(0),[Ze,Qe]=(0,s.useState)(0),[$e,et]=(0,s.useState)(0),[tt,it]=(0,s.useState)(null),[nt,st]=(0,s.useState)([]),[ot,rt]=(0,s.useState)("active"),[lt,at]=(0,s.useState)({}),[ct,dt]=(0,s.useState)(!1),[xt,ht]=(0,s.useState)([]),[pt,gt]=(0,s.useState)({}),[ut,At]=(0,s.useState)(!0),[jt,mt]=(0,s.useState)(""),[ft,bt]=(0,s.useState)(""),[vt,yt]=(0,s.useState)(""),[St,wt]=(0,s.useState)({}),[Ct,kt]=(0,s.useState)({}),[zt,Wt]=(0,s.useState)(0),[It,Pt]=(0,s.useState)("Active"),Mt=()=>{dt(!1)},Rt=(e,t)=>{Pt(0==t?"Active":1==t?"Pending":"InActive"),Ue(t),d(""),Wt(0)},Yt=(e,t)=>{console.log("newValue1",t),Qe(t)},Lt=(e,t)=>{console.log("newValue2",t),et(t)},[_t,Et]=(0,s.useState)(null),[Kt,Tt]=(0,s.useState)(null),Dt=e=>{Et((t=>t===e?null:e))};(0,s.useEffect)((()=>{console.log("selectedCustomer",lt)}),[lt]),(0,s.useEffect)((()=>{Et(-1),Tt(-1)}),[Ge]);const Ot=(e,t,i)=>{(0,h.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:i})};const Ht={current:null},[Bt,Ft]=(0,s.useState)(""),[qt,Nt]=(0,s.useState)([]),Vt=(0,s.useRef)(!1);"undefined"===typeof window||Vt.current||(document.querySelector("#google-maps")||function(e,t,i){if(!t)return;const n=document.createElement("script");n.setAttribute("async",""),n.setAttribute("id",i),n.src=e,t.appendChild(n)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places"),document.querySelector("head"),"google-maps"),Vt.current=!0);const Xt=(0,s.useMemo)((()=>(0,j.A)(((e,t)=>{Ht.current.getPlacePredictions(e,t)}),400)),[]);(0,s.useEffect)((()=>{let e=!0;if(!Ht.current&&window.google&&(Ht.current=new window.google.maps.places.AutocompleteService),Ht.current){if(""!==Bt)return Xt({input:Bt},(t=>{if(e){let e=[];Xe&&(e=[Xe]),t&&(e=[...e,...t]),Nt(e)}})),()=>{e=!1};Nt(Xe?[Xe]:[])}}),[Xe,Bt,Xt]),p.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,s.useEffect)((()=>{try{console.log("selected address =>",jt),p.A.fromAddress(jt).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:i}=e.results[0].geometry.location;if(wt({lat:t,lng:i}),kt((0,n.A)((0,n.A)({},Ct),{},{latitude:t.toString(),longitude:i.toString()})),e.results[0].address_components){let t,i,s,o,r=e.results[0];for(let e=0;e<r.address_components.length;e++)for(let n=0;n<r.address_components[e].types.length;n++)switch(r.address_components[e].types[n]){case"locality":t=r.address_components[e].long_name;break;case"administrative_area_level_1":s=r.address_components[e].long_name;break;case"postal_code":i=r.address_components[e].long_name;break;case"sublocality":o=r.address_components[e].long_name}bt(t||""),setState(s||""),yt(i||""),setSuburb(o||""),kt((0,n.A)((0,n.A)({},Ct),{},{city:t||"",state:s||"",postcode:vt||"",suburb:o||""}))}}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[jt]),(0,s.useEffect)((()=>{lt&&wt({lat:lt.latitude,lng:lt.longitude})}),[lt]),(0,s.useEffect)((()=>{const e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t.current.focus()),"Escape"===e.key&&document.activeElement===t.current&&t.current.blur()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[]);const{data:Jt,isLoading:Gt,refetch:Ut}=(0,ue.I)({queryKey:["tenantList",Be,u,ot,zt,ze],queryFn:Ae.ry}),{data:Zt=[],isLoading:Qt,refetch:$t}=(0,ue.I)({queryKey:["gettenantsummary",Be,ot],queryFn:Ae.bd}),ei=async()=>{await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/getpricinglist/?tenantid=").concat(tt)).then((e=>{console.log("getpricinglist",e),e.data.status&&st(e.data.details)})).catch((e=>{console.log(e)}))};(0,s.useEffect)((()=>{tt&&ei()}),[tt]);(0,s.useEffect)((()=>{tt&&(async e=>{try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("tenantPricing",t.data.details),setTenanatPricing(t.data.details)}catch(t){console.log("fetchTenanatPricing",t)}})(tt)}),[tt]);const ti=async e=>{let t;He(!0),t=-1==e?{tenantid:tt,approved:1}:{tenantid:e,status:"active"===ot?"InActive":"Active"},await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),t).then((e=>{e.data.status&&(Ot(0==Ge?"Inactivated Successfully":1==Ge?"Approved Successfully":"Activate Successfully","success",2e3),Ut(),$t(),He(!1))})).catch((e=>{console.log(e),Ot(e.message,"error",1500),He(!1)}))},ii=async e=>{console.log("id",e);try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapppricing/?applocationid=").concat(e));console.log("appPricingRes",t.data.details),ht(t.data.details)}catch(t){console.log("appPricingRes",t)}},ni=async()=>{He(!0),await r.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/createpricing"),{tenantpricingid:0,applocationid:Be,pricingid:pt.pricingid,tenantid:tt,pricingdate:x()().format("YYYY-MM-DD HH:mm:ss"),configid:pt.configid,pricingtypeid:pt.pricingtypeid,slab:pt.slab,baseprice:+pt.baseprice,priceperkm:+pt.priceperkm,minkm:+pt.minkm,maxkm:+pt.maxkm,orders:+pt.minorder,othercharges:0}).then((e=>{e.data.status&&((0,h.M8)("Price Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Mt(),gt({}),ti(-1),ei())})).catch((e=>{console.log(e)}))},si=Re[null===(e=Ye[Ge])||void 0===e?void 0:e.status]||Re.active;return(0,me.jsxs)(me.Fragment,{children:[(Gt||Qt||Oe)&&(0,me.jsx)(a.A,{}),(0,me.jsx)(pe.A,{title:"Tenants",subtitle:"Live \xb7 ".concat(qe||"All Zones"),live:!0,action:(0,me.jsx)(xe.A,{locations:Ve,locaName:qe,setAppId:Fe,setLocoName:Ne,setPage:Wt,pill:!0,accentColor:"#662582",icon:(0,me.jsx)(ae.HPi,{size:14}),placeholder:"Select Zone",paperComponent:_e,sx:{width:{xs:"100%",sm:280},zIndex:100}})}),(0,me.jsx)(v.Ay,{container:!0,spacing:{xs:2,md:2.5},sx:{mb:{xs:1.5,md:2}},children:Le.map(((e,t)=>{var i;const n=e.icon,s=null!==(i=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==i?i:0;return(0,me.jsx)(v.Ay,{item:!0,xs:12,sm:4,children:(0,me.jsx)(y.A,{onClick:()=>{t>=0&&Rt(0,t)},sx:{cursor:"pointer",height:"100%"},children:(0,me.jsx)(ge.A,{title:e.label,value:null!==s&&void 0!==s?s:0,icon:(0,me.jsx)(n,{size:20}),color:0===t?"#662582":e.color,loading:Qt})})},e.key)}))}),(0,me.jsx)(m.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:fe/8,borderTopRightRadius:fe/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:we,borderBottom:0,background:"#fff"},children:(0,me.jsxs)(S.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,me.jsx)(S.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:we,borderRadius:4}},children:Ye.map(((e,t)=>{var i;const n=Re[e.status],s=n.icon,o=Ge===t,r=null!==(i=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==i?i:0;return(0,me.jsxs)(y.A,{onClick:()=>{rt(e.status),Rt(0,t)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:"10px",border:"1px solid ".concat(o?n.color:"#e2e8f0"),bgcolor:o?n.color:"#fff",color:o?"#fff":"#64748b",fontWeight:600,boxShadow:"none",transition:"background-color 0.15s, border-color 0.15s, color 0.15s","&:hover":{borderColor:o?n.color:"#cbd5e1",bgcolor:o?n.color:"#f8fafc"}},children:[(0,me.jsx)(f.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:o?"rgba(255,255,255,0.22)":Ie(n.color),color:o?"#fff":n.color},children:(0,me.jsx)(s,{size:13})}),(0,me.jsx)(w.A,{variant:"caption",sx:{fontWeight:600,fontSize:{xs:11.5,md:13},lineHeight:1},children:n.label}),(0,me.jsx)(y.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:700,bgcolor:o?"rgba(255,255,255,0.22)":"#f8fafc",color:o?"#fff":"#64748b",border:"none"},children:Qt?(0,me.jsx)(C.A,{variant:"text",width:14,height:10}):r})]},e.status)}))}),(0,me.jsx)(y.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,me.jsx)(he.A,{value:i,onChange:d,onDebouncedChange:be,sx:{m:0,width:"100%",borderRadius:999,bgcolor:We("#662582"),"& fieldset":{borderColor:Me("#662582"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#662582"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Pe("#662582"))}}})})]})}),(0,me.jsxs)(m.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:fe/8,borderBottomRightRadius:fe/8,border:"1px solid",borderColor:we,overflow:"hidden",background:"#fff"},children:[(0,me.jsx)(k.A,{sx:{display:{xs:"none",md:"block"},maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:"10px",height:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:Me("#662582"),borderRadius:"8px","&:hover":{backgroundColor:"#662582"}},"&::-webkit-scrollbar-track":{backgroundColor:ke}},children:(0,me.jsxs)(z.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,me.jsx)(W.A,{children:(0,me.jsxs)(I.A,{sx:{"& th":{backgroundColor:ke,color:ye,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(we),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,me.jsx)(P.A,{children:"#"}),(0,me.jsx)(P.A,{children:"Status"}),(0,me.jsx)(P.A,{children:"Client"}),(0,me.jsx)(P.A,{children:"Contact"}),(0,me.jsx)(P.A,{children:"Address"}),(0,me.jsx)(P.A,{align:"right",children:"Actions"})]})}),(0,me.jsxs)(M.A,{children:[Gt&&(0,me.jsx)(je.r,{}),0!=(null===Jt||void 0===Jt?void 0:Jt.length)||Oe?null===Jt||void 0===Jt?void 0:Jt.map(((e,t)=>{var i;const l=Re[0===Ge?"active":1===Ge?"pending":"inactive"],a=l.icon;return(0,me.jsxs)(s.Fragment,{children:[(0,me.jsxs)(I.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(Ce),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:ke}},children:[(0,me.jsx)(P.A,{children:(0,me.jsx)(w.A,{variant:"caption",sx:{fontWeight:700,color:Se},children:String(t+1+zt*ze).padStart(2,"0")})}),(0,me.jsx)(P.A,{children:(0,me.jsxs)(S.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:We(l.color),border:"1px solid ".concat(Me(l.color)),color:l.color},children:[(0,me.jsx)(Ee,{color:l.color,size:20,children:(0,me.jsx)(a,{size:12})}),(0,me.jsx)(w.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:l.label})]})}),(0,me.jsx)(P.A,{children:(0,me.jsxs)(S.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,me.jsx)(Ee,{color:"#662582",size:32,children:(0,me.jsx)(ae.Azs,{size:16})}),(0,me.jsxs)(S.A,{children:[(0,me.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:ve,whiteSpace:"nowrap"},children:e.tenantname}),(0,me.jsxs)(w.A,{variant:"caption",sx:{color:ye},children:["ID #",e.tenantid]})]})]})}),(0,me.jsx)(P.A,{children:(0,me.jsxs)(S.A,{children:[(0,me.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:700,color:ve,whiteSpace:"nowrap"},children:e.primarycontact||"\u2014"}),(0,me.jsx)(w.A,{variant:"caption",sx:{color:ye},children:e.primaryemail||"\u2014"})]})}),(0,me.jsx)(P.A,{sx:{maxWidth:280},children:(0,me.jsx)(R.A,{title:e.address||"",placement:"top",children:(0,me.jsx)(w.A,{variant:"caption",sx:{color:ye,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,me.jsx)(P.A,{align:"right",children:(0,me.jsxs)(S.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[0==Ge&&(0,me.jsx)(R.A,{title:"Inactivate",placement:"top",children:(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Me("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{at(e),it(e.tenantid),Fe(e.applocationid),setTimeout((()=>{ti(e.tenantid)}),100)},children:(0,me.jsx)(Z.A,{style:{fontSize:14}})})}),1==Ge&&(0,me.jsx)(R.A,{title:"Approve",placement:"top",children:(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Me("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{at(e),dt(!0),it(e.tenantid),Fe(e.applocationid),ii(e.applolcationid)},children:(0,me.jsx)(Q.A,{style:{fontSize:14}})})}),2==Ge&&(0,me.jsx)(R.A,{title:"Activate",placement:"top",children:(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#10b981"),color:"#10b981",border:"1px solid ".concat(Me("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{at(e),it(e.tenantid),Fe(e.applocationid),setTimeout((()=>{ti(e.tenantid)}),100)},children:(0,me.jsx)(se.yjt,{style:{fontSize:14}})})}),(0,me.jsx)(R.A,{title:_t===t?"Hide details":"View details",placement:"top",children:(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:_t===t?"#662582":Ie("#662582"),color:_t===t?"#fff":"#662582",border:"1px solid ".concat(Me("#662582")),"&:hover":{bgcolor:"#662582",color:"#fff"}},onClick:()=>{at(e),Dt(t),Tt(-1),it(e.tenantid)},children:_t===t?(0,me.jsx)($.A,{style:{fontSize:14}}):(0,me.jsx)(ee.A,{style:{fontSize:14}})})}),1!==Ge&&(0,me.jsx)(R.A,{title:Kt===t?"Close":"Edit",placement:"top",children:(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Kt===t?"#8b5cf6":Ie("#8b5cf6"),color:Kt===t?"#fff":"#8b5cf6",border:"1px solid ".concat(Me("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{var i;at(e),i=t,Tt((e=>e===i?null:i)),Et(-1),it(e.tenantid),Fe(e.applocationid)},children:Kt===t?(0,me.jsx)(te.A,{style:{fontSize:14}}):(0,me.jsx)(ie.A,{style:{fontSize:14}})})})]})})]}),_t===t&&(0,me.jsx)(I.A,{children:(0,me.jsx)(P.A,{sx:{"&:hover":{backgroundColor:"white !important"}},colSpan:15,children:(0,me.jsx)(L.A,{in:open,timeout:800,easing:"ease-in-out",mountOnEnter:!0,unmountOnExit:!1,sx:{"& .MuiCollapse-wrapperInner":{transition:"transform 800ms ease, opacity 800ms ease"}},children:(0,me.jsxs)(o.A,{content:!1,sx:{transform:open?"translateY(0)":"translateY(-8px)",opacity:open?1:0},title:(0,me.jsxs)(_.A,{sx:{bgcolor:"primary.lighter"},value:Ze,onChange:Yt,"aria-label":"basic tabs example",children:[(0,me.jsx)(E.A,{label:" Details",icon:(0,me.jsx)(oe.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),(0,me.jsx)(E.A,{label:"Pricing",icon:(0,me.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}})]}),children:[0==Ze&&(0,me.jsxs)(v.Ay,{container:!0,sx:{m:1},spacing:2.5,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.tenantname}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Tenant"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.firstname}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Contact Person"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.primarycontact}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Phone"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.primaryemail}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"E-Mail"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(se.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.address}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Address"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.city}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"City"})]}),(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",variant:"subtitle1",children:e.postcode}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"PostCode"})]})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(oe.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",children:e.latitude}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Latitude"})]}),(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(oe.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsxs)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,me.jsx)(w.A,{align:"left",variant:"subtitle1",children:e.longitude}),(0,me.jsx)(w.A,{align:"left",variant:"caption",color:"secondary",children:"Longitude"})]})]})})]}),1==Ze&&(0,me.jsx)(K.A,{variant:"outlined",sx:{},children:(0,me.jsx)(k.A,{children:(0,me.jsxs)(z.A,{children:[(0,me.jsx)(W.A,{children:(0,me.jsxs)(I.A,{children:[(0,me.jsx)(P.A,{children:"#"}),(0,me.jsx)(P.A,{children:"Date"}),(0,me.jsx)(P.A,{children:"Slab"}),(0,me.jsx)(P.A,{children:"Base Price"}),(0,me.jsx)(P.A,{children:"Min Kms"}),(0,me.jsx)(P.A,{children:"Price/Km"}),(0,me.jsx)(P.A,{children:"Other Charges"})]})}),(0,me.jsx)(M.A,{children:0===(null===nt||void 0===nt?void 0:nt.length)?(0,me.jsx)(I.A,{children:(0,me.jsx)(P.A,{colSpan:7,align:"center",children:(0,me.jsx)(c.A,{description:"No Pricing List"})})}):nt.map(((e,t)=>(0,me.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,me.jsx)(P.A,{children:t+1}),(0,me.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,me.jsx)(P.A,{children:e.slab}),(0,me.jsx)(P.A,{children:e.baseprice}),(0,me.jsx)(P.A,{children:e.minkm}),(0,me.jsx)(P.A,{children:e.priceperkm}),(0,me.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})}),Kt===t&&(0,me.jsx)(I.A,{children:(0,me.jsx)(P.A,{sx:{backgroundColor:"white!important","&:hover":{backgroundColor:"white!important"}},colSpan:15,children:(0,me.jsxs)(o.A,{content:!1,title:(0,me.jsxs)(y.A,{sx:{bgcolor:"primary.lighter",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,me.jsxs)(_.A,{value:$e,onChange:Lt,"aria-label":"basic tabs example",children:[(0,me.jsx)(E.A,{label:"Edit Details",icon:(0,me.jsx)(oe.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),1!==Ge&&(0,me.jsx)(E.A,{label:"Edit Pricing",icon:(0,me.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"},onClick:()=>{ii(lt.applolcationid)}})]}),1==$e&&(0,me.jsx)(T.A,{variant:"contained",color:"error",size:"smaller",startIcon:(0,me.jsx)(ie.A,{size:"small"}),sx:{mr:1.8,height:"30px"},onClick:()=>{dt(!0)},children:"Add Pricing"})]}),children:[0==$e&&(0,me.jsx)(K.A,{variant:"outlined",sx:{m:2},children:(0,me.jsx)(v.Ay,{container:!0,spacing:0,children:(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(K.A,{variant:"outlined",children:[(0,me.jsx)(D.A,{children:(0,me.jsxs)(v.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(de.PY8,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Tenant Name",defaultValue:lt.tenantname,variant:"outlined",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{tenantname:e.target.value}))},sx:{mt:2}})})]})})," ",(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Contact Person",defaultValue:e.firstname,variant:"outlined",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{firstname:e.target.value}))},sx:{mt:2}})})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{inputProps:{maxLength:10},fullWidth:!0,id:"outlined-basic",label:"Contact Number",defaultValue:lt.primarycontact,variant:"outlined",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{primarycontact:e.target.value}))},sx:{mt:2}})})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:6,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"E-Mail",defaultValue:lt.primaryemail,variant:"outlined",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{primaryemail:e.target.value}))},sx:{mt:2}})})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(se.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(H.A,{id:"google-map-demo",sx:{},fullWidth:!0,label:"Address",getOptionLabel:e=>"string"===typeof e?e:e.description,filterOptions:e=>e,options:qt,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,defaultValue:lt.address,noOptionsText:"No locations",onChange:(e,t)=>{Nt(t?[t,...qt]:qt),Je(t||""),console.log("newValue",t),mt((null===t||void 0===t?void 0:t.description)||""),kt((0,n.A)((0,n.A)({},Ct),{},{address:(null===t||void 0===t?void 0:t.description)||""}))},onInputChange:(e,t)=>{Ft(t)},renderInput:e=>(0,me.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{fullWidth:!0,label:"Address",variant:"outlined"})),renderOption:(e,t)=>{const i=t.structured_formatting.main_text_matched_substrings||[],s=A()(t.structured_formatting.main_text,i.map((e=>[e.offset,e.offset+e.length])));return(0,me.jsx)("li",(0,n.A)((0,n.A)({},e),{},{children:(0,me.jsxs)(v.Ay,{container:!0,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,me.jsx)(g.A,{sx:{color:"text.secondary"}})}),(0,me.jsxs)(v.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[s.map(((e,t)=>(0,me.jsx)(y.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,me.jsx)(w.A,{variant:"body2",color:"text.secondary",children:t.structured_formatting.secondary_text})]})]})}))}})})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{fullWidth:!0,required:!0,id:"outlined-required",label:"City",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{city:e.target.value}))},value:""==ft?lt.city:ft})}),(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{fullWidth:!0,required:!0,label:" PostCode",id:"outlined-required",onChange:e=>{kt((0,n.A)((0,n.A)({},Ct),{},{postcode:e.target.value}))},value:""==vt?lt.postcode:vt})})]})}),(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(v.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(oe.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{variant:"outlined",readonly:!0,label:"Latitude",fullWidth:!0,value:St.lat,sx:{cursor:"not-allowed"}})}),(0,me.jsx)(v.Ay,{item:!0,children:(0,me.jsx)(oe.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,me.jsx)(v.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,me.jsx)(O.A,{label:"Longitude",readonly:!0,variant:"outlined",fullWidth:!0,value:St.lng})})]})})]})}),(0,me.jsx)(B.A,{sx:{display:"flex",justifyContent:"end",mr:3,mb:2},children:(0,me.jsx)(T.A,{variant:"contained",size:"medium",onClick:()=>{(async()=>{try{const e=(0,n.A)((0,n.A)({},Ct),{},{tenantid:tt});console.log("updateClient",e);const t=await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),e);console.log("updateClient",t.data.message),t.data.status&&Ot(t.data.message,"success",1500),Ut(),$t()}catch(e){console.log("updateClient",e)}})()},children:"Update Client"})})]})})})},"left - card"),1==$e&&(0,me.jsx)(K.A,{variant:"outlined",sx:{},children:(0,me.jsx)(k.A,{children:(0,me.jsxs)(z.A,{children:[(0,me.jsx)(W.A,{children:(0,me.jsxs)(I.A,{children:[(0,me.jsx)(P.A,{children:"#"}),(0,me.jsx)(P.A,{children:"Date"}),(0,me.jsx)(P.A,{children:"Slab"}),(0,me.jsx)(P.A,{children:"Base Price"}),(0,me.jsx)(P.A,{children:"Min Kms"}),(0,me.jsx)(P.A,{children:"Price/Km"}),(0,me.jsx)(P.A,{children:"Other Charges"})]})}),(0,me.jsx)(M.A,{children:0===(null===nt||void 0===nt?void 0:nt.length)?(0,me.jsx)(I.A,{children:(0,me.jsx)(P.A,{colSpan:7,align:"center",children:(0,me.jsx)(c.A,{})})}):nt.map(((e,t)=>(0,me.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,me.jsx)(P.A,{children:t+1}),(0,me.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,me.jsx)(P.A,{children:e.slab}),(0,me.jsx)(P.A,{children:e.baseprice}),(0,me.jsx)(P.A,{children:e.minkm}),(0,me.jsx)(P.A,{children:e.priceperkm}),(0,me.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,me.jsx)(I.A,{children:(0,me.jsx)(P.A,{colSpan:6,sx:{py:6},children:(0,me.jsxs)(S.A,{alignItems:"center",spacing:1.5,children:[(0,me.jsx)(f.A,{sx:{width:64,height:64,bgcolor:Ie("#94a3b8"),color:Se},children:(0,me.jsx)(ae.Itr,{size:28})}),(0,me.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:ve},children:"No tenants to show"}),(0,me.jsx)(w.A,{variant:"caption",sx:{color:ye},children:"No ".concat(si.label.toLowerCase()," tenants for this filter.")})]})})})]})]})}),De&&(0,me.jsxs)(U.nV,{scroll:!0,sx:{display:{xs:"flex",md:"none"}},children:[Gt&&(0,me.jsxs)(S.A,{alignItems:"center",sx:{py:4},children:[(0,me.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave"}),(0,me.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave",sx:{mt:1.25}})]}),0!=(null===Jt||void 0===Jt?void 0:Jt.length)||Oe?null===Jt||void 0===Jt?void 0:Jt.map(((e,t)=>{var i;const n=Re[0===Ge?"active":1===Ge?"pending":"inactive"],s=n.icon,o=_t===t;return(0,me.jsxs)(U.pg,{accent:n.color,header:(0,me.jsxs)(S.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,me.jsxs)(S.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,me.jsx)(Ee,{color:"#662582",size:36,children:(0,me.jsx)(ae.Azs,{size:18})}),(0,me.jsxs)(S.A,{sx:{minWidth:0},children:[(0,me.jsx)(w.A,{variant:"subtitle2",sx:{fontWeight:800,color:ve},noWrap:!0,children:e.tenantname}),(0,me.jsxs)(S.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",mt:.25,pl:.25,pr:.875,py:.125,borderRadius:999,bgcolor:We(n.color),border:"1px solid ".concat(Me(n.color)),color:n.color,alignSelf:"flex-start"},children:[(0,me.jsx)(Ee,{color:n.color,size:16,children:(0,me.jsx)(s,{size:10})}),(0,me.jsx)(w.A,{sx:{fontWeight:800,fontSize:10,lineHeight:1},children:n.label})]})]})]}),(0,me.jsxs)(S.A,{direction:"row",spacing:.5,sx:{flexShrink:0},children:[0==Ge&&(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Me("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{at(e),it(e.tenantid),Fe(e.applocationid),setTimeout((()=>{ti(e.tenantid)}),100)},children:(0,me.jsx)(Z.A,{style:{fontSize:14}})}),1==Ge&&(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Me("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{at(e),dt(!0),it(e.tenantid),Fe(e.applocationid),ii(e.applolcationid)},children:(0,me.jsx)(Q.A,{style:{fontSize:14}})}),2==Ge&&(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#10b981"),color:"#10b981",border:"1px solid ".concat(Me("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{at(e),it(e.tenantid),Fe(e.applocationid),setTimeout((()=>{ti(e.tenantid)}),100)},children:(0,me.jsx)(se.yjt,{style:{fontSize:14}})}),(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:o?"#662582":Ie("#662582"),color:o?"#fff":"#662582",border:"1px solid ".concat(Me("#662582")),"&:hover":{bgcolor:"#662582",color:"#fff"}},onClick:()=>{at(e),Dt(t),Tt(-1),it(e.tenantid)},children:o?(0,me.jsx)($.A,{style:{fontSize:14}}):(0,me.jsx)(ee.A,{style:{fontSize:14}})}),1!==Ge&&(0,me.jsx)(Y.A,{size:"small",sx:{bgcolor:Ie("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(Me("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{at(e),it(e.tenantid),Fe(e.applocationid),ii(e.applolcationid),dt(!0)},children:(0,me.jsx)(ie.A,{style:{fontSize:14}})})]})]}),children:[(0,me.jsxs)(U.FG,{children:[(0,me.jsx)(U.pY,{label:"Tenant ID",value:"#".concat(e.tenantid)}),(0,me.jsx)(U.pY,{label:"Contact",value:e.primarycontact||"\u2014"}),(0,me.jsx)(U.pY,{label:"Email",value:e.primaryemail||"\u2014",full:!0}),(0,me.jsx)(U.pY,{label:"Address",full:!0,children:(0,me.jsx)(w.A,{sx:{fontSize:13,fontWeight:600,color:ve},children:e.address||"\u2014"})})]}),o&&(0,me.jsx)(y.A,{sx:{mt:1.25,pt:1.25,borderTop:"1px solid ".concat(Ce)},children:(0,me.jsxs)(U.FG,{children:[(0,me.jsx)(U.pY,{label:"Contact Person",value:e.firstname||"\u2014"}),(0,me.jsx)(U.pY,{label:"City",value:e.city||"\u2014"}),(0,me.jsx)(U.pY,{label:"Postcode",value:e.postcode||"\u2014"}),(0,me.jsx)(U.pY,{label:"Latitude",value:e.latitude||"\u2014"}),(0,me.jsx)(U.pY,{label:"Longitude",value:e.longitude||"\u2014"})]})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,me.jsxs)(S.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,me.jsx)(f.A,{sx:{width:64,height:64,bgcolor:Ie("#94a3b8"),color:Se},children:(0,me.jsx)(ae.Itr,{size:28})}),(0,me.jsx)(w.A,{variant:"subtitle1",sx:{fontWeight:700,color:ve},children:"No tenants to show"}),(0,me.jsx)(w.A,{variant:"caption",sx:{color:ye,textAlign:"center"},children:"No ".concat(si.label.toLowerCase()," tenants for this filter.")})]})]}),!i&&(null===Jt||void 0===Jt?void 0:Jt.length)>0&&(0,me.jsxs)(me.Fragment,{children:[(0,me.jsx)(F.A,{sx:{borderColor:we}}),(0,me.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50,100],component:"div",count:0==Ge?null===Zt||void 0===Zt?void 0:Zt.active:1==Ge?null===Zt||void 0===Zt?void 0:Zt.pending:2==Ge?null===Zt||void 0===Zt?void 0:Zt.inactive:0,rowsPerPage:ze,page:zt,onPageChange:(e,t)=>{Wt(t)},onRowsPerPageChange:e=>{Ke(parseInt(e.target.value,10)),Wt(0)}})]})]}),(0,me.jsxs)(N.A,{fullWidth:!0,fullScreen:De,open:ct,onClose:Mt,scroll:"paper",maxWidth:"sm",TransitionComponent:ne.s,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,me.jsx)(V.A,{sx:{bgcolor:"#662582",color:"#fff",fontSize:"20px"},children:"Client Pricing - (".concat(lt.tenantname,")")}),(0,me.jsx)(X.A,{dividers:!0,children:(0,me.jsx)(o.A,{sx:{height:"100%"},children:(0,me.jsxs)(v.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Select Slab"}),(0,me.jsx)(H.A,{disablePortal:!0,id:"combo-box-demo",options:xt,getOptionLabel:e=>"".concat(e.slab),fullWidth:!0,selectOnFocus:!0,renderInput:e=>(0,me.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{label:"Slab"})),onChange:(e,t,i)=>{gt(t),console.log("pricing",t),At(!1),"clear"===i&&At(!0)}})]}),(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Base Price"}),(0,me.jsx)(O.A,{type:"number",fullWidth:!0,value:ut?0:pt.baseprice,onChange:e=>{gt((0,n.A)((0,n.A)({},pt),{},{baseprice:e.target.value}))}})]}),(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Price/Km"}),(0,me.jsx)(O.A,{type:"number",fullWidth:!0,value:ut?0:pt.priceperkm,onChange:e=>{gt((0,n.A)((0,n.A)({},pt),{},{priceperkm:e.target.value}))}})]}),(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Min Kms"}),(0,me.jsx)(O.A,{type:"number",fullWidth:!0,value:ut?0:pt.minkm,onChange:e=>{gt((0,n.A)((0,n.A)({},pt),{},{minkm:e.target.value}))}})]}),(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Max Kms"}),(0,me.jsx)(O.A,{type:"number",fullWidth:!0,value:ut?0:pt.maxkm,onChange:e=>{gt((0,n.A)((0,n.A)({},pt),{},{maxkm:e.target.value}))}})]}),(0,me.jsxs)(v.Ay,{item:!0,xs:12,sm:6,children:[(0,me.jsx)(J.A,{children:"Min Orders"}),(0,me.jsx)(O.A,{type:"number",fullWidth:!0,value:ut?0:pt.minorder,onChange:e=>{gt((0,n.A)((0,n.A)({},pt),{},{minorder:e.target.value}))}})]})]})})}),(0,me.jsx)(G.A,{children:(0,me.jsx)(v.Ay,{container:!0,children:(0,me.jsx)(v.Ay,{item:!0,xs:12,children:(0,me.jsxs)(S.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[1==$e&&(0,me.jsx)(T.A,{disabled:ut,variant:"contained",onClick:()=>{ni()},children:"Update Pricing"}),1==Ge&&(0,me.jsx)(T.A,{disabled:ut,variant:"contained",onClick:()=>{ni()},children:"Save"}),(0,me.jsx)(T.A,{variant:"contained",onClick:()=>{At(!0),setTimeout((()=>{Mt()}),100),gt({})},color:"error",children:"Cancel"})]})})})})]})]})}},96646:(e,t,i)=>{i.d(t,{r:()=>a});var n=i(9213),s=i(21671),o=i(82917),r=i(93230),l=i(44414);const a=e=>{let{rowsPerPage:t=5,col:i=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(s.A,{children:(0,l.jsx)(o.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(o.A,{variant:"text",width:30})}),Array.from({length:i}).map(((e,t)=>(0,l.jsx)(s.A,{children:(0,l.jsxs)(r.A,{spacing:.5,children:[(0,l.jsx)(o.A,{variant:"text",width:100}),(0,l.jsx)(o.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(s.A,{children:(0,l.jsx)(o.A,{variant:"text",width:150})}),(0,l.jsx)(s.A,{children:(0,l.jsx)(o.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(s.A,{align:"center",children:(0,l.jsxs)(r.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(o.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(o.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); |