PageSourceSearch

https://academy.lovable.app/assets/academy-CMxE-4a7.js

js academy.lovable.app collected 2026-10-03 03:18:20 UTC 8,483 bytes, 1 lines download raw bytes

1import{j as e,L as g,r,O as w}from"./index-DAs1KOK5.js";import{u as b}from"./useLocation-Bajg31Rx.js";import{t as h}from"./track-3q73ADp9.js";import{X as S}from"./x-BBWHJJ6r.js";import{E as C}from"./external-link-Chl25UFc.js";import{c as j}from"./createLucideIcon-UDRdbThm.js";import{D as L,a as B,b as D,c as E,d as F,T as z}from"./textarea-Cs8q18jb.js";import{B as O}from"./button-Ei9c70Yw.js";import{s as _}from"./feedback.functions-C2lqly1p.js";import{C as A}from"./check-BMzPj47b.js";import{S as T}from"./send-CDPXOVlc.js";import"./index-DnAf2n9M.js";import"./index-Cwcw04lZ.js";import"./index-CRlCp5gk.js";import"./index-8mUa3fam.js";import"./utils-BQHNewu7.js";import"./auth-middleware-B2D2EF1g.js";const M=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],R=j("menu",M);const $=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],I=j("message-circle",$),y="/assets/logo-academy-CsmB2WLC.svg",H=[{label:"Learn",items:[{title:"Get started",to:"/academy"},{title:"Learning paths",to:"/academy/learning-path"},{title:"Learn to prompt",to:"/academy/prompting"},{title:"Video catalog",to:"/academy/video-catalog"}]},{label:"Build",items:[{title:"Templates",to:"/academy/templates"},{title:"Build inspiration",to:"/academy/what-to-build"}]},{label:"Reference",items:[{title:"Go deeper",to:"/academy/go-deeper"},{title:"Docs",to:"https://docs.lovable.dev",external:!0},{title:"Community",to:"https://lovable.dev/community",external:!0}]}];function V(n,s){return s==="/academy"?n==="/academy":n.startsWith(s)}function v({onClose:n,onOpenFeedback:s}){const d=b().pathname;return e.jsxs("aside",{className:"flex h-full w-[var(--sidebar-width)] flex-col bg-white border-r border-[#e5e5e5]",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 pt-7 pb-6",children:[e.jsx(g,{to:"/academy",className:"no-underline flex items-center",children:e.jsx("img",{src:y,alt:"Lovable Academy",className:"h-6"})}),n&&e.jsx("button",{onClick:n,className:"lg:hidden p-1 -mr-1 text-[var(--brand-black-60)] hover:text-[var(--brand-black)] transition-colors duration-150","aria-label":"Close navigation menu",children:e.jsx(S,{size:20})})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-4 pb-6","aria-label":"Academy navigation",children:H.map(t=>e.jsxs("div",{className:"mb-5",children:[e.jsx("div",{className:"eyebrow-m text-muted-foreground px-2 mb-2",children:t.label}),e.jsx("ul",{className:"list-none m-0 p-0",children:t.items.map(a=>{if(a.external)return e.jsx("li",{children:e.jsxs("a",{href:a.to,target:"_blank",rel:"noopener noreferrer","aria-label":`${a.title} (opens in new tab)`,className:"paragraph-s flex items-center gap-1.5 rounded-md px-2 py-2 text-[var(--brand-black)] no-underline hover:bg-brand-creme/60 transition-colors duration-150",children:[a.title,e.jsx(C,{size:13,className:"opacity-50"})]})},a.to);const l=V(d,a.to);return e.jsx("li",{children:e.jsxs(g,{to:a.to,onClick:()=>{h("sidebar_nav_click",{destination:a.to,label:a.title}),n?.()},className:`paragraph-s flex items-center gap-2 rounded-md px-2 py-2 no-underline transition-colors duration-150 ${l?"font-semibold text-[var(--brand-black)] bg-brand-creme":"text-[var(--brand-black)] hover:bg-brand-creme/60"}`,children:[a.title,a.beta&&e.jsx("span",{className:"inline-flex items-center rounded-full border border-[#e5e5e5] bg-brand-creme px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide leading-none text-[var(--brand-black-60)]",children:"Beta"})]})},a.to)})})]},t.label))}),e.jsx("div",{className:"px-4 pb-6 pt-2",children:e.jsxs("button",{onClick:s,className:"paragraph-s flex w-full items-center justify-center gap-2 rounded-lg px-3 py-2.5 font-semibold tracking-normal bg-brand-black text-white no-underline hover:bg-[#2a2a2a] transition-colors duration-150",children:[e.jsx(I,{size:16,className:"text-white"}),"Share feedback"]})})]})}function W({open:n,onOpenChange:s}){const[m,d]=r.useState(""),[t,a]=r.useState(""),[l,i]=r.useState("idle"),[p,x]=r.useState(""),u=r.useRef(0),k=b(),o=m.trim().length,f=o>=10&&o<=1e3,N=async()=>
1{if(Date.now()-u.current<3e4){x("Please wait a moment before submitting again.");return}if(f){i("submitting"),x("");try{await _({data:{message:m.trim(),pageUrl:k.pathname,honeypot:t}}),i("success"),u.current=Date.now(),setTimeout(()=>{s(!1),i("idle"),d(""),a("")},2e3)}catch{x("Something went wrong. Please try again."),i("idle")}}};return e.jsx(L,{open:n,onOpenChange:c=>{c&&h("feedback_opened"),s(c),c||(i("idle"),x(""))},children:e.jsxs(B,{className:"sm:max-w-md border-[#e5e5e5] bg-white",children:[e.jsxs(D,{children:[e.jsx(E,{className:"text-[var(--brand-black)] text-lg font-semibold tracking-normal",children:"Send feedback"}),e.jsx(F,{className:"text-[#666] text-sm",children:"Help us improve Lovable Academy. What's on your mind?"})]}),l==="success"?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[#E8F5E9]",children:e.jsx(A,{size:24,className:"text-[#2E7D32]"})}),e.jsx("p",{className:"text-[var(--brand-black)] font-semibold tracking-normal",children:"Thank you for your feedback!"})]}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{children:[e.jsx(z,{value:m,onChange:c=>d(c.target.value),placeholder:"Tell us what you think...",className:"min-h-[120px] resize-none border-[#e5e5e5] bg-white text-[var(--brand-black)] placeholder:text-[#999] focus-visible:ring-[var(--brand-black)]",maxLength:1e3,disabled:l==="submitting"}),e.jsxs("div",{className:"mt-1.5 flex items-center justify-between",children:[e.jsx("span",{className:`text-xs ${o>0&&o<10?"text-[#D32F2F]":"text-[#999]"}`,children:o>0&&o<10?`${10-o} more characters needed`:" "}),e.jsxs("span",{className:"text-xs text-[#999]",children:[o,"/1000"]})]})]}),e.jsx("input",{type:"text",value:t,onChange:c=>a(c.target.value),tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"absolute -left-[9999px] h-0 w-0 overflow-hidden opacity-0"}),p&&e.jsx("p",{className:"text-sm text-[#D32F2F]",children:p}),e.jsx(O,{onClick:N,disabled:!f||l==="submitting",className:"w-full bg-[var(--brand-black)] text-white hover:bg-[#333] disabled:opacity-40",children:l==="submitting"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/30 border-t-white"}),"Sending..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(T,{size:16}),"Send feedback"]})})]})]})})}function G(){const[n,s]=r.useState(!1),[m,d]=r.useState(!1),t=b();r.useLayoutEffect(()=>{const i=document.documentElement,p=i.style.scrollBehavior;i.style.scrollBehavior="auto",t.hash?document.getElementById(t.hash.slice(1))?.scrollIntoView({block:"start",behavior:"auto"}):window.scrollTo({top:0,left:0,behavior:"auto"}),i.style.scrollBehavior=p},[t.pathname,t.hash]);const a=r.useRef(t.pathname);r.useEffect(()=>{h("page_view",{path:t.pathname}),a.current=t.pathname},[t.pathname]);const l=()=>{s(!1),d(!0)};return e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsx("a",{href:"#main-content",className:"skip-to-content",children:"Skip to content"}),e.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:left-0 lg:z-30 lg:block",children:e.jsx(v,{onOpenFeedback:l})}),e.jsxs("div",{className:"sticky top-0 z-20 flex h-14 items-center border-b border-[#e5e5e5] bg-white/95 backdrop-blur-sm px-4 lg:hidden",children:[e.jsx("button",{onClick:()=>s(!0),className:"p-2 -ml-2 text-[var(--brand-black)] hover:bg-[#1B1B1B08] rounded-md transition-colors duration-150","aria-label":"Open navigation menu",children:e.jsx(R,{size:22})}),e.jsx("img",{src:y,alt:"Lovable Academy",className:"h-5 ml-3"})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-black/20 animate-backdrop-fade-in backdrop-blur-[2px] lg:hidden",onClick:()=>s(!1)}),e.jsx("div",{className:"fixed inset-y-0 left-0 z-50 animate-slide-in-left lg:hidden",children:e.jsx(v,{onClose:()=>s(!1),onOpenFeedback:l})})]}),e.jsx("main",{id:"main-content",className:"lg:ml-[var(--sidebar-width)]",children:e.jsx("div",{className:"mx-auto max-w-[1100px] px-6 py-10 sm:px-8 md:px-12 lg:py-16",children:e.jsx("div",{children:e.jsx(w,{})},t.pathname)})}),e.jsx(W,{open:m,onOpenChange:d})]})}const oe=G;export{oe 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.