PageSourceSearch

https://fineas.ai/assets/SettingsScreen-CWJX-Y49.js

js fineas.ai collected 2026-10-05 12:55:53 UTC 19,692 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B8vKoKCv.js","assets/vendor-react-BszgV781.js","assets/vendor-icons-CxvfwD5c.js","assets/vendor-query-CTeAFhsp.js","assets/vendor-supabase-DtqnsGWZ.js","assets/vendor-motion-2YzK-2rt.js","assets/vendor-charts-DjLyuU_E.js","assets/vendor-markdown-DZo4tDoQ.js","assets/index-wSUTckMu.css"])))=>i.map(i=>d[i]);
2import{c as h,ae as L,L as U,af as z,am as D,s as S,N as C,aV as V,c3 as G,c4 as $,c5 as M,c6 as Y,c7 as Z,c8 as H,c9 as X,ca as q,ak as K,cb as J,ai as P}from"./index-B8vKoKCv.js";import{u as y,r as m,j as e}from"./vendor-react-BszgV781.js";import{V as Q}from"./VoiceSettingsPanel-DmVaSZOD.js";import{u as W}from"./usePriceAlerts-C4tjdEeR.js";import{S as ee}from"./SegmentedControl-tf9X-yAn.js";import{S as N}from"./skeleton-CeLPXN-C.js";import{u as te}from"./useEntitlement-cSURlO3q.js";import{u as se}from"./useOrg-Cq1CKdq9.js";import{f as ae}from"./useCohorts-D9ClokBV.js";import{_ as re,d as ne,l as v,a as O,b2 as le,e as T,cf as ie,X as oe,aQ as ce,cj as de,$ as I,ar as E,ah as me}from"./vendor-icons-CxvfwD5c.js";import"./vendor-query-CTeAFhsp.js";import"./vendor-supabase-DtqnsGWZ.js";import"./vendor-motion-2YzK-2rt.js";import"./vendor-charts-DjLyuU_E.js";import"./vendor-markdown-DZo4tDoQ.js";import"./slider-CJLWrg7V.js";import"./switch-BZuP3KQq.js";import"./useVoiceSettings-D5CatyW3.js";const ue="calc(3.5rem + env(safe-area-inset-bottom, 0px) + 1.5rem)",xe=[{value:.9,label:"Small",demo:"13px"},{value:1,label:"Default",demo:"16px"},{value:1.1,label:"Large",demo:"19px"},{value:1.25,label:"XL",demo:"23px"}],pe=[{value:"detailed",label:"Detailed",hint:"Depth, with bullets + bold"},{value:"concise",label:"Concise",hint:"Mostly bullets, bold key terms"}],ge=["AI","Semiconductors","Crypto","Energy","Fed & rates","EVs","Biotech","Defense"];function p({children:s}){return e.jsx("h2",{className:"mb-2 px-1 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground/70",children:s})}function u({children:s,className:a}){return e.jsx("div",{className:h("rounded-2xl border border-border/40 bg-card/40",a),children:s})}function he(){const s=y(),{user:a}=L(),{data:t,isLoading:r}=U(),c=z(),[x,l]=m.useState(""),[i,n]=m.useState(!1),d=m.useRef(null);m.useEffect(()=>{l((t==null?void 0:t.display_name)??"")},[t==null?void 0:t.display_name]);const w=((t==null?void 0:t.display_name)||(a==null?void 0:a.email)||"?").split(/[\s@.]+/).filter(Boolean).slice(0,2).map(o=>{var f;return(f=o[0])==null?void 0:f.toUpperCase()}).join(""),R=()=>{const o=x.trim();o!==((t==null?void 0:t.display_name)??"")&&c.mutate({display_name:o||null},{onSuccess:()=>{n(!0),setTimeout(()=>n(!1),1500)}})},F=o=>{var _;const f=(_=o.target.files)==null?void 0:_[0];if(o.target.value="",!f)return;const k=URL.createObjectURL(f),g=new Image;g.onload=()=>{const b=document.createElement("canvas");b.width=192,b.height=192;const A=b.getContext("2d");if(A){const j=Math.min(g.width,g.height);A.drawImage(g,(g.width-j)/2,(g.height-j)/2,j,j,0,0,192,192);const B=b.toDataURL("image/jpeg",.82);c.mutate({avatar_url:B})}URL.revokeObjectURL(k)},g.onerror=()=>URL.revokeObjectURL(k),g.src=k};return e.jsxs(u,{className:"p-4",children:[r?e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(N,{className:"h-16 w-16 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(N,{className:"h-4 w-32"}),e.jsx(N,{className:"h-3 w-44"})]})]}):e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("button",{type:"button",onClick:()=>{var o;return(o=d.current)==null?void 0:o.click()},className:"relative h-16 w-16 shrink-0 rounded-full","aria-label":"Change profile photo",children:[t!=null&&t.avatar_url?e.jsx("img",{src:t.avatar_url,alt:"",className:"h-16 w-16 rounded-full object-cover ring-1 ring-border/40"}):e.jsx("div",{className:"grid h-16 w-16 place-items-center rounded-full bg-primary text-lg font-bold text-primary-foreground",children:w}),e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 grid h-6 w-6 place-items-center rounded-full border border-border/40 bg-card text-muted-foreground",children:c.isPending?e.jsx(O,{className:"h-3 w-3 animate-spin"}):e.jsx(le,{className:"h-3 w-3"})})]}),e.jsx("input",{ref:d,type:"file",accept:"image/*",className:"hidden",onChange:F}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{value:x,onChange:o=>l(o.target.value),onBlur:R,onKeyDown:o=>o.key==="Enter"&&o.target.blur(),placeholder:"Your name",className:"w-full min-w-0 rounded-lg border border-transparent bg-transparent px-1.5 py-1 text-base font-semibold text-foreground placeholder:text-muted-foreground
2/50 focus:border-border/60 focus:bg-card/60 focus:outline-none"}),i&&e.jsx(T,{className:"h-4 w-4 shrink-0 text-gain-400"})]}),e.jsx("p",{className:"truncate px-1.5 text-xs text-muted-foreground",children:D(a)?"Guest session":a==null?void 0:a.email})]})]}),D(a)&&e.jsxs("button",{type:"button",onClick:()=>s("/sign-in"),className:"mt-3 flex w-full items-center justify-center gap-2 rounded-xl bg-primary py-2.5 text-sm font-semibold text-primary-foreground shadow-[0_0_16px_hsl(var(--primary)/0.3)] transition-all active:scale-[0.99]",children:[e.jsx(ie,{className:"h-4 w-4"})," Sign in to Fineas"]})]})}function fe(){const{user:s}=L(),[a,t]=m.useState(!0),[r,c]=m.useState(!1);m.useEffect(()=>{if(!(s!=null&&s.id))return;let l=!1;return(async()=>{const{data:i,error:n}=await S.from("notification_prefs").select("market_pulse").eq("user_id",s.id).maybeSingle();l||(!n&&i&&t(i.market_pulse),c(!0))})(),()=>{l=!0}},[s==null?void 0:s.id]);const x=async()=>{const l=!a;if(t(l),!(s!=null&&s.id))return;const{error:i}=await S.from("notification_prefs").upsert({user_id:s.id,market_pulse:l,breaking_news:l,updated_at:new Date().toISOString()});i&&i.code!=="PGRST205"&&i.code!=="42P01"&&t(!l)};return e.jsx(u,{className:"p-4",children:e.jsxs("button",{type:"button",onClick:x,disabled:!r&&!!s,className:"flex w-full items-center justify-between gap-3 text-left","aria-pressed":a,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Breaking news & market pulse"}),e.jsx("p",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:"Push alerts while you're away: breaking stories, big index moves, and a smart one-line insight on the last hour's biggest event."})]}),e.jsx("span",{className:h("relative h-6 w-10 shrink-0 rounded-full transition-colors",a?"bg-primary":"bg-muted/60"),children:e.jsx("span",{className:h("absolute top-0.5 h-5 w-5 rounded-full bg-white shadow transition-all",a?"left-[18px]":"left-0.5")})})]})})}function be(){const{fontScale:s,setFontScale:a}=C();return e.jsxs(u,{children:[e.jsx("div",{className:"grid grid-cols-4 gap-1.5 p-2",children:xe.map(t=>{const r=t.value===s;return e.jsxs("button",{type:"button",onClick:()=>a(t.value),"aria-pressed":r,className:h("flex h-16 flex-col items-center justify-center gap-1 rounded-xl transition-colors",r?"bg-primary text-primary-foreground shadow-sm":"bg-background/40 text-muted-foreground active:bg-muted/40"),children:[e.jsx("span",{className:"font-bold leading-none",style:{fontSize:t.demo},children:"A"}),e.jsx("span",{className:"text-3xs font-medium leading-none",children:t.label})]},t.value)})}),e.jsxs("div",{className:"border-t border-border/30 px-4 py-3.5",children:[e.jsx("p",{className:"mb-1.5 text-3xs font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Preview"}),e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-base font-semibold text-foreground",children:"Apple Inc · AAPL"}),e.jsx("span",{className:"text-base font-semibold tabular-nums text-gain-400",children:"+1.84%"})]}),e.jsx("p",{className:"mt-1 text-sm leading-snug text-muted-foreground",children:"Megacaps lead a steady tape; rates in focus ahead of CPI."})]})]})}function je(){const{responseStyle:s,setResponseStyle:a}=C();return e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:pe.map(t=>{const r=t.value===s;return e.jsxs("button",{type:"button",onClick:()=>a(t.value),"aria-pressed":r,className:h("relative rounded-2xl border p-4 text-left transition-colors",r?"border-primary/60 bg-primary/10":"border-border/40 bg-card/40 active:bg-card/60"),children:[r&&e.jsx("span",{className:"absolute right-3 top-3 grid h-4 w-4 place-items-center rounded-full bg-primary text-primary-foreground",children:e.jsx(T,{className:"h-3 w-3"})}),e.jsx("span",{className:"block text-sm font-semibold text-foreground",children:t.label}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:t.hint})]},t.value)})})}function Ne(){const{interests:s,setInterests:a}=C(),[t,r]=m.useState(""),c=n=>{const d=n.trim();d&&(s.some(w=>w.toLowerCase()===d.toLowerCase())||(a([...s,d].slice(0,20)),r("")))},x=n=>a(s.filter(d=>d!==n)),l=n=>{(n.key==="Enter"||n.key===",")&&(n.preventDefault(),c(t))},i=ge.filter(n=>!s.some(d=>d.toLowerCase()===n.toLowerCase()));return e.jsxs(u,{className:"p-3",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/15 px-2.5 py-1 text-xs font-medium text-primary",children:[n,e.jsx("button",{type:"button",onClick:()=>x(n),"aria-label":`Remove ${n}`,className:"opacity-70 active:opacity-100",children:e.jsx(oe,{className:"h-3 w-3"})})]},n)),s.length===0&&e.jsx("span",{className:"px-0.5 py-1 text-xs text-muted-foreground",children:"No interests yet — add a few below."})]}),e.jsxs("div",{className:"mt-2.5 flex items-center gap-2 rounded-xl border border-border/40 bg-background/40 px-3",children:[e.jsx("input",{value:t,onChange:n=>r(n.target.value),onKeyDown:l,placeholder:"Add an interest (e.g. AI, NVDA, oil)…",autoCapitalize:"words",className:"h-10 min-w-0 flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground
2/70 focus:outline-none"}),e.jsx("button",{type:"button",onClick:()=>c(t),disabled:!t.trim(),className:"grid h-7 w-7 place-items-center rounded-full bg-primary text-primary-foreground transition-opacity active:opacity-80 disabled:opacity-40","aria-label":"Add interest",children:e.jsx(ce,{className:"h-4 w-4"})})]}),i.length>0&&e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:i.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n),className:"rounded-full border border-border/40 bg-background/30 px-2.5 py-1 text-xs text-muted-foreground active:text-foreground",children:["+ ",n]},n))})]})}function ve(){const{alerts:s,isLoading:a,deleteAlert:t}=W();return a?e.jsx(u,{className:"p-3",children:e.jsx(N,{className:"h-10 rounded-lg"})}):s.length===0?e.jsx(u,{className:"p-3",children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"No alerts yet — tap the bell on any ticker card to set one."})}):e.jsx(u,{className:"divide-y divide-border/20 p-0",children:s.map(r=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[e.jsx(de,{className:h("h-3.5 w-3.5 shrink-0",r.triggered_at?"text-muted-foreground/50":"text-primary")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"text-sm font-medium text-foreground",children:[r.symbol.replace(/^X:/,"")," ",e.jsx("span",{className:r.direction==="above"?"text-gain-400":"text-loss-400",children:r.direction==="above"?"↑":"↓"})," ",e.jsxs("span",{className:"tabular-nums",children:["$",r.target_price]})]}),e.jsx("p",{className:"text-3xs text-muted-foreground",children:r.triggered_at?`Triggered ${new Date(r.triggered_at).toLocaleDateString()}`:"Armed"})]}),e.jsx("button",{type:"button",onClick:()=>void t(r.id),"aria-label":"Delete alert",className:"rounded-md p-1.5 text-muted-foreground transition-colors active:bg-muted/40",children:e.jsx(I,{className:"h-3.5 w-3.5"})})]},r.id))})}function ye(){const s=y(),{data:a}=te(),{data:t}=se(),{data:r}=ae(),c=!!(a!=null&&a.hasOrg)&&!!t,x=a!=null&&a.isOrgAdmin?"Admin":a!=null&&a.isEducator?"Educator":"Student";return e.jsxs(u,{className:"divide-y divide-border/20 p-0",children:[c?e.jsxs("button",{type:"button",onClick:()=>s("/org"),className:"flex w-full items-center gap-3 px-4 py-3.5 text-left active:bg-card/70",children:[e.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-primary/10",children:e.jsx(E,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:t.name}),e.jsx(V,{variant:"outline",className:"shrink-0 text-3xs",children:x})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:((r==null?void 0:r.length)??0)>0?`${r.length} class${r.length===1?"":"es"}`:"Manage organization"})]}),e.jsx(v,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}):e.jsxs("button",{type:"button",onClick:()=>s("/org"),className:"flex w-full items-center gap-3 px-4 py-3.5 text-left active:bg-card/70",children:[e.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-muted/40",children:e.jsx(E,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Organization"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Create or join an organization"})]}),e.jsx(v,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("button",{type:"button",onClick:()=>s("/join"),className:"flex w-full items-center gap-3 px-4 py-3 text-left active:bg-card/70",children:[e.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-muted/40",children:e.jsx(me,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Join a class"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a code from your instructor"})]}),e.jsx(v,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})]})}function we(){const s=y(),[a,t]=m.useState(!1),[r,c]=m.useState(!1),x=async()=>{c(!0);try{const{error:l}=await S.rpc("delete_own_account");if(l)throw l;const{Preferences:i}=await K(async()=>{const{Preferences:n}=await import("./index-B8vKoKCv.js").then(d=>d.cH);return{Preferences:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]));await i.clear(),localStorage.clear(),await J(),P.success("Your account has been deleted."),s("/sign-in",{replace:!0})}
2catch(l){console.error("Account deletion failed:",l);const i=(l==null?void 0:l.message)||(l==null?void 0:l.error_description)||String(l);P.error(`Could not delete account: ${i}`)}finally{c(!1),t(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"p-4",children:[e.jsx("p",{className:"mb-3 text-xs leading-snug text-muted-foreground",children:"Permanently delete your account and all associated data including conversations, research, courses, and portfolio connections."}),e.jsxs("button",{type:"button",onClick:()=>t(!0),className:"flex items-center gap-2 rounded-xl border border-destructive/50 px-4 py-2.5 text-sm font-medium text-destructive transition-colors active:bg-destructive/10",children:[e.jsx(I,{className:"h-4 w-4"}),"Delete account"]})]}),e.jsx(G,{open:a,onOpenChange:t,children:e.jsxs($,{children:[e.jsxs(M,{children:[e.jsx(Y,{children:"Delete your account?"}),e.jsx(Z,{children:"This will permanently delete your account and all your data — conversations, research reports, course progress, and portfolio connections. This action cannot be undone."})]}
2),e.jsxs(H,{children:[e.jsx(X,{disabled:r,children:"Cancel"}),e.jsx(q,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:l=>{l.preventDefault(),x()},disabled:r,children:r?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"mr-1.5 h-4 w-4 animate-spin"}),"Deleting…"]}):"Delete permanently"})]})]})})]})}function $e(){const s=y(),[a,t]=m.useState("profile");return e.jsxs("div",{className:"flex h-dvh flex-col bg-background",children:[e.jsx("header",{className:"sticky top-0 z-40 shrink-0 border-b border-border/20 bg-background/80 backdrop-blur-xl",children:e.jsxs("div",{className:"flex items-center gap-0.5 px-1 py-1.5",children:[e.jsx("button",{type:"button",onClick:()=>s(-1),"aria-label":"Back",className:"grid h-8 w-8 place-items-center rounded-full text-muted-foreground transition-colors active:bg-muted/40",children:e.jsx(re,{className:"h-5 w-5"})}),e.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"Settings"})]})}),e.jsx("div",{className:"shrink-0 px-4 pb-1 pt-2",children:e.jsx(ee,{value:a,onChange:t,segments:[{value:"profile",label:"Profile"},{value:"prefs",label:"Preferences"},{value:"alerts",label:"Alerts"}]})}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-4",style:{paddingBottom:ue}
2,children:e.jsxs("div",{className:"w-full max-w-md space-y-8",children:[a==="profile"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx(p,{children:"Profile"}),e.jsx(he,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"Tap the photo to change it. Your name shows on shared chats and reports."})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Your interests"}),e.jsx(Ne,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"We tailor your news, suggestions, and Fineas toward these."})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Organization & Classes"}),e.jsx(ye,{})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Voice History"}),e.jsx(u,{className:"p-0",children:e.jsxs("button",{type:"button",onClick:()=>s("/saved-answers"),className:"flex w-full items-center gap-3 px-4 py-3.5 text-left active:bg-card/70",children:[e.jsx("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-primary/10",children:e.jsx(ne,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Saved Answers"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Browse your voice conversation transcripts"})]}),e.jsx(v,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Account"}),e.jsx(we,{})]})]}),a==="prefs"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx(p,{children:"How Fineas responds"}),e.jsx(je,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"Both styles use bullet points and bold key terms — concise just keeps it tighter."})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Voice agent"}),e.jsx(u,{className:"p-3",children:e.jsx(Q,{})})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Text size"}),e.jsx(be,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"Changes text size across the app. Layout and spacing stay the same."})]})]}),a==="alerts"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx(p,{children:"Notifications"}),e.jsx(fe,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"Requires notification permission; delivery starts with the next backend deploy."})]}),e.jsxs("section",{children:[e.jsx(p,{children:"Price alerts"}),e.jsx(ve,{}),e.jsx("p",{className:"mt-2 px-1 text-xs leading-snug text-muted-foreground/70",children:"Alerts notify while the app is open; background push lands with the next backend deploy."})]})]})]})})]})}export{$e as default};

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.