1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4718],{76726:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/settings",function(){return t(9491)}])},91725:function(n,e,t){"use strict";t.d(e,{Z:function(){return b}});var r=t(14251),i=t(52875),o=t(44747),c=t(32692),a=t(85893),s=(t(67294),t(45697)),u=t.n(s),l=t(20648),d=t(38504),f=t(40944),h=t(21911),p=t(79466),m=t(14373);function x(){var n=(0,c.Z)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 16px;\n\n padding: 20px;\n\n border: 1px solid ",";\n border-radius: ",";\n\n text-decoration: none;\n\n color: ",";\n"]);return x=function(){return n},n}function Z(){var n=(0,c.Z)(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 8px;\n\n > * {\n text-align: left;\n }\n"]);return Z=function(){return n},n}var g=(0,l.ZP)(d.Z).withConfig({componentId:"sc-4954667d-0"})(x(),(function(n){return n.theme.colors.divider}),(function(n){return n.theme.borderRadius}),(function(n){return n.theme.colors.textPrimary})),v=(0,l.ZP)(d.Z).withConfig({componentId:"sc-4954667d-1"})(Z()),w=function(n){var e=n.title,t=n.subtitle,c=n.icon,s=n.iconType,u=n.href,l=n.onClick,d=n.disabled,p=(0,o.Z)(n,["title","subtitle","icon","iconType","href","onClick","disabled"]);return(0,a.jsxs)(g,(0,i.Z)((0,r.Z)({as:u?m.Z:"button",href:d?void 0:u,onClick:d?void 0:l},p),{children:[(0,a.jsx)(f.Z,{color:d?"disabled":"primary",name:c,type:s,size:"24px"}),(0,a.jsxs)(v,{color:d?"disabled":"primary",children:[(0,a.jsx)(h.Z,{type:"label-medium",children:e}),t&&(0,a.jsx)(h.Z,{type:"body-small",children:t})]}),(0,a.jsx)(f.Z,{color:d?"disabled":"primary",name:"chevron_right",size:"24px"})]}))},y=function(n){var e=n.disabled,t=n.disabledMessage,i=(0,o.Z)(n,["disabled","disabledMessage"]);return t&&e?(0,a.jsx)(p.Z,{bottom:!0,content:t,children:(0,a.jsx)(w,(0,r.Z)({disabled:!0},i))}):(0,a.jsx)(w,(0,r.Z)({disabled:e},i))};w.propTypes={title:u().string.isRequired,subtitle:u().string,icon:u().string.isRequired,iconType:u().string,href:u().string,onClick:u().func,disabled:u().bool},y.propTypes={disabled:u().bool,disabledMessage:u().string};var b=y},9491:function(n,e,t){"use strict";t.r(e),t.d(e,{default:function(){return Sn}});var r=t(34727),i=t(97582),o=t(85893),c=t(67294),a=t(20648),s=t(24844),u=t(41139),l=t(32692),d=t(38504),f=t(14251),h=t(52875),p=t(44747),m=t(22920),x=t(45697),Z=t.n(x),g=t(21911),v=t(9953),w=t(41041),y=t(59870);function b(){var n=(0,l.Z)(["\n display: flex;\n\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n\n padding: 0px 8px;\n min-height: 80vh;\n\n color: ",";\n"]);return b=function(){return n},n}function j(){var n=(0,l.Z)(["\n width: 100%;\n\n margin-bottom: 8px;\n padding: 4px;\n"]);return j=function(){return n},n}function k(){var n=(0,l.Z)(["\n padding: 12px;\n"]);return k=function(){return n},n}function A(){var n=(0,l.Z)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n"]);return A=function(){return n},n}var S=(0,a.ZP)(d.Z).withConfig({componentId:"sc-c7e5e0ad-0"})(b(),(function(n){return n.theme.colors.textPrimary})),P=(0,a.ZP)(d.Z).withConfig({componentId:"sc-c7e5e0ad-1"})(j()),C=(0,a.ZP)(d.Z).withConfig({componentId:"sc-c7e5e0ad-2"})(k()),B=(0,a.ZP)(d.Z).withConfig({componentId:"sc-c7e5e0ad-3"})(A()),T=function(n){var e=n.showBack,t=n.onBack,c=(0,p.Z)(n,["showBack","onBack"]),a=(0,y.Z)(),u=(0,s.Kw)((function(n){return n.me.data})),l=function(){var n=(0,r.Z)((function(){var n;return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,a.forgotPassword({email:u.email})];case 1:return e.sent(),m.Am.success("Password Reset Email sent"),[3,3];case 2:return n=e.sent(),console.error(n),m.Am.error("Failed to send forgot password email. Please contact Renti Supp
1ort."),[3,3];case 3:return[2]}}))}));return function(){return n.apply(this,arguments)}}();return(0,o.jsxs)(S,(0,h.Z)((0,f.Z)({},c),{children:[(0,o.jsxs)(P,{children:[(0,o.jsx)(g.Z,{type:"large-headline",mt:"16px",color:"textPrimary",children:"Update Password"}),(0,o.jsx)(v.Z,{mt:"8px"})]}),(0,o.jsxs)(C,{children:[(0,o.jsx)(g.Z,{type:"small-headline",color:"textPrimary",children:"Send Password Reset Email"}),(0,o.jsx)(g.Z,{mt:"8px",type:"body",color:"textPrimary",children:"\n To reset your password, we'll send you an email with instructions to ".concat(u.email," on how to set a new password for your account.\n ")}),(0,o.jsx)(g.Z,{mt:"16px",type:"body",color:"textPrimary",children:"It should arrive in your inbox within few minutes."})]}),(0,o.jsx)(v.Z,{mt:"8px"}),(0,o.jsxs)(B,{mt:"16px",children:[e&&(0,o.jsx)(w.Z,{buttonStyle:"text",onClick:t,iconLeft:"chevron_left",width:"150px",children:"Back"}),(0,o.jsx)(w.Z,{ml:"auto",onClick:l,children:"Send Email"})]})]}))};T.propTypes={showBack:Z().bool,onBack:Z().func};var _=T;function I(){var n=(0,l.Z)(["\n width: 100%;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n"]);return I=function(){return n},n}var E=(0,a.ZP)(d.Z).withConfig({componentId:"sc-be33eca4-0"})(I()),N=function(n){var e=n.showBack,t=n.onBack,c=(0,y.Z)(),a=(0,s.WX)((function(n){return n.me.fetchMe})),u=function(){var n=(0,r.Z)((function(){var n;return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,c.disable2FA()];case 1:return e.sent(),a(),m.Am.success("Two Factor Authentication has been disabled"),[3,3];case 2:return n=e.sent(),m.Am.error(n.message),[3,3];case 3:return[2]}}
1))}));return function(){return n.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.Z,{mt:"8px",type:"body",children:"Two Factor Authentication is currently enabled. You can disable it below."}),(0,o.jsx)(g.Z,{mt:"8px",type:"body",children:"We recommend leaving two factor authentication enabled to help keep your account secure."}),(0,o.jsxs)(E,{children:[e&&(0,o.jsx)(w.Z,{buttonStyle:"text",onClick:t,iconLeft:"chevron_left",width:"150px",mt:"16px",children:"Back"}),(0,o.jsx)(w.Z,{buttonStyle:"discourage",onClick:u,ml:"auto",children:"Disable 2FA"})]})]})};N.propTypes={showBack:Z().bool,onBack:Z().func};var F=N,M=t(96009),L=t(4860),R=t(31838),q=function(n){var e=n.showBack,t=n.onBack,a=(0,y.Z)(),u=(0,c.useState)(null),l=u[0],f=u[1],h=(0,s.WX)((function(n){return n.me.fetchMe}));(0,c.useEffect)((function(){p()}),[]);var p=function(){var n=(0,r.Z)((function(){var n,e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,a.setup2FA()];case 1:return n=t.sent(),f(n.qrCode),[3,3];case 2:return e=t.sent(),m.Am.error(e.message),[3,3];case 3:return[2]}}
1))}));return function(){return n.apply(this,arguments)}}(),x=function(){var n=(0,r.Z)((function(n){var e;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:if(6!==n.length)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,a.complete2FA(parseInt(n,10))];case 2:return t.sent(),h(),m.Am.success("Two Factor Authentication has been setup on your account. You will now be provided to enter an authenticator code when logging in."),[3,4];case 3:return e=t.sent(),m.Am.error(e.message),[3,4];case 4:return[2]}}))}));return function(e){return n.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(d.Z,{textAlign:"center",children:(0,o.jsx)(M.Z,{src:"".concat(R.Z.api.baseUrl,"/qr?url=").concat(l),height:"200px"})}),(0,o.jsx)(g.Z,{mt:"32px",type:"small-headline",children:"Setting up Two Factor Authentication is easy."}),(0,o.jsx)(g.Z,{mt:"8px",type:"body",children:'Simply install the "Google Authenticator" app on your iPhone or Android device and scan this QR code.'}),(0,o.jsx)(g.Z,{mt:"16px",type:"body",children:"Once scanned simply enter the 6 digit code that is generated on your device to finish the setup."}),(0,o.jsx)(v.Z,{mt:"8px"}),(0,o.jsx)(L.Z,{mt:"16px",length:6,onChangeValue:x}),e&&(0,o.jsx)(w.Z,{buttonStyle:"text",onClick:t,iconLeft:"chevron_left",width:"150px",mt:"16px",children:"Back"})]})};q.propTypes={showBack:Z().bool,onBack:Z().func};var V=q;function W(){var n=(0,l.Z)(["\n display: flex;\n\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n\n padding: 0px 8px;\n min-height: 80vh;\n\n color: ",";\n"]);return W=function(){return n},n}function O(){var n=(0,l.Z)(["\n width: 100%;\n\n margin-bottom: 8px;\n padding: 4px;\n"]);return O=function(){return n},n}function Y(){var n=(0,l.Z)(["\n display: flex;\n\n flex-direction: column;\n align-items: flex-start;\n padding: 12px;\n"]);return Y=function(){return n},n}var z=(0,a.ZP)(d.Z).withConfig({componentId:"sc-dd9be4aa-0"})(W(),(function(n){return n.theme.colors.textPrimary})),X=(0,a.ZP)(d.Z).withConfig({componentId:"sc-dd9be4aa-1"})(O()),H=(0,a.ZP)(d.Z).withConfig({componentId:"sc-dd9be4aa-2"})(Y()),K=function(n){var e=n.showBack,t=n.onBack,r=(0,p.Z)(n,["showBack","onBack"]),i=(0,s.Kw)((function(n){return n.me.data}));return(0,o.jsxs)(z,(0,h.Z)((0,f.Z)({},r),{children:[(0,o.jsxs)(X,{children:[(0,o.jsx)(g.Z,{type:"large-headline",mt:"16px",children:"Two Factor Authentication Setup"}),(0,o.jsx)(v.Z,{mt:"8px"})]}),(0,o.jsx)(H,{children:i.has2FAEnabled?(0,o.jsx)(F,{showBack:e,onBack:t}):(0,o.jsx)(V,{showBack:e,onBack:t})})]}))};K.propTypes={showBack:Z().bool,onBack:Z().func};var U=K,D=t(6453),G=t(74865),Q=t.n(G),J=t(34423);function $(){var n=(0,l.Z)(["\n display: flex;\n\n flex-direction: column;\n align-items: flex-start;\n width: 100%;\n\n padding: 0px 8px;\n min-height: 80vh;\n\n color: ",";\n"]);return $=function(){return n},n}function nn(){var n=(0,l.Z)(["\n width: 100%;\n\n margin-bottom: 8px;\n padding: 4px;\n"]);return nn=function(){return n},n}function en(){var n=(0,l.Z)(["\n padding: 12px;\n width: 100%;\n"]);return en=function(){return n},n}function tn(){var n=(0,l.Z)(["\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n"]);return tn=function(){return n},n}var rn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-6495de68-0"})($(),(function(n){return n.theme.colors.textPrimary})),on=(0,a.ZP)(d.Z).withConfig({componentId:"sc-6495de68-1"})(nn()),cn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-6495de68-2"})(en()),an=(0,a.ZP)(d.Z).withConfig({componentId:"sc-6495de68-3"})(tn()),sn=function(n){var e=(0,D.Z)({},n),t=(0,y.Z)(),a=(0,s.Kw)((function(n){return n.me.data})),u=(0,s.WX)((function(n){return n.me.fetchMe})),l=(0,c.useState)(a.allowSMSNotifications),d=l[0],p=l[1],x=(0,c.useState)(a.profile.overEighteen),Z=x[0],b=x[1],j=(0,c.useState)(!1),k=j[0],A=j[1],S=function(){var n=(0,r.Z)((function(){var n;return(0,i.__generator)(this,(function(e){switch(e.label){case 0:Q().start(),e.label=1;case 1:return e.trys.push([1,4,5,6]),[4,t.editMe({allowSMSNotifications:d,overEighteen:Z})];case 2:return e.sent(),[4,u()];case 3:return e.sent(),A(!1),m.Am.success("Preferences updated!"),[3,6];case 4:return n=e.sent(),alert(n),[3,6];case 5:return Q().done(),[7];case 6:return[2]}}
1))}));return function(){return n.apply(this,arguments)}}();return(0,o.jsxs)(rn,(0,h.Z)((0,f.Z)({},e),{children:[(0,o.jsxs)(on,{children:[(0,o.jsx)(g.Z,{type:"large-headline",mt:"16px",color:"textPrimary",children:"SMS Notifications"}),(0,o.jsx)(v.Z,{mt:"8px"})]}),(0,o.jsxs)(cn,{children:[(0,o.jsx)(J.Z,{width:"100%",type:"switch",label:"Receiving SMS Notifications",subLabel:"Would you like to receive SMS Notifications",value:d,required:!0,toggle:!0,onChangeValue:function(n){A(!0),p(n)}}),(0,o.jsx)(J.Z,{width:"100%",type:"switch",label:"Are you over 18?",subLabel:"You are asked this question to receive SMS Notifications",value:Z,required:!0,toggle:!0,onChangeValue:function(n){A(!0),b(n)}})]}),(0,o.jsx)(an,{mt:"16px",children:(0,o.jsx)(w.Z,{ml:"auto",onClick:S,disabled:!(k&&void 0!==d&&void 0!==Z),children:"Save"})})]}))};sn.propTypes={showBack:Z().bool,onBack:Z().func};var un=sn,ln=t(91725),dn=t(36411);function fn(){var n=(0,l.Z)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n"]);return fn=function(){return n},n}function hn(){var n=(0,l.Z)(["\n width: 100%;\n\n display: flex;\n flex-direction: row;\n align-items: stretch;\n\n margin-top: 16px;\n"]);return hn=function(){return n},n}function pn(){var n=(0,l.Z)(["\n width: 100%;\n flex: 1;\n min-height: 80vh;\n\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 16px;\n\n padding-right: 16px;\n padding-left: 16px;\n\n @media (max-width: 769px) {\n width: 100%;\n }\n"]);return pn=function(){return n},n}function mn(){var n=(0,l.Z)(["\n width: 100%;\n flex: 1;\n min-height: 80vh;\n\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n\n padding-right: 16px;\n padding-left: 16px;\n"]);return mn=function(){return n},n}var xn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-528695ef-0"})(fn()),Zn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-528695ef-1"})(hn()),gn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-528695ef-2"})(pn()),vn=(0,a.ZP)(d.Z).withConfig({componentId:"sc-528695ef-3"})(mn()),wn=[{key:"1",icon:"lock",iconType:"outlined",label:"Update Password",subLabel:"You'll receive an email with password reset instructions",component:_},{key:"3",icon:"privacy_tip",iconType:"outlined",label:"Two Factor Authentication",subLabel:"Manage Two Factor Authentication",component:U},{key:"4",icon:"chat",iconType:"outlined",label:"SMS Notifications",subLabel:"Manage SMS Notifications",component:un}],yn=function(){var n=(0,c.useState)(null),e=n[0],t=n[1],r=(0,dn.Z)("sm");return(0,o.jsx)(xn,{children:(0,o.jsxs)(Zn,{children:[(!r||!e)&&(0,o.jsx)(gn,{children:wn.map((function(n){return(0,o.jsx)(ln.Z,{title:n.label,subtitle:n.subLabel,icon:n.icon,iconType:n.iconType,onClick:function(){t(n)}},n.key)}))}),(!r||e)&&(0,o.jsx)(vn,{children:(null===e||void 0===e?void 0:e.component)&&(0,o.jsx)(e.component,{showBack:r,onBack:function(){return t(null)}})})]})})},bn=t(5601),jn=t(19700),kn=t(97892),An=function(){var n=(0,s.Kw)((function(n){return n.me}));return(0,o.jsx)(a.f6,{theme:(0,jn.Z)(n,!0),children:(0,o.jsxs)(bn.Z,{title:"Account Settings",children:[(0,o.jsx)(u.Z,{items:[{label:"Home",link:"/"},{label:"Settings"}],mb:"16px"}),(0,o.jsx)(yn,{})]})})};An.getInitialProps=function(){var n=(0,r.Z)((function(n){return(0,i.__generator)(this,(function(e){switch(e.label){case 0:return[4,(0,kn.ZP)(n,{requiresAuth:!0,privateLandlord:kn.lp.BOTH})];case 1:return e.sent(),[2]}}))}));return function(e){return n.apply(this,arguments)}}();var Sn=An},19700:function(n,e,t){"use strict";var r=t(14018),i=t(28644),o=t(56746),c=t(13923);e.Z=function(n,e){return n.data.agency?n.data.agency.privateLandlord?e?c.Z:o.Z:e?i.Z:r.Z:"trademe"===n.data.theme||"mixed"===n.data.theme?e?c.Z:o.Z:e?i.Z:r.Z}},97892:function(n,e,t){"use strict";t.d(e,{VC:function(){return d},lp:function(){return l}});var r=t(34727),i=t(97582),o=t(49704),c=t.n(o),a=t(80325),s=t(99664),u=t(49736),l={NEVER:0,ALWAYS:1,BOTH:2},d={NEVER:0,ALWAYS:1,BOTH:2};function f(){return f=(0,r.Z)((function(n){var e,t,r,o,f,h,p,m,x,Z,g,v,w,y,b,j,k,A,S,P,C,B,T,_,I,E,N,F,M,L,R,q=arguments;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return e=q.length>1&&void 0!==q[1]?q[1]:{},r=e.requiresAuth,o=e.requiresNoAuth,f=e.requiresOwner,h=void 0!==f&&f,p=e.authRedirectTo,m=void 0===p?"/login?redirectTo=".concat(n.asPath):p,x=e.redirectTo,Z=e.fetch
1Me,g=void 0===Z||Z,v=e.fetchNotificationsCount,w=void 0===v||v,y=e.requiresAdmin,b=void 0!==y&&y,j=e.requiresAdminOrImpersonated,k=void 0!==j&&j,A=e.privateLandlord,S=void 0===A?l.NEVER:A,P=e.allowFrozen,C=void 0===P?d.NEVER:P,B=n.store.getState().me,T=n.query.referrer,_=m,T&&(_=m.includes("?")?"".concat(m,"&referrer=").concat(T):"".concat(m,"?referrer=").concat(T)),I=B.token,E=B.referrer,N=B.dismissInstall,(I=(0,a.ej)("token"))&&(n.store.getActions().me.setToken(I),n.formStore&&n.formStore.dispatch((0,u.o)(I))),(E=(0,a.ej)("referrer")||T)&&n.store.getActions().me.setReferrer(E),(N=(0,a.ej)("dismissInstall"))&&n.store.getActions().me.setDismissInstall(N),g?!I||B.isFetched?[3,2]:[4,n.store.getActions().me.fetchMe()]:[3,2];case 1:i.sent(),i.label=2;case 2:return(!b||!I||(F=c().decode(I))&&F.isAdmin)&&(!k||!I||(M=c().decode(I))&&(M.impersonatedBy||M.isAdmin))?w&&I?[4,n.store.getActions().me.notificationsCount.fetchNotificationsCount()]:[3,4]:((0,s.Z)("/",n),[2]);case 3:i.sent(),i.label=4;case 4:return B=n.store.getState().me,x?((0,s.Z)(x,n),[2]):(L=null===(t=B.data)||void 0===t?void 0:t.agency,r&&!I||o&&I?((0,s.Z)(_,n),[2]):C===d.NEVER&&B.data.isFrozen?((0,s.Z)("/account/frozen",n),[2]):C!==d.ALWAYS||B.data.isFrozen?S===l.NEVER&&(null===L||void 0===L?void 0:L.privateLandlord)?((0,s.Z)("/listings",n),[2]):S!==l.ALWAYS||(null===L||void 0===L?void 0:L.privateLandlord)?(h&&(L&&L.owners.find((function(n){return n.toString()===B.data._id.toString()}))||(R=c().decode(I))&&(R.impersonatedBy||R.isAdmin)||(0,s.Z)("/",n)),[2]):((0,s.Z)(L?"/agency/dashboard":"/trademe/private-landlord/activate",n),[2]):((0,s.Z)("/account",n),[2]))}}))})),f.apply(this,arguments)}e.ZP=function(n){return f.apply(this,arguments)}}},function(n){n.O(0,[8153,4032,5601,9774,2888,179],(function(){return e=76726,n(n.s=e);var e}));var e=n.O();_N_E=e}]);
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.