import{n as e,t}from"./VisualListItem-DRPpOUh4.js";import{A as n,D as r,Dt as i,Et as a,N as o,P as s,T as c,Y as l,dt as u,ht as d,jt as f,k as p,kt as m,mt as h,ut as g,w as _}from"./main-ChC-SNZa.js";import{t as v}from"./ButtonLink-CvJOjYPg.js";var y=f(),b=n(`
  mutation AllowCrossSigningReset($userId: ID!) {
    allowUserCrossSigningReset(input: { userId: $userId }) {
      user {
        id
      }
    }
  }
`);function x(){let{deepLink:n}=_.useSearch(),f=_.useNavigate(),{t:x}=s(),{data:{viewer:S}}=m(c);if(S.__typename!==`User`)throw a();let C=S.id,w=i({mutationFn:async e=>p({query:b,variables:{userId:e}}),onSuccess:()=>{setTimeout(()=>{window.onAuthDone?window.onAuthDone():window.opener?.postMessage&&window.opener.postMessage(`authDone`,`*`)}),f({to:`/reset-cross-signing/success`,replace:!0})}});return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o,{Icon:u,title:x(`frontend.reset_cross_signing.heading`),invalid:!0}),(0,y.jsx)(d,{className:`text-center text-secondary`,size:`md`,children:x(`frontend.reset_cross_signing.description`)}),(0,y.jsxs)(e,{children:[(0,y.jsx)(t,{Icon:l,success:!0,children:x(`frontend.reset_cross_signing.effect_list.positive_1`)}),(0,y.jsx)(t,{Icon:g,children:x(`frontend.reset_cross_signing.effect_list.neutral_1`)}),(0,y.jsx)(t,{Icon:g,children:x(`frontend.reset_cross_signing.effect_list.neutral_2`)})]}),(0,y.jsx)(d,{className:`text-center`,size:`md`,weight:`semibold`,children:x(`frontend.reset_cross_signing.warning`)}),(0,y.jsxs)(h,{kind:`primary`,destructive:!0,disabled:w.isPending,onClick:async()=>{w.mutate(C)},children:[!!w.isPending&&(0,y.jsx)(r,{inline:!0}),x(`frontend.reset_cross_signing.finish_reset`)]}),n?(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-BqT5P_bA.js.map