(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4881],{20015:function(e,t,n){"use strict";var s=n(25675),r=n.n(s),a=n(67294),i=n(85893);t.Z=function(e){var t=e.value,n=e.disabled,s=e.name,o=e.styles,c=e.placeholder,l=e.label,d=e.type,u=e.errors,f=e.touched,p=e.icon,h=e.onChange,m=e.onBlur,x=(0,a.useState)("password"),w=x[0],v=x[1];return(0,i.jsxs)(i.Fragment,{children:[l&&(0,i.jsx)("label",{className:"mb-3 font-semibold text-base",htmlFor:s,children:l}),(0,i.jsxs)("div",{className:"w-full flex justify-start items-center relative",children:[(0,i.jsx)("input",{id:s,name:s,value:t,disabled:n,placeholder:c,type:d,onChange:h,onBlur:m,className:"rounded-lg border-solid border border-[#E8E8E8] p-3 w-full ".concat(o," ").concat(u&&f&&"border-accent-error"," focus:outline-0")}),p,"password"===d&&(0,i.jsx)("div",{role:"presentation",className:"absolute right-5 bottom-4",onClick:function(){return v("password"===w?"text":"password")},children:(0,i.jsx)(r(),{src:"/icons/eye.svg",alt:"show",width:19,height:19})})]}),u&&f&&(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"text-accent-error",children:"string"==typeof u&&u})})]})}},69829:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var s=n(67294),r=n(17988),a=n(63163),i=n(11163),o=n(94184),c=n.n(o),l=n(5152),d=n.n(l),u=n(57342),f=n(25675),p=n.n(f),h=n(85893);function m(e){var t=e.hideBannerHandler;return(0,h.jsxs)("div",{className:"p-4 w-full flex items-center justify-between bg-neutral-100 md:hidden",children:[(0,h.jsxs)("div",{className:"flex",children:[(0,h.jsx)("button",{onClick:function(){t()},children:(0,h.jsx)(p(),{src:"/icons/x.svg",alt:"close",width:20,height:20,className:"opacity-50 mr-2"})}),(0,h.jsx)(p(),{src:"/icons/drivegate-app-logo.svg",alt:"logo",width:48,height:48,className:"rounded-lg"}),(0,h.jsxs)("div",{className:"flex flex-col ml-2 justify-between",children:[(0,h.jsx)("p",{className:"font-bold text-neutral-500",children:"Drivegate"}),(0,h.jsx)("p",{className:"text-[12px] font-medium text-neutral-400",children:"Book & Track your Driving Lessons"})]})]}),(0,h.jsx)("a",{href:"https://link.drivegate.com/link/app",className:"px-4 py-2 rounded-lg bg-neutral-500 text-white text-sm font-bold",children:"OPEN"})]})}var x=n(50029),w=n(64687),v=n.n(w);function b(){return(b=(0,x.Z)(v().mark(function e(){return v().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(1198).then(n.bind(n,1198));case 2:window.rudderanalytics=e.sent,rudderanalytics.load("2UAKBBENw8HQVpCWsnPlGhyQpKL","https://inbusineshuogf.dataplane.rudderstack.com",{integrations:{All:!0}}),rudderanalytics.ready(function(){console.log("All set!")});case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}var j=n(32138),g=n(37871),y=n(31955);function N(){var e=(0,g.$G)().t,t=(0,s.useState)(!1),n=t[0],r=t[1];if((0,s.useEffect)(function(){y.Z.get("cookieConsent")||r(!0)},[]),!n)return null;var a=function(){r(!1),y.Z.set("cookieConsent","accepted",{expires:365})};return(0,h.jsx)("div",{className:"fixed bottom-[-110px] md:bottom-[-60px] lg:bottom-[-50px] left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-[100] w-full md:w-fit",children:(0,h.jsx)("div",{className:"bg-white p-4 md:p-6 w-full lg:w-[878px] shadow-boxShadow animate__animated animate__fadeInUp",children:(0,h.jsxs)("div",{className:"flex flex-col md:flex-row w-full items-center gap-x-10 animate__animated animate__fadeInUp animate__slow",children:[(0,h.jsxs)("div",{className:"flex flex-col",children:[(0,h.jsxs)("div",{className:"flex gap-x-2 mb-2",children:[(0,h.jsx)("p",{className:"font-bold",children:e("yourPrivacy")}),(0,h.jsx)(p(),{src:"/icons/lock.svg",width:24,height:24,alt:"lock"})]}),(0,h.jsx)("div",{className:"text-neutral-400 text-sm",dangerouslySetInnerHTML:{__html:e("privacyPolicyMessage")}})]}),(0,h.jsx)(j.Z,{buttonText:"OK",className:"py-3 px-[64px] h-fit w-full md:w-fit mt-4 md:mt-0",onClick:function(){a()}})]})})})}var P=n(7802),k=n(22373),_=n(86501),C=n(94442),E=n(82376),S=n(41664),O=n.n(S),Z=d()(function(){return n.e(4755).then(n.bind(n,4755))},{loading:function(){return(0,h.jsx)("p",{children:"Loading..."})},loadableGenerated:{webpack:function(){return[4755]}}}),T=d()(function(){return n.e(3455).then(n.bind(n,23455))},{loading:function(){return(0,h.jsx)("p",{children:"Loading..."})},loadableGenerated:{webpack:function(){return[23455]}}}),A=function(e){var t,n=e.children,o=e.wrapperClassName,l=e.contentClassName,d=(0,s.useState)(!1),f=d[0],x=d[1],w=(0,s.useState)(!1),v=w[0],j=w[1],g=(0,C.h)().user,y=(0,a.Z)("(min-width: 768px)"),S=(0,s.useMemo)(function(){return{showSidebar:f,setShowSidebar:x}},[f]),A=(0,i.useRouter)(),R=(0,s.useState)(!1),I=R[0],U=R[1];(0,s.useEffect)(function(){try{var e=(0,P.KL)(k.l2);return(0,P.ps)(e,function(e){var t,n;if(!I&&(t=e.data.type,n=A.asPath.includes("/instructors")?"INSTRUCTOR":"STUDENT","STUDENT"===n?!!t.includes("FOR_STUDENT")||"NEW_MESSAGE"===t:!!t.includes("FOR_INSTRUCTOR")||"NEW_MESSAGE"===t)){var s=e.data,r=s.type,a=s.title,i=s.content;new Audio("/sounds/notification.mp3").play(),_.ZP.custom(function(){return(0,h.jsxs)("div",{className:c()("py-2 px-3 shadow-sm flex items-start md:w-[350px] justify-between border rounded-lg cursor-pointer bg-white"),onClick:function(){return _.ZP.dismiss()},children:[(0,h.jsxs)("div",{className:"flex items-start",children:[(0,h.jsx)(p(),{src:"NEW_MESSAGE"===r?"/icons/sms-notification.svg":"/icons/info-circle-orange.svg",alt:"",width:24,height:24}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"font-semibold ml-2.5",children:a||r}),(0,h.jsx)("p",{className:"ml-2.5 text-neutral-400 whitespace-wrap break-words",children:i})]})]}),(0,h.jsx)(p(),{src:"/icons/x.svg",alt:"exit",onClick:function(){return _.ZP.dismiss()},width:24,height:24,className:"ml-10"})]})},{duration:5e3,position:"top-right"}),U(!0)}}),function(){return U(!1)}}catch(e){console.error(e)}},[P.ps,I]),(0,s.useEffect)(function(){!function(){b.apply(this,arguments)}()},[]),(0,s.useEffect)(function(){y&&!f?x(!0):!y&&f&&x(!1)},[y]),(0,s.useEffect)(function(){y||x(!1)},[A.asPath]);var D=!("/"===A.asPath||A.asPath.startsWith("/students")||A.asPath.startsWith("/instructor")||A.asPath.startsWith("/chats")||A.asPath.startsWith("/info")||A.asPath.startsWith("/stickers"));return(0,s.useEffect)(function(){if(window){var e=localStorage.getItem("showAppBanner");e?e&&"false"===e?j(!1):j(!0):-1!==window.navigator.userAgent.toLowerCase().indexOf("safari")?j(!1):j(!0)}},[]),(0,h.jsxs)(r.En.Provider,{value:S,children:[(0,h.jsx)(_.x7,{}),(0,h.jsxs)("div",{className:c()("min-h-screen bg-[#FAFAFA] flex flex-col justify-between relative",o),children:[(null==g||null===(t=g.roles)||void 0===t?void 0:t[0].name)===E.i.ADMIN&&(0,h.jsxs)("div",{className:"bg-brand-500 text-white font-semibold text-center fixed top-0 w-full z-[10000]",children:["You're logged in as admin. View"," ",(0,h.jsx)(O(),{href:"/admin",className:"underline",children:"admin panel"})]}),(0,h.jsxs)("div",{className:"flex flex-col",children:[(0,h.jsx)("div",{className:c()("pt-0",A.asPath.startsWith("/instructor/")&&"hidden md:block"),children:(0,h.jsx)(u.Z,{})}),v&&(0,h.jsx)("div",{className:"animate__animated animate__fadeIn",children:(0,h.jsx)(m,{hideBannerHandler:function(){window&&(localStorage.setItem("showAppBanner","false"),j(!1))}})}),(0,h.jsx)("div",{className:c()("pt-0 block my-6 pt-4",l,{"my-0":f&&!y||"/"===A.pathname||"/filter"}),children:(0,h.jsx)("div",{className:c()({"z-10 max-w-[1680px] mx-auto px-2 md:px-4 lg:px-8 2xl:px-[120px] mb-10":A.asPath.startsWith("/students")||A.asPath.startsWith("/chats")||A.asPath.startsWith("/notifications")||A.asPath.startsWith("/instructors/")||"/instructor/reservation"===A.pathname}),children:n})})]}),(0,h.jsx)(N,{}),D?(0,h.jsx)(T,{}):(0,h.jsx)(Z,{})]})]})}},22423:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return j}});var s=n(59499),r=n(50029),a=n(64687),i=n.n(a),o=n(69829),c=n(37871),l=n(24646),d=n(20015),u=n(67294),f=n(32138),p=n(11163),h=n(17702),m=n(8875),x=n(85893);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach(function(t){(0,s.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var b=function(){var e,t,n=(0,c.$G)().t,s=(0,p.useRouter)(),a=(0,u.useState)(!1),o=a[0],w=a[1],b=(0,u.useState)({password:"",confirmPassword:"",error:null}),j=b[0],g=b[1],y=(null===(t=s.query.oobCode)||void 0===t?void 0:t.toString())||"",N=j.password===j.confirmPassword&&j.password.length>6,P=(e=(0,r.Z)(i().mark(function e(){var t;return i().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=(0,h.v0)(),e.next=4,(0,h.TX)(t,y);case 4:if(e.sent){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,(0,h.LG)(t,y,j.password);case 11:w(!0);case 12:e.next=19;break;case 14:e.prev=14,e.t0=e.catch(0),w(!0),g(v(v({},j),{},{error:e.t0.message})),console.error(e.t0);case 19:case"end":return e.stop()}},e,null,[[0,14]])})),function(){return e.apply(this,arguments)});return(0,x.jsxs)("div",{className:"flex w-full justify-center",children:[(0,x.jsx)(l.Z,{title:n("resetPassword")+" - Drivegate"}),(0,x.jsxs)(m.Z,{open:o,onClose:function(){return w(!1)},modalTitle:n("passwordUpdate"),children:[(0,x.jsx)("p",{children:j.error?j.error:n("successfullyResetPassword")}),(0,x.jsx)(f.Z,{onClick:function(){return s.push("/")},className:"w-full mt-6",children:n("goBack")})]}),(0,x.jsxs)("div",{className:"border border-neutral-200 rounded-lg flex items-center justify-center p-6 flex-col bg-white my-6 w-full md:w-[600px]",children:[(0,x.jsx)("p",{className:"text-[24px] font-semibold",children:n("resetYourPassword")}),(0,x.jsx)("p",{className:"text-neutral-400 font-medium text-center mt-2",children:n("passwordResetTip")}),(0,x.jsx)("div",{className:"w-full my-6",children:(0,x.jsx)(d.Z,{value:j.password,type:"password",onChange:function(e){g(v(v({},j),{},{password:e.target.value}))},styles:"w-full",placeholder:n("enterYourPassword"),label:n("password")})}),(0,x.jsx)("div",{className:"w-full",children:(0,x.jsx)(d.Z,{value:j.confirmPassword,type:"password",onChange:function(e){g(v(v({},j),{},{confirmPassword:e.target.value}))},styles:"w-full",placeholder:n("confirmYourPassword"),label:n("passwordConfirm")})}),(0,x.jsx)("div",{className:"mt-6 w-full",children:(0,x.jsx)(f.Z,{variant:f.W.PRIMARY,disabled:!N,onClick:function(){return P()},styles:"w-full",children:n("resetPassword")})})]})]})},j=!0;t.default=b,b.getLayout=function(e){return(0,x.jsx)(o.Z,{children:e})}},35626:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/reset-password",function(){return n(22423)}])},31955:function(e,t,n){"use strict";/*! js-cookie v3.0.5 | MIT */function s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}n.d(t,{Z:function(){return r}});var r=function e(t,n){function r(e,r,a){if("undefined"!=typeof document){"number"==typeof(a=s({},n,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var o in a)a[o]&&(i+="; "+o,!0!==a[o]&&(i+="="+a[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],s={},r=0;r<n.length;r++){var a=n[r].split("="),i=a.slice(1).join("=");try{var o=decodeURIComponent(a[0]);if(s[o]=t.read(i,o),e===o)break}catch(e){}}return e?s[e]:s}},remove:function(e,t){r(e,"",s({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,s({},this.attributes,t))},withConverter:function(t){return e(s({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}},function(e){e.O(0,[3590,4885,2336,5675,558,1664,7382,6211,4460,7342,2888,9774,179],function(){return e(e.s=35626)}),_N_E=e.O()}]);