"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2912],{91547:function(e,t,n){var o=n(1413),a=n(29439),r=n(47313),i=n(76088),s=n(16783),c=n(85281),l=n(88706),d=n(46417),u="https://nominatim.openstreetmap.org/search",_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[],n=function(e,n){e&&t.push({long_name:e,short_name:e,types:n})};return n(e.house_number,["street_number"]),n(e.road||e.pedestrian,["route"]),n(e.suburb||e.neighbourhood||e.quarter,["sublocality_level_1","sublocality"]),n(e.city_district||e.county,["administrative_area_level_3"]),n(e.city||e.town||e.village,["locality"]),n(e.state,["administrative_area_level_1"]),n(e.country,["country"]),n(e.postcode,["postal_code"]),t},A=function(e){var t;return{formatted_address:e.display_name,name:(null===(t=e.display_name)||void 0===t?void 0:t.split(",")[0])||"",geometry:{location:{lat:function(){return parseFloat(e.lat)},lng:function(){return parseFloat(e.lon)}}},address_components:_(e.address)}},x=function(e,t){var n=new URLSearchParams({q:e,format:"json",addressdetails:"1",limit:"5"});if(null!==t&&void 0!==t&&t.lat&&null!==t&&void 0!==t&&t.lng){var o=.5;n.set("viewbox","".concat(t.lng-o,",").concat(t.lat+o,",").concat(t.lng+o,",").concat(t.lat-o))}return n};t.ZP=function(e){var t=e.id,n=e.label,_=e.placeholder,p=void 0===_?"Search address":_,E=e.value,P=e.onChange,f=e.onPlaceSelected,m=e.bias,h=e.sx,g=e.textFieldSx,S=e.fullWidth,C=void 0===S||S,Z=e.disabled,v=e.inputRef,b=e.TextFieldProps,R=void 0===b?{}:b,T=(0,r.useState)(E||""),I=(0,a.Z)(T,2),j=I[0],y=I[1],k=(0,r.useState)([]),D=(0,a.Z)(k,2),L=D[0],O=D[1],M=(0,r.useState)(!1),H=(0,a.Z)(M,2),U=H[0],w=H[1];(0,r.useEffect)((function(){void 0!==E&&E!==j&&y(E||"")}),[E]);var F=(0,r.useMemo)((function(){return(0,l.Z)((function(e,t,n){if(e){var o=x(e,t);fetch("".concat(u,"?").concat(o.toString()),{headers:{Accept:"application/json"}}).then((function(e){return e.ok?e.json():[]})).then((function(e){return n(e||[])})).catch((function(){return n([])}))}else n([])}),500)}),[]);return(0,r.useEffect)((function(){var e=!0;return j?(w(!0),F(j,m,(function(t){e&&(w(!1),O(t))})),function(){e=!1}):(O([]),void w(!1))}),[j,null===m||void 0===m?void 0:m.lat,null===m||void 0===m?void 0:m.lng,F]),(0,d.jsx)(i.Z,{id:t,freeSolo:!0,fullWidth:C,disabled:Z,sx:h,options:L,filterOptions:function(e){return e},getOptionLabel:function(e){return"string"===typeof e?e:e.display_name||""},isOptionEqualToValue:function(e,t){return e.place_id===(null===t||void 0===t?void 0:t.place_id)},inputValue:j,onInputChange:function(e,t){y(t),null===P||void 0===P||P(t)},onChange:function(e,t){t&&"string"!==typeof t&&(y(t.display_name||""),null===f||void 0===f||f(A(t)))},renderInput:function(e){var t,a,r,i;return(0,d.jsx)(s.Z,(0,o.Z)((0,o.Z)((0,o.Z)({},e),R),{},{inputRef:v,label:n,placeholder:p,sx:g,autoComplete:"off",InputProps:(0,o.Z)((0,o.Z)((0,o.Z)({},e.InputProps),R.InputProps),{},{startAdornment:null!==(t=null===(a=R.InputProps)||void 0===a?void 0:a.startAdornment)&&void 0!==t?t:e.InputProps.startAdornment,endAdornment:(0,d.jsxs)(d.Fragment,{children:[U?(0,d.jsx)(c.Z,{color:"inherit",size:16}):null,null!==(r=null===(i=R.InputProps)||void 0===i?void 0:i.endAdornment)&&void 0!==r?r:e.InputProps.endAdornment]})})}))}})}},62912:function(e,t,n){n.r(t);var o=n(93433),a=n(74165),r=n(15861),i=n(29439),s=n(1413),c=n(47313),l=n(42832),d=n(48119),u=n(61113),_=n(9019),A=n(57829),x=n(76088),p=n(16783),E=n(69099),P=n(47131),f=n(16429),m=n(83929),h=n(44758),g=n(66212),S=n(70024),C=n(19536),Z=n(85281),v=n(33604),b=n(49914),R=n(96467),T=n(11198),I=n(37159),j=n(36528),y=n(12058),k=n(88960),D=n(23195),L=n(58467),O=n(22539),M=n(66277),H=n(56573),U=n(19860),w=n(91547),F=n(11577),N=(n(46926),n(97316),n(29736)),B=n(23208),Y=n(45904),W=n(94469),K=n(10658),z=n.n(K),G=n(90842),V=n(40765),q=n(3745),X=n(70501),Q=n(46417),J=n(91635);z().extend(J);var $=999,ee=16,te="0 14px 40px rgba(15, 23, 42, 0.10)",ne="0 8px 24px rgba(15, 23, 42, 0.08)",oe="0 18px 50px rgba(15, 23, 42, 0.18)",ae="#0f172a",re="#64748b",ie="#94a3b8",se="#e2e8f0",ce="#f1f5f9",le="#f8fafc",de=function(e,t){return"".concat(e).concat(t)},ue=function(e){return de(e,"08")},_e=function(e){return de(e,"18")},Ae=function(e){return de(e,"26")},xe=function(e){return de(e,"55")},pe="#662582",Ee="#9255AB",Pe=function(e){var t=e.color,n=e.icon,o=e.title,a=e.subtitle,r=e.action;return(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{px:{xs:1.5,md:2},py:1.25,borderBottom:"1px solid ".concat(ce),background:"linear-gradient(90deg, ".concat(ue(t)," 0%, transparent 100%)")},children:[(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,Q.jsx)(d.Z,{sx:{width:32,height:32,bgcolor:t,color:"#fff",boxShadow:"0 6px 18px ".concat(Ae(t))},children:n}),(0,Q.jsxs)(l.Z,{children:[(0,Q.jsx)(u.Z,{sx:{fontWeight:800,color:ae,fontSize:14,lineHeight:1.1},children:o}),a&&(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:re,fontWeight:600},children:a})]})]}),r]})},fe=function(e){var t=e.children,n=e.sx,o=void 0===n?{}:n;return(0,Q.jsx)(X.Z,{elevation:0,sx:(0,s.Z)({borderRadius:ee/8,border:"1px solid",borderColor:se,background:"#fff",overflow:"hidden",boxShadow:te,height:"100%"},o),children:t})},me=function(e){return(0,Q.jsx)(X.Z,(0,s.Z)((0,s.Z)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:oe,border:"1px solid",borderColor:"divider",overflow:"hidden"}}))};t.default=function(){var e=c.useState(""),t=(0,i.Z)(e,2),n=t[0],K=t[1],J=c.useState(""),oe=(0,i.Z)(J,2),de=oe[0],he=oe[1],ge=(0,c.useState)(""),Se=(0,i.Z)(ge,2),Ce=(Se[0],Se[1],(0,c.useState)("")),Ze=(0,i.Z)(Ce,2),ve=(Ze[0],Ze[1],(0,c.useState)("")),be=(0,i.Z)(ve,2),Re=(be[0],be[1],(0,c.useState)("")),Te=(0,i.Z)(Re,2),Ie=(Te[0],Te[1],(0,c.useState)("")),je=(0,i.Z)(Ie,2),ye=(je[0],je[1],(0,c.useState)("")),ke=(0,i.Z)(ye,2),De=(ke[0],ke[1],(0,c.useState)("")),Le=(0,i.Z)(De,2),Oe=(Le[0],Le[1],(0,c.useState)("")),Me=(0,i.Z)(Oe,2),He=(Me[0],Me[1],(0,c.useState)("")),Ue=(0,i.Z)(He,2),we=(Ue[0],Ue[1],(0,c.useState)("")),Fe=(0,i.Z)(we,2),Ne=(Fe[0],Fe[1],(0,c.useState)("")),Be=(0,i.Z)(Ne,2),Ye=(Be[0],Be[1],(0,c.useState)("")),We=(0,i.Z)(Ye,2),Ke=(We[0],We[1],(0,c.useState)("")),ze=(0,i.Z)(Ke,2),Ge=(ze[0],ze[1],(0,c.useState)("")),Ve=(0,i.Z)(Ge,2),qe=(Ve[0],Ve[1],(0,c.useState)("")),Xe=(0,i.Z)(qe,2),Qe=(Xe[0],Xe[1],(0,c.useState)("")),Je=(0,i.Z)(Qe,2),$e=(Je[0],Je[1],(0,c.useState)(localStorage.getItem("locationid"))),et=(0,i.Z)($e,2),tt=et[0],nt=et[1],ot=(0,c.useState)(!1),at=(0,i.Z)(ot,2),rt=at[0],it=at[1],st=(0,c.useRef)(null),ct=(0,c.useRef)(null),lt=(0,c.useState)(0),dt=(0,i.Z)(lt,2),ut=dt[0],_t=dt[1],At=(0,c.useState)(1),xt=(0,i.Z)(At,2),pt=xt[0],Et=xt[1],Pt=localStorage.getItem("applocationid"),ft=(0,L.s0)(),mt=(0,c.useState)({}),ht=(0,i.Z)(mt,2),gt=(ht[0],ht[1],(0,c.useState)("")),St=(0,i.Z)(gt,2),Ct=(St[0],St[1],(0,c.useState)(!1)),Zt=(0,i.Z)(Ct,2),vt=(Zt[0],Zt[1],(0,c.useState)(!1)),bt=(0,i.Z)(vt,2),Rt=(bt[0],bt[1],(0,c.useState)(!1)),Tt=(0,i.Z)(Rt,2),It=Tt[0],jt=Tt[1],yt=(0,c.useState)(1),kt=(0,i.Z)(yt,2),Dt=(kt[0],kt[1],(0,c.useState)([])),Lt=(0,i.Z)(Dt,2),Ot=(Lt[0],Lt[1],(0,c.useState)([])),Mt=(0,i.Z)(Ot,2),Ht=Mt[0],Ut=Mt[1],wt=(0,c.useState)(""),Ft=(0,i.Z)(wt,2),Nt=(Ft[0],Ft[1],(0,c.useState)(z()().format("MM-DD-YYYY"))),Bt=(0,i.Z)(Nt,2),Yt=Bt[0],Wt=Bt[1],Kt=(0,c.useState)(z()().add(1,"day").format("MM-DD-YYYY")),zt=(0,i.Z)(Kt,2),Gt=(zt[0],zt[1]),Vt=(0,c.useState)(),qt=(0,i.Z)(Vt,2),Xt=qt[0],Qt=qt[1],Jt=(0,c.useState)(),$t=(0,i.Z)(Jt,2),en=$t[0],tn=$t[1],nn=(0,c.useState)([]),on=(0,i.Z)(nn,2),an=on[0],rn=on[1],sn=(0,c.useState)(""),cn=(0,i.Z)(sn,2),ln=(cn[0],cn[1],(0,c.useState)([])),dn=(0,i.Z)(ln,2),un=(dn[0],dn[1],(0,U.Z)()),_n=(0,c.useState)(""),An=(0,i.Z)(_n,2),xn=An[0],pn=An[1],En=(0,c.useState)([]),Pn=(0,i.Z)(En,2),fn=(Pn[0],Pn[1],(0,c.useState)([])),mn=(0,i.Z)(fn,2),hn=(mn[0],mn[1],(0,c.useState)([])),gn=(0,i.Z)(hn,2),Sn=(gn[0],gn[1],(0,c.useState)([])),Cn=(0,i.Z)(Sn,2),Zn=(Cn[0],Cn[1],(0,c.useState)(!1)),vn=(0,i.Z)(Zn,2),bn=(vn[0],vn[1]),Rn=(0,c.useState)(!1),Tn=(0,i.Z)(Rn,2),In=Tn[0],jn=Tn[1],yn=(0,c.useState)(!1),kn=(0,i.Z)(yn,2),Dn=kn[0],Ln=kn[1],On=(0,c.useState)([]),Mn=(0,i.Z)(On,2),Hn=Mn[0],Un=(Mn[1],(0,c.useState)([])),wn=(0,i.Z)(Un,2),Fn=(wn[0],wn[1],(0,c.useState)([])),Nn=(0,i.Z)(Fn,2),Bn=(Nn[0],Nn[1]),Yn=(0,c.useState)(""),Wn=(0,i.Z)(Yn,2),Kn=Wn[0],zn=Wn[1],Gn=(0,c.useState)(""),Vn=(0,i.Z)(Gn,2),qn=(Vn[0],Vn[1],(0,c.useState)({})),Xn=(0,i.Z)(qn,2),Qn=(Xn[0],Xn[1],(0,c.useState)("")),Jn=(0,i.Z)(Qn,2),$n=Jn[0],eo=(Jn[1],(0,c.useState)([])),to=(0,i.Z)(eo,2),no=(to[0],to[1]),oo=(0,c.useState)([]),ao=(0,i.Z)(oo,2),ro=(ao[0],ao[1],(0,c.useState)()),io=(0,i.Z)(ro,2),so=io[0],co=io[1],lo=(0,c.useState)([]),uo=(0,i.Z)(lo,2),_o=(uo[0],uo[1],(0,c.useState)({})),Ao=(0,i.Z)(_o,2),xo=Ao[0],po=Ao[1],Eo=(0,c.useState)({}),Po=(0,i.Z)(Eo,2),fo=(Po[0],Po[1],(0,c.useState)("")),mo=(0,i.Z)(fo,2),ho=mo[0],go=mo[1],So=(0,c.useState)([]),Co=(0,i.Z)(So,2),Zo=(Co[0],Co[1],(0,c.useState)()),vo=(0,i.Z)(Zo,2),bo=(vo[0],vo[1]),Ro=(0,c.useState)(""),To=(0,i.Z)(Ro,2),Io=(To[0],To[1],(0,c.useState)(!0)),jo=(0,i.Z)(Io,2),yo=(jo[0],jo[1],(0,c.useState)("B")),ko=(0,i.Z)(yo,2),Do=(ko[0],ko[1],(0,c.useState)(!1)),Lo=(0,i.Z)(Do,2),Oo=(Lo[0],Lo[1],(0,c.useState)({latitude:0,longitude:0})),Mo=(0,i.Z)(Oo,2),Ho=Mo[0],Uo=Mo[1],wo=(0,c.useState)({latitude:0,longitude:0}),Fo=(0,i.Z)(wo,2),No=Fo[0],Bo=Fo[1],Yo=(0,c.useState)(!1),Wo=(0,i.Z)(Yo,2),Ko=Wo[0],zo=Wo[1],Go=(0,c.useState)(0),Vo=(0,i.Z)(Go,2),qo=Vo[0],Xo=Vo[1],Qo=(0,c.useState)(0),Jo=(0,i.Z)(Qo,2),$o=Jo[0],ea=Jo[1],ta=(0,c.useState)(0),na=(0,i.Z)(ta,2),oa=na[0],aa=na[1],ra=(0,c.useState)(0),ia=(0,i.Z)(ra,2),sa=ia[0],ca=ia[1],la=(0,c.useState)(0),da=(0,i.Z)(la,2),ua=da[0],_a=da[1],Aa=(0,c.useState)([]),xa=(0,i.Z)(Aa,2),pa=xa[0],Ea=xa[1],Pa=(0,c.useState)("Select "),fa=(0,i.Z)(Pa,2),ma=fa[0],ha=fa[1],ga=(0,c.useState)(),Sa=(0,i.Z)(ga,2),Ca=Sa[0],Za=Sa[1],va=(0,c.useState)(""),ba=(0,i.Z)(va,2),Ra=(ba[0],ba[1]),Ta=localStorage.getItem("tenantid"),Ia=(0,c.useState)(null),ja=(0,i.Z)(Ia,2),ya=ja[0],ka=ja[1],Da=(0,c.useState)(!1),La=(0,i.Z)(Da,2),Oa=La[0],Ma=La[1],Ha=(0,c.useState)(""),Ua=(0,i.Z)(Ha,2),wa=Ua[0],Fa=Ua[1],Na=(0,c.useState)([]),Ba=(0,i.Z)(Na,2),Ya=Ba[0],Wa=Ba[1],Ka=(0,c.useState)({}),za=(0,i.Z)(Ka,2),Ga=za[0],Va=za[1],qa=(0,c.useState)({}),Xa=(0,i.Z)(qa,2),Qa=Xa[0],Ja=Xa[1],$a=(0,c.useState)(0),er=(0,i.Z)($a,2),tr=er[0],nr=er[1],or=(0,c.useState)(0),ar=(0,i.Z)(or,2),rr=ar[0],ir=ar[1],sr=(0,c.useState)(0),cr=(0,i.Z)(sr,2),lr=cr[0],dr=cr[1],ur=(0,c.useState)([]),_r=(0,i.Z)(ur,2),Ar=_r[0],xr=_r[1],pr=(0,c.useState)(),Er=(0,i.Z)(pr,2),Pr=Er[0],fr=Er[1],mr=(0,c.useState)(),hr=(0,i.Z)(mr,2),gr=hr[0],Sr=hr[1],Cr=(0,c.useState)(),Zr=(0,i.Z)(Cr,2),vr=Zr[0],br=Zr[1],Rr=(0,c.useState)(0),Tr=(0,i.Z)(Rr,2),Ir=Tr[0],jr=Tr[1],yr=(0,c.useState)(0),kr=(0,i.Z)(yr,2),Dr=kr[0],Lr=kr[1],Or=(0,c.useState)(0),Mr=(0,i.Z)(Or,2),Hr=Mr[0],Ur=Mr[1],wr=(0,c.useState)(0),Fr=(0,i.Z)(wr,2),Nr=Fr[0],Br=Fr[1],Yr=(0,c.useState)(),Wr=(0,i.Z)(Yr,2),Kr=Wr[0],zr=Wr[1],Gr=(0,c.useState)(),Vr=(0,i.Z)(Gr,2),qr=Vr[0],Xr=Vr[1],Qr=(0,c.useState)(!1),Jr=(0,i.Z)(Qr,2),$r=Jr[0],ei=Jr[1],ti=(0,c.useState)(!1),ni=(0,i.Z)(ti,2),oi=ni[0],ai=ni[1],ri=(0,c.useState)(0),ii=(0,i.Z)(ri,2),si=ii[0],ci=ii[1];(0,c.useEffect)((function(){console.log(si)}),[si]);var li=function(e){ka(e)},di=function(e){return{cursor:"pointer",backgroundColor:ya===e?un.palette.primary.main:"default",color:ya===e?"#fff":"","&:hover":{backgroundColor:ya===e?un.palette.primary.main:un.palette.primary.light,color:"#fff"}}},ui=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/tenants/gettenantpricing/?tenantid=").concat(Ta));case 3:t=e.sent,console.log("pricingResponse",t.data.details),ea(t.data.details.baseprice),aa(t.data.details.priceperkm),ca(t.data.details.minkm),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.log("fetchTenantPricing error",e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){ui()}),[]),(0,c.useEffect)((function(){console.log("startPoint",Ho),console.log("endPoint",No),0!=Ho.latitude&&0!=Ho.longitude&&0!=No.latitude&&0!=No.longitude&&_i(Ho,No)}),[Ho,No]);var _i=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(t,n){var o,r,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,I.v)(t,n);case 3:o=e.sent,console.log("calculated distance in km:",o),Xo(o),r=(0,I.j)(o,$o,oa,sa),console.log("total charge:",r),_a(r),zo(!0),o>vr&&(zo(!0),jt(!0)),40,i=Math.round(o/40*60),console.log("Distance: ".concat(o,", Duration: ").concat(i)),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),console.error("Error calculating distance:",e.t0);case 19:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t,n){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){if(an[0]){var e=[];an.map((function(t){z()().diff(z()("".concat(z()(Yt).format("MM-DD-YYYY")," ").concat(z()(t).format("HH:mm:ss"))),"m")<=0&&e.push(t)})),e[0]&&Bn([{sno:1,address:"",customerid:"",deliverytime:z()(e[0])||"",deliverylocationid:"",clientname:"",contactno:"",latitude:"",longitude:""}])}}),[an]),(0,c.useEffect)((function(){if($n){var e=Ht.filter((function(e){return e.address.toLowerCase().includes($n.toLowerCase())||e.firstname.toLowerCase().includes($n.toLowerCase())||e.contactno.toLowerCase().includes($n.toLowerCase())}));console.log(e),no((0,o.Z)(e))}else no((0,o.Z)(Ht))}),[$n]);var Ai=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return jn(!0),console.log("tid",Ta),e.next=4,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/tenants/gettenantinfo/?tenantid=").concat(Ta)).then((function(e){console.log("fetchtenantinfo",e),e.data.status&&(po(e.data.details),bo(e.data.details.tenantid),Ei(),Za(e.data.details.subcategoryid)),jn(!1)})).catch((function(e){console.log(e),jn(!1)}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){Ai()}),[]);var xi=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/utils/getsubcategories/?moduleid=6")).then((function(e){console.log("subcateRes",e.data.details),e.data.status&&e.data.details?Ea(e.data.details):Ea([])})).catch((function(e){console.log(e),Ea([])}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){xi()}),[]);var pi=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return jn(!0),e.next=3,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/utils/getapplocations/?applocationid=").concat(Pt)).then((function(e){console.log("fetchTiming",e);var t=e.data.details[0],n=t.opentime,o=t.closetime,a=t.latitude,r=t.longitude,i=t.radius;if(e.data.status){fr(a),Sr(r),br(i),Qt("".concat(z()().format("MM-DD-YYYY")," ").concat(n)),tn("".concat(z()().format("MM-DD-YYYY")," ").concat(o)),console.log("starttime","".concat(z()().format("MM-DD-YYYY")," ").concat(n)),console.log("endtime","".concat(z()().format("MM-DD-YYYY")," ").concat(o," "));for(var s=[],c="".concat(z()().format("MM-DD-YYYY")," ").concat(n);z()("".concat(z()().format("MM-DD-YYYY")," ").concat(o," ")).diff(c,"m")>=0;c=z()(c).add(30,"m"))s.push(c);console.log("setTimeslotarr",s),rn(s)}jn(!1)})).catch((function(e){console.log(e),jn(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){pi()}),[]);var Ei=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return jn(!0),e.next=3,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/utils/getapplocationconfig/?applocationid=").concat(Pt)).then((function(e){var t=e.data.details.applocationadmins.map((function(e){return e.userfcmtokem}));console.log("fetchAppAdminTokens",e),console.log("userfcmtokemArray",t),e.data.status&&co(t),jn(!1)})).catch((function(e){console.log(e),jn(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){Xt&&en&&Ei()}),[Xt,en]);var Pi=function(e,t,n){(0,G.yv)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:n||2e3}),console.log(Kn)};var fi=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){var t,n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={},t={orders:{applocationid:xo.applolcationid,cancellled:"",categoryid:+xo.categoryid,configid:7,customerid:0==Ir&&+Ga.customerid||0,deliveryaddress:Qa.address||"",deliverycharge:+ua.toFixed(2)||0,deliverycity:Qa.city||"",deliverycontactno:Qa.contactno||"",deliverycustomer:Qa.firstname||"",deliveryid:0==Dr&&+Qa.customerid||0,deliverylandmark:Qa.landmark||"",deliverylat:Qa.latitude.toString(),deliverylocation:Qa.suburb||"",deliverylocationid:Qa.deliverylocationid||0,deliverylong:Qa.longitude.toString(),deliverytime:"".concat(z()(Yt).format("YYYY-MM-DD")," ").concat(z()(ho.$d).format("HH:mm:ss")),deliverytype:0!==Ga.customerid||0!==Qa.customerid?"B":"C",delivered:"",itemcount:1,kms:qo.toString()||0,locationid:+tt,moduleid:+xo.moduleid,orderamount:+ua.toFixed(2)||0,ordercharges:0,orderdate:z()().format("YYYY-MM-DD HH:mm:ss"),orderheaderid:0,orderid:"",ordernotes:xn,orderstatus:"created",ordervalue:+ua.toFixed(2)||0,partnerid:xo.partnerid,paymentstatus:1,paymenttype:42,pending:"",pickupaddress:Ga.address||"",pickupcity:Ga.city||"",pickupcontactno:Ga.contactno||"",pickupcustomer:Ga.firstname||"",pickuplandmark:Ga.landmark||"",pickuplat:Ga.latitude.toString(),pickuplocation:Ga.suburb||"",pickuplocationid:Ga.deliverylocationid||0,pickuplong:Ga.longitude.toString(),processing:"",ready:"",remarks:"",smsdelivery:si,subcategoryid:+Ca,taxamount:0,tenantid:xo.tenantid,tenantuserid:parseInt(localStorage.getItem("userid")),collectionamt:+ut||0,quantity:+pt||1},pickup:{address:Ga.address||"",applocationid:xo.applolcationid,city:Ga.city||"",configid:7,contactno:Ga.contactno||"",customertoken:"",customerid:0==Ir&&Ga.customerid||0,devicetype:"",deviceid:"",dialcode:"+91",doorno:Ga.doorno||"",email:Ga.email||"",firstname:Ga.firstname||"",landmark:Ga.landmark||"",latitude:Ga.latitude.toString()||"",longitude:Ga.longitude.toString()||"",locationid:Ga.deliverylocationid||0,postcode:Ga.postcode||"",primaryaddress:1,profileimage:"",state:Ga.state||"",suburb:Ga.suburb||"",tenantid:xo.tenantid},drop:{address:Qa.address||"",applocationid:xo.applolcationid,city:Qa.city||"",configid:7,contactno:Qa.contactno||"",customertoken:"",customerid:0==Dr&&Qa.customerid||0,devicetype:"",deviceid:"",dialcode:"+91",doorno:Qa.doorno||"",email:Qa.email||"",firstname:Qa.firstname||"",landmark:Qa.landmark||"",latitude:Qa.latitude.toString(),longitude:Qa.longitude.toString(),locationid:Qa.deliverylocationid||0,postcode:Qa.postcode||"",primaryaddress:1,profileimage:"",state:Qa.state||"",suburb:Qa.suburb||"",tenantid:xo.tenantid}},console.log("createsubmitobj2",t),Ga.firstname){e.next=7;break}Pi("Enter Pickup Contact Name ","warning",2e3),e.next=79;break;case 7:if(Ga.contactno){e.next=11;break}Pi("Enter Pickup Contact Number ","warning",2e3),e.next=79;break;case 11:if(10==Ga.contactno.length){e.next=15;break}Pi("Check Pickup Contact Number ","error",2e3),e.next=79;break;case 15:if(Ga.suburb){e.next=19;break}Pi("Enter Pickup Location ","warning",2e3),e.next=79;break;case 19:if(Ga.city){e.next=23;break}Pi("Enter Pickup City ","warning",2e3),e.next=79;break;case 23:if(Ga.postcode){e.next=27;break}Pi("Enter Pickup Postcode ","warning",2e3),e.next=79;break;case 27:if(Ga.landmark){e.next=31;break}Pi("Enter Pickup Landmark ","warning",2e3),e.next=79;break;case 31:if(Qa.firstname){e.next=35;break}Pi("Enter Drop Contact Name ","warning",2e3),e.next=79;break;case 35:if(Qa.contactno){e.next=39;break}Pi("Enter Drop Contact Number","warning",2e3),e.next=79;break;case 39:if(10===Qa.contactno.length){e.next=43;break}Pi("Check Drop Contact Number ","error",2e3),e.next=79;break;case 43:if(Qa.suburb){e.next=47;break}Pi("Enter Drop Suburb ","warning",2e3),e.next=79;break;case 47:if(Qa.city){e.next=51;break}Pi("Enter Drop City ","warning",2e3),e.next=79;break;case 51:if(Qa.postcode){e.next=55;break}Pi("Enter Drop postcode ","warning",2e3),e.next=79;break;case 55:if(Qa.landmark){e.next=59;break}Pi("Enter Drop Landmark ","warning",2e3),e.next=79;break;case 59:if(ho){e.next=63;break}Pi("Choose deliverytime ","warning",2e3),e.next=79;break;case 63:if(Za){e.next=67;break}Pi("Choose SubCategory ","warning",2e3),e.next=79;break;case 67:return e.prev=67,e.next=70,H.Z.post("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/createorder"),t);case 70:(n=e.sent).data.status?(console.log("createRes",n),(0,G.yv)("Order Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),so&¬ifyadmin(so),ft("/nearle/orders")):Pi("Something went wrong, Cannot create order","warning"),jn(!1),console.log(n),e.next=79;break;case 76:e.prev=76,e.t0=e.catch(67),console.log("createResErr",e.t0);case 79:case"end":return e.stop()}}),e,null,[[67,76]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){console.log("shiftarr"),console.log(Hn)}),[Hn]);var mi=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return bn(!0),e.prev=1,t=""==wa?"".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/customers/gettenantcustomers/?tenantid=").concat(Ta,"&pageno=1&pagesize=20"):"".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/customers/search/?tenantid=").concat(Ta,"&keyword=").concat(wa),e.next=5,H.Z.get(t).then((function(e){if(console.log("clientdetails",e.data.details),e.data.status&&e.data.details){Ut(e.data.details||[]),Wa(e.data.details||[]);var t=[];e.data.details.map((function(e){t.push((0,s.Z)({label:"".concat(e.firstname," | ").concat(e.contactno)},e))})),no(t)}else Ut([]),Wa([]),no([]);bn(!1)})).catch((function(e){console.log(e),bn(!1),Pi("server error","warning")}));case 5:e.next=11;break;case 7:e.prev=7,e.t0=e.catch(1),console.log(e.t0),bn(!1);case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){console.log("clientdetails, by search"),mi()}),[wa.length>3,""==wa]);var hi=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL,"/tenants/gettenantlocations/?tenantid=").concat(Ta));case 3:t=e.sent,console.log("gettenantlocations",t.data.details),t.data&&t.data.details?(xr(t.data.details),1==t.data.details.length&&(it(!0),nt(t.data.details[0].locationid))):xr([]),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),console.log("gettenantlocations",e.t0),xr([]);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){hi()}),[]),(0,Q.jsxs)(Q.Fragment,{children:[In&&(0,Q.jsx)(F.Z,{}),(0,Q.jsxs)(_.ZP,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsx)(X.Z,{elevation:0,sx:{position:"sticky",top:"60px",zIndex:1e3,mb:1.5,p:{xs:1.5,sm:2,md:2.5},borderRadius:ee/8,border:"1px solid",borderColor:se,background:"linear-gradient(135deg, ".concat(ue(pe)," 0%, ").concat(ue(Ee)," 100%)"),boxShadow:ne},children:(0,Q.jsxs)(l.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Q.jsx)(d.Z,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:pe,color:"#fff",boxShadow:"0 6px 18px ".concat(Ae(pe))},children:(0,Q.jsx)(O.tX2,{size:22})}),(0,Q.jsxs)(l.Z,{children:[(0,Q.jsx)(u.Z,{variant:"h3",sx:{fontWeight:800,color:ae,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Create Order"}),(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Q.jsx)(A.Z,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:re,fontWeight:600},children:"Fill pickup, drop, schedule & pricing details"})]})]})]}),1===Ar.length?(0,Q.jsxs)(A.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.5,py:.875,borderRadius:999,bgcolor:ue(pe),border:"1.5px solid ".concat(xe(pe)),color:pe,fontWeight:800,fontSize:13},children:[(0,Q.jsx)(O.x$F,{size:14})," ",Ar[0].locationname]}):(0,Q.jsx)(x.Z,{options:Ar||[],getOptionLabel:function(e){return e&&e.locationname?"".concat(e.locationname," (").concat(e.suburb||"",")"):""},isOptionEqualToValue:function(e,t){return(null===e||void 0===e?void 0:e.locationid)===(null===t||void 0===t?void 0:t.locationid)},PaperComponent:me,sx:{width:{xs:"100%",sm:300}},size:"small",renderInput:function(e){return(0,Q.jsx)(p.Z,(0,s.Z)((0,s.Z)({},e),{},{placeholder:"Select Business Location",InputProps:(0,s.Z)((0,s.Z)({},e.InputProps),{},{startAdornment:(0,Q.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:(0,Q.jsx)(d.Z,{sx:{width:22,height:22,bgcolor:pe,color:"#fff"},children:(0,Q.jsx)(O.x$F,{size:13})})})}),sx:{"& .MuiOutlinedInput-root":{borderRadius:$+"px",bgcolor:"#fff",fontWeight:600,"& fieldset":{borderColor:xe(pe),borderWidth:1.5},"&:hover fieldset":{borderColor:pe},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Ae(pe))},"&.Mui-focused fieldset":{borderColor:pe,borderWidth:2}}}}))},onChange:function(e,t,n){t&&(nt(t.locationid),it(!0)),"clear"===n&&it(!1)}})]})})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsxs)(A.Z,{sx:{overflow:"visible"},children:[(0,Q.jsx)(_.ZP,{container:!0,spacing:2,children:(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsxs)(_.ZP,{container:!0,spacing:2,sx:{height:"100%"},children:[(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(Pe,{color:"#0ea5e9",icon:(0,Q.jsx)(O.$0r,{size:16}),title:"Pickup Details",subtitle:"Where the order is picked up",action:(0,Q.jsx)(E.Z,{size:"small",variant:"outlined",startIcon:(0,Q.jsx)(O.Bjz,{size:14}),onClick:function(){rt?(Ma(!0),nr(1),Va({}),K(""),Fa("")):Pi("Select Business Location","warning")},sx:{borderRadius:999,px:1.5,py:.375,fontSize:11.5,fontWeight:700,textTransform:"none",borderColor:xe("#0ea5e9"),color:"#0ea5e9","&:hover":{borderColor:"#0ea5e9",bgcolor:ue("#0ea5e9"),boxShadow:"0 0 0 3px ".concat(Ae("#0ea5e9"))}},children:"Saved Locations"})}),(0,Q.jsx)(A.Z,{sx:{p:{xs:2,md:2.5}},children:(0,Q.jsx)(_.ZP,{container:!0,spacing:2,children:(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsxs)(_.ZP,{container:!0,spacing:4,children:[(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{inputRef:st,disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.Xws,{})})},variant:"outlined",label:"Contact Name",value:Ga.firstname,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{firstname:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{error:$r,disabled:!rt,fullWidth:!0,type:"number",InputProps:{inputProps:{maxLength:10},startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(j.DNl,{color:$r&&"red"})})},variant:"outlined",label:"Contact Number",value:Ga.contactno,onChange:function(e){e.target.value.length<=10&&Va((0,s.Z)((0,s.Z)({},Ga),{},{contactno:e.target.value})),Kr==e.target.value?Ur(0):Ur(1),e.target.value.length<10?ei(!0):ei(!1)}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsx)(l.Z,{spacing:1.25,sx:{mt:0},children:0==rr?(0,Q.jsx)("div",{children:(0,Q.jsx)(w.ZP,{label:"Address",disabled:!rt,id:"addressAuto1",fullWidth:!0,value:n,onChange:K,onPlaceSelected:function(e){K("".concat(e.name,", ").concat(e.formatted_address)),Uo({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Va((0,s.Z)((0,s.Z)({},Ga),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));var t={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((function(e){e.types.forEach((function(n){switch(n){case"street_number":t.street_number=e.long_name;break;case"route":t.route=e.long_name;break;case"locality":t.locality=e.long_name;break;case"sublocality_level_1":t.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":t.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":t.administrative_area_level_1=e.long_name;break;case"country":t.country=e.long_name;break;case"postal_code":t.postal_code=e.long_name}}))})),Va((0,s.Z)((0,s.Z)({},Ga),{},{address:t.address,doorno:"".concat(t.street_number," ").concat(t.route),suburb:t.sublocality_level_1,city:t.locality,postcode:t.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}))},bias:{lat:Pr,lng:gr},TextFieldProps:{variant:"outlined",InputProps:{endAdornment:(0,Q.jsx)(P.Z,{onClick:function(){K(""),Va((0,s.Z)((0,s.Z)({},Ga),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),zo(!1),Uo({latitude:0,longitude:0})},size:"small",children:(0,Q.jsx)(T.Z,{})})}}})}):(0,Q.jsx)(p.Z,{InputProps:{endAdornment:(0,Q.jsx)(P.Z,{onClick:function(){ir(0),Va((0,s.Z)((0,s.Z)({},Ga),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),zo(!1),Uo({latitude:0,longitude:0})},children:(0,Q.jsx)(D.Z,{})})},variant:"outlined",placeholder:"Select",value:Ga.address,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{address:e.target.value})),""==e.target.value&&(ir(0),zo(!1),Uo({latitude:0,longitude:0}))}})})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(y.Lmk,{})})},variant:"outlined",label:"Door No / Street",value:Ga.doorno,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{doorno:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.GUT,{})})},variant:"outlined",label:"Location",value:Ga.suburb,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{suburb:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(O.Ys1,{})})},variant:"outlined",label:"City",value:Ga.city,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{city:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(M.kk8,{})})},variant:"outlined",label:"Postcode",value:Ga.postcode,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{postcode:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.I2o,{})})},variant:"outlined",label:"Landmark",value:Ga.landmark,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Ga),{},{landmark:e.target.value}))}})}),1==Hr&&(0,Q.jsx)(_.ZP,{item:!0,xs:12,sx:{display:"flex",justifyContent:"end"},children:(0,Q.jsx)(f.Z,{children:(0,Q.jsx)(m.Z,{control:(0,Q.jsx)(h.Z,{checked:1===Ir,onChange:function(e){jr(e.target.checked?1:0)}}),label:"Save For Later"})})})]})})})})]})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,children:(0,Q.jsxs)(fe,{children:[(0,Q.jsx)(Pe,{color:pe,icon:(0,Q.jsx)(O.ili,{size:16}),title:"Drop Details",subtitle:"Where the order is delivered",action:(0,Q.jsx)(E.Z,{size:"small",variant:"outlined",startIcon:(0,Q.jsx)(O.Bjz,{size:14}),onClick:function(){rt?(Ma(!0),nr(2),he(""),Fa("")):Pi("Select Business Location","warning")},sx:{borderRadius:999,px:1.5,py:.375,fontSize:11.5,fontWeight:700,textTransform:"none",borderColor:xe(pe),color:pe,"&:hover":{borderColor:pe,bgcolor:ue(pe),boxShadow:"0 0 0 3px ".concat(Ae(pe))}},children:"Saved Locations"})}),(0,Q.jsx)(A.Z,{sx:{p:{xs:2,md:2.5}},children:(0,Q.jsxs)(_.ZP,{container:!0,spacing:2,sx:{height:"100%"},children:[(0,Q.jsx)(_.ZP,{item:!0,xs:12,sx:{height:"100%"},children:(0,Q.jsxs)(l.Z,{direction:"row",justifyContent:"space-between",sx:{display:"none"},children:[(0,Q.jsx)(u.Z,{variant:"h5",sx:{mb:2},children:"Drop Details"}),(0,Q.jsx)(l.Z,{direction:"row",alignItems:"center",children:(0,Q.jsx)(E.Z,{variant:"outlined",sx:{"&:hover":{bgcolor:un.palette.primary.main,color:"white"}},onClick:function(){rt?(Ma(!0),nr(2),he(""),Fa("")):Pi("Select Business Location","warning")},children:"Saved Locations"})})]})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsxs)(_.ZP,{container:!0,spacing:4,children:[(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{inputRef:ct,disabled:!rt,fullWidth:!0,variant:"outlined",label:"Contact Name",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.Xws,{})})},value:Qa.firstname,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{firstname:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,error:oi,fullWidth:!0,type:"number",variant:"outlined",label:"Contact Number",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(j.DNl,{color:oi&&"red"})})},value:Qa.contactno,onChange:function(e){e.target.value.length<=10&&Ja((0,s.Z)((0,s.Z)({},Qa),{},{contactno:e.target.value})),qr==e.target.value?Br(0):Br(1),e.target.value.length<10?ai(!0):ai(!1)}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsx)(l.Z,{spacing:1.25,sx:{mt:0},children:0==lr?(0,Q.jsx)("div",{children:(0,Q.jsx)(w.ZP,{id:"addressAuto2",disabled:!rt,label:"Address",fullWidth:!0,value:de,onChange:he,onPlaceSelected:function(e){he("".concat(e.name,", ").concat(e.formatted_address)),Bo({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Ja((0,s.Z)((0,s.Z)({},Qa),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));var t={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((function(e){e.types.forEach((function(n){switch(n){case"street_number":t.street_number=e.long_name;break;case"route":t.route=e.long_name;break;case"locality":t.locality=e.long_name;break;case"sublocality_level_1":t.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":t.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":t.administrative_area_level_1=e.long_name;break;case"country":t.country=e.long_name;break;case"postal_code":t.postal_code=e.long_name}}))})),Ja((0,s.Z)((0,s.Z)({},Qa),{},{address:t.address,doorno:"".concat(t.street_number," ").concat(t.route),suburb:t.sublocality_level_1,city:t.locality,postcode:t.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}))},bias:{lat:Pr,lng:gr},TextFieldProps:{InputProps:{endAdornment:(0,Q.jsx)(P.Z,{onClick:function(){he(""),Ja((0,s.Z)((0,s.Z)({},Qa),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),zo(!1),Bo({latitude:0,longitude:0})},size:"small",children:(0,Q.jsx)(T.Z,{})})}}})}):(0,Q.jsx)(p.Z,{disabled:!rt,InputProps:{endAdornment:(0,Q.jsx)(P.Z,{onClick:function(){dr(0),Ja((0,s.Z)((0,s.Z)({},Qa),{},{firstname:"",contactno:"",doorno:"",suburb:"",city:"",postcode:"",landmark:""})),zo(!1),Bo({latitude:0,longitude:0})},children:(0,Q.jsx)(D.Z,{})})},variant:"outlined",placeholder:"Select",value:Qa.address,onChange:function(e){Va((0,s.Z)((0,s.Z)({},Qa),{},{address:e.target.value})),""==e.target.value&&(dr(0),zo(!1),Bo({latitude:0,longitude:0}))}})})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,variant:"outlined",label:"Door No / Street",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(y.Lmk,{})})},value:Qa.doorno,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{doorno:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,variant:"outlined",label:"Location",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.GUT,{})})},value:Qa.suburb,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{suburb:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,variant:"outlined",label:"City",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(O.Ys1,{})})},value:Qa.city,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{city:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:6,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,variant:"outlined",label:"Postcode",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(M.kk8,{})})},value:Qa.postcode,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{postcode:e.target.value}))}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,children:(0,Q.jsx)(p.Z,{disabled:!rt,fullWidth:!0,variant:"outlined",label:"Landmark",InputProps:{startAdornment:(0,Q.jsx)(P.Z,{children:(0,Q.jsx)(k.I2o,{})})},value:Qa.landmark,onChange:function(e){Ja((0,s.Z)((0,s.Z)({},Qa),{},{landmark:e.target.value}))}})}),1==Nr&&(0,Q.jsx)(_.ZP,{item:!0,xs:12,sx:{display:"flex",justifyContent:"end"},children:(0,Q.jsx)(f.Z,{children:(0,Q.jsx)(m.Z,{control:(0,Q.jsx)(h.Z,{checked:1===Dr,onChange:function(e){Lr(e.target.checked?1:0)}}),label:"Save For Later"})})})]})})]})})]})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,children:(0,Q.jsxs)(fe,{sx:{mt:2,minHeight:390},children:[(0,Q.jsx)(Pe,{color:"#f59e0b",icon:(0,Q.jsx)(O.k71,{size:16}),title:"Schedule",subtitle:"Pickup date & time slot"}),(0,Q.jsx)(A.Z,{sx:{p:{xs:2,md:2.5}},children:(0,Q.jsx)(_.ZP,{container:!0,children:(0,Q.jsxs)(_.ZP,{item:!0,xs:12,children:[(0,Q.jsx)(u.Z,{variant:"subtitle2",sx:{fontWeight:700,color:re,mb:1},children:"Date"}),(0,Q.jsx)(B._,{dateAdapter:Y.y,sx:{},children:(0,Q.jsx)(N.M,{format:"DD-MM-YYYY",onChange:function(e){var t=z()().diff(z()("".concat(z()(e).format("YYYY-MM-DD"))),"d");if(console.log("dateres11"),console.log(t),go(""),t<=0){console.log("startdate",e),Wt(e),Gt(e);var n=[];an.map((function(t){z()().diff(z()("".concat(z()(e).format("MM-DD-YYYY")," ").concat(z()(t).format("HH:mm:ss"))),"m")<=0&&n.push(t)})),n[0]?Bn([{sno:1,address:"",customerid:"",deliverytime:z()(n[0])||"",deliverylocationid:"",clientname:"",contactno:"",latitude:"",longitude:""}]):Bn([])}else zn("choose Upcoming Date"),Pi("choose Upcoming Date","warning"),Wt(NaN)},value:z()(Yt),sx:{width:"100%",mt:2},disablePast:!0})}),(0,Q.jsx)(u.Z,{variant:"subtitle2",sx:{fontWeight:700,color:re,mt:2,mb:1},children:"Time"}),(0,Q.jsx)(A.Z,{sx:{mt:.5,p:1.25,borderRadius:2,border:"1px solid",borderColor:ce,bgcolor:le,maxHeight:150,overflowY:"auto",scrollbarWidth:"thin","&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-thumb":{backgroundColor:xe(pe),borderRadius:6}},children:(0,Q.jsx)(l.Z,{direction:"row",flexWrap:"wrap",gap:.75,useFlexGap:!0,children:an.map((function(e,t){if(z()().diff(z()("".concat(z()(Yt).format("MM-DD-YYYY")," ").concat(z()(e).format("HH:mm:ss"))),"m")<=0){var n=z()(ho).format("HH:mm")==z()(e).format("HH:mm");return(0,Q.jsxs)(A.Z,{onClick:function(){qo>vr?jt(!0):Ko?go(e):Pi("Select Pickup and Drop","error")},sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(n?"#f59e0b":xe("#f59e0b")),bgcolor:n?"#f59e0b":ue("#f59e0b"),color:n?"#fff":"#f59e0b",fontSize:12,fontWeight:800,transition:"all 0.15s",boxShadow:n?"0 6px 18px ".concat(Ae("#f59e0b")):"none","&:hover":{borderColor:"#f59e0b",boxShadow:n?"0 6px 18px ".concat(Ae("#f59e0b")):"0 0 0 3px ".concat(Ae("#f59e0b"))}},children:[(0,Q.jsx)(O.Y8K,{size:11})," ",z()(e).format("hh:mm A")]},t)}}))})})]})})})]})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,sx:{},children:(0,Q.jsxs)(fe,{sx:{mt:2,minHeight:390},children:[(0,Q.jsx)(Pe,{color:"#10b981",icon:(0,Q.jsx)(O.sF1,{size:16}),title:"Distance & Pricing",subtitle:"Auto-calculated from pickup \u2192 drop"}),(0,Q.jsxs)(A.Z,{sx:{p:{xs:2,md:2.5}},children:[Ko&&(0,Q.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",mb:3},children:[(0,Q.jsx)(l.Z,{spacing:1.5,children:(0,Q.jsx)(g.Z,{label:"Distance: ".concat(qo," km"),size:"medium",variant:"contained",color:"primary"})}),(0,Q.jsx)(l.Z,{spacing:1.5,children:(0,Q.jsx)(g.Z,{label:"Charge: \u20b9".concat(ua.toFixed(2)),size:"medium",variant:"contained",color:"primary"})})]}),(0,Q.jsxs)(l.Z,{direction:"column",justifyContent:"space-between",sx:{mb:2},children:[(0,Q.jsx)(u.Z,{variant:"h5",children:"Category"}),(0,Q.jsx)(x.Z,{disablePortal:!0,id:"combo-box-demo",options:pa,getOptionLabel:function(e){return"".concat(e.subcategoryname)||""},sx:{my:2,zIndex:"100"},fullWidth:!0,renderInput:function(e){return(0,Q.jsx)(p.Z,(0,s.Z)((0,s.Z)({},e),{},{label:""==ma?xo.subcategoryname:ma}))},onChange:function(e,t,n){t&&(console.log(t),ha(t.subcategoryname),Za(t.subcategoryid))}})]}),(0,Q.jsx)(u.Z,{variant:"h5",children:"Weight"}),(0,Q.jsxs)(l.Z,{direction:"row",justifyContent:"space-evenly",sx:{border:"1px solid #eee",my:2,py:2},children:[(0,Q.jsx)(g.Z,{variant:"contained",color:"default",label:"1-10kgs",sx:di("1-10kgs"),onClick:function(){li("1-10kgs"),Ra("1-10kgs")}}),(0,Q.jsx)(g.Z,{variant:"contained",color:"default",label:"11-20kgs",sx:di("11-20kgs"),onClick:function(){li("11-20kgs"),Ra("11-20kgs")}}),(0,Q.jsx)(g.Z,{variant:"contained",color:"default",label:"21-30kgs",sx:di("21-30kgs"),onClick:function(){li("21-30kgs"),Ra("21-30kgs")}})]}),(0,Q.jsxs)(l.Z,{direction:"row",justifyContent:"space-between",sx:{mt:4},children:[(0,Q.jsx)(u.Z,{variant:"h5",children:"SMS Delivery"}),(0,Q.jsx)(S.Z,{checked:1===si,onChange:function(e){ci(e.target.checked?1:0)}})]})]})]})})]})})}),(0,Q.jsxs)(fe,{sx:{mt:2},children:[(0,Q.jsx)(Pe,{color:"#6366f1",icon:(0,Q.jsx)(O.ByW,{size:16}),title:"Collection & Quantity",subtitle:"Cash to collect on delivery, total items"}),(0,Q.jsx)(A.Z,{sx:{p:{xs:2,md:2.5}},children:(0,Q.jsxs)(_.ZP,{container:!0,spacing:2,children:[(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,children:(0,Q.jsx)(p.Z,{type:"number",value:ut,fullWidth:!0,label:"Cash Collect",onChange:function(e){return _t(e.target.value)},inputProps:{min:0}})}),(0,Q.jsx)(_.ZP,{item:!0,xs:12,sm:6,children:(0,Q.jsx)(p.Z,{type:"number",value:pt,fullWidth:!0,label:"Quantity",onChange:function(e){return Et(e.target.value)},inputProps:{min:1}})})]})})]}),(0,Q.jsxs)(fe,{sx:{mt:2},children:[(0,Q.jsx)(Pe,{color:re,icon:(0,Q.jsx)(O.hKf,{size:16}),title:"Notes",subtitle:"Add anything the rider should know"}),(0,Q.jsxs)(A.Z,{sx:{p:{xs:2,md:2.5}},children:[(0,Q.jsx)(p.Z,{focused:!0,variant:"outlined",sx:{width:"100%",mb:2},multiline:!0,rows:2,label:"Notes",placeholder:"Special instructions, gate code, etc.",value:xn,onChange:function(e){return pn(e.target.value)}}),(0,Q.jsx)(C.Z,{sx:{my:1.5}}),(0,Q.jsxs)(l.Z,{direction:"row",justifyContent:"flex-end",alignItems:"center",spacing:1.25,children:[!Ko&&(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:ie,fontWeight:700},children:"Set pickup & drop to enable"}),(0,Q.jsx)(E.Z,{size:"medium",disabled:!Ko,variant:"contained",startIcon:Dn?null:(0,Q.jsx)(O.ZSR,{size:16}),onClick:function(){jn(!0),Ln(!0),fi(),setTimeout((function(){jn(!1),Ln(!1)}),1e3)},sx:{borderRadius:999,px:3,py:1,fontWeight:800,textTransform:"none",fontSize:13,background:"linear-gradient(135deg, ".concat(pe," 0%, ").concat(Ee," 100%)"),color:"#fff",boxShadow:"0 8px 22px ".concat(Ae(pe)),transition:"all 0.18s","&:hover":{background:"linear-gradient(135deg, #4D1C61 0%, ".concat(pe," 100%)"),transform:"translateY(-1px)",boxShadow:"0 10px 26px ".concat(Ae(pe))},"&.Mui-disabled":{background:ce,color:ie,boxShadow:"none"}},children:Dn?(0,Q.jsx)(Z.Z,{size:18,thickness:5,sx:{color:"#fff"}}):"Create Order"})]})]})]})]})}),(0,Q.jsxs)(W.Z,{open:Oa,onClose:function(){return Ma(!1)},fullWidth:!0,maxWidth:"sm",PaperProps:{sx:{borderRadius:3}},children:[(0,Q.jsxs)(v.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(ue(pe)," 0%, ").concat(ue(Ee)," 100%)"),borderBottom:"1px solid ".concat(se)},children:[(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:1.5,sx:{mb:1.5},children:[(0,Q.jsx)(d.Z,{sx:{bgcolor:pe,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(Ae(pe))},children:(0,Q.jsx)(O.Bjz,{size:20})}),(0,Q.jsxs)(l.Z,{children:[(0,Q.jsx)(u.Z,{variant:"h5",sx:{fontWeight:800,color:ae},children:"Saved Locations"}),(0,Q.jsxs)(u.Z,{variant:"caption",sx:{color:re,fontWeight:600},children:["Pick a saved customer for ",1===tr?"Pickup":"Drop"]})]})]}),(0,Q.jsxs)(A.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:"#fff",border:"1.5px solid ".concat(xe(pe)),transition:"all 0.18s","&:focus-within":{borderColor:pe,boxShadow:"0 0 0 3px ".concat(Ae(pe))}},children:[(0,Q.jsx)(V.Z,{style:{color:pe,fontSize:14}}),(0,Q.jsx)(b.Z,{fullWidth:!0,placeholder:"Search saved customer",value:wa,onChange:function(e){return Fa(e.target.value)},sx:{flex:1,"& .MuiOutlinedInput-input":{p:"6px 4px",fontSize:13,fontWeight:600},"& fieldset":{border:"none"}},endAdornment:wa&&(0,Q.jsx)(P.Z,{size:"small",onClick:function(){return Fa("")},sx:{p:.25,color:pe},children:(0,Q.jsx)(D.Z,{fontSize:"small"})}),autoComplete:"off"})]})]}),(0,Q.jsx)(R.Z,{sx:{p:2,bgcolor:le},children:0===Ya.length?(0,Q.jsxs)(l.Z,{alignItems:"center",justifyContent:"center",spacing:1.5,sx:{minHeight:480,maxHeight:480},children:[(0,Q.jsx)(d.Z,{sx:{width:56,height:56,bgcolor:_e("#94a3b8"),color:ie},children:(0,Q.jsx)(O.Bjz,{size:26})}),(0,Q.jsx)(u.Z,{variant:"subtitle1",sx:{fontWeight:700,color:ae},children:"No saved locations"}),(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:re},children:wa?"Try a different keyword.":"Save a customer from the order form to reuse it later."})]}):(0,Q.jsx)(l.Z,{spacing:1,sx:{minHeight:480,maxHeight:480,overflow:"auto",pr:.5},children:Ya.map((function(e,t){var n=Ga.customerid===e.customerid;return(0,Q.jsxs)(A.Z,{onClick:function(){n||(Ma(!1),1===tr?(ir(1),Uo({latitude:e.latitude,longitude:e.longitude}),Va(e),zr(e.contactno)):(dr(1),Bo({latitude:e.latitude,longitude:e.longitude}),Ja(e),Xr(e.contactno)))},sx:{display:"flex",alignItems:"flex-start",gap:1.25,p:1.5,borderRadius:2,border:"1px solid",borderColor:n?xe("#94a3b8"):se,bgcolor:n?le:"#fff",cursor:n?"not-allowed":"pointer",opacity:n?.6:1,transition:"all 0.15s","&:hover":n?{}:{borderColor:xe(pe),bgcolor:ue(pe),boxShadow:te}},children:[(0,Q.jsx)(d.Z,{sx:{width:36,height:36,bgcolor:_e(pe),color:pe,fontWeight:800},children:String(e.firstname||"?").charAt(0).toUpperCase()}),(0,Q.jsxs)(l.Z,{sx:{flex:1,minWidth:0},children:[(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:[(0,Q.jsx)(u.Z,{sx:{fontWeight:800,color:ae,fontSize:13.5},noWrap:!0,children:e.firstname}),(0,Q.jsxs)(A.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.375,px:.75,py:.125,borderRadius:999,bgcolor:ue("#0ea5e9"),border:"1px solid ".concat(xe("#0ea5e9")),color:"#0ea5e9",fontSize:10.5,fontWeight:800},children:[(0,Q.jsx)(j.DNl,{size:9})," ",e.contactno]}),n&&(0,Q.jsx)(A.Z,{sx:{display:"inline-flex",alignItems:"center",px:.75,py:.125,borderRadius:999,bgcolor:ue("#94a3b8"),border:"1px solid ".concat(xe("#94a3b8")),color:re,fontSize:10.5,fontWeight:800},children:"Already used"})]}),(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:re,mt:.25},noWrap:!0,children:e.address})]})]},t)}))})}),(0,Q.jsx)(l.Z,{direction:"row",justifyContent:"flex-end",sx:{p:2,borderTop:"1px solid ".concat(ce)},children:(0,Q.jsx)(E.Z,{variant:"outlined",onClick:function(){return Ma(!1)},sx:{borderRadius:999,px:2.5,borderColor:se,color:re,fontWeight:700,textTransform:"none","&:hover":{borderColor:re,bgcolor:le}},children:"Cancel"})})]}),(0,Q.jsxs)(W.Z,{open:It,onClose:function(){return jt(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,Q.jsx)(A.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(ue("#ef4444")," 0%, ").concat(ue("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(se)},children:(0,Q.jsxs)(l.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,Q.jsx)(d.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(Ae("#ef4444"))},children:(0,Q.jsx)(q.Z,{})}),(0,Q.jsxs)(l.Z,{children:[(0,Q.jsx)(u.Z,{variant:"h5",sx:{fontWeight:800,color:ae},children:"Out of Service Area"}),(0,Q.jsx)(u.Z,{variant:"caption",sx:{color:re,fontWeight:600},children:"This drop point is outside the supported radius"})]})]})}),(0,Q.jsx)(R.Z,{sx:{pt:2.5},children:(0,Q.jsx)(u.Z,{sx:{color:re,fontWeight:600},children:"Service is not available at this location. Try a different drop point within the coverage zone."})}),(0,Q.jsx)(l.Z,{direction:"row",justifyContent:"flex-end",sx:{p:2,borderTop:"1px solid ".concat(ce)},children:(0,Q.jsx)(E.Z,{variant:"contained",onClick:function(){return jt(!1)},sx:{borderRadius:999,px:3,bgcolor:"#ef4444",fontWeight:700,textTransform:"none",boxShadow:"0 6px 18px ".concat(Ae("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Close"})})]})]})]})}},37159:function(e,t,n){n.d(t,{j:function(){return i},v:function(){return r}});var o=n(74165),a=n(15861),r=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(t,n){var a,r,i,s,c,l,d,u,_,A,x,p,E,P,f,m;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null===t||void 0===t?void 0:t.latitude,r=null===t||void 0===t?void 0:t.longitude,i=null===n||void 0===n?void 0:n.latitude,s=null===n||void 0===n?void 0:n.longitude,null!=a&&null!=r&&null!=i&&null!=s){e.next=6;break}throw new Error("Invalid coordinates");case 6:return c={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_OSRM_URL||"https://router.project-osrm.org",e.prev=7,l="".concat(c,"/route/v1/driving/").concat(r,",").concat(a,";").concat(s,",").concat(i,"?overview=false"),e.next=11,fetch(l);case 11:if(!(d=e.sent).ok){e.next=20;break}return e.next=15,d.json();case 15:if(!((u=e.sent).routes&&u.routes.length>0)){e.next=20;break}return _=u.routes[0].distance,A=_/1e3,e.abrupt("return",Math.round(A));case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(7),console.warn("OSRM API failed, falling back to Haversine math:",e.t0);case 25:return 6371,p=(x=function(e){return e*Math.PI/180})(i-a),E=x(s-r),P=Math.sin(p/2)*Math.sin(p/2)+Math.cos(x(a))*Math.cos(x(i))*Math.sin(E/2)*Math.sin(E/2),f=2*Math.atan2(Math.sqrt(P),Math.sqrt(1-P)),m=6371*f,e.abrupt("return",Math.round(1.3*m));case 33:case"end":return e.stop()}}),e,null,[[7,22]])})));return function(t,n){return e.apply(this,arguments)}}(),i=function(e,t,n,o){return e