PageSourceSearch

https://app.tutoremy.ai/assets/Invite-DB7upxl0.js

js tutoremy.ai collected 2026-10-05 13:51:35 UTC 2,813 bytes, 1 lines download raw bytes

1import{ap as L,l as R,p as B,r as s,j as e,o as E,C as h,v as f,w as g,R as j,k as p,B as r,L as i,J as v}from"./index-Bch6FxxE.js";import{B as N}from"./BrandLink-7TOKeZNu.js";import{U as $}from"./user-plus-BAoPMNSL.js";import{L as A}from"./log-in-BjBDAQYH.js";function _(){const{token:t}=L(),l=R(),{user:c,loading:a}=B(),[n,w]=s.useState(null),[y,b]=s.useState(!0),[d,C]=s.useState(""),[o,u]=s.useState(!1),x=s.useRef(!1);if(s.useEffect(()=>{if(!t||a||x.current)return;x.current=!0;async function I(){try{const{data:S}=await v.getInviteInfo(t);if(w(S),c){u(!0);try{const{data:k}=await v.claimShare(t);l(`/guide/${k.guide_slug}`,{replace:!0});return}catch{u(!1)}}}catch{C("This invite is no longer valid.")}finally{b(!1)}}I()},[t,c,a,l]),y||o||a)return e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background px-4",children:[e.jsx(E,{className:"h-8 w-8 animate-spin text-primary mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:o?"Setting up your shared guide...":"Loading invite..."})]});if(d||!n)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:e.jsxs(h,{className:"w-full max-w-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx(N,{}),e.jsx(g,{className:"text-2xl",children:"Invite not found"}),e.jsx(j,{children:d||"This invite link is no longer valid or has already been claimed."})]}),e.jsx(p,{children:e.jsx(r,{asChild:!0,className:"w-full",children:e.jsx(i,{to:"/login",children:"Go to Sign In"})})})]})});const m=encodeURIComponent(`/invite/${t}`);return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:e.jsxs(h,{className:"w-full max-w-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx(N,{}),e.jsx(g,{className:"text-2xl",children:"You've been invited!"}),e.jsxs(j,{children:[e.jsx("strong",{children:n.sender_name})," has shared a Study Guide with you"]})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 text-center overflow-hidden",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Study Guide"}),e.jsx("p",{className:"text-lg font-semibold break-words line-clamp-2",children:n.guide_title})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(r,{asChild:!0,className:"w-full gap-2",children:e.jsxs(i,{to:`/signup?redirect=${m}`,children:[e.jsx($,{className:"h-4 w-4"}),"Create Account"]})}),e.jsx(r,{asChild:!0,variant:"outline",className:"w-full gap-2",children:e.jsxs(i,{to:`/login?redirect=${m}`,children:[e.jsx(A,{className:"h-4 w-4"}),"Sign In"]})})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Sign in or create an account to view the shared study guide."})]})]})})}export{_ 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.