import{i as e,s as t,t as n}from"./graphql-BME5mLgf.js";import{n as r,t as i}from"./LoadingSpinner-BR8GsFxa.js";import{t as a}from"./jsx-runtime-C3uB2UIS.js";import"./useStore-BnK_t0Uy.js";import{n as o}from"./not-found-D2Q6nITs.js";import"./link-DiTuM_g9.js";import{t as s}from"./useTranslation-DVVidJl_.js";import{t as c}from"./error-solid-D_cdpnqe.js";import{t as l}from"./check-v-1lZ3Ot.js";import{t as u}from"./Button-BZSwK8Kg.js";import{n as d,t as f}from"./VisualListItem-CR8GatM7.js";import{C as p,E as m,O as h,b as g,y as _}from"./main-BpPO1zAy.js";import{t as v}from"./ButtonLink-BlaAAQga.js";var y=a(),b=e(`
  mutation AllowCrossSigningReset($userId: ID!) {
    allowUserCrossSigningReset(input: { userId: $userId }) {
      user {
        id
      }
    }
  }
`);function x(){let{deepLink:e}=_.useSearch(),a=_.useNavigate(),{t:x}=s(),{data:{viewer:S}}=t(g);if(S.__typename!==`User`)throw o();let C=S.id,w=r({mutationFn:async e=>n({query:b,variables:{userId:e}}),onSuccess:()=>{setTimeout(()=>{window.onAuthDone?window.onAuthDone():window.opener?.postMessage&&window.opener.postMessage(`authDone`,`*`)}),a({to:`/reset-cross-signing/success`,replace:!0})}});return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(p,{Icon:c,title:x(`frontend.reset_cross_signing.heading`),invalid:!0}),(0,y.jsx)(m,{className:`text-center text-secondary`,size:`md`,children:x(`frontend.reset_cross_signing.description`)}),(0,y.jsxs)(d,{children:[(0,y.jsx)(f,{Icon:l,success:!0,children:x(`frontend.reset_cross_signing.effect_list.positive_1`)}),(0,y.jsx)(f,{Icon:h,children:x(`frontend.reset_cross_signing.effect_list.neutral_1`)}),(0,y.jsx)(f,{Icon:h,children:x(`frontend.reset_cross_signing.effect_list.neutral_2`)})]}),(0,y.jsx)(m,{className:`text-center`,size:`md`,weight:`semibold`,children:x(`frontend.reset_cross_signing.warning`)}),(0,y.jsxs)(u,{kind:`primary`,destructive:!0,disabled:w.isPending,onClick:async()=>{w.mutate(C)},children:[!!w.isPending&&(0,y.jsx)(i,{inline:!0}),x(`frontend.reset_cross_signing.finish_reset`)]}),e?(0,y.jsx)(v,{to:`/reset-cross-signing/cancelled`,kind:`tertiary`,replace:!0,children:x(`action.cancel`)}):(0,y.jsx)(v,{to:`/`,kind:`tertiary`,children:x(`action.back`)})]})}export{x as component};
//# sourceMappingURL=reset-cross-signing.index-BTuuf0Rj.js.map