PageSourceSearch

https://seniormoments.co.nz/assets/welcome-D6MNXf3d.js

js seniormoments.co.nz collected 2026-10-09 22:04:06 UTC 12,987 bytes, 1 lines download raw bytes

1import{r as a,j as e,u as se,a as te,L,s as re,t as F}from"./index-B8x47Np6.js";import{B as N}from"./button-D0tjTrtO.js";import{I as W}from"./input-DuQhOHcx.js";import{L as I}from"./label-MxSpsLwE.js";import{c as _}from"./utils-0exNfmSl.js";import{u as Y}from"./index-C_Ozil7u.js";import{P as ae,a as A,u as oe,c as q,b as ne}from"./index-CT_4jwyh.js";import{u as le}from"./index-D158fRLV.js";import{u as ie,S as ce}from"./index-ChWmzZvy.js";import{C as de}from"./check-ksWrDi2E.js";import{c as ue}from"./index-B8k91cqS.js";import{C as he}from"./chevron-right-D6eNGqbj.js";import"./clsx-B-dksMZM.js";const J=a.forwardRef(({className:t,...n},o)=>e.jsx("textarea",{className:_("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm 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",t),ref:o,...n}));J.displayName="Textarea";var E="Checkbox",[me]=ne(E),[xe,M]=me(E);function pe(t){const{__scopeCheckbox:n,checked:o,children:m,defaultChecked:c,disabled:r,form:l,name:x,onCheckedChange:h,required:p,value:g="on",internal_do_not_use_render:d}=t,[f,j]=oe({prop:o,defaultProp:c??!1,onChange:h,caller:E}),[b,v]=a.useState(null),[C,i]=a.useState(null),u=a.useRef(!1),w=b?!!l||!!b.closest("form"):!0,S={checked:f,disabled:r,setChecked:j,control:b,setControl:v,name:x,form:l,value:g,hasConsumerStoppedPropagationRef:u,required:p,defaultChecked:k(c)?!1:c,isFormControl:w,bubbleInput:C,setBubbleInput:i};return e.jsx(xe,{scope:n,...S,children:fe(d)?d(S):m})}var V="CheckboxTrigger",H=a.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:o,...m},c)=>{const{control:r,value:l,disabled:x,checked:h,required:p,setControl:g,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:j,bubbleInput:b}=M(V,t),v=Y(c,g),C=a.useRef(h);return a.useEffect(()=>{const i=r?.form;if(i){const u=()=>d(C.current);return i.addEventListener("reset",u),()=>i.removeEventListener("reset",u)}},[r,d]),e.jsx(A.button,{type:"button",role:"checkbox","aria-checked":k(h)?"mixed":h,"aria-required":p,"data-state":X(h),"data-disabled":x?"":void 0,disabled:x,value:l,...m,ref:v,onKeyDown:q(n,i=>{i.key==="Enter"&&i.preventDefault()}),onClick:q(o,i=>{d(u=>k(u)?!0:!u),b&&j&&(f.current=i.isPropagationStopped(),f.current||i.stopPropagation())})})});H.displayName=V;var D=a.forwardRef((t,n)=>{const{__scopeCheckbox:o,name:m,checked:c,defaultChecked:r,required:l,disabled:x,value:h,onCheckedChange:p,form:g,...d}=t;return e.jsx(pe,{__scopeCheckbox:o,checked:c,defaultChecked:r,disabled:x,required:l,onCheckedChange:p,name:m,form:g,value:h,internal_do_not_use_render:({isFormControl:f})=>e.jsxs(e.Fragment,{children:[e.jsx(H,{...d,ref:n,__scopeCheckbox:o}),f&&e.jsx(U,{__scopeCheckbox:o})]})})});D.displayName=E;var z="CheckboxIndicator",G=a.forwardRef((t,n)=>{const{__scopeCheckbox:o,forceMount:m,...c}=t,r=M(z,o);return e.jsx(ae,{present:m||k(r.checked)||r.checked===!0,children:e.jsx(A.span,{"data-state":X(r.checked),"data-disabled":r.disabled?"":void 0,...c,ref:n,style:{pointerEvents:"none",...t.style}})})});G.displayName=z;var K="CheckboxBubbleInput",U=a.forwardRef(({__scopeCheckbox:t,...n},o)=>{const{control:m,hasConsumerStoppedPropagationRef:c,checked:r,defaultChecked:l,required:x,disabled:h,name:p,value:g,form:d,bubbleInput:f,setBubbleInput:j}=M(K,t),b=Y(o,j),v=le(r),C=ie(m);a.useEffect(()=>{const u=f;if(!u)return;const w=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(w,"checked").set,B=!c.current;if(v!==r&&P){const R=new Event("click",{bubbles:B});u.indeterminate=k(r),P.call(u,k(r)?!1:r),u.dispatchEvent(R)}},[f,v,r,c]);const i=a.useRef(k(r)?!1:r);return e.jsx(A.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??i.current,required:x,disabled:h,name:p,value:g,form:d,...n,tabIndex:-1,ref:b,style:{...n.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});U.displayName=K;function fe(t){return typeof t=="function"}function k(t){return t==="indeterminate"}function X(t){return k(t)?"indeterminate":t?"checked":"unchecked"}const Z=a.forwardRef(({className:t,...n},o)=>e.jsx(D,{ref:o,className:_("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...n,children:e.jsx(G,{className:_("grid place-content-center text-current"),children:e.jsx(de,{className:"h-4 w-4"})})}));Z.displayName=D.displayName;const ge=ue("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function be({className:t,variant:n,...o}){return e.jsx("div",{className:_(ge({variant:n}),t),...o})}const ve=["Funny moments","Family","Travel","Pets","Then & Now","Community","Photos","Videos","Tech help","Safety tips","Nostalgia","Local NZ stories"];function Te(){const t=se(),{user:n,profile:o,loading:m,refreshProfile:c}
1=te(),[r,l]=a.useState(1),[x,h]=a.useState(""),[p,g]=a.useState(""),[d,f]=a.useState(""),[j,b]=a.useState(""),[v,C]=a.useState(""),[i,u]=a.useState(!1),[w,S]=a.useState("members_only"),[P,B]=a.useState([]),[R,O]=a.useState(!1);a.useEffect(()=>{!m&&!n&&t({to:"/login"}),o&&(h(o.display_name||""),o.onboarding_completed&&t({to:"/moments"}))},[m,n,o,t]);const $=async()=>{if(!n)return;O(!0);const{error:s}=await re.from("profiles").update({display_name:x.trim(),birth_month:p||null,birth_year:d||null,town_region:j||null,bio:v||null,profile_visibility:w,default_post_visibility:w,interests:P,onboarding_completed:!0,house_rules_accepted_at:new Date().toISOString()}).eq("id",n.id);if(O(!1),s){F.error(s.message);return}await c(),F.success("All set. Welcome to Senior Moments."),t({to:"/moments"})},Q=s=>B(y=>y.includes(s)?y.filter(T=>T!==s):[...y,s]),ee=x.trim().length>1&&p&&d&&i;return e.jsx("div",{className:"min-h-screen bg-background py-10 px-4",children:e.jsxs("div",{className:"mx-auto max-w-2xl",children:[e.jsx("div",{className:"mb-8 flex items-center gap-2",children:[1,2,3,4,5].map(s=>e.jsx("div",{className:_("h-1.5 flex-1 rounded-full",s<=r?"bg-sage":"bg-secondary")},s))}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-8 shadow-sm",children:[r===1&&e.jsxs("div",{className:"space-y-5",children:[e.jsx("h1",{className:"font-display text-3xl",children:"What should people call you?"}),e.jsx("p",{className:"text-muted-foreground",children:"Just the basics. You can fill in more later."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-base",children:"Display name"}),e.jsx(W,{value:x,onChange:s=>h(s.target.value),className:"h-12 text-base",placeholder:"e.g. Margaret W."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-base",children:"Birth month"}),e.jsxs("select",{className:"h-12 w-full rounded-md border border-input bg-transparent px-3 text-base",value:p,onChange:s=>g(s.target.value?Number(s.target.value):""),children:[e.jsx("option",{value:"",children:"Month"}),["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].map((s,y)=>e.jsx("option",{value:y+1,children:s},s))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-base",children:"Birth year"}),e.jsxs("select",{className:"h-12 w-full rounded-md border border-input bg-transparent px-3 text-base",value:d,onChange:s=>f(s.target.value?Number(s.target.value):""),children:[e.jsx("option",{value:"",children:"Year"}),Array.from({length:80},(s,y)=>2010-y).map(s=>e.jsx("option",{value:s,children:s},s))]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"We only ask for month and year. Your full date of birth stays private."}),e.jsxs("label",{className:"flex items-start gap-3 border border-border bg-secondary/30 p-4 cursor-pointer",children:[e.jsx(Z,{checked:i,onCheckedChange:s=>u(s===!0),className:"mt-1 !h-4 !w-4 !min-h-0 rounded-none"}),e.jsxs("span",{className:"text-sm",children:["I'm joining as myself and I agree to the"," ",e.jsx(L,{to:"/safety",target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"underline hover:text-foreground font-medium",children:"house rules"})," ","and"," ",e.jsx(L,{to:"/privacy",target:"_blank",rel:"noreferrer",onClick:s=>s.stopPropagation(),className:"underline hover:text-foreground font-medium",children:"privacy policy"}),"."]})]}),e.jsxs(N,{disabled:!ee,onClick:()=>l(2),className:"w-full h-12 text-base bg-sage text-sage-foreground hover:bg-sage hover:text-sage-foreground hover:brightness-95",children:["Next ",e.jsx(he,{className:"ml-1 h-4 w-4"})]})]}),r===2&&e.jsxs("div",{className:"space-y-5",children:[e.jsx("h1",{className:"font-display text-3xl",children:"Who can see your moments?"}),e.jsx("p",{className:"text-muted-foreground",children:"You can change this any time."}),[["public","Public","Anyone on the internet can see your moments."],["members_only","Members only","Only signed-in Senior Moments members. Recommended."],["family_link","Family link only","Only people you give a private link to."]].map(([s,y,T])=>e.jsxs("button",{onClick:()=>S(s),className:_("w-full text-left rounded-xl border p-4 transition",w===s?"border-sage bg-sage/10":"border-border hover:bg-secondary/50"),children:[e.jsx("div",{className:"font-medium",children:y}),e.jsx("div",{className:"text-sm text-muted-foreground",children:T})]},s)),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"ghost",onClick:()=>l(1),className:"flex-1",children:"Back"}),e.jsx(N,{onClick:()=>l(3),className:"flex-1 bg-sage text-sage-foreground hover:bg-sage hover:text-sage-foreground hover:brightness-95",children:"Next"})]})]}),r===3&&e.jsxs("div",{className:"space-y-5",children:[e.jsx("h1",{className:"font-display text-3xl",children:"What do you enjoy?"}),e.jsx("p",{className:"text-muted-foreground",children:"Pick a few. We'll show you more of what you like."}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ve.map(s=>e.jsx(be,{onClick:()=>
1Q(s),className:_("cursor-pointer rounded-full px-4 py-2 text-sm border",P.includes(s)?"bg-sage text-sage-foreground border-sage":"bg-background text-foreground border-border hover:bg-secondary"),children:s},s))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"ghost",onClick:()=>l(2),className:"flex-1",children:"Back"}),e.jsx(N,{onClick:()=>l(4),className:"flex-1 bg-sage text-sage-foreground hover:bg-sage hover:text-sage-foreground hover:brightness-95",children:"Next"})]})]}),r===4&&e.jsxs("div",{className:"space-y-5",children:[e.jsx("h1",{className:"font-display text-3xl",children:"A bit about you"}),e.jsx("p",{className:"text-muted-foreground",children:"Optional, skip and come back later."}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-base",children:"Town or region"}),e.jsx(W,{value:j,onChange:s=>b(s.target.value),className:"h-12 text-base",placeholder:"e.g. Tauranga"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{className:"text-base",children:"Short bio"}),e.jsx(J,{value:v,onChange:s=>C(s.target.value),className:"text-base",rows:3,placeholder:"Three things you love…"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"ghost",onClick:()=>l(3),className:"flex-1",children:"Back"}),e.jsx(N,{onClick:()=>l(5),className:"flex-1 bg-sage text-sage-foreground hover:bg-sage hover:text-sage-foreground hover:brightness-95",children:"Next"})]})]}),r===5&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ce,{className:"h-8 w-8 text-sage"}),e.jsx("h1",{className:"font-display text-3xl",children:"A quick safety reminder"})]}),e.jsxs("ul",{className:"space-y-2 text-base",children:[e.jsx("li",{children:"• Don't share bank details or passwords."}),e.jsx("li",{children:"• Don't share private codes from texts or emails."}),e.jsx("li",{children:"• Tap the report button if anything feels off."}),e.jsx("li",{children:"• Our team is here if you need help."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{variant:"ghost",onClick:()=>l(4),className:"flex-1",children:"Back"}),e.jsx(N,{disabled:R,onClick:$,className:"flex-1 h-12 bg-sage text-sage-foreground hover:bg-sage hover:text-sage-foreground hover:brightness-95",children:R?"Saving…":"All done, let me in"})]})]})]})]})})}export{Te as component};

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.