Panic-BCdnCJw2.js

4.2 KB · raw

1import{A as e,B as t,F as n,G as r,H as i,K as a,L as o,M as s,N as c,U as l,V as u,k as d}from"./index-J2S54SZa.js";import{t as f}from"./RuneCanvas-BQmgJ8DE.js";var p=o(`<div class=peach-overlay-header><button class="peach-btn peach-btn--ghost peach-btn--sm peach-icon-btn"aria-label=Back><svg width=7 height=12 viewBox="0 0 7 12"fill=none stroke=currentColor stroke-width=1.1 stroke-linecap=round stroke-linejoin=round><path d="M6 1L1 6L6 11"></path></svg></button><span class=peach-overlay-title></span><div class=peach-overlay-spacer>`),m=o(`<div class=peach-panic><h2 class=peach-panic-title>Before you destroy your vault</h2><p class=peach-panic-body>Once destroyed, your vault cannot be recovered. Ever. There is no undo, no support ticket, no way back.</p><p class=peach-panic-body>If you haven't already, export your vault now. It takes ten seconds and you'll be glad you did.</p><button class="peach-panic-button peach-panic-button--primary">Export my vault first</button><div class=peach-panic-divider></div><p class=peach-panic-body>I have already exported my vault or I don't want to.</p><button class=peach-panic-link>Continue to destruction →`),h=o(`<div class="peach-panic peach-panic-step2"><span class=peach-panic-icon aria-hidden=true>⚠</span><h2 class="peach-panic-title peach-panic-title--severe">This will permanently destroy your vault.</h2><p class="peach-panic-body peach-panic-body--severe">Every password, card, passkey, note, and setting will be wiped from this device. This cannot be undone.</p><p class=peach-panic-confirm-label>Type DESTROY to confirm:</p><input class=peach-panic-confirm-input type=text autocomplete=off autocapitalize=off aria-label="Type DESTROY to confirm"><div class=peach-panic-actions><button class="peach-panic-button peach-panic-button--danger">Yes, destroy my vault</button><button class="peach-panic-button peach-panic-button--ghost">Cancel — keep my vault`),g=o(`<button class="peach-panic-button peach-panic-button--ghost">No — take me back`),_=o(`<div class="peach-panic peach-panic-step3"><div class=peach-panic-rune-bg aria-hidden=true></div><div class=peach-panic-bar>THIS IS YOUR LAST CHANCE</div><p class="peach-panic-body peach-panic-body--final-intro">Your vault is about to be permanently destroyed.</p><p class="peach-panic-body peach-panic-body--final">There is no recovery.<br>There is no support.<br>There is no undo.</p><div class=peach-panic-divider></div><div class=peach-panic-actions><button class=peach-panic-final-button>`),v=o(`<div class="peach-overlay-view ov-enter-right"style=display:flex;flex-direction:column>`),y=Array.from({length:80},(e,t)=>String.fromCodePoint(57344+(t*19+7)%256)).join(``);function b(t){return(()=>{var n=p(),r=n.firstChild,i=r.nextSibling;return e(r,`click`,t.onBack,!0),c(i,()=>t.title),n})()}function x(e){let[o,s]=a(1),[p,x]=a(``),[S,C]=a(!1),w=()=>p()===`DESTROY`;async function T(){if(!S()){if(C(!0),!(await d({type:`DESTROY_VAULT`}))?.ok){C(!1);return}await e.onDestroyed()}}return(()=>{var a=v();return c(a,l(i,{get children(){return[l(t,{get when(){return o()===1},get children(){return[l(b,{title:`danger zone`,get onBack(){return e.onCancel}}),(()=>{var t=m(),n=t.firstChild.nextSibling.nextSibling.nextSibling,r=n.nextSibling.nextSibling.nextSibling;return n.$$click=()=>e.onOpenExport(),r.$$click=()=>s(2),t})()]}}),l(t,{get when(){return o()===2},get children(){var t=h(),i=t.firstChild.nextSibling.nextSibling.nextSibling.nextSibling,a=i.nextSibling.firstChild,o=a.nextSibling;return i.$$input=e=>x(e.currentTarget.value),n(i,`spellcheck`,!1),a.$$click=()=>s(3),o.$$click=()=>{x(``),e.onCancel()},r(e=>{var t=!!w(),n=!w();return t!==e.e&&i.classList.toggle(`peach-panic-confirm-input--match`,e.e=t),n!==e.t&&(a.disabled=e.t=n),e},{e:void 0,t:void 0}),r(()=>i.value=p()),t}}),l(t,{get when(){return o()===3},get children(){var e=_(),t=e.firstChild,n=t.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,i=n.firstChild;return c(t,l(f,{runeString:y,width:320,height:480})),i.$$click=()=>void T(),c(i,()=>S()?`Destroying…`:`Destroy my vault forever`),c(n,l(u,{get when(){return!S()},get children(){var e=g();return e.$$click=()=>{x(``),s(1)},e}}),null),r(()=>i.disabled=S()),e}})]}})),a})()}s([`click`,`input`]);export{x as PanicView};