PageSourceSearch

https://www.birdfact.com/_next/static/chunks/3872632948183734.js?dpl=dpl_78Hg7JsArJsRSeqGxpWzHwT829Ez

js birdfact.com collected 2026-10-02 05:04:23 UTC 48,906 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,643531,e=>{"use strict";var t=e.i(678745);e.s(["Check",()=>t.default])},409797,e=>{"use strict";var t=e.i(631171);e.s(["ChevronDownIcon",()=>t.default])},373375,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],373375)},687607,e=>{"use strict";var t=e.i(271645),s=e.i(981140),a=e.i(30030),i=e.i(369340),n=e.i(934620),r=e.i(820783),l=e.i(248425),o=e.i(296626),d=e.i(610772),c=e.i(843476),u="Collapsible",[m,h]=(0,a.createContextScope)(u),[x,f]=m(u),p=t.forwardRef((e,s)=>{let{__scopeCollapsible:a,open:n,defaultOpen:r,disabled:o,onOpenChange:m,...h}=e,[f,p]=(0,i.useControllableState)({prop:n,defaultProp:r??!1,onChange:m,caller:u});return(0,c.jsx)(x,{scope:a,disabled:o,contentId:(0,d.useId)(),open:f,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),children:(0,c.jsx)(l.Primitive.div,{"data-state":w(f),"data-disabled":o?"":void 0,...h,ref:s})})});p.displayName=u;var g="CollapsibleTrigger",y=t.forwardRef((e,t)=>{let{__scopeCollapsible:a,...i}=e,n=f(g,a);return(0,c.jsx)(l.Primitive.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":w(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...i,ref:t,onClick:(0,s.composeEventHandlers)(e.onClick,n.onOpenToggle)})});y.displayName=g;var b="CollapsibleContent",j=t.forwardRef((e,t)=>{let{forceMount:s,...a}=e,i=f(b,e.__scopeCollapsible);return(0,c.jsx)(o.Presence,{present:s||i.open,children:({present:e})=>(0,c.jsx)(v,{...a,ref:t,present:e})})});j.displayName=b;var v=t.forwardRef((e,s)=>{let{__scopeCollapsible:a,present:i,children:o,...d}=e,u=f(b,a),[m,h]=t.useState(i),x=t.useRef(null),p=(0,r.useComposedRefs)(s,x),g=t.useRef(0),y=g.current,j=t.useRef(0),v=j.current,N=u.open||m,k=t.useRef(N),C=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,n.useLayoutEffect)(()=>{let e=x.current;if(e){C.current=C.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();g.current=t.height,j.current=t.width,k.current||(e.style.transitionDuration=C.current.transitionDuration,e.style.animationName=C.current.animationName),h(i)}},[u.open,i]),(0,c.jsx)(l.Primitive.div,{"data-state":w(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!N,...d,ref:p,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:N&&o})});function w(e){return e?"open":"closed"}e.s(["Collapsible",()=>p,"CollapsibleContent",()=>j,"CollapsibleTrigger",()=>y,"Content",()=>j,"Root",()=>p,"Trigger",()=>y,"createCollapsibleScope",()=>h])},890538,e=>{"use strict";var t=e.i(843476),s=e.i(409797),a=e.i(271645),i=e.i(30030),n=e.i(75830),r=e.i(820783),l=e.i(981140),o=e.i(369340),d=e.i(248425),c=e.i(687607),u=e.i(610772),m=e.i(586318),h="Accordion",x=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[f,p,g]=(0,n.createCollection)(h),[y,b]=(0,i.createContextScope)(h,[g,c.createCollapsibleScope]),j=(0,c.createCollapsibleScope)(),v=a.default.forwardRef((e,s)=>{let{type:a,...i}=e;return(0,t.jsx)(f.Provider,{scope:e.__scopeAccordion,children:"multiple"===a?(0,t.jsx)(A,{...i,ref:s}):(0,t.jsx)(S,{...i,ref:s})})});v.displayName=h;var[w,N]=y(h),[k,C]=y(h,{collapsible:!1}),S=a.default.forwardRef((e,s)=>{let{value:i,defaultValue:n,onValueChange:r=()=>{},collapsible:l=!1,...d}=e,[c,u]=(0,o.useControllableState)({prop:i,defaultProp:n??"",onChange:r,caller:h});return(0,t.jsx)(w,{scope:e.__scopeAccordion,value:a.default.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:a.default.useCallback(()=>l&&u(""),[l,u]),children:(0,t.jsx)(k,{scope:e.__scopeAccordion,collapsible:l,children:(0,t.jsx)(T,{...d,ref:s})})})}),A=a.default.forwardRef((e,s)=>{let{value:i,defaultValue:n,onValueChange:r=()=>{},...l}=e,[d,c]=(0,o.useControllableState)({prop:i,defaultProp:n??[],onChange:r,caller:h}),u=a.default.useCallback(e=>c((t=[])=>[...t,e]),[c]),m=a.default.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,t.jsx)(w,{scope:e.__scopeAccordion,value:d,onItemOpen:u,onItemClose:m,children:(0,t.jsx)(k,{scope:e.__scopeAccordion,collapsible:!0,children:(0,t.jsx)(T,{...l,ref:s})})})}),[I,R]=y(h),T=a.default.forwardRef((e,s)=>{let{__scopeAccordion:i,disabled:n,dir:o,orientation:c="vertical",...u}=e,h=a.default.useRef(null),g=(0,r.useComposedRefs)(h,s),y=p(i),b="ltr"===(0,m.useDirection)(o),j=(0,l.composeEventHandlers)(e.onKeyDown,e=>
1{if(!x.includes(e.key))return;let t=e.target,s=y().filter(e=>!e.ref.current?.disabled),a=s.findIndex(e=>e.ref.current===t),i=s.length;if(-1===a)return;e.preventDefault();let n=a,r=i-1,l=()=>{(n=a+1)>r&&(n=0)},o=()=>{(n=a-1)<0&&(n=r)};switch(e.key){case"Home":n=0;break;case"End":n=r;break;case"ArrowRight":"horizontal"===c&&(b?l():o());break;case"ArrowDown":"vertical"===c&&l();break;case"ArrowLeft":"horizontal"===c&&(b?o():l());break;case"ArrowUp":"vertical"===c&&o()}let d=n%i;s[d].ref.current?.focus()});return(0,t.jsx)(I,{scope:i,disabled:n,direction:o,orientation:c,children:(0,t.jsx)(f.Slot,{scope:i,children:(0,t.jsx)(d.Primitive.div,{...u,"data-orientation":c,ref:g,onKeyDown:n?void 0:j})})})}),E="AccordionItem",[_,M]=y(E),P=a.default.forwardRef((e,s)=>{let{__scopeAccordion:a,value:i,...n}=e,r=R(E,a),l=N(E,a),o=j(a),d=(0,u.useId)(),m=i&&l.value.includes(i)||!1,h=r.disabled||e.disabled;return(0,t.jsx)(_,{scope:a,open:m,disabled:h,triggerId:d,children:(0,t.jsx)(c.Root,{"data-orientation":r.orientation,"data-state":z(m),...o,...n,ref:s,disabled:h,open:m,onOpenChange:e=>{e?l.onItemOpen(i):l.onItemClose(i)}})})});P.displayName=E;var B="AccordionHeader",D=a.default.forwardRef((e,s)=>{let{__scopeAccordion:a,...i}=e,n=R(h,a),r=M(B,a);return(0,t.jsx)(d.Primitive.h3,{"data-orientation":n.orientation,"data-state":z(r.open),"data-disabled":r.disabled?"":void 0,...i,ref:s})});D.displayName=B;var U="AccordionTrigger",O=a.default.forwardRef((e,s)=>{let{__scopeAccordion:a,...i}=e,n=R(h,a),r=M(U,a),l=C(U,a),o=j(a);return(0,t.jsx)(f.ItemSlot,{scope:a,children:(0,t.jsx)(c.Trigger,{"aria-disabled":r.open&&!l.collapsible||void 0,"data-orientation":n.orientation,id:r.triggerId,...o,...i,ref:s})})});O.displayName=U;var W="AccordionContent",L=a.default.forwardRef((e,s)=>{let{__scopeAccordion:a,...i}=e,n=R(h,a),r=M(W,a),l=j(a);return(0,t.jsx)(c.Content,{role:"region","aria-labelledby":r.triggerId,"data-orientation":n.orientation,...l,...i,ref:s,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function z(e){return e?"open":"closed"}L.displayName=W,e.s(["Accordion",()=>v,"AccordionContent",()=>L,"AccordionHeader",()=>D,"AccordionItem",()=>P,"AccordionTrigger",()=>O,"Content",()=>L,"Header",()=>D,"Item",()=>P,"Root",()=>v,"Trigger",()=>O,"createAccordionScope",()=>b],767660);var q=e.i(767660),q=q,F=e.i(647163);function $({...e}){return(0,t.jsx)(q.Root,{"data-slot":"accordion",...e})}function H({className:e,...s}){return(0,t.jsx)(q.Item,{"data-slot":"accordion-item",className:(0,F.cn)("border-b last:border-b-0",e),...s})}function K({className:e,children:a,...i}){return(0,t.jsx)(q.Header,{className:"flex",children:(0,t.jsxs)(q.Trigger,{"data-slot":"accordion-trigger",className:(0,F.cn)("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...i,children:[a,(0,t.jsx)(s.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function G({className:e,children:s,...a}){return(0,t.jsx)(q.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...a,children:(0,t.jsx)("div",{className:(0,F.cn)("pt-0 pb-4",e),children:s})})}e.s(["Accordion",()=>$,"AccordionContent",()=>G,"AccordionItem",()=>H,"AccordionTrigger",()=>K],890538)},286536,e=>{"use strict";let t=(0,e.i(475254).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],286536)},77705,e=>{"use strict";let t=(0,e.i(475254).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",()=>t],77705)},433234,478949,265447,e=>{"use strict";var t=e.i(843476),s=e.i(522016),a=e.i(271645),i=e.i(531278),n=e.i(263488);let r=(0,e.i(475254).default)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}
1],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);var l=e.i(167881),o=e.i(920755);let d=60,c=new Set(["user_already_exists","email_exists"]);function u(e){let{data:t,error:s}=e;if(s)return s.code&&c.has(s.code)||/already (been )?registered/i.test(s.message)?{kind:"existing"}:{kind:"error",message:h(s)};if(t?.session)return{kind:"session",session:t.session};let a=t?.user?.identities;return Array.isArray(a)&&0===a.length?{kind:"existing"}:{kind:"confirm"}}function m(e){return!!e&&("email_not_confirmed"===e.code||/email not confirmed/i.test(e.message??""))}function h(e){switch(e.code){case"over_email_send_rate_limit":return"We’ve sent a lot of emails just now. Please wait a minute and try again.";case"over_request_rate_limit":return"Too many attempts just now. Please wait a minute and try again.";case"email_address_invalid":return"Please enter a valid email address.";case"weak_password":return e.message||"Please choose a stronger password.";case"signup_disabled":return"New sign-ups are paused at the moment. Please try again later."}return 429===e.status?"Too many attempts just now. Please wait a minute and try again.":e.message}e.s(["RESEND_COOLDOWN_SECONDS",0,d,"authErrorMessage",()=>h,"classifySignUp",()=>u,"isEmailNotConfirmedError",()=>m],478949);let x=/[\u0000-\u001F\u007F]/,f="http://next-path.invalid";function p(e){let t;if("string"!=typeof e||0===e.length||e.length>2048||!e.startsWith("/")||"/"===e[1]||"\\"===e[1]||x.test(e))return null;try{t=new URL(e,f)}catch{return null}if(t.origin!==f)return null;let s=`${t.pathname}${t.search}${t.hash}`;
1return s.startsWith("//")||s.startsWith("/\\")?null:s}function g(e,t="/"){return p(e)??t}function y(e,t){return`${e}/api/auth/callback?next=${encodeURIComponent(g(t))}`}function b(e,t){let s=(0,a.useRef)(t);(0,a.useEffect)(()=>{s.current=t},[t]),(0,a.useEffect)(()=>{if(!e)return;let t=(0,o.createClient)(),a=!1;function i(e){a||!e||e.user.is_anonymous||(a=!0,s.current(e))}async function n(){if(!a)try{let{data:e}=await t.auth.getSession();i(e.session)}catch{}}function r(){"visible"===document.visibilityState&&n()}n(),window.addEventListener("focus",n),document.addEventListener("visibilitychange",r);let{data:l}=t.auth.onAuthStateChange((e,t)=>{"SIGNED_IN"===e&&i(t)});return()=>{a=!0,window.removeEventListener("focus",n),document.removeEventListener("visibilitychange",r),l.subscription.unsubscribe()}},[e])}function j(){let e=(0,a.useRef)(null);return(0,a.useEffect)(()=>{e.current?.focus()},[]),e}function v({children:e}){return(0,t.jsx)("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-brand-amber/15",children:e})}function w({email:e,password:s,redirectPath:r,onSession:c,watchSession:u=!0,onUseDifferentEmail:x,backLabel:f="Use a different email",title:p="Check your inbox",intro:g,hint:w,initialCooldown:N=d,resendLabel:k="Resend email",continueLabel:C="I’ve confirmed my email",touchFriendly:S=!1}){let{secondsLeft:A,start:I}=function(e=0){let[t,s]=(0,a.useState)(e);return(0,a.useEffect)(()=>{if(t<=0)return;let e=window.setTimeout(()=>s(e=>Math.max(0,e-1)),1e3);return()=>window.clearTimeout(e)},[t]),{secondsLeft:t,start:(0,a.useCallback)((e=d)=>{s(Math.max(0,Math.ceil(e)))},[])}}(N),[R,T]=(0,a.useState)(!1),[E,_]=(0,a.useState)(!1),[M,P]=(0,a.useState)(null),[B,D]=(0,a.useState)(null),U=(0,a.useRef)(!1),O=(0,a.useCallback)(e=>{U.current||(U.current=!0,c(e))},[c]);async function W(){if(A>0||R)return;T(!0),D(null),P(null);let t=(0,o.createClient)(),{error:s}=await t.auth.resend({type:"signup",email:e,options:{emailRedirectTo:y(window.location.origin,r)}});if(T(!1),s){var a;let e,t=(a=s.message,(e=/after (\d+) seconds?/i.exec(a))?Number(e[1]):null);if(null!==t||429===s.status){I(t??d),D("You can ask for another email in a moment. Please wait for the timer.");return}D(h(s));return}I(d),P("Sent. It can take a minute to arrive, so check your spam folder too.")}async function L(){if(E)return;_(!0),D(null),P(null);let t=(0,o.createClient)();try{let{data:a}=await t.auth.getSession();if(a.session&&!a.session.user.is_anonymous)return void O(a.session);if(!s)return void D("We can’t see your confirmation yet. Open the link in the email, then try again.");let{data:i,error:n}=await t.auth.signInWithPassword({email:e,password:s});if(n)return void D(m(n)?"We haven’t had your confirmation yet. Open the link in the email we sent, then try again.":h(n));i.session&&O(i.session)}catch{D("Something went wrong. Please try again.")}finally{_(!1)}}b(u,O);let z=j(),q=S?"w-full min-h-[48px] text-base sm:min-h-0 sm:text-sm":"w-full";return(0,t.jsxs)("div",{ref:z,tabIndex:-1,className:"text-center outline-none",children:[(0,t.jsx)(v,{children:(0,t.jsx)(n.Mail,{className:"h-6 w-6 text-brand-amber","aria-hidden":"true"})}),p&&(0,t.jsx)("h2",{className:"font-serif text-xl font-medium",children:p}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:g??(0,t.jsxs)(t.Fragment,{children:["We've sent a confirmation link to"," ",(0,t.jsx)("strong",{className:"font-medium text-foreground break-words",children:e}),". Open it to confirm your email and finish creating your account."]})}),w&&(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:w}),B&&(0,t.jsx)("div",{role:"alert",className:"mt-4 rounded-md bg-destructive/10 px-3 py-2 text-left text-sm text-destructive",children:B}),M&&!B&&(0,t.jsx)("p",{role:"status",className:"mt-4 text-sm text-brand-forest",children:M}),(0,t.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,t.jsx)(l.Button,{type:"button",variant:"accent",className:q,onClick:L,disabled:E,children:E?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Checking..."]}):C}),(0,t.jsx)(l.Button,{type:"button",variant:"outline",className:q,onClick:W,disabled:R||A>0,children:R?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):A>0?`${k} in ${A}s`:k})]}),x&&(0,t.jsx)("button",{type:"button",onClick:x,className:"mt-4 text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",children:f})]})}function N({email:e,signInHref:a="/login",onSignIn:i,resetHref:n="/forgot-password",onUseDifferentEmail:o,title:d="That email already has an account",touchFriendly:c=!1}){let u=j(),m=c?"w-full min-h-[48px] text-base sm:min-h-0 sm:text-sm":"w-full";
1return(0,t.jsxs)("div",{ref:u,tabIndex:-1,className:"text-center outline-none",children:[(0,t.jsx)(v,{children:(0,t.jsx)(r,{className:"h-6 w-6 text-brand-amber","aria-hidden":"true"})}),d&&(0,t.jsx)("h2",{className:"font-serif text-xl font-medium",children:d}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:[(0,t.jsx)("strong",{className:"font-medium text-foreground break-words",children:e})," ","is already registered with Birdfact. Sign in instead, or reset your password if you've forgotten it."]}),(0,t.jsxs)("div",{className:"mt-5 space-y-2",children:[i?(0,t.jsx)(l.Button,{type:"button",variant:"accent",className:m,onClick:i,children:"Sign in"}):(0,t.jsx)(l.Button,{asChild:!0,variant:"accent",className:m,children:(0,t.jsx)(s.default,{href:a,children:"Sign in"})}),(0,t.jsx)(l.Button,{asChild:!0,variant:"outline",className:m,children:(0,t.jsx)(s.default,{href:n,children:"Reset password"})})]}),o&&(0,t.jsx)("button",{type:"button",onClick:o,className:"mt-4 text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",children:"Use a different email"})]})}e.s(["authCallbackUrl",()=>y,"safeNextPath",()=>p,"sanitiseNextPath",()=>g],265447),e.s(["CheckInboxPanel",()=>w,"ExistingAccountPanel",()=>N,"useSessionOnReturn",()=>b],433234)},514764,e=>{"use strict";let t=(0,e.i(475254).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",()=>t],514764)},735501,e=>{"use strict";let t=(0,e.i(475254).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["ImageIcon",()=>t],735501)},313131,e=>{"use strict";var t=e.i(843476),s=e.i(994179);let a=(0,e.i(475254).default)("sprout",[["path",{d:"M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3",key:"139s4v"}],["path",{d:"M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4",key:"1dlkgp"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var i=e.i(317587);let n=(0,i.getMediaUrlWithTransform)("images","robin-singing.jpg",{width:600,height:450,resize:"cover",quality:80}),r=(0,i.getMediaUrlWithTransform)("images","wren_2021-03-09-181334.jpg",{width:600,height:450,resize:"cover",quality:80}),l=(0,i.getMediaUrlWithTransform)("images","greenfinch_2023-06-30-075022_vzfz.jpg",{width:600,height:450,resize:"cover",quality:80}),o=(0,i.getMediaUrlWithTransform)("images","robin-singing.jpg",{width:1200,height:500,resize:"cover",quality:80}),d=[{name:"Robin",scientificName:"Erithacus rubecula",category:"Songbird",difficulty:"Easy",difficultyColor:"#4A7C59",description:"With its unmistakable bright red breast, the Robin is a familiar and fiercely territorial garden resident. In March, their sweet, rippling song can be heard from prominent perches.",habitat:"Perched on fences, spades, or hopping on the lawn.",image:n},{name:"Wren",scientificName:"Troglodytes troglodytes",category:"Songbird",difficulty:"Moderate",difficultyColor:"#C4713B",description:"A tiny, dumpy brown bird with a cocked tail, the Wren is surprisingly loud for its size. It tends to creep mouse-like through undergrowth.",habitat:"Low down in brambles, ivy, and dense garden borders.",image:r},{name:"Greenfinch",scientificName:"Chloris chloris",category:"Songbird",difficulty:"Moderate",difficultyColor:"#C4713B",description:"A chunky, olive-green finch with flashes of bright yellow in its wings and tail. They have a heavy beak designed for cracking open tough seeds.",habitat:"Sitting high in conifers or feeding at sunflower hearts.",image:l}];function c(){return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-brand-sage/40"}),(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-brand-forest/30"}),(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-brand-sage/40"})]})}function u(){return(0,t.jsx)("div",{className:"mx-auto max-w-3xl",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-border bg-white shadow-lg",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("img",{src:o,alt:"Robin singing on a branch",className:"block w-full object-cover object-top",style:{height:"220px"}}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1B3A2D]/90 via-[#1B3A2D]/50 to-[#1B3A2D]/20"}),(0,t.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-5 sm:p-6",children:[(0,t.jsx)("h3",{className:"font-serif text-2xl sm:text-3xl font-medium text-white",children:"Sussex, England"}),(0,t.jsx)("p",{className:"text-sm text-white/70 mt-1",children:"March 2026"})]})]}),(0,t.jsx)("div",{className:"px-5 sm:px-8 pt-6 pb-1",children:(0,t.jsx)("p",{className:"text-[15px] leading-[1.8] text-foreground
1/80 drop-cap-serif",children:"As the days begin to lengthen, the transition from winter to spring brings a palpable energy to your garden. This is a thrilling time for birdwatching, as the dawn chorus starts to build in volume and variety, offering a wonderful natural soundtrack right outside your window."})}),(0,t.jsx)(c,{}),(0,t.jsxs)("div",{className:"px-5 sm:px-8",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-3 mb-5",children:[(0,t.jsx)("h3",{className:"font-serif text-xl sm:text-2xl font-medium text-primary",children:"Birds to Look For"}),(0,t.jsx)(s.Badge,{variant:"secondary",className:"text-xs",children:"8 species"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:d.map(e=>(0,t.jsxs)("div",{className:"rounded-xl border border-border overflow-hidden flex flex-col",children:[(0,t.jsx)("img",{src:e.image,alt:e.name,className:"block w-full object-cover",style:{height:"140px"}}),(0,t.jsxs)("div",{className:"p-3 flex-1 flex flex-col",children:[(0,t.jsx)("h4",{className:"font-serif text-base font-medium",children:e.name}),(0,t.jsx)("p",{className:"text-[11px] italic text-muted-foreground",children:e.scientificName}),(0,t.jsxs)("div",{className:"flex gap-1.5 mt-2",children:[(0,t.jsx)("span",{className:"rounded-full bg-surface-warm px-2 py-0.5 text-[10px] text-text-primary",children:e.category}),(0,t.jsx)("span",{className:"rounded-full px-2 py-0.5 text-[10px] text-white",style:{backgroundColor:e.difficultyColor},children:e.difficulty})]}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-foreground/70 mt-2 line-clamp-3",children:e.description}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground mt-auto pt-2",children:e.habitat})]})]},e.name))}),(0,t.jsx)("p",{className:"text-center text-xs text-muted-foreground mt-4",children:"+ 5 more species in the full digest"})]}),(0,t.jsx)(c,{}),(0,t.jsx)("div",{className:"px-5 sm:px-8 pb-6",children:(0,t.jsxs)("div",{className:"rounded-xl bg-surface-green-light/40 p-5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)(a,{className:"h-4 w-4 text-brand-forest"}),(0,t.jsx)("h3",{className:"font-serif text-lg font-medium text-primary",children:"Garden & Feeder Tips"})]}),(0,t.jsxs)("ul",{className:"space-y-2",children:[(0,t.jsxs)("li",{className:"flex items-start gap-2 text-sm text-foreground/80",children:[(0,t.jsx)("span",{className:"mt-1.5 h-1.5 w-1.5 rounded-full bg-brand-forest/40 shrink-0"}),"Give all your feeders a thorough clean to prevent disease as bird activity increases."]}),(0,t.jsxs)("li",{className:"flex items-start gap-2 text-sm text-foreground/80",children:[(0,t.jsx)("span",{className:"mt-1.5 h-1.5 w-1.5 rounded-full bg-brand-forest/40 shrink-0"}),"Switch to high-protein foods like mealworms and sunflower hearts for breeding condition."]}),(0,t.jsxs)("li",{className:"flex items-start gap-2 text-sm text-foreground/80",children:[(0,t.jsx)("span",{className:"mt-1.5 h-1.5 w-1.5 rounded-full bg-brand-forest/40 shrink-0"}),"Leave a muddy patch in a quiet corner — thrushes and martins use mud for nest building."]})]})]})})]})})}e.s(["DigestMockup",()=>u],313131)},14476,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(373375),i=e.i(735501),n=e.i(531278),r=e.i(514764),l=e.i(475254);let o=(0,l.default)("signal",[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]]),d=(0,l.default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),c=(0,l.default)("battery-full",[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);var u=e.i(647163);let m=(0,e.i(317587).getMediaUrlWithTransform)("images","kingfisher.jpg",{width:280,height:200,resize:"cover",quality:80});function h({label:e}){return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 py-0.5",children:[(0,t.jsx)(n.Loader2,{className:"h-3 w-3 animate-spin text-brand-forest"}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e})]})}function x({children:e}){return(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)("div",{className:"max-w-[80%] rounded-2xl rounded-br-md bg-brand-forest/10 px-3 py-2 text-[13px] text-text-primary",children:e})})}function f({children:e}){return(0,t.jsx)("div",{className:"text-[13px] leading-relaxed text-text-primary",children:e})}function p({name:e,color:s}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-surface-cream/80 px-2.5 py-1 text-[11px] font-medium text-text-primary",children:[(0,t.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:s}}),e]})}function g({label:e}){return(0,t.jsx)("span",{className:"inline-block rounded-full border border-brand-forest/20 px-2.5 py-1 text-[10px] text-brand-forest",children:e})}let y=[{type:"user",turn:1,delay:800},{type:"tools",turn:1,delay:600},{type:"assistant",turn:1,delay:1200},{type:"cards",turn:1,delay:400},{type:"chips",turn:1,delay:300},{type:"user",turn:2,delay:1e3},{type:"tools",turn:2,delay:600},{type:"assistant",turn:2,delay:1200},{type:"user",turn:3,delay:1e3},{type:"tools",turn:3,delay:600},{type:"assistant",turn:3,delay:1200},{type:"cards",turn:3,delay:400}];function b({visible:e,children:s}){return(0,t.jsx)("div",{className:(0,u.cn)("transition-all duration-500 ease-out",e?"opacity-100 translate-y-0":"opacity-0 translate-y-2 h-0 overflow-hidden"),children:s})}
1function j(){let[e,n]=(0,s.useState)(-1),[l,u]=(0,s.useState)(!1),j=(0,s.useRef)(null),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!j.current)return;let e=new IntersectionObserver(([e])=>{e.isIntersecting&&!l&&u(!0)},{threshold:.3});return e.observe(j.current),()=>e.disconnect()},[l]);let w=(0,s.useCallback)(()=>{n(-1),v.current&&v.current.scrollTo({top:0}),setTimeout(()=>u(!0),600)},[]);function N(t,s){let a=y.findIndex(e=>e.type===t&&e.turn===s);return -1!==a&&e>=a}return(0,s.useEffect)(()=>{if(!l)return;if(e>=y.length-1){let e=setTimeout(()=>{u(!1),w()},4e3);return()=>clearTimeout(e)}let t=e+1,s=setTimeout(()=>{n(t)},0===t?400:y[t].delay);return()=>clearTimeout(s)},[l,e,w]),(0,s.useEffect)(()=>{v.current&&e>2&&v.current.scrollTo({top:v.current.scrollHeight,behavior:"smooth"})},[e]),(0,t.jsx)("div",{ref:j,role:"img","aria-label":"A simulated conversation with the Birding Assistant showing regional species suggestions, species comparison, and photo identification",className:"mx-auto w-[320px] sm:w-[360px]",children:(0,t.jsxs)("div",{className:"relative rounded-[2.5rem] border-[6px] border-gray-900 bg-white shadow-2xl overflow-hidden h-[640px] sm:h-[700px]",children:[(0,t.jsx)("div",{className:"absolute left-1/2 top-2.5 z-20 h-[22px] w-[90px] -translate-x-1/2 rounded-full bg-gray-900"}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between bg-white px-6 pt-[38px] pb-1 text-[10px] font-medium text-gray-900",children:[(0,t.jsx)("span",{children:"9:41"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(o,{className:"h-3 w-3"}),(0,t.jsx)(d,{className:"h-3 w-3"}),(0,t.jsx)(c,{className:"h-3 w-3"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-2 bg-white",children:[(0,t.jsx)(a.ChevronLeft,{className:"h-4 w-4 text-brand-forest"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-text-primary",children:"Birding Assistant"})]}),(0,t.jsxs)("div",{className:"relative flex flex-col overflow-hidden",style:{height:"calc(100% - 104px)"},children:[(0,t.jsxs)("div",{ref:v,className:"flex-1 space-y-4 overflow-y-auto px-3 py-3 scroll-smooth",children:[(0,t.jsx)(b,{visible:N("user",1),children:(0,t.jsx)(x,{children:"What new birds should I look for this week?"})}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(b,{visible:N("tools",1),children:(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)(h,{label:"Checking regional species..."}),(0,t.jsx)(h,{label:"Reviewing your life list..."})]})}),(0,t.jsx)(b,{visible:N("assistant",1),children:(0,t.jsxs)(f,{children:[(0,t.jsxs)("p",{children:["Great timing! ",(0,t.jsx)("strong",{children:"Chiffchaffs"})," are arriving across Sussex this week — and I can see you haven't logged one yet this year. Listen for their distinctive two-note song from treetops."]}),(0,t.jsxs)("p",{className:"mt-2",children:[(0,t.jsx)("strong",{children:"Sand Martins"})," are also returning to local reservoirs. They're often the first hirundine back, so keep an eye on any open water."]})]})}),(0,t.jsx)(b,{visible:N("cards",1),children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[(0,t.jsx)(p,{name:"Chiffchaff",color:"#8B9E3C"}),(0,t.jsx)(p,{name:"Sand Martin",color:"#7B6B4F"})]})}),(0,t.jsx)(b,{visible:N("chips",1),children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1.5",children:[(0,t.jsx)(g,{label:"Where's the best spot nearby?"}),(0,t.jsx)(g,{label:"Compare Chiffchaff and Willow Warbler"})]})})]}),(0,t.jsx)(b,{visible:N("user",2),children:(0,t.jsx)(x,{children:"Compare Chiffchaff and Willow Warbler"})}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(b,{visible:N("tools",2),children:(0,t.jsx)(h,{label:"Comparing species..."})}),(0,t.jsx)(b,{visible:N("assistant",2),children:(0,t.jsxs)(f,{children:[(0,t.jsx)("p",{children:"They're easily confused, but a few key differences help:"}),(0,t.jsxs)("p",{className:"mt-2",children:[(0,t.jsx)("strong",{children:"Chiffchaff"})," — duller olive-brown plumage, dark legs, bobs its tail constantly, and sings a simple repeating “chiff-chaff”."]}),(0,t.jsxs)("p",{className:"mt-2",children:[(0,t.jsx)("strong",{children:"Willow Warbler"})," — brighter yellow-green, pale legs, cleaner supercilium, and a lovely desce
1nding warble."]}),(0,t.jsxs)("p",{className:"mt-2",children:["At this time of year, ",(0,t.jsx)("strong",{children:"song is the easiest way"})," to tell them apart before the leaves are fully out."]})]})})]}),(0,t.jsx)(b,{visible:N("user",3),children:(0,t.jsxs)(x,{children:[(0,t.jsx)("img",{src:m,alt:"Kingfisher photo",className:"mb-2 w-36 rounded-xl"}),"What bird is this?"]})}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(b,{visible:N("tools",3),children:(0,t.jsx)(h,{label:"Identifying bird in your photo..."})}),(0,t.jsx)(b,{visible:N("assistant",3),children:(0,t.jsxs)(f,{children:[(0,t.jsxs)("p",{children:["That's a ",(0,t.jsx)("strong",{children:"Kingfisher"}),"! The electric-blue back and orange underparts are unmistakable."]}),(0,t.jsxs)("p",{className:"mt-2",children:["This would be a ",(0,t.jsx)("strong",{children:"new addition"})," to your life list — would you like me to save it as a sighting?"]})]})}),(0,t.jsx)(b,{visible:N("cards",3),children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:(0,t.jsx)(p,{name:"Kingfisher",color:"#0077B6"})})})]})]}),(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-10 left-0 right-0 h-16 bg-gradient-to-t from-white to-transparent"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 border-t bg-white px-3 py-2",children:[(0,t.jsx)(i.ImageIcon,{className:"h-5 w-5 text-muted-foreground"}),(0,t.jsx)("div",{className:"flex-1 rounded-full bg-gray-100 px-3 py-1.5 text-[12px] text-muted-foreground",children:"Ask about birds..."}),(0,t.jsx)("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-brand-forest",children:(0,t.jsx)(r.Send,{className:"h-3.5 w-3.5 text-white"})})]})]})]})})}e.s(["ChatMockup",()=>j],14476)},610088,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(920755),i=e.i(167881),n=e.i(994179),r=e.i(643531),l=e.i(647163),o=e.i(770703),d=e.i(286536),c=e.i(77705),u=e.i(531278),m=e.i(23750),h=e.i(630374),x=e.i(433234),f=e.i(478949),p=e.i(265447);let g=(0,o.default)(()=>e.A(616928).then(e=>e.TurnstileWidget),{loadableGenerated:{modules:[295218]},ssr:!1}),y="/plus";function b({open:e,onOpenChange:n,onAuthenticated:r}
1){let[l,o]=(0,s.useState)("signup"),[b,j]=(0,s.useState)(""),[v,w]=(0,s.useState)(""),[N,k]=(0,s.useState)(""),[C,S]=(0,s.useState)(!1),[A,I]=(0,s.useState)(!1),[R,T]=(0,s.useState)(null),[E,_]=(0,s.useState)(!1),[M,P]=(0,s.useState)(null),[B,D]=(0,s.useState)(0),[U,O]=(0,s.useState)(""),[W,L]=(0,s.useState)(null);function z(){P(null),D(e=>e+1)}function q(e){w(""),k(""),j(""),S(!1),T(null),_(!1),P(null),O(""),L(null),o(e)}function F(e=l){T(null),L(null),o(e)}async function $(e){if(e.preventDefault(),I(!0),T(null),U)return void I(!1);if(M)try{if(!(await fetch("/api/auth/verify-captcha",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:M,honeypot:U})})).ok){z(),T("Verification failed. Please try again."),I(!1);return}}catch{z(),T("Verification failed. Please try again."),I(!1);return}let t=(0,a.createClient)(),s=(0,f.classifySignUp)(await t.auth.signUp({email:v,password:N,options:{emailRedirectTo:(0,p.authCallbackUrl)(window.location.origin,y),data:{first_name:b}}}));if("session"===s.kind){fetch("/api/auth/send-verification",{method:"POST"}).catch(()=>{}),I(!1),r();return}(M&&z(),I(!1),"error"===s.kind)?T(s.message):L(s.kind)}async function H(e){e.preventDefault(),I(!0),T(null);let t=(0,a.createClient)(),{error:s}=await t.auth.signInWithPassword({email:v,password:N});s?(I(!1),(0,f.isEmailNotConfirmedError)(s))?L("unconfirmed"):T((0,f.authErrorMessage)(s)):(I(!1),r())}async function K(){I(!0),T(null);let e=(0,a.createClient)(),{error:t}=await e.auth.signInWithOtp({email:v,options:{emailRedirectTo:`${window.location.origin}/plus`}});if(t){T(t.message),I(!1);return}I(!1),_(!0)}return(0,t.jsx)(h.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(h.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(h.DialogHeader,{children:[(0,t.jsx)(h.DialogTitle,{className:"font-serif font-medium text-xl",children:"confirm"===W?"Check your inbox":"unconfirmed"===W?"Confirm your email first":"existing"===W?"You already have an account":"signup"===l?"Create your account":"Sign in to continue"}),(0,t.jsx)(h.DialogDescription,{children:"existing"===W?"Sign in to carry on to checkout.":W?"Then you can carry on to checkout.":"signup"===l?"Create your account to start your subscription.":"Sign in to continue to checkout."})]}),"confirm"===W&&(0,t.jsx)(x.CheckInboxPanel,{email:v,password:N,redirectPath:y,onSession:()=>r(),onUseDifferentEmail:()=>F("signup"),title:null,hint:"Once you’ve confirmed, come back to this page to carry on."}),"unconfirmed"===W&&(0,t.jsx)(x.CheckInboxPanel,{email:v,password:N,redirectPath:y,onSession:()=>r(),onUseDifferentEmail:()=>F("signin"),backLabel:"Back to sign in",title:null,intro:(0,t.jsxs)(t.Fragment,{children:["We sent a confirmation link to"," ",(0,t.jsx)("strong",{className:"font-medium text-foreground break-words",children:v})," ","when you created your account. Open it, then sign in again, or we can send a new link."]}),initialCooldown:0,resendLabel:"Resend confirmation",continueLabel:"I’ve confirmed, sign me in"}),"existing"===W&&(0,t.jsx)(x.ExistingAccountPanel,{email:v,onSignIn:()=>{k(""),F("signin")},onUseDifferentEmail:()=>F("signup"),title:null}),!W&&(0,t.jsxs)("div",{className:"flex rounded-lg border border-border bg-muted p-1",children:[(0,t.jsx)("button",{onClick:()=>q("signup"),className:`flex-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${"signup"===l?"bg-white text-primary shadow-sm":"text-muted-foreground hover:text-primary"}`,children:"Sign Up"}),(0,t.jsx)("button",{onClick:()=>q("signin"),className:`flex-1 rounded-md px-3 py-1.5 text-sm font-medium transition-colors ${"signin"===l?"bg-white text-primary shadow-sm":"text-muted-foreground hover:text-primary"}`,children:"Sign In"})]}),!W&&R&&(0,t.jsx)("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:R}),W?null:E?(0,t.jsxs)("div",{className:"rounded-md bg-green-50 px-4 py-3 text-center text-sm text-green-800",children:[(0,t.jsx)("p",{className:"font-medium",children:"Check your email"}),(0,t.jsxs)("p",{className:"mt-1 text-green-700",children:["We sent a magic link to ",(0,t.jsx)("strong",{children:v}),". Click it to sign in and you'll be redirected back here."]})]}):"signup"===l?(0,t.jsxs)("form",{onSubmit:$,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"plus-signup-name",className:"text-sm font-medium",children:"First name"}
1),(0,t.jsx)(m.Input,{id:"plus-signup-name",value:b,onChange:e=>j(e.target.value),placeholder:"Jane",required:!0,autoComplete:"given-name",className:"bg-white"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"plus-signup-email",className:"text-sm font-medium",children:"Email"}),(0,t.jsx)(m.Input,{id:"plus-signup-email",type:"email",value:v,onChange:e=>w(e.target.value),placeholder:"[email protected]",required:!0,autoComplete:"email",className:"bg-white"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"plus-signup-password",className:"text-sm font-medium",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(m.Input,{id:"plus-signup-password",type:C?"text":"password",value:N,onChange:e=>k(e.target.value),placeholder:"At least 8 characters",required:!0,minLength:8,autoComplete:"new-password",className:"pr-10 bg-white"}),(0,t.jsx)("button",{type:"button",onClick:()=>S(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:C?(0,t.jsx)(c.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(d.Eye,{className:"h-4 w-4"})})]})]}),(0,t.jsx)("div",{className:"absolute -left-[9999px]","aria-hidden":"true",children:(0,t.jsx)("input",{type:"text",name:"website",tabIndex:-1,autoComplete:"off",value:U,onChange:e=>O(e.target.value)})}),(0,t.jsx)(g,{onSuccess:P,onError:()=>P(null)},B),(0,t.jsx)(i.Button,{type:"submit",className:"w-full",variant:"accent",disabled:A,children:A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Sign Up & Continue"})]}):(0,t.jsxs)("form",{onSubmit:H,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"plus-signin-email",className:"text-sm font-medium",children:"Email"}),(0,t.jsx)(m.Input,{id:"plus-signin-email",type:"email",value:v,onChange:e=>w(e.target.value),placeholder:"[email protected]",required:!0,autoComplete:"email",className:"bg-white"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"plus-signin-password",className:"text-sm font-medium",children:"Password"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(m.Input,{id:"plus-signin-password",type:C?"text":"password",value:N,onChange:e=>k(e.target.value),placeholder:"Your password",required:!0,autoComplete:"current-password",className:"pr-10 bg-white"}),(0,t.jsx)("button",{type:"button",onClick:()=>S(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",tabIndex:-1,children:C?(0,t.jsx)(c.EyeOff,{className:"h-4 w-4"}):(0,t.jsx)(d.Eye,{className:"h-4 w-4"})})]})]}),(0,t.jsx)(i.Button,{type:"submit",className:"w-full",variant:"accent",disabled:A,children:A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in..."]}):"Sign In & Continue"}),(0,t.jsx)("button",{type:"button",onClick:K,disabled:A||!v,className:"w-full text-center text-sm text-muted-foreground underline hover:text-primary disabled:opacity-50",children:"Send me a magic link instead"})]}),(0,t.jsxs)("p",{className:"text-center text-xs text-muted-foreground",children:["By continuing you agree to our"," ",(0,t.jsx)("a",{href:"/privacy-policy",className:"underline hover:text-foreground",children:"privacy policy"}),"."]})]})})}let j=[{code:"USD",label:"USD",symbol:"$"},{code:"GBP",label:"GBP",symbol:"£"},{code:"EUR",label:"EUR",symbol:"€"},{code:"AUD",label:"AUD",symbol:"A$"}],v={USD:{monthly:"2.49",yearly:"24.99",yearlySave:"Save ~16%"},GBP:{monthly:"1.99",yearly:"20.99",yearlySave:"Save ~12%"},EUR:{monthly:"2.29",yearly:"22.99",yearlySave:"Save ~16%"},AUD:{monthly:"3.99",yearly:"37.99",yearlySave:"Save ~21%"}};
1function w(){let[e,o]=(0,s.useState)("USD"),[d,c]=(0,s.useState)([]),[u,m]=(0,s.useState)(null),[h,x]=(0,s.useState)(null),[f,p]=(0,s.useState)(null),[g,y]=(0,s.useState)(!1),[w,N]=(0,s.useState)(!1),[k,C]=(0,s.useState)(null),[S,A]=(0,s.useState)(null);async function I(t){let s=d.find(s=>s.plan_type===t&&s.currency===e);if(s){p(t),A(null);try{let e=await fetch("/api/stripe/create-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan_id:s.id})}),t=await e.json();if(!e.ok){A(t.error||"Something went wrong. Please try again."),p(null);return}t.url&&(window.location.href=t.url)}catch{A("Something went wrong. Please try again."),p(null)}}}function R(t){try{let s=new Blob([JSON.stringify({event_type:"plus_subscribe_click",url:"/plus",properties:{plan_type:t,currency:e,authenticated:!!h}})],{type:"application/json"});navigator.sendBeacon("/api/analytics/event",s)}catch{}if(!h){C(t),N(!0);return}I(t)}async function T(){let e=(0,a.createClient)(),{data:{user:t}}=await e.auth.getUser();t&&(x(t.id),N(!1),k&&I(k))}(0,s.useEffect)(()=>{try{let e=new Blob([JSON.stringify({event_type:"plus_page_view",url:"/plus"})],{type:"application/json"});navigator.sendBeacon("/api/analytics/event",e)}catch{}},[]),(0,s.useEffect)(()=>{!async function(){let e=(0,a.createClient)(),{data:{user:t}}=await e.auth.getUser();if(t){x(t.id);let{data:s}=await e.from("profiles").select("subscription_tier").eq("id",t.id).single();m(s?.subscription_tier??"free")}let{data:s}=await e.from("subscription_plans").select("id, plan_type, currency, price, stripe_price_id").eq("is_active",!0).order("price");c(s??[]),y(!0)}()},[]);let E=v[e],_=j.find(t=>t.code===e).symbol;return"plus"===u?(0,t.jsxs)("div",{className:"mx-auto max-w-md rounded-xl border border-brand-amber/30 bg-white p-8 text-center shadow-sm",children:[(0,t.jsx)(n.Badge,{className:"mb-3 bg-brand-amber/10 text-brand-amber",children:"Active Member"}),(0,t.jsx)("p",{className:"font-serif text-xl font-medium",children:"You're a Birdfact+ member"}),(0,t.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Thank you for supporting independent ornithology."}),(0,t.jsx)(i.Button,{variant:"outline",className:"mt-4",asChild:!0,children:(0,t.jsx)("a",{href:"/account/subscription",children:"Manage Subscription"})})]}):(0,t.jsxs)("div",{children:[S&&(0,t.jsx)("div",{className:"mx-auto mb-6 max-w-3xl rounded-lg bg-red-50 px-4 py-3 text-sm text-red-700",children:S}),(0,t.jsx)("div",{className:"mb-8 flex justify-center",children:(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border bg-white p-1",children:j.map(s=>(0,t.jsx)("button",{onClick:()=>o(s.code),className:(0,l.cn)("rounded-md px-4 py-1.5 text-sm font-medium transition-colors",e===s.code?"bg-brand-forest text-white":"text-muted-foreground hover:text-primary"),children:s.label},s.code))})}),(0,t.jsxs)("div",{className:"mx-auto grid max-w-3xl gap-6 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex flex-col rounded-xl border border-border bg-white p-6 shadow-sm",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Monthly"}),(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsxs)("span",{className:"font-serif text-4xl font-medium",children:[_,E.monthly]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"/month"})]}),(0,t.jsx)("ul",{className:"mt-6 flex-1 space-y-3",children:["Unlimited AI identifications","AI Birding Assistant","Monthly personalised digest","Digest delivered by email","Early access to features"].map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,t.jsx)(r.Check,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),e]},e))}),(0,t.jsx)(i.Button,{className:"mt-6 w-full",variant:"outline",onClick:()=>R("monthly"),disabled:null!==f||!g&&!h,children:"monthly"===f?"Redirecting...":"Subscribe"})]}),(0,t.jsxs)("div",{className:"relative flex flex-col rounded-xl border-2 border-brand-amber bg-white p-6 shadow-md",children:[(0,t.jsx)("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:(0,t.jsx)(n.Badge,{className:"bg-brand-amber text-white shadow-sm",children:"Best Value"})}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:"Yearly"}),(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsxs)("span",{className:"font-serif text-4xl font-medium",children:[_,E.yearly]}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"/year"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs font-medium text-green-700",children:E.yearlySave}),(0,t.jsx)("ul",{className:"mt-6 flex-1 space-y-3",children:["Unlimited AI identifications","AI Birding Assistant","Monthly personalised digest","Digest delivered by email","Early access to features"].map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,t.jsx)(r.Check,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),e]},e))}),(0,t.jsx)(i.Button,{className:"mt-6 w-full",variant:"accent",onClick:()=>R("yearly"),disabled:null!==f||!g&&!h,children:"yearly"===f?"Redirecting...":"Subscribe"})]})]}),(0,t.jsx)(b,{open:w,onOpenChange:N,onAuthenticated:T})]})}e.s(["PricingSection",()=>w],610088)},28438,e=>{"use strict";var t=e.i(843476),s=e.i(994179),a=e.i(643531),i=e.i(972520);let n=(0,e.i(317587).getMediaUrlWithTransform)("images","kingfisher.jpg",{width:600,height:500,resize:"cover",quality:80});function r(){return(0,t.jsx)("div",{className:"mx-auto max-w-md",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-border bg-white shadow-lg",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("img",{src:n,alt:"Kingfisher perched on a branch",className:"block w-full object-cover",style:{height:"240px"}})}),(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-serif text-xl font-medium text-primary",children:"Common Kingfisher"}),(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:"Alcedo atthis"})]}),(0,t.jsx)(s.Badge,{variant:"outline",className:"bg-brand-forest/5 text-brand-forest border-brand-forest/20 shrink-0",children:"Strong match"})]}),(0,t.jsxs)("div",{className:"mt-4 space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Key field marks"}),(0,t.jsx)("ul",{className:"space-y-1",children:["Electric-blue and orange plumage","Long, dagger-like bill","Compact body, short tail"].map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm text-foreground
1/80",children:[(0,t.jsx)(a.Check,{className:"h-3.5 w-3.5 text-brand-forest shrink-0"}),e]},e))})]}),(0,t.jsxs)("div",{className:"mt-5 flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center gap-2 rounded-lg bg-brand-forest py-2.5 text-sm font-medium text-white",children:"Save as Sighting"}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1.5 rounded-lg border border-border px-3 py-2.5 text-sm text-muted-foreground",children:["Learn more",(0,t.jsx)(i.ArrowRight,{className:"h-3.5 w-3.5"})]})]}),(0,t.jsx)("div",{className:"mt-4 flex flex-wrap gap-1.5",children:["Diet & feeding","Habitat","Calls & song","Similar species"].map(e=>(0,t.jsx)("span",{className:"rounded-full border border-brand-forest/15 bg-surface-green-light/50 px-2.5 py-1 text-[11px] text-brand-forest",children:e},e))})]})]})})}e.s(["IdentifyMockup",()=>r])},616928,e=>{e.v(t=>Promise.all(["static/chunks/12efddd7fd0328eb.js"].map(t=>e.l(t))).then(()=>t(295218)))}]);

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.