PageSourceSearch

https://linkna.me/_next/static/chunks/app/(authenticated)/login/page-78955bbf6bc66d0b.js

js linkna.me collected 2026-10-02 03:33:21 UTC 12,391 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1217],{99:(e,t,s)=>{"use strict";var a=s(76299);s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})},27985:(e,t,s)=>{"use strict";s.d(t,{w:()=>a.L});var a=s(55941)},56818:(e,t,s)=>{"use strict";s.d(t,{h:()=>r});var a=s(52693);let n=(0,s(11423).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);var l=s(59147);function r(e){let{verb:t,selected:s,onSelect:r,onBack:i,children:o}=e,c=[{id:"email",label:"Use your Email address",icon:(0,a.jsx)(n,{className:"w-6 h-6",strokeWidth:1.75})},{id:"bluesky",label:"Use your Bluesky account",icon:(0,a.jsx)(l.o44,{className:"w-6 h-6 text-[#1185fe]"})},{id:"mastodon",label:"Use your Mastodon account",icon:(0,a.jsx)(l.c4c,{className:"w-6 h-6 text-[#6364ff]"})}];return s?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("button",{type:"button",onClick:i,className:"flex items-center gap-1 text-[#8b5cf6] font-medium hover:opacity-80 transition-opacity text-sm",children:[(0,a.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})}),"Back"]}),o]}):(0,a.jsx)("div",{className:"space-y-3",children:c.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:"w-full flex items-center gap-4 px-6 py-5 border border-gray-300 rounded-2xl text-left hover:border-[#8b5cf6] hover:bg-[#8b5cf6]/[0.03] transition-all",children:[(0,a.jsx)("span",{className:"shrink-0 text-black",children:e.icon}),(0,a.jsx)("span",{className:"flex-1 font-medium text-black",children:e.label}),(0,a.jsx)("svg",{className:"w-5 h-5 text-gray-400 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})]},e.id))})}},70263:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var a=s(52693),n=s(33777),l=s(99),r=s(87470),i=s.n(r),o=s(56277),c=s(91273),u=s(56818),d=s(27985),m=s(1232);function x(){let e=(0,l.useRouter)(),t=(0,l.useSearchParams)(),{requestOtp:s,verifyOtp:r,resendOtp:x,requestRecoveryOtp:h,verifyRecoveryOtp:f,signInWithBluesky:p,signInWithMastodon:b,isAuthenticated:g,isLoading:y}=(0,d.w)(),[v,j]=(0,n.useState)(null),[w,N]=(0,n.useState)("email"),[k,C]=(0,n.useState)(!1),[S,L]=(0,n.useState)(""),[E,P]=(0,n.useState)(""),[B,F]=(0,n.useState)(null),[R,_]=(0,n.use
1State)(!1),[D,M]=(0,n.useState)(!1),[U,I]=(0,n.useState)(0),[W,A]=(0,n.useState)(""),[H,O]=(0,n.useState)(null),[T,q]=(0,n.useState)(!1),[K,V]=(0,n.useState)(""),[$,z]=(0,n.useState)(null),[G,J]=(0,n.useState)(!1),Q=(0,n.useRef)(null);if((0,n.useEffect)(()=>{let e=t.get("handle");e&&e.includes("@")&&(L(e),j("email"))},[t]),(0,n.useEffect)(()=>{if(U<=0)return;let e=setInterval(()=>{I(e=>e-1)},1e3);return()=>clearInterval(e)},[U]),g&&!y)return e.push("/page/links"),null;let X=async e=>{e.preventDefault(),O(null);let t=W.trim();if(!t)return void O("Please enter your Bluesky handle");q(!0);try{await p(t)}catch(t){let e=t instanceof Error?t.message:"Failed to connect";e.includes("invalid_client_metadata")||e.includes("Unable to obtain client metadata")||e.includes("fetch")||e.includes("network")?O("Connection issue. Please try logging in again."):O(e),q(!1)}},Y=async e=>{e.preventDefault(),z(null);let t=K.trim().replace(/^@/,"");if(!t||!t.includes("@"))return void z("Enter your full handle, e.g. [email protected]");J(!0);try{await b(t)}catch(e){z(e instanceof Error?e.message:"Failed to connect"),J(!1)}},Z=async e=>{e.preventDefault(),F(null);let t=S.trim();if(!t)return void F("Please enter your email");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return void F("Please enter a valid email address");_(!0);try{k?await h(t):(await s(t,"login"),M(!1),(0,m.KT)(t.toLowerCase()).then(M)),N("code"),I(30)}catch(e){F(e instanceof Error?e.message:"Failed to send verification code")}finally{_(!1)}},ee=async t=>{if(t.preventDefault(),F(null),E.trim()){_(!0);try{k?await f(S.trim().toLowerCase(),E.trim()):await r(S.trim().toLowerCase(),E.trim(),"login"),e.push("/page/links")}catch(e){F(e.message||"Verification failed"),_(!1)}}},et=async()=>{if(!(U>0)){F(null);try{k?await h(S.trim().toLowerCase()):await x(S.trim().toLowerCase(),"login"),I(30),P("")}catch(e){F(e instanceof Error?e.message:"Failed to resend code")}}},es=(0,a.jsx)("div",{className:"h-5 w-5 border-2 border-white border-t-transparent rounded-full animate-spin mx-auto"}),ea="relative border border-gray-300 rounded-xl focus-within:ring-2 focus-within:ring-[#8b5cf6] focus-within:border-[#8b5cf6] transition-all",en="w-full py-3 px-4 bg-[#8b5cf6] text-white rounded-xl font-medium hover:bg-[#7c3aed] focus:outline-none focus:ring-3 focus:ring-[#8b5cf6]/30 focus:ring-offset-2 disabled:bg-[#8b5cf6]/50 disabled:text-white disabled:cursor-not-allowed transition-all",el="How do you want to log in?",er=null;return"email"===v&&"code"===w?(el="Check your inbox",er="We've sent a 6-digit code to your account email."):"email"===v&&k?(el="Recover access",er="Enter the backup email saved to your account."):"email"===v?el="Log in with email":"bluesky"===v?el="Log in with Bluesky":"mastodon"===v&&(el="Log in with Mastodon"),(0,a.jsxs)("div",{className:"force-light min-h-screen flex flex-col bg-white text-black",style:{fontFamily:"Inter, sans-serif"},children:[(0,a.jsx)(o.Header,{showNav:!1}),(0,a.jsx)("div",{className:"flex-1 flex justify-center pt-[20vh] p-4",children:(0,a.jsxs)("div",{className:"w-full ".concat(v?"max-w-md":"max-w-2xl"),children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"font-bold text-black text-2xl",children:el}),er&&(0,a.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:er})]}),(0,a.jsxs)("div",{className:v?"":"max-w-md mx-auto",children:[(0,a.jsxs)(u.h,{verb:"Log in",selected:v,onSelect:j,onBack:()=>{j(null),N("email"),C(!1),P(""),F(null),A(""),O(null),V(""),z(null)},children:["email"===v&&"email"===w&&(0,a.jsxs)("form",{onSubmit:Z,className:"space-y-4",children:[B&&(0,a.jsx)("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm",children:B}),(0,a.jsxs)("div",{className:ea,children:[(0,a.jsx)("input",{id:"email",type:"email",autoComplete:"email",value:S,onChange:e=>L(e.target.value),placeholder:" ",className:"peer w-full px-6 pt-5 pb-2 bg-transparent text-black rounded-xl focus:outline-none",disabled:R,autoFocus:!0}),(0,a.jsx)("span",{className:"absolute left-6 top-1/2 -translate-y-1/2 text-gray-400 text-lg pointer-events-none transition-all duration-200 peer-focus:top-2 peer-focus:text-xs peer-focus:translate-y-0 peer-[:not(:placeholder-shown)]:top-2 peer-[:not(:placeholder-shown)]:text-xs peer-[:not(:placeholder-shown)]:translate-y-0",children:k?"Backup email":"Email"})]}),(0,a.jsx)("button",{type:"submit",disabled:R||y||!S.trim(),className:en,children:R?es:"Continue"}),k&&(0,a.jsx)("div",{className:"text-center text-sm",children:(0,a.jsx)("button",{type:"button",onClick:()=>{C(!1),F(null)},className:"text-muted-foreground underline",children:"Back to normal login"})})]}),"email"===v&&"code"===w&&(0,a.jsxs)("form",{ref:Q,onSubmit:ee,className:"space-y-6",children:[B&&(0,a.jsx)("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm",children:B}),(0,a.jsx)(c.I,{value:E,onChange:P,onComplete:e=>{P(e),setTimeout(()=>{var e;return null==(e=Q.current)?void 0:e.requestSubmit()},0)},disabled:R,autoFocus:!0}),(0,a.jsx)("button",{type:"submit",disabled:R||6!==E.replace(/\s/g,"").length,className:en,children:R?es:"Submit"}),(0,a.jsxs)("div",{className:"flex justify-center gap-4 text-sm",children:[(0,a.jsx)("button",{type:"button",onClick:et,disabled:U>0,className:"text-muted-foreground underline disabled:no-underline disabled:text-gray-400 disabled:cursor-not-allowed",children:U>0?"Resend code (".concat(U,"s)"):"Resend code"}),(0,a.jsx)("button",{type:"button",onClick:()=>{N("email"),P(""),F(null),C(!1)},className:"text-muted-foreground underline",children:"Use different email"})]}),!k&&D&&(0,a.jsxs)("div",{className:"text-center text-sm text-muted-foreground",children:["Lost access to your email?"," ",(0,a.jsx)("button",{type:"button",onClick:()=>{N("email"),P(""),F(null),L(""),C(!0)},className:"text-muted-foreground underline",children:"Use recovery email"})]})]}),"bluesky"===v&&(0,a.jsxs)("form",{onSubmit:X,className:"space-y-4",children:[H&&(0,a.jsx)("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm",children:H}),(0,a.jsx)("div",{className:ea,children:(0,a.jsx)("input",{type:"text",autoComplete:"username",value:W,onChange:e=>{A(e.target.value.toLowerCase().replace(/\s/g,"")),O(null)},placeholder:"you.bsky.social",className:"w-full px-6 py-3 bg-transparent text-black rounded-xl focus:outline-none placeholder-gray-400",disabled:T,autoFocus:!0})}),(0,a.jsx)("button",{type:"submit",disabled:T||!W.trim(),className:en,children:T?es:"Continue with Bluesky"})]}),"mastodon"===v&&(0,a.jsxs)("form",{onSubmit:Y,className:"space-y-4",children:[$&&(0,a.jsx)("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-xl text-sm",children:$}),(0,a.jsx)("div",{className:ea,children:(0,a.jsx)("input",{type:"text",autoComplete:"username",value:K,onChange:e=>{V(e.target.value.toLowerCase().replace(/\s/g,"")),z(null)},placeholder:"[email protected]",className:"w-full px-6 py-3 bg-transparent text-black rounded-xl focus:outline-none placeholder-gray-400",disabled:G,autoFocus:!0})}),(0,a.jsx)("button",{type:"submit",disabled:G||!K.trim(),className:en,children:G?es:"Continue with Mastodon"})]})]}),!v&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("p",{className:"text-xs text-muted-foreground text-center mt-6",children:["By continuing, you agree to Linkname's"," ",(0,a.jsx)(i(),{href:"/privacy",className:"underline",children:"privacy policy"})," ","and ",(0,a.jsx)(i(),{href:"/tos",className:"underline",children:"terms of service"}),"."]}),(0,a.jsxs)("p",{className:"text-center text-muted-foreground text-sm mt-4",children:["Don't have a Linkname account?"," ",(0,a.jsx)(i(),{href:"/signup",className:"text-[#8b5cf6]",children:"Create one"})]})]})]})]})})]})}function h(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)("div",{className:"force-light min-h-screen flex items-center justify-center bg-white",children:(0,a.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}),children:(0,a.jsx)(x,{})})}},73384:(e,t,s)=>{Promise.resolve().then(s.bind(s,70263))},91273:(e,t,s)=>{"use strict";s.d(t,{I:()=>l});var a=s(52693),n=s(33777);function l(e){let{value:t,onChange:s,onComplete:l,disabled:r,autoF
1ocus:i,length:o=6}=e,c=(0,n.useRef)(null);(0,n.useEffect)(()=>{var e;i&&(null==(e=c.current)||e.focus())},[i]);let u=t.split("").concat(Array(o).fill("")).slice(0,o),d=Math.min(t.length,o-1),m=e=>{let t=e.replace(/\D/g,"").slice(0,o);s(t),t.length===o&&l&&l(t)};return(0,a.jsxs)("div",{className:"relative flex justify-center gap-2 sm:gap-3",children:[u.map((e,s)=>{let n=!r&&s===d&&t.length<o,l=s<t.length;return(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none w-12 h-12 sm:w-14 sm:h-14 flex items-center justify-center text-xl font-medium rounded-xl bg-white border-2 transition-all ".concat(n?"border-[#8b5cf6] ring-2 ring-[#8b5cf6]":l?"border-[#8b5cf6]":"border-gray-300"," ").concat(r?"opacity-50":""),children:(0,a.jsx)("span",{className:"text-black",children:e})},s)}),(0,a.jsx)("input",{ref:c,type:"text",inputMode:"numeric",pattern:"[0-9]*",autoComplete:"one-time-code",maxLength:o,value:t,onChange:e=>m(e.target.value),disabled:r,"aria-label":"".concat(o,"-digit verification code"),className:"absolute inset-0 w-full h-full opacity-0 text-transparent caret-transparent tracking-[999px] focus:outline-none disabled:cursor-not-allowed"})]})}}},e=>{var t=t=>e(e.s=t);e.O(0,[6471,8887,6441,2285,7470,4964,4046,8897,1009,6038,1474,9289,5941,6277,4505,7677,7358],()=>t(73384)),_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.