PageSourceSearch

https://mentay.ai/assets/AssistantPage-B3b_GKmb.js

js mentay.ai collected 2026-10-05 13:30:42 UTC 9,104 bytes, 1 lines download raw bytes

1import{r as d,g as P,s as T,z as $,H as c,f as L,o as r,a as t,c as n,F as v,q as w,j as f,h as x,t as i,e as N,W as S,w as V,v as Y}from"./index-C1d_tkr5.js";import{G as D}from"./GrowthLayout-D7O_8XC8.js";import"./LeftSideBar-Cn0ovPc6.js";const K={key:0,class:"mt-8 space-y-4"},q={key:1,class:"mt-8 space-y-5"},z={class:"rounded-2xl border border-[var(--border-color)] bg-[var(--surface-white)] p-5"},F={key:0,class:"mt-4 divide-y divide-[var(--border-color)]"},G=["onClick"],H={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},E={class:"min-w-0 flex-1"},I={key:0,class:"text-xs text-[var(--text-secondary)]"},O={key:0},U={key:1},W={key:2},J=["onClick"],Q={key:1,class:"mt-4 text-sm text-[var(--text-secondary)]"},X={class:"mt-3 flex gap-2"},Z=["onKeydown"],tt={class:"grid grid-cols-1 lg:grid-cols-2 gap-5"},et={class:"rounded-2xl border border-[var(--border-color)] bg-[var(--surface-white)] p-5"},st={class:"mt-3 text-sm text-[var(--text-primary)] italic"},ot={class:"mt-3 space-y-2"},rt=["onClick","title"],nt={class:"flex-shrink-0"},at={key:0,xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",class:"text-[var(--text-primary)]"},it={key:1,xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"text-[var(--text-primary)]"},lt={key:2,class:"block w-[15px] h-[15px] rounded-full border border-[var(--border-color)]"},dt=["disabled"],ct=["disabled"],ut={class:"rounded-2xl border border-[var(--border-color)] bg-[var(--surface-white)] p-5"},pt={class:"mt-4 space-y-2"},vt=["onClick"],gt={__name:"AssistantPage",setup(xt){const h=L(),y=d(!0),a=d([]),p=d(null),k=d([]),m=d(""),l=d(!1),C=async()=>{y.value=!0;try{const o=await c.getAssistant();a.value=(o==null?void 0:o.reminders)||[],p.value=(o==null?void 0:o.plan)||null,k.value=(o==null?void 0:o.suggestions)||[]}catch{a.value=[]}finally{y.value=!1}},A=async o=>{const e=!o.completed;o.completed=e;try{await c.updateAssistantReminder(o.id,{completed:e}),e&&setTimeout(()=>{a.value=a.value.filter(s=>s.id!==o.id)},250)}catch{o.completed=!e}},b=async()=>{const o=m.value.trim();if(o){m.value="";try{const e=await c.createAssistantReminder({title:o});a.value.push(e)}catch{}}},B=async o=>{a.value=a.value.filter(e=>e.id!==o.id);try{await c.deleteAssistantReminder(o.id)}catch{}},_=async()=>{if(!l.value){l.value=!0;try{p.value=await c.generateAssistantPlan()}catch{}finally{l.value=!1}}},M=async o=>{const s={pending:"next",next:"done",done:"pending"}[o.status]||"pending",u=o.status;o.status=s;try{await c.updateAssistantPlanStep(o.id,s)}catch{o.status=u}},g=d(!1),R=async o=>{if(!g.value){g.value=!0;try{const e=await c.newThread(o);e&&e.sid?h.push(`/chat/${e.sid}`):h.push("/new-chat")}catch{h.push("/new-chat")}finally{g.value=!1}}};return P(C),(o,e)=>(r(),T(D,{title:"Assistant"},{default:$(()=>[e[10]||(e[10]=t("p",{class:"text-[11px] font-semibold uppercase tracking-wider text-[var(--text-secondary)]"},"Intelligent Assistance",-1)),e[11]||(e[11]=t("h2",{class:"mt-2 text-3xl leading-tight text-[var(--text-primary)]"},"Turn clarity into action.",-1)),e[12]||(e[12]=t("p",{class:"mt-3 text-sm text-[var(--text-secondary)] max-w-xl"},"Once you decide, MentaY helps you carry it — plans, reminders, and the next move, quietly held until you need them.",-1)),y.value?(r(),n("div",K,e[1]||(e[1]=[t("div",{class:"h-44 rounded-2xl bg-[var(--surface-secondary)] animate-pulse"},null,-1),t("div",{class:"h-32 rounded-2xl bg-[var(--surface-secondary)] animate-pulse"},null,-1)]))):(r(),n("div",q,[t("section",z,[e[4]||(e[4]=t("div",{class:"flex items-center gap-2 text-[var(--text-primary)]"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),t("path",{d:"M16 2v4M8 2v4M3 10h18"})]),t("h3",{class:"text-sm font-medium"},"Coming up")],-1)),a.value.length?(r(),n("div",F,[(r(!0),n(v,null,w(a.value,s=>(r(),n("div",{key:s.id,class:"flex items-start gap-3 py-3 first:pt-0 group"},[t("button",{onClick:u=>
1A(s),class:f(["mt-0.5 w-5 h-5 rounded-md flex items-center justify-center flex-shrink-0 border cursor-pointer transition",s.completed?"bg-[var(--text-primary)] border-[var(--text-primary)] text-[var(--surface-white)]":"border-[var(--border-color)] hover:border-[var(--text-secondary)]"])},[s.completed?(r(),n("svg",H,e[2]||(e[2]=[t("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):x("",!0)],10,G),t("div",E,[t("p",{class:f(["text-sm text-[var(--text-primary)]",{"line-through text-[var(--text-secondary)]":s.completed}])},i(s.title),3),s.schedule_label||s.source?(r(),n("p",I,[s.schedule_label?(r(),n("span",O,i(s.schedule_label),1)):x("",!0),s.schedule_label&&s.source?(r(),n("span",U," · ")):x("",!0),s.source?(r(),n("span",W,i(s.source),1)):x("",!0)])):x("",!0)]),t("button",{onClick:u=>B(s),class:"opacity-0 group-hover:opacity-100 text-[var(--text-secondary)] hover:text-[var(--text-red)] transition cursor-pointer",title:"Remove"},e[3]||(e[3]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)]),8,J)]))),128))])):(r(),n("p",Q,"Nothing scheduled. Add a reminder or ask MentaY to set one up.")),t("div",X,[N(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),onKeydown:S(V(b,["prevent"]),["enter"]),type:"text",placeholder:"Add a reminder...",class:"flex-1 px-3 py-1.5 rounded-lg bg-[var(--surface-secondary)] border-0 text-sm text-[var(--text-primary)] focus:outline-none focus:ring-2 focus:ring-[var(--accent-blue)]"},null,40,Z),[[Y,m.value]]),t("button",{onClick:b,class:"px-3 py-1.5 rounded-lg bg-[var(--text-primary)] text-[var(--surface-white)] text-sm font-medium hover:opacity-90 transition cursor-pointer"},"Add")])]),t("div",tt,[t("section",et,[e[8]||(e[8]=t("div",{class:"flex items-center gap-2 text-[var(--text-primary)]"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M9 11l3 3L22 4"}),t("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]),t("h3",{class:"text-sm font-medium"},"A plan you made")],-1)),p.value?(r(),n(v,{key:0},[t("p",st,'"'+i(p.value.title)+'" — broken into steps.',1),t("div",ot,[(r(!0),n(v,null,w(p.value.steps,s=>(r(),n("button",{key:s.id,onClick:u=>M(s),class:"w-full flex items-center gap-2.5 text-left text-sm cursor-pointer group",title:"Tap to change status ("+s.status+")"},[t("span",nt,[s.status==="done"?(r(),n("svg",at,e[5]||(e[5]=[t("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):s.status==="next"?(r(),n("svg",it,e[6]||(e[6]=[t("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1),t("polyline",{points:"12 5 19 12 12 19"},null,-1)]))):(r(),n("span",lt))]),t("span",{class:f({"text-[var(--text-primary)]":s.status==="next","text-[var(--text-secondary)] line-through":s.status==="done","text-[var(--text-secondary)]":s.status==="pending"})},i(s.text),3)],8,rt))),128))]),t("button",{onClick:_,disabled:l.value,class:"mt-3 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[var(--text-primary)] text-[var(--surface-white)] text-sm font-medium hover:opacity-90 transition cursor-pointer disabled:opacity-60"},i(l.value?"Building plan…":"Replace plan"),9,dt)],64)):(r(),n(v,{key:1},[e[7]||(e[7]=t("p",{class:"mt-3 text-sm text-[var(--text-secondary)]"},"No plan yet. Let MentaY break your current goal into steps.",-1)),t("button",{onClick:_,disabled:l.value,class:"mt-3 inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[var(--text-primary)] text-[var(--surface-white)] text-sm font-medium hover:opacity-90 transition cursor-pointer disabled:opacity-60"},i(l.value?"Building plan…":"Build a plan"),9,ct)],64))]),t("section",ut,[e[9]||(e[9]=t("div",{class:"flex items-center gap-2 text-[var(--text-primary)]"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 6v6l4 2"})]),t("h3",{class:"text-sm font-medium"},"Ask MentaY to...")],-1)),t("div",pt,[(r(!0),n(v,null,w(k.value,(s,u)=>(r(),n("button",{key:u,onClick:j=>R(s),class:"w-full text-left px-3.5 py-2.5 rounded-xl border border-[var(--border-color)] text-sm text-[var(--text-primary)] hover:bg-[var(--hover-color)] transition cursor-pointer"},i(s),9,vt))),128))])])])]))]),_:1}))}};export{gt 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.