1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3459],{5369:function(e,r,s){"use strict";s.r(r),s.d(r,{__N_SSP:function(){return j}});var t=s(85893),n=s(809),a=s.n(n),i=s(92447),c=s(26685),l=s(92002),d=s(37283),o=s(27216),m=s(25675),u=s(41664),x=s(11163),h=s(67294),f=s(42283),g=s(789),p=s(21609),j=!0;r.default=function(){var e=(0,f.cI)(),r=e.register,s=e.handleSubmit,n=e.formState.errors,j=(0,p.Z)((function(e){return e.account})),N=(0,x.useRouter)(),v="string"===typeof N.query.from&&"verification"===N.query.from,y="string"===typeof N.query.from&&"checkout"===N.query.from,w=(0,h.useState)([]),b=w[0],_=w[1],k=(0,h.useState)(!1),E=k[0],q=k[1],O=(0,p.Z)((function(e){return e.setAccount})),S=(0,h.useCallback)(function(){var e=(0,i.Z)(a().mark((function e(r){var s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _([]),q(!0),e.next=4,(new g.Z).login(r.username,r.password);case 4:s=e.sent,q(!1),s.hasError()?_(s.error.errors):(O(s.getJsonData()),N.query.from&&"verification"!==N.query.from?N.push("/".concat(N.query.from)):N.push("/"));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[O,N]);return(0,h.useEffect)((function(){j.id>0&&N.replace("/")}),[j,N]),(0,t.jsx)("div",{className:"container mx-auto",children:(0,t.jsxs)("div",{className:"grid ".concat(y?"grid-cols-1 sm:grid-cols-2":"grid-cols-1"," sm:gap-32 sm:my-16"),children:[(0,t.jsx)("div",{className:"border rounded-md border-gray-300 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:(0,t.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,t.jsxs)("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:[(0,t.jsx)("h2",{className:"mb-6 text-center text-3xl font-extrabold text-gray-900",children:"Login"}),(0,t.jsxs)("form",{className:"space-y-6",onSubmit:s(S),children:[b.length>0?(0,t.jsx)(o.Z,{heading:"Login Error",items:b,translate_prefix:"ecomaccount:form.error"}):null,0===b.length&&v&&!E?(0,t.jsx)(o.Z,{items:["verification_success"],theme:"success",translate_prefix:"ecomaccount:form.success"}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"phone",className:"block text-sm font-medium text-gray-700",children:"Phone number"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(d.Z,{prefix:(0,t.jsxs)("span",{className:"inline-flex w-36 items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm",children:[(0,t.jsx)(m.default,{src:"/images/us.png",width:"16",height:"11",alt:"us"}),(0,t.jsx)("strong",{className:"pl-1",children:" US:(+1)"})]}),doRegister:function(){return r("username",{required:!0})},error:{field:n.username,messages:{required:"ecomaccount:form.error.error_login_account_required"}}})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700",children:"Password"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(d.Z,{doRegister:function(){return r("password",{required:!0})},type:"password",error:{field:n.password,messages:{required:"ecomaccount:form.error.error_login_password_required"}}})})]}),(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(u.default,{href:"/forgotpassword",children:(0,t.jsx)("a",{className:"font-medium text-indigo-600 hover:text-indigo-500",children:"Forgot your password?"})})})}),(0,t.jsx)("div",{children:(0,t.jsx)(l.Z,{loading:E,block:!0,children:"Sign in"})})]}),(0,t.jsxs)("div",{className:"text-center pt-4",children:["DO NOT HAVE ACCOUNT ?",(0,t.jsx)(u.default,{href:"/register",children:(0,t.jsx)("a",{className:"text-red-500 pl-2",children:"REGISTER NOW"})})]}),(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,t.jsx)("div",{className:"w-full border-t border-gray-300"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,t.jsx)("span",{className:"px-2 bg-white text-gray-500",children:"OR"})})]}),(0,t.jsx)("div",{className:"mt-6 grid grid-cols-1 gap-3",children:(0,t.jsx)("div",{children:(0,t.jsx)(c.Z,{})})})]})]})})}),y?(0,t.jsx)("div",{className:"border min-h-full rounded-md border-gray-300 flex flex-col justify-start py-12 sm:px-6 lg:px-8",children:(0,t.jsx)("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:(0,t.jsxs)("div",{className:"bg-white py-8 px-4 shadow sm:rounded-lg sm:px-10",children:[(0,t.jsx)("h2",{className:"mb-6 text-center text-3xl font-extrabold text-gray-900",children:"New customer"}),(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("p",{className:"text-center font-thin my-10",children:"Checkout as a guest and you will have an opportunity to create an account when you are finished"}),(0,t.jsx)("div",{children:(0,t.jsx)(u.default,{href:"/checkout?guest=true",children:(0,t.jsx)("a",{children:(0,t.jsx)(l.Z,{loading:E,block:!0,children:"Checkout as a Guest"})})})})]}),(0,t.jsxs)("div",{className:"text-center pt-4",children:["DO NOT HAVE ACCOUNT ?",(0,t.jsx)(u.default,{href:"/register",children:(0,t.jsx)("a",{className:"text-red-500 pl-2",children:"REGISTER NOW"})})]})]})})}):null]})})}},87237:function(e,r,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return s(5369)}])}},function(e){e.O(0,[2763,3443,129,8764,3198,4123,8077,9774,2888,179],(function(){return r=87237,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.