1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8295],{5397:(e,t,a)=>{"use strict";a.d(t,{b:()=>d});var n=a(55729),r=a(19639),s=a(6029),i="horizontal",l=["horizontal","vertical"],o=n.forwardRef((e,t)=>{var a;let{decorative:n,orientation:o=i,...d}=e,c=(a=o,l.includes(a))?o:i;return(0,s.jsx)(r.sG.div,{"data-orientation":c,...n?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...d,ref:t})});o.displayName="Separator";var d=o},19639:(e,t,a)=>{"use strict";a.d(t,{hO:()=>o,sG:()=>l});var n=a(55729),r=a(56760),s=a(97628),i=a(6029),l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let a=(0,s.TL)(`Primitive.${t}`),r=n.forwardRef((e,n)=>{let{asChild:r,...s}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(r?a:t,{...s,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function o(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}},33836:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>p,default:()=>g});var n=a(6029),r=a(35270),s=a(83248),i=a(68539),l=a(35460),o=a(82203),d=a.n(o),c=a(55729),u=a(58578),m=a(14187),f=a(81278),h=a(36919),x=a(43003),p=!0;function g(e){let{availableLogins:t}=e,{t:a}=(0,m.Bd)(),o=(0,f.useRouter)(),{data:p}=(0,x.UK)(),[g,b]=(0,c.useState)(!1),[w,v]=(0,c.useState)({username:"",password:""});async function j(e){if(e.preventDefault(),""!==w.username&&""!==w.password){b(!0);let e=u.oR.loading(a("authenticating")),t=await (0,l.signIn)("credentials",{username:w.username,password:w.password,redirect:!1});u.oR.dismiss(e),b(!1),(null==t?void 0:t.ok)||(u.oR.error((null==t?void 0:t.error)||a("invalid_credentials")),(null==t?void 0:t.error)==="Email not verified."&&(await (0,l.signIn)("email",{email:w.username,callbackUrl:"/",redirect:!1}),o.push("/confirmation?email=".concat(encodeURIComponent(w.username)))))}else u.oR.error(a("fill_all_fields"))}async function N(e){b(!0);let t=u.oR.loading(a("authenticating"));await (0,l.signIn)(e,{}),u.oR.dismiss(t),b(!1)}return(0,n.jsx)(i.A,{header:a("sign_in_to_linkwarden"),children:(0,n.jsx)("form",{onSubmit:j,children:(0,n.jsxs)("div",{className:"mx-auto flex flex-col gap-3 justify-between max-w-md min-w-80 w-full","data-testid":"login-form",children:[function(){if("true"===t.credentialsEnabled)return(0,n.jsxs)(n.Fragment,{children:[(null==p?void 0:p.DEMO)&&(null==p?void 0:p.DEMO_USERNAME)&&(null==p?void 0:p.DEMO_PASSWORD)&&(0,n.jsx)("div",{className:"p-3 shadow-lg border border-primary rounded-xl",children:(0,n.jsxs)("div",{className:"flex flex-col gap-2 items-center text-center w-full",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-info h-6 w-6 shrink-0",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,n.jsx)("p",{className:"font-bold",children:a("demo_title")})]}),(0,n.jsx)("div",{className:"text-xs",children:a("demo_desc")}),(0,n.jsxs)("div",{className:"text-xs",children:[a("demo_desc_2")," ",(0,n.jsx)("a",{href:"https://cloud.linkwarden.app",target:"_blank",className:"font-bold",children:"cloud.linkwarden.app"})]}),(0,n.jsx)(r.$,{variant:"primary",size:"full",onClick:async()=>{let e=u.oR.loading(a("authenticating"));v({username:null==p?void 0:p.DEMO_USERNAME,password:null==p?void 0:p.DEMO_PASSWORD}),await (0,l.signIn)("credentials",{username:null==p?void 0:p.DEMO_USERNAME,password:null==p?void 0:p.DEMO_PASSWORD,redirect:!1}),u.oR.dismiss(e)},children:a("demo_button")})]})}),(0,n.jsx)("div",{children:(0,n.jsx)(s.A,{name:"username",autoFocus:!0,placeholder:"true"===t.emailEnabled?a("username_or_email"):a("username"),value:w.username,className:"bg-base-100","data-testid":"username-input",onChange:e=>v({...w,username:e.target.value})})}),(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsx)(s.A,{type:"password",placeholder:a("password"),value:w.password,className:"bg-base-100","data-testid":"password-input",onChange:e=>v({...w,password:e.target.value})}),"true"===t.emailEnabled&&(0,n.jsx)("div",{className:"w-fit ml-auto mt-1",children:(0,n.jsx)(d(),{href:"/forgot",className:"text-neutral font-semibold","data-testid":"forgot-password-link",children:a("forgot_password")})})]}),(0,n.jsx)(r.$,{type:"submit",size:"full",variant:"accent","data-testid":"submit-login-button",disabled:g,children:a("login")}),t.buttonAuths.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(h.w,{className:"my-1 flex-1 w-auto"}),(0,n.jsx)("p",{className:"whitespace-nowrap",children:a("or")}),(0,n.jsx)(h.w,{className:"my-1 flex-1 w-auto"})]})]})}(),function(){let e=[];return t.buttonAuths.forEach((t,s)=>{e.push((0,n.jsx)(c.Fragment,{children:(0,n.jsx)(r.$,{type:"button",onClick:()=>N(t.method),size:"full",variant:"metal",disabled:g,children:"google"===t.name.toLowerCase()?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("i",{className:"bi-google"}),a("continue_with_google")]}):"apple"===t.name.toLowerCase()?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("i",{className:"bi-apple"}),a("continue_with_apple")]}):t.name})},s))}),e}(),function(){if("true"!==t.registrationDisabled)return(0,n.jsxs)("div",{className:"flex items-baseline gap-1 justify-center",children:[(0,n.jsx)("p",{className:"w-fit text-gray-500 dark:text-gray-400",children:a("new_here")}),(0,n.jsx)(d(),{href:"/register",className:"font-semibold","data-testid":"register-link",children:a("sign_up")})]})}()]})})})}},35270:(e,t,a)=>{"use strict";a.d(t,{$:()=>d});var n=a(6029),r=a(55729),s=a(97628),i=a(72262),l=a(45933);let o=(0,i.F)("inline-flex items-center focus:outline-none outline-none justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background duration-150 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 select-none",{variants:{variant:{default:"bg-neutral-content text-neutral-content-foreground hover:bg-neutral-content/90",primary:"bg-primary text-primary-foreground hover:bg-primary/90",accent:"bg-accent text-white hover:bg-accent/90 border border-violet-400",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-base-content bg-background hover:bg-base-content hover:text-base-100",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",metal:"bg-neutral-content text-base-content hover:bg-neutral-content/80 border border-neutral/30",ghost:"hover:bg-base-content/20",simple:"bg-base-200 hover:bg-base-300",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-1 px-2 text-xs",lg:"h-11 px-8",full:"px-4 py-2 w-full",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),d=r.forwardRef((e,t)=>
1{let{className:a,variant:r,size:i,asChild:d=!1,...c}=e,u=d?s.DX:"button";return(0,n.jsx)(u,{className:(0,l.cn)(o({variant:r,size:i,className:a})),ref:t,...c})});d.displayName="Button"},36919:(e,t,a)=>{"use strict";a.d(t,{w:()=>l});var n=a(6029),r=a(55729),s=a(5397),i=a(45933);let l=r.forwardRef((e,t)=>{let{className:a,orientation:r="horizontal",decorative:l=!0,...o}=e;return(0,n.jsx)(s.b,{ref:t,decorative:l,orientation:r,className:(0,i.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",a),...o})});l.displayName=s.b.displayName},68539:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029),r=a(45933),s=a(8588),i=a.n(s);function l(e){let{header:t,text:a,children:s,className:l,"data-testid":o}=e;return(0,n.jsx)("div",{className:(0,r.cn)("flex min-h-screen justify-center items-center p-5",l),"data-testid":o,children:(0,n.jsxs)("div",{className:"m-auto flex flex-col gap-3 w-full",children:[(0,n.jsx)(i(),{src:"/icon-small-150x150.png",width:150,height:150,alt:"Linkwarden",className:"h-16 w-auto mx-auto",priority:!0}),t&&(0,n.jsx)("p",{className:"text-2xl text-black dark:text-white text-center font-semibold",children:t}),a&&(0,n.jsx)("p",{className:"text-lg max-w-[30rem] min-w-80 w-full mx-auto px-2 font-light text-center",children:a}),s]})})}a(55729)},82805:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return a(33836)}])},83248:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(6029),r=a(23994);let s=(0,a(55729).forwardRef)((e,t)=>{let{className:a,type:s="text",...i}=e;return(0,n.jsx)("input",{ref:t,type:s,className:(0,r.cn)("w-full rounded-md p-2 border-neutral-content border-solid border outline-none focus:border-primary duration-100",a),...i})});s.displayName="TextInput";let i=s}},e=>{e.O(0,[8986,2203,636,6593,8792],()=>e(e.s=82805)),_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.