1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6273],{386:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/invite",function(){return r(39944)}])},39944:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return N},default:function(){return _}});var a=r(85893),l=r(67294),i=r(11163),n=r(4298),s=r.n(n),o=r(89180),d=r(41664),c=r.n(d),u=r(67421),x=r(34516),h=r(32474),m=r(52808),p=r(82865);let b="0x4AAAAAACNZuLjE1-AqfJK5",f=e=>{let{t}=(0,u.$G)();if(!e)return null;let r="invite.campaigns.".concat(e.source);return{title:t("".concat(r,".title"),{defaultValue:""})||t("invite.campaigns.default.title"),text:t("".concat(r,".text"),{defaultValue:""})||t("invite.campaigns.default.text")}},v=[{color:"bg-purple-400",top:"30%",left:"4%",size:"w-1.5 h-1.5 rounded-full"},{color:"bg-pink-400",top:"55%",left:"9%",size:"w-1 h-3",rotate:"rotate-12"},{color:"bg-yellow-300",top:"25%",left:"16%",size:"w-2 h-2 rounded-full"},{color:"bg-indigo-400",top:"60%",left:"23%",size:"w-1 h-2.5",rotate:"-rotate-12"},{color:"bg-orange-400",top:"20%",left:"32%",size:"w-1.5 h-1.5 rounded-full"},{color:"bg-purple-300",top:"65%",left:"40%",size:"w-1 h-3",rotate:"rotate-45"},{color:"bg-pink-300",top:"30%",left:"48%",size:"w-2 h-2 rounded-full"},{color:"bg-yellow-400",top:"55%",left:"57%",size:"w-1 h-2.5",rotate:"-rotate-45"},{color:"bg-indigo-300",top:"20%",left:"66%",size:"w-1.5 h-1.5 rounded-full"},{color:"bg-orange-300",top:"60%",left:"74%",size:"w-1 h-3",rotate:"rotate-12"},{color:"bg-purple-400",top:"25%",left:"82%",size:"w-2 h-2 rounded-full"},{color:"bg-pink-400",top:"55%",left:"90%",size:"w-1 h-2.5",rotate:"-rotate-12"},{color:"bg-yellow-300",top:"35%",left:"96%",size:"w-1.5 h-1.5 rounded-full"}],w=()=>(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 h-8 overflow-hidden rounded-t-2xl pointer-events-none","aria-hidden":"true",children:v.map((e,t)=>{var r;return(0,a.jsx)("span",{className:"absolute ".concat(e.color," ").concat(e.size," ").concat(null!==(r=e.rotate)&&void 0!==r?r:""),style:{top:e.top,left:e.left}},t)})}),g=()=>{let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(prefers-reduced-motion: reduce)");t(e.matches);let r=e=>t(e.matches);return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e},k=["bg-purple-400","bg-pink-400","bg-yellow-300","bg-indigo-400","bg-orange-400","bg-purple-300","bg-pink-300","bg-yellow-400"],j=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48;return Array.from({length:t},(t,r)=>({id:e+r,colorClass:k[Math.floor(Math.random()*k.length)],startX:100*Math.random(),startY:-200-200*Math.random(),driftX:(Math.random()-.5)*120,fallY:900+400*Math.random(),rotate:(Math.random()-.5)*900,duration:2e3+1200*Math.random(),delay:1200*Math.random(),shape:Math.random()>.4?"circle":"rect",size:Math.random()>.5?"sm":"md"}))},y=e=>{let{particles:t}=e;return 0===t.length?null:(0,a.jsx)("div",{className:"absolute inset-0 pointer-events-none z-20 overflow-visible","aria-hidden":"true",children:t.map(e=>{let t="sm"===e.size?"circle"===e.shape?"w-1.5 h-1.5 rounded-full":"w-1 h-2.5":"circle"===e.shape?"w-2 h-2 rounded-full":"w-1.5 h-3";return(0,a.jsx)("span",{className:"absolute ".concat(t," ").concat(e.colorClass," animate-confettiFall"),style:{left:"".concat(e.startX,"%"),top:"".concat(e.startY,"px"),animationDelay:"".concat(e.delay,"ms"),animationDuration:"".concat(e.duration,"ms"),"--confetti-x":"".concat(e.driftX,"px"),"--confetti-y":"".concat(e.fallY,"px"),"--confetti-r":"".concat(e.rotate,"deg")}},e.id)})})};var N=!0;function _(e){let{redemptionUnavailable:t}=e,r=(0,i.useRouter)(),{t:n}=(0,u.$G)(),{theme:d}=(0,x.F)(),[v,k]=(0,l.useState)(t?"unavailable":"loading"),[N,_]=(0,l.useState)(null),z=f(N),[C,M]=(0,l.useState)(""),[L,S]=(0,l.useState)(!1),[E,A]=(0,l.useState)(null),[R,H]=(0,l.useState)([]),[T,W]=(0,l.useState)(!1),[X,B]=(0,l.useState)(!1),F=(0,l.useRef)(null),V=(0,l.useRef)(null),Y=(0,l.useRef)(null),q=(0,l.useRef)(!1),D=(0,l.useRef)(0),P=(0,l.useRef)(new Set),I=g();(0,l.useEffect)(()=>{let e=P.current;return()=>
1{e.forEach(e=>window.clearTimeout(e)),e.clear()}},[]);let G=(0,l.useCallback)(()=>{M(""),A(null),_(null),q.current=!1,k("manual"),r.query.code&&r.replace("/invite",void 0,{shallow:!0})},[r]),O=(0,l.useCallback)(()=>{if(I)return;let e=j(D.current);D.current+=e.length,H(t=>[...t,...e]);let t=new Set(e.map(e=>e.id)),r=window.setTimeout(()=>{H(e=>e.filter(e=>!t.has(e.id))),P.current.delete(r)},4500);P.current.add(r)},[I]),$=r.query.code,J=(0,l.useCallback)(async()=>{W(!0),B(!1);try{await r.replace(r.asPath)&&B(!0)}finally{W(!1)}},[r]);(0,l.useEffect)(()=>{window.turnstile&&!L&&S(!0)},[L]);let K=(0,l.useCallback)(async(e,t)=>{var r;let a=await (0,h.uV)(e,t);_(null!==(r=a.campaign)&&void 0!==r?r:null),a.valid?(sessionStorage.setItem("invitation_code",e),k("verified")):a.campaign?k("campaign_full"):k("invalid")},[]);(0,l.useEffect)(()=>{if(r.isReady&&"unavailable"!==v){if(!$){k("manual");return}if(L&&F.current&&b&&!Y.current)return Y.current=window.turnstile.render(F.current,{sitekey:b,callback:async e=>{q.current||(q.current=!0,await K($,e))},"error-callback":()=>{k("invalid")},"expired-callback":()=>{k("invalid")},theme:"system"===d?"auto":d,size:"flexible"}),()=>{if(Y.current){var e;null===(e=window.turnstile)||void 0===e||e.remove(Y.current),Y.current=null}}}},[r.isReady,$,L,d,K,v]),(0,l.useEffect)(()=>{if("manual"===v&&L&&V.current&&b&&!Y.current)return Y.current=window.turnstile.render(V.current,{sitekey:b,callback:e=>{A(e)},"error-callback":()=>{A(null)},"expired-callback":()=>{A(null)},theme:"system"===d?"auto":d,size:"flexible"}),()=>{if(Y.current){var e;null===(e=window.turnstile)||void 0===e||e.remove(Y.current),Y.current=null}}},[v,L,d]);let Q=async e=>{e.preventDefault();let t=C.trim();t&&E&&(k("verifying"),await K(t,E))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.R,{title:"Invitation",description:"You've been invited to join Namag â your AI-powered library.",path:"/invite",noindex:!0}),b&&(0,a.jsx)(s(),{src:"https://challenges.cloudflare.com/turnstile/v0/api.js",onLoad:()=>S(!0)}),(0,a.jsx)(p.a2,{navMinimal:!0,children:(0,a.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-4 py-12 md:py-16 text-black dark:text-white",children:["loading"===v&&(0,a.jsxs)("div",{className:"relative z-10 text-center",children:[(0,a.jsx)("div",{className:"inline-block mb-6",children:(0,a.jsx)("div",{className:"w-12 h-12 border-4 border-purple-500/20 border-t-purple-500 rounded-full animate-spin"})}),(0,a.jsx)("p",{className:"text-slate-600 dark:text-white/70 text-lg mb-4",children:n("invite.verifying")}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("div",{ref:F})})]}),("manual"===v||"verifying"===v)&&(0,a.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,a.jsxs)("div",{className:"bg-slate-50 dark:bg-white/[0.025] border border-black/[0.08] dark:border-white/[0.08] shadow-[0_20px_60px_-30px_rgba(0,0,0,0.4)] rounded-2xl p-8 text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto mb-6 rounded-full bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-purple-600 dark:text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 9v.906a2.25 2.25 0 01-1.183 1.981l-6.478 3.488M2.25 9v.906a2.25 2.25 0 001.183 1.981l6.478 3.488m8.839 2.51l-4.66-2.51m0 0l-1.023-.55a2.25 2.25 0 00-2.134 0l-1.022.55m0 0l-4.661 2.51m16.5 1.615a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V8.844a2.25 2.25 0 011.183-1.98l7.5-4.04a2.25 2.25 0 012.134 0l7.5 4.04a2.25 2.25 0 011.183 1.98V19.5z"})})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-3",children:n("invite.enterCode.title")}),(0,a.jsx)("p",{className:"text-slate-600 dark:text-white/70 mb-6",children:n("invite.enterCode.subtitle")}),(0,a.jsxs)("form",{onSubmit:Q,className:"space-y-4",children:[(0,a.jsx)("input",{type:"text",value:C,onChange:e=>M(e.target.value),placeholder:n("invite.enterCode.placeholder"),required:!0,disabled:"verifying"===v,className:"w-full px-4 py-2.5 bg-white dark:bg-white/5 border border-slate-200 dark:border-white/10 rounded-lg text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-colors font-mono text-sm disabled:opacity-50"}),b&&(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("div",{ref:V})}),(0,a.jsx)("button",{type:"submit",disabled:"verifying"===v||!C.trim()||!E,className:"w-full px-6 py-2.5 bg-primary hover:bg-primary-hover text-on-accent disabled:opacity-50 rounded-lg font-medium transition-colors flex items-center justify-center gap-2",children:"verifying"===v?(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):n("invite.enterCode.submit")})]}),(0,a.jsxs)("div",{className:"pt-6 border-t border-slate-200 dark:border-white/10 mt-6 space-y-3",children:[(0,a.jsxs)("p",{className:"text-sm text-slate-500 dark:text-white/50",children:[n("invite.enterCode.noCodeQuestion")," ",(0,a.jsxs)(c(),{href:"/waitlist",className:"inline-flex items-center gap-1.5 text-purple-600 dar
1k:text-purple-400 hover:opacity-80 transition font-medium align-middle",children:[n("invite.enterCode.joinWaitlist"),(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})]}),(0,a.jsxs)(c(),{href:"/",className:"inline-flex items-center gap-2 text-sm text-slate-500 dark:text-white/50 hover:text-slate-700 dark:hover:text-white/70 transition-colors",children:[(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),n("invite.backToHome")]})]})]})}),"verified"===v&&(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md animate-fade-in-up",children:[(0,a.jsxs)("div",{className:"relative rounded-2xl bg-slate-50 dark:bg-white/[0.025] border border-black/[0.08] dark:border-white/[0.08] shadow-[0_20px_60px_-30px_rgba(0,0,0,0.4)] overflow-hidden",children:[N&&z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w,{}),(0,a.jsxs)("button",{type:"button",onClick:O,"aria-label":"".concat(z.title," â ").concat(n("invite.celebrate")),className:"group w-full pt-10 pb-1 px-8 text-center bg-transparent border-0 cursor-pointer rounded-t-2xl transition-transform active:scale-[0.99] focus:outline-none focus-visible:ring-2 focus-visible:ring-purple-500 focus-visible:ring-inset",children:[(0,a.jsx)("span",{className:"block text-2xl font-bold text-slate-900 dark:text-white mb-2 tracking-tight transition-transform duration-300 group-hover:scale-[1.03]",children:z.title}),(0,a.jsx)("span",{className:"block text-sm text-slate-600 dark:text-white/70 leading-relaxed max-w-xs mx-auto",children:z.text})]})]}),(0,a.jsx)("div",{className:"p-8 md:px-12 md:pb-12 md:pt-8",children:(0,a.jsx)(m.U,{variant:"invite",showTitle:!N})})]}),N&&(0,a.jsx)(y,{particles:R})]}),"campaign_full"===v&&N&&z&&(0,a.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,a.jsxs)("div",{className:"bg-slate-50 dark:bg-white/[0.025] border border-black/[0.08] dark:border-white/[0.08] shadow-[0_20px_60px_-30px_rgba(0,0,0,0.4)] rounded-2xl p-8 text-center",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-3",children:n("invite.capacity.title")}),(0,a.jsx)("p",{className:"text-slate-600 dark:text-white/70 mb-6",children:n("invite.capacity.body")}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:G,className:"flex-1 px-4 py-2.5 bg-primary hover:bg-primary-hover text-on-accent rounded-lg font-medium transition-colors text-center",children:n("invite.capacity.useDifferent")}),(0,a.jsx)(c(),{href:"/",className:"flex-1 px-4 py-2.5 bg-slate-900/5 dark:bg-white/10 hover:bg-slate-900/10 dark:hover:bg-white/20 text-slate-700 dark:text-white rounded-lg font-medium transition-colors text-center",children:n("invite.goHome")})]})]})}),"unavailable"===v&&(0,a.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,a.jsxs)("div",{className:"bg-slate-50 dark:bg-white/[0.025] border border-black/[0.08] dark:border-white/[0.08] shadow-[0_20px_60px_-30px_rgba(0,0,0,0.4)] rounded-2xl p-8 text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto mb-6 rounded-full bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-amber-600 dark:text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-2.994-1.5-3.86 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-3",children:n("invite.unavailable.title")}),(0,a.jsx)("p",{className:"text-slate-600 dark:text-white/70 mb-6",children:n("invite.unavailable.body")}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:J,disabled:T,className:"flex-1 px-4 py-2.5 bg-primary hover:bg-primary-hover text-on-accent disabled:opacity-50 rounded-lg font-medium transition-colors flex items-center justify-center gap-2",children:T?(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):n("invite.unavailable.retry")}),(0,a.jsx)(c(),{href:"/",className:"flex-1 px-4 py-2.5 bg-slate-900/5 dark:bg-white/10 hover:bg-slate-900/10 dark:hover:bg-white/20 text-slate-700 dark:text-white rounded-lg font-medium transition-colors text-center",children:n("invite.goHome")})]}),X&&(0,a.jsx)("p",{role:"alert",className:"mt-4 text-sm text-slate-500 dark:text-white/50",children:n("invite.unavailable.retryFailed")})]})}),"invalid"===v&&(0,a.jsx)("div",{className:"relative z-10 w-full max-w-md",children:(0,a.jsxs)("div",{className:"bg-slate-50 dark:bg-white/[0.025] border border-black/[0.08] dark:border-white/[0.08] shadow-[0_20px_60px_-30px_rgba(0,0,0,0.4)] rounded-2xl p-8 text-center",children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto mb-6 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75
1a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})})}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 dark:text-white mb-3",children:n("invite.invalid.title")}),(0,a.jsx)("p",{className:"text-slate-600 dark:text-white/70 mb-6",children:n("invite.invalid.body")}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:G,className:"flex-1 px-4 py-2.5 bg-primary hover:bg-primary-hover text-on-accent rounded-lg font-medium transition-colors text-center",children:n("invite.invalid.tryAnother")}),(0,a.jsx)(c(),{href:"/",className:"flex-1 px-4 py-2.5 bg-slate-900/5 dark:bg-white/10 hover:bg-slate-900/10 dark:hover:bg-white/20 text-slate-700 dark:text-white rounded-lg font-medium transition-colors text-center",children:n("invite.goHome")})]})]})})]})})]})}},4298:function(e,t,r){e.exports=r(23381)}},function(e){e.O(0,[1664,839,2888,9774,179],function(){return e(e.s=386)}),_N_E=e.O()}]);
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.