PageSourceSearch

https://centa.org/_next/static/chunks/pages/centa-for-teachers/reset-password-32e8226aaa47a30f.js

js centa.org collected 2026-10-01 12:08:13 UTC 12,979 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6847,2215],{53219:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(91373);let o=(0,n.Z)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},55485:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/centa-for-teachers/reset-password",function(){return r(30787)}])},97498:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PrefetchKind:function(){return r},ACTION_REFRESH:function(){return o},ACTION_NAVIGATE:function(){return a},ACTION_RESTORE:function(){return s},ACTION_SERVER_PATCH:function(){return u},ACTION_PREFETCH:function(){return l},ACTION_FAST_REFRESH:function(){return i},ACTION_SERVER_ACTION:function(){return c}});let o="refresh",a="navigate",s="restore",u="server-patch",l="prefetch",i="fast-refresh",c="server-action";(n=r||(r={})).AUTO="auto",n.FULL="full",n.TEMPORARY="temporary",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10030:function(e,t,r){"use strict";function getDomainLocale(e,t,r,n){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return getDomainLocale}}),r(22866),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65170:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return v}});let n=r(38754),o=n._(r(67294)),a=r(74450),s=r(92227),u=r(64364),l=r(10109),i=r(73607),c=r(11823),d=r(89031),f=r(40920),p=r(10030),h=r(77192),m=r(97498),b=new Set;function prefetch(e,t,r,n,o,a){if(!a&&!(0,s.isLocalURL)(t))return;if(!n.bypassPrefetchedCheck){let o=void 0!==n.locale?n.locale:"locale"in e?e.locale:void 0,a=t+"%"+r+"%"+o;if(b.has(a))return;b.add(a)}let u=a?e.prefetch(t,o):e.prefetch(t,r,n);Promise.resolve(u).catch(e=>{})}function formatStringOrUrl(e){return"string"==typeof e?e:(0,u.formatUrl)(e)}let g=o.default.forwardRef(function(e,t){let r,n;let{href:u,as:b,children:g,prefetch:v=null,passHref:y,replace:x,shallow:_,scroll:w,locale:j,onClick:N,onMouseEnter:E,onTouchStart:O,legacyBehavior:C=!1,...P}=e;r=g,C&&("string"==typeof r||"number"==typeof r)&&(r=o.default.createElement("a",null,r));let A=o.default.useContext(c.RouterContext),S=o.default.useContext(d.AppRouterContext),R=null!=A?A:S,T=!A,k=!1!==v,I=null===v?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,{href:M,as:L}=o.default.useMemo(()=>{if(!A){let e=formatStringOrUrl(u);return{href:e,as:b?formatStringOrUrl(b):e}}let[e,t]=(0,a.resolveHref)(A,u,!0);return{href:e,as:b?(0,a.resolveHref)(A,b):t||e}},[A,u,b]),U=o.default.useRef(M),D=o.default.useRef(L);C&&(n=o.default.Children.only(r));let z=C?n&&"object"==typeof n&&n.ref:t,[F,K,B]=(0,f.useIntersection)({rootMargin:"200px"}),H=o.default.useCallback(e=>{(D.current!==L||U.current!==M)&&(B(),D.current=L,U.current=M),F(e),z&&("function"==typeof z?z(e):"object"==typeof z&&(z.current=e))},[L,z,M,B,F]);o.default.useEffect(()=>{R&&K&&k&&prefetch(R,M,L,{locale:j},{kind:I},T)},[L,M,K,j,k,null==A?void 0:A.locale,R,T,I]);let V={ref:H,onClick(e){C||"function"!=typeof N||N(e),C&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),R&&!e.defaultPrevented&&function(e,t,r,n,a,u,l,i,c,d){let{nodeName:f}=e.currentTarget,p="A"===f.toUpperCase();if(p&&(function(e){let t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!c&&!(0,s.isLocalURL)(r)))return;e.preventDefault();let navigate=()=>{let e=null==l||l;"beforePopState"in t?t[a?"replace":"push"](r,n,{shallow:u,locale:i,scroll:e}):t[a?"replace":"push"](n||r,{forceOptimisticNavigation:!d,scroll:e})};c?o.default.startTransition(navigate):navigate()}(e,R,M,L,x,_,w,j,T,k)},onMouseEnter(e){C||"function"!=typeof E||E(e),C&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),R&&(k||!T)&&prefetch(R,M,L,{locale:j,priority:!0,bypassPrefetchedCheck:!0},{kind:I},T)},onTouchStart(e){C||"function"!=typeof O||O(e),C&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),R&&(k||!T)&&prefetch(R,M,L,{locale:j,priority:!0,bypassPrefetchedCheck:!0},{kind:I},T)}};if((0,l.isAbsoluteUrl)(L))V.href=L;else if(!C||y||"a"===n.type&&!("href"in n.props)){let e=void 0!==j?j:null==A?void 0:A.locale,t=(null==A?void 0:A.isLocaleDomain)&&(0,p.getDomainLocale)(L,e,null==A?void 0:A.locales,null==A?void 0:A.domainLocales);V.href=t||(0,h.addBasePath)((0,i.addLocale)(L,e,null==A?void 0:A.defaultLocale))}return C?o.default.cloneElement(n,V):o.default.createElement("a",{...P,...V},r)}),v=g;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
1dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40920:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return useIntersection}});let n=r(67294),o=r(63436),a="function"==typeof IntersectionObserver,s=new Map,u=[];function useIntersection(e){let{rootRef:t,rootMargin:r,disabled:l}=e,i=l||!a,[c,d]=(0,n.useState)(!1),f=(0,n.useRef)(null),p=(0,n.useCallback)(e=>{f.current=e},[]);(0,n.useEffect)(()=>{if(a){if(i||c)return;let e=f.current;if(e&&e.tagName){let n=function(e,t,r){let{id:n,observer:o,elements:a}=function(e){let t;let r={root:e.root||null,margin:e.rootMargin||""},n=u.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=s.get(n)))return t;let o=new Map,a=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e);return t={id:r,observer:a,elements:o},u.push(r),s.set(r,t),t}(r);return a.set(e,t),o.observe(e),function(){if(a.delete(e),o.unobserve(e),0===a.size){o.disconnect(),s.delete(n);let e=u.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&u.splice(e,1)}}}(e,e=>e&&d(e),{root:null==t?void 0:t.current,rootMargin:r});return n}}else if(!c){let e=(0,o.requestIdleCallback)(()=>d(!0));return()=>(0,o.cancelIdleCallback)(e)}},[i,r,t,c,f.current]);let h=(0,n.useCallback)(()=>{d(!1)},[]);return[p,c,h]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94185:function(e,t,r){"use strict";r.d(t,{O:function(){return u}});var n=r(53833),o=r(83454);let a=o.env.NEXT_PUBLIC_SUPABASE_URL||"https://mehahzpqfzfxmczbldup.supabase.co",s=o.env.NEXT_PUBLIC_SUPABASE_ANON_KEY||"sb_publishable_bIDJ7hsQTtZA_JXDJOjLjA_9bojo1sj",u=(0,n.eI)(a,s,{auth:{persistSession:!0,autoRefreshToken:!0,storage:window.localStorage}})},25343:function(e,t,r){"use strict";r.d(t,{cn:function(){return cn}});var n=r(90512),o=r(98388);function cn(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,o.m6)((0,n.W)(t))}},72787:function(e,t,r){"use strict";r.d(t,{d:function(){return l},z:function(){return i}});var n=r(85893),o=r(67294),a=r(88426),s=r(12003),u=r(25343);let l=(0,s.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),i=o.forwardRef((e,t)=>{let{className:r,variant:o,size:s,asChild:i=!1,...c}=e,d=i?a.g7:"button";return(0,n.jsx)(d,{className:(0,u.cn)(l({variant:o,size:s,className:r})),ref:t,...c})});i.displayName="Button"},42191:function(e,t,r){"use strict";r.d(t,{I:function(){return s}});var n=r(85893),o=r(67294),a=r(25343);let s=o.forwardRef((e,t)=>{let{className:r,type:o,...s}=e;return(0,n.jsx)("input",{type:o,className:(0,a.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...s})});s.displayName="Input"},21066:function(e,t,r){"use strict";r.d(t,{_:function(){return i}});
1var n=r(85893),o=r(67294),a=r(49102),s=r(12003),u=r(25343);let l=(0,s.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),i=o.forwardRef((e,t)=>{let{className:r,...o}=e;return(0,n.jsx)(a.f,{ref:t,className:(0,u.cn)(l(),r),...o})});i.displayName=a.f.displayName},30787:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return ResetPasswordPage}});var n=r(85893),o=r(9008),a=r.n(o),s=r(67294),u=r(41664),l=r.n(u),i=r(11163),c=r(53219),d=r(36316),f=r(91444),p=r(72787),h=r(42191),m=r(21066),b=r(94185);function ResetPasswordPage(){let e=(0,i.useRouter)(),[t,r]=(0,s.useState)(!1),[o,u]=(0,s.useState)(""),[g,v]=(0,s.useState)(""),[y,x]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let{data:e}=b.O.auth.onAuthStateChange(e=>{("PASSWORD_RECOVERY"===e||"SIGNED_IN"===e)&&r(!0)});return b.O.auth.getSession().then(e=>{let{data:t}=e;t.session&&r(!0)}),()=>e.subscription.unsubscribe()},[]);let handleSubmit=async t=>{if(t.preventDefault(),o.length<8){f.Am.error("Password must be at least 8 characters.");return}if(o!==g){f.Am.error("Passwords do not match.");return}x(!0);let{error:r}=await b.O.auth.updateUser({password:o});if(x(!1),r){f.Am.error(r.message);return}f.Am.success("Password updated"),e.push("/centa-for-teachers/school/profile")};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{children:[(0,n.jsx)("title",{children:"Reset password — CENTA"}),(0,n.jsx)("meta",{name:"description",content:"Set a new password for your CENTA school account."})]}),(0,n.jsxs)("div",{className:"centa-teachers-scope min-h-screen bg-background",children:[(0,n.jsx)("header",{className:"border-b border-border bg-background/90 backdrop-blur",children:(0,n.jsxs)("div",{className:"mx-auto flex h-16 max-w-5xl items-center justify-between px-4 sm:px-6",children:[(0,n.jsx)(l(),{href:"/centa-for-teachers","aria-label":"CENTA home",children:(0,n.jsx)("img",{src:"/centa-teachers/centa-logo.jpg",alt:"CENTA",className:"h-9 w-auto object-contain"})}),(0,n.jsxs)(l(),{href:"/centa-for-teachers/login",className:"inline-flex items-center gap-1 text-sm font-medium text-foreground/70 hover:text-primary",children:[(0,n.jsx)(c.Z,{className:"h-4 w-4"})," Back to login"]})]})}),(0,n.jsx)("main",{className:"mx-auto max-w-md px-4 py-14 sm:px-6",children:(0,n.jsxs)("div",{className:"rounded-2xl border border-border bg-card p-7 shadow-soft",children:[(0,n.jsx)("h1",{className:"font-display text-2xl text-navy",children:"Set a new password"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:t?"Choose a strong password (min 8 characters).":"Validating your reset link…"}),(0,n.jsxs)("form",{onSubmit:handleSubmit,className:"mt-6 space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(m._,{htmlFor:"password",children:"New password"}),(0,n.jsx)(h.I,{id:"password",type:"password",autoComplete:"new-password",required:!0,disabled:!t,value:o,onChange:e=>u(e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(m._,{htmlFor:"confirm",children:"Confirm password"}),(0,n.jsx)(h.I,{id:"confirm",type:"password",autoComplete:"new-password",required:!0,disabled:!t,value:g,onChange:e=>v(e.target.value)})]}),(0,n.jsxs)(p.z,{type:"submit",className:"h-11 w-full bg-primary text-primary-foreground hover:bg-primary/90",disabled:y||!t,children:[y&&(0,n.jsx)(d.Z,{className:"h-4 w-4 animate-spin"}),"Update password"]})]})]})})]})]})}},41664:function(e,t,r){e.exports=r(65170)}},function(e){e.O(0,[1023,8914,7834,9774,2888,179],function(){return e(e.s=55485)}),_N_E=e.O()}]);

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.