PageSourceSearch

https://censusmapper.ca/_next/static/chunks/1i7f1yk18gagd.js

js censusmapper.ca collected 2026-10-02 04:33:34 UTC 12,535 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87942,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(618566),n=e.i(522016),s=e.i(167881),i=e.i(23750),l=e.i(10708),o=e.i(970065),d=e.i(852647),c=e.i(517711);function u(){let e=(0,a.useSearchParams)(),u=(0,d.safeReturnTo)(e.get("returnTo")),m=e.get("confirmed"),x=e.get("reset"),g=e.get("error"),[h,b]=(0,r.useState)(""),[f,p]=(0,r.useState)(""),[v,y]=(0,r.useState)(""),[j,w]=(0,r.useState)(!1),[N,C]=(0,r.useState)(!1),[S,T]=(0,r.useState)("idle");async function P(e){e.preventDefault(),y(""),C(!1),T("idle"),w(!0);try{let e=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:h,password:f})}),t=await e.json();if(!e.ok){if("object"==typeof t.detail&&t.detail?.error==="email_not_confirmed")return void C(!0);let e="string"==typeof t.detail?t.detail:t.detail?.message??t.error??"Login failed";y(e);return}window.location.assign((0,d.safeReturnTo)(u))}catch{y("Unable to connect to the server")}finally{w(!1)}}async function k(){T("sending");try{await fetch("/api/auth/resend-confirmation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:h})})}finally{T("sent")}}return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-900 px-4",children:(0,t.jsxs)(o.Card,{className:"w-full max-w-md bg-gray-800 border-gray-700",children:[(0,t.jsx)(o.CardHeader,{className:"text-center",children:(0,t.jsx)(o.CardTitle,{className:"text-2xl text-white",children:"Sign in to CensusMapper"})}),(0,t.jsxs)(o.CardContent,{className:"space-y-6",children:[m&&(0,t.jsx)("div",{className:"bg-green-900/50 border border-green-700 text-green-300 px-4 py-2 rounded text-sm",children:"Email confirmed! You can now sign in."}),x&&(0,t.jsx)("div",{className:"bg-green-900/50 border border-green-700 text-green-300 px-4 py-2 rounded text-sm",children:"Password reset! You can now sign in with your new password."}),g&&(0,t.jsx)("div",{className:"bg-red-900/50 border border-red-700 text-red-300 px-4 py-2 rounded text-sm",children:"oauth_invalid"===g?"OAuth sign-in could not be completed. Please try again.":"backend_unavailable"===g?"Authentication service unavailable. Please try again later.":decodeURIComponent(g)}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("a",{href:`${(0,c.getAPIBaseUrl)()}/auth/oauth/google?returnTo=${encodeURIComponent(u)}`,className:"flex items-center justify-center w-full px-4 py-2.5 bg-white text-gray-800 rounded-md font-medium hover:bg-gray-100 transition",children:[(0,t.jsxs)("svg",{className:"w-5 h-5 mr-3",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),(0,t.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Continue with Google"]}),(0,t.jsxs)("a",{href:`${(0,c.getAPIBaseUrl)()}/auth/oauth/github?returnTo=${encodeURIComponent(u)}`,className:"flex items-center justify-center w-full px-4 py-2.5 bg-gray-700 text-white rounded-md font-medium hover:bg-gray-600 transition",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-3",fill:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844a9.59 9.59 0 0 1 2.504.337c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z",clipRule:"evenodd"})}),"Continue with GitHub"]})]}),(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-600"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,t.jsx)("span",{className:"px-2 bg-gray-800 text-gray-400",children:"or"})})]}),(0,t.jsxs)("form",{onSubmit:P,className:"space-y-4",children:[v&&(0,t.jsx)("div",{className:"bg-red-900/50 border border-red-700 text-red-300 px-4 py-2 rounded text-sm",children:v}),N&&(0,t.jsxs)("div",{className:"bg-amber-900/40 border border-amber-700 text-amber-200 px-4 py-3 rounded text-sm space-y-2",children:[(0,t.jsxs)("p",{children:["Please confirm your email at"," ",(0,t.jsx)("span",{className:"font-medium",children:h})," before signing in."]}),(0,t.jsxs)("button",{type:"button",onClick:k,disabled:"idle"!==S,className:"text-amber-100 underline hover:text-white disabled:opacity-50",children:["idle"===S&&"Resend confirmation email","sending"===S&&"Sending...","sent"===S&&"Sent — check your inbox"]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"email",className:"text-gray-300",children:"Email"}),(0,t.jsx)(i.Input,{id:"email",type:"email",value:h,onChange:e=>b(e.target.value),required:!0,className:"bg-gray-700 border-gray-600 text-white",placeholder:"[email protected]"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(l.Label,{htmlFor:"password",className:"text-gray-300",children:"Password"}),(0,t.jsx)(n.default,{href:"/auth/forgot-password",className:"text-sm text-blue-400 hover:text-blue-300",children:"Forgot password?"})]}),(0,t.jsx)(i.Input,{id:"password",type:"password",value:f,onChange:e=>p(e.target.value),required:!0,className:"bg-gray-700 border-gray-600 text-white"})]}),(0,t.jsx)(s.Button,{type:"submit",disabled:j,className:"w-full bg-blue-600 text-white hover:bg-blue-500",children:j?"Signing in...":"Sign in with email"})]}),(0,t.jsxs)("p",{className:"text-center text-sm text-gray-400",children:["Don't have an account?"," ",(0,t.jsx)(n.default,{href:`/auth/register?returnTo=${encodeURIComponent(u)}`,className:"text-blue-400 hover:text-blue-300",children:"Sign up"})]}),(0,t.jsx)("p",{className:"text-center text-xs text-gray-500",children:(0,t.jsx)(n.default,{href:"/privacy",className:"hover:text-gray-300 underline",children:"Privacy policy"})})]})]})})}e.s(["default",0,function(){return(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:(0,t.jsx)("p",{className:"text-gray-400",children:"Loading..."})}),children:(0,t.jsx)(u,{})})}])},167881,225913,970065,e=>{"use strict";var t=e.i(843476),r=e.i(991918),a=e.i(207670);let n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,s=a.clsx,i=(e,t)=>r=>{var a;if((null==t?void 0:t.variants)==null)return s(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:l}=t,o=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],a=null==l?void 0:l[e];
1if(null===t)return null;let s=n(t)||n(a);return i[e][s]}),d=r&&Object.entries(r).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return s(e,o,null==t||null==(a=t.compoundVariants)?void 0:a.reduce((e,t)=>{let{class:r,className:a,...n}=t;return Object.entries(n).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...d}[t]):({...l,...d})[t]===r})?[...e,r,a]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)};e.s(["cva",0,i],225913);var l=e.i(647163);let o=i("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:a="default",size:n="default",asChild:s=!1,...i}){let d=s?r.Slot:"button";return(0,t.jsx)(d,{"data-slot":"button","data-variant":a,"data-size":n,className:(0,l.cn)(o({variant:a,size:n,className:e})),...i})}],167881),e.s(["Card",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,l.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})},"CardContent",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,l.cn)("px-6",e),...r})},"CardDescription",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,l.cn)("text-muted-foreground text-sm",e),...r})},"CardHeader",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,l.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})},"CardTitle",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,l.cn)("leading-none font-semibold",e),...r})}],970065)},23750,e=>{"use strict";var t=e.i(843476),r=e.i(647163);e.s(["Input",0,function({className:e,type:a,...n}){return(0,t.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input h-9 w-full min-w-0 rounded-md border bg-white px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-white file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-input focus-visible:ring-border/60 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}])},10708,e=>{"use strict";var t=e.i(843476),r=e.i(271645),a=e.i(248425),n=Object.defineProperty,s=r.forwardRef(n(function(e,r){return(0,t.jsx)(a.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),i=e.i(647163);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)(s,{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],10708)},852647,e=>{"use strict";let t=["/auth/login","/auth/register","/auth/logout","/auth/callback"];function r(e){if(!e||e.startsWith("//")||!e.startsWith("/"))return"/";let r=e.split("?")[0];return t.some(e=>r===e||r.startsWith(e+"/"))?"/":e}e.s(["currentReturnTo",0,function(){let e=new URLSearchParams(window.location.search).get("returnTo");return e?r(decodeURIComponent(e)):r(window.location.pathname+window.location.search)},"safeReturnTo",0,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.