import{j as z,t as H,m as g,n as s,p as t,f as I,A as y,s as R,q as E,S as T}from"./web.Os7kOAdY.js";import{g as U,t as le}from"./i18n-runtime._BAkvU05.js";var ne=y('<details style=width:100%;max-width:560px><summary style=cursor:pointer;color:var(--accent);font-size:14px><!$><!/><!$><!/>)</summary><div style=max-height:200px;overflow:auto;margin-top:8px><table style=width:100%;font-size:12px;font-family:ui-monospace,monospace;border-collapse:collapse><thead><tr style="border-bottom:1px solid var(--border)"><th style=text-align:left;padding:4px>key</th><th style=text-align:left;padding:4px>code</th><th style=text-align:left;padding:4px>keyCode</th><th style=text-align:left;padding:4px>which</th></tr></thead><tbody>'),ie=y("<div class=panel style=display:flex;flex-direction:column;gap:18px;align-items:center><p style=color:var(--muted);font-size:14px;text-align:center></p><!$><!/><!$><!/><p class=tool-hint>"),de=y('<div style="border:2px dashed var(--border);border-radius:12px;padding:48px 32px;text-align:center;width:100%;max-width:500px"><span style=font-size:48px;opacity:0.3>⌨️</span><p style=color:var(--muted);margin-top:12px>'),ae=y('<div style=width:100%;max-width:560px><div style=text-align:center;margin-bottom:18px><div style="display:inline-block;padding:18px 36px;border-radius:12px;background:var(--bg-2);border:2px solid var(--accent);font-size:36px;font-weight:700;font-family:ui-monospace,monospace"></div></div><dl class=tool-kv style=font-family:ui-monospace,monospace><dt>event.key</dt><dd></dd><dt>event.code</dt><dd></dd><dt>event.keyCode</dt><dd style=font-size:20px;font-weight:700;color:var(--accent)></dd><dt>event.which</dt><dd></dd><dt>event.location</dt><dd><!$><!/> (<!$><!/>)</dd><dt>repeat</dt><dd></dd><dt></dt><dd>'),oe=y('<tr style="border-bottom:1px solid var(--border)"><td style=padding:4px></td><td style=padding:4px></td><td style=padding:4px></td><td style=padding:4px>');function ce(){const[F,M]=z(U(),{equals:!1}),c=e=>le(e,F());H(()=>{const e=d=>{const o=d.detail?.locale;o&&M(o)};window.addEventListener("taitan:locale-change",e),M(U()),R(()=>window.removeEventListener("taitan:locale-change",e))});const[G,J]=z(null),[f,O]=z([]);function N(e){e.preventDefault();const d={key:e.key,code:e.code,keyCode:e.keyCode,which:e.which,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,location:e.location,repeat:e.repeat};J(d),O(o=>[d,...o].slice(0,20))}H(()=>{document.addEventListener("keydown",N),R(()=>{document.removeEventListener("keydown",N)})});const P=e=>["Standard","Left","Right","Numpad"][e]||"Unknown";return(()=>{var e=g(ie),d=e.firstChild,o=d.nextSibling,[j,Q]=s(o.nextSibling),V=j.nextSibling,[q,W]=s(V.nextSibling),X=q.nextSibling;return t(d,()=>c("按下任意键查看详细信息")),t(e,I(T,{get when(){return G()},get fallback(){return(()=>{var l=g(de),n=l.firstChild,r=n.nextSibling;return t(r,()=>c("等待按键...")),l})()},children:l=>(()=>{var n=g(ae),r=n.firstChild,$=r.firstChild,v=r.nextSibling,S=v.firstChild,p=S.nextSibling,u=p.nextSibling,_=u.nextSibling,w=_.nextSibling,h=w.nextSibling,C=h.nextSibling,i=C.nextSibling,b=i.nextSibling,a=b.nextSibling,m=a.firstChild,[x,k]=s(m.nextSibling),K=x.nextSibling,Y=K.nextSibling,[A,Z]=s(Y.nextSibling);A.nextSibling;var ee=a.nextSibling,B=ee.nextSibling,D=B.nextSibling,te=D.nextSibling;return t($,(()=>{var L=E(()=>l().key===" ");return()=>L()?"Space":l().key})()),t(p,(()=>{var L=E(()=>l().key===" ");return()=>L()?'" "':l().key})()),t(_,()=>l().code),t(h,()=>l().keyCode),t(i,()=>l().which),t(a,()=>l().location,x,k),t(a,()=>P(l().location),A,Z),t(B,()=>l().repeat?"是":"否"),t(D,()=>c("修饰键")),t(te,()=>[l().ctrlKey&&"Ctrl",l().shiftKey&&"Shift",l().altKey&&"Alt",l().metaKey&&"Meta"].filter(Boolean).join(" + ")||"无"),n})()}),j,Q),t(e,I(T,{get when(){return f().length>1},get children(){var l=g(ne),n=l.firstChild,r=n.firstChild,[$,v]=s(r.nextSibling),S=$.nextSibling,[p,u]=s(S.nextSibling);p.nextSibling;var _=n.nextSibling,w=_.firstChild,h=w.firstChild,C=h.nextSibling;return t(n,()=>c("历史记录 ("),$,v),t(n,()=>f().length,p,u),t(C,()=>f().map(i=>(()=>{var b=g(oe),a=b.firstChild,m=a.nextSibling,x=m.nextSibling,k=x.nextSibling;return t(a,(()=>{var K=E(()=>i.key===" ");return()=>K()?"Space":i.key})()),t(m,()=>i.code),t(x,()=>i.keyCode),t(k,()=>i.which),b})())),l}}),q,W),t(X,()=>c("keyCode 已弃用但仍广泛使用；推荐使用 event.key 或 event.code。")),e})()}export{ce as default};
