1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Dp7ySphv.js";import{a as n,t as r}from"./button-DXz7C9ai.js";import{n as i}from"./dist-bUu6sd0X.js";import{t as a}from"./jsx-runtime-fbxXJtWM.js";import{t as o}from"./key-round-DRraWxaW.js";import{t as s}from"./loader-circle-CWjxNz2m.js";import{r as c}from"./legalLinks-He03yO-Y.js";var l=e(t(),1),u=a(),d=()=>typeof window<`u`&&window.PublicKeyCredential!==void 0;function f({onSuccess:e}){let{language:t}=n(),{signInWithPasskey:a}=c(),[f,p]=(0,l.useState)(!1);return d()?(0,u.jsxs)(r,{type:`button`,variant:`secondary`,className:`w-full gap-2`,"data-testid":`passkey-signin`,disabled:f,onClick:async()=>{p(!0);let{error:n}=await a();if(p(!1),n){/cancel|abort|not allowed|timed out/i.test(n.message)||(console.error(`Passkey sign-in failed:`,n),i.error(t===`de`?`Passkey-Anmeldung fehlgeschlagen`:`Passkey sign-in failed`,{description:t===`de`?`Wir konnten keinen Passkey verwenden. Nutze eine andere Anmeldeoption.`:`We couldn't use a passkey. Try another sign-in option.`}));return}e?.()},children:[f?(0,u.jsx)(s,{className:`h-4 w-4 animate-spin`}):(0,u.jsx)(o,{className:`h-4 w-4`}),t===`de`?`Mit Passkey anmelden`:`Sign in with a passkey`]}):null}export{d as n,f as t};
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.