1import{r as a,b as Me,c as Ie,j as n}from"./react-vendor-Cjoe_APl.js";import{o as Pe}from"./ai-chat-3tRUzqf_.js";import{a1 as qe,a2 as Ue,p as v,a3 as Be,t as J,a4 as Ge,a5 as Ve,E as me,a6 as T,a7 as fe,l as ge}from"./index-D8DLnaN_.js";import{B as He}from"./booking-BosEuqTF.js";import{h as B}from"./hr-store-DhybakLT.js";import{u as _e,i as Fe,v as Ke}from"./overlay-bus-BACCTe-W.js";import{E as ze}from"./EmailSubscribe-C01CqZ79.js";import{D as We,a as $e,b as Xe,c as Ye,d as Je}from"./dialog-ObWuOpy4.js";import{aZ as Qe,af as Ze,m as he,B as be,n as et,a_ as ye,an as tt,aC as Q,aq as ot,a$ as we,F as xe,h as ve,P as at,b0 as nt,ad as st,b1 as it,b2 as rt,z as ct,b3 as lt,b4 as ut,ax as dt,Z as pt,b5 as mt,b6 as Z,b7 as ft,b8 as gt,C as ee,aN as ht,ag as bt,b9 as yt,D as wt,aA as xt,ba as vt,bb as kt,y as St,a7 as Ct,G as Et,o as Nt,bc as At,bd as Tt,E as jt,aD as Rt,ac as Lt,X as Dt,be as Ot}from"./icons-DW2APY13.js";import{A as Mt,m as ke}from"./framer-motion-Bt-cU7Mj.js";import"./radix-Bj2ee229.js";const Ae="sound-enabled",Te="sound-volume";let j=null,N=!1,A=.5;try{N=localStorage.getItem(Ae)==="true";const t=localStorage.getItem(Te);t&&(A=parseFloat(t))}catch{}function R(){return j||(j=new(window.AudioContext||window.webkitAudioContext)),j.state==="suspended"&&j.resume(),j}function H(t,i){const l=t.createGain();return l.gain.value=i*A,l.connect(t.destination),l}function Se(t,i,l,r){if(N)try{const o=R(),c=o.sampleRate*(t/1e3),p=o.createBuffer(1,c,o.sampleRate),h=p.getChannelData(0);for(let w=0;w<c;w++)h[w]=(Math.random()*2-1)*Math.pow(1-w/c,6);const y=o.createBufferSource();y.buffer=p;const S=o.createBiquadFilter();S.type="bandpass",S.frequency.value=i,S.Q.value=l;const L=H(o,r);y.connect(S),S.connect(L),y.start(),y.stop(o.currentTime+t/1e3)}catch{}}function G(t,i,l,r=0){if(N)try{const o=R(),c=o.createOscillator();c.type="sine",c.frequency.value=t;const p=H(o,l);p.gain.setValueAtTime(l*A,o.currentTime+r),p.gain.exponentialRampToValueAtTime(.001,o.currentTime+r+i/1e3),c.connect(p),c.start(o.currentTime+r),c.stop(o.currentTime+r+i/1e3)}catch{}}function Ce(t,i,l,r){if(N)try{const o=R(),c=o.createOscillator();c.type="sine",c.frequency.setValueAtTime(t,o.currentTime),c.frequency.exponentialRampToValueAtTime(i,o.currentTime+l/1e3);const p=H(o,r);p.gain.setValueAtTime(r*A,o.currentTime),p.gain.exponentialRampToValueAtTime(.001,o.currentTime+l/1e3),c.connect(p),c.start(),c.stop(o.currentTime+l/1e3)}catch{}}const V={init(){j||R()},playHover(){Se(15,4e3,.8,.03)},playClick(){Se(40,3e3,.5,.06)},playPageTransition(){if(N)try{const t=R(),i=t.sampleRate*.2,l=t.createBuffer(1,i,t.sampleRate),r=l.getChannelData(0);for(let h=0;h<i;h++)r[h]=(Math.random()*2-1)*Math.pow(1-h/i,3);const o=t.createBufferSource();o.buffer=l;const c=t.createBiquadFilter();c.type="bandpass",c.frequency.setValueAtTime(5e3,t.currentTime),c.frequency.exponentialRampToValueAtTime(500,t.currentTime+.2),c.Q.value=1;const p=H(t,.04);o.connect(c),c.connect(p),o.start(),o.stop(t.currentTime+.2)}catch{}},playSuccess(){G(523,80,.05,0),G(659,80,.05,.08)},playToggle(){G(800,30,.04)},playOpen(){Ce(300,700,150,.04)},playClose(){Ce(700,300,150,.04)},playAchievement(){[523,659,784,1047].forEach((t,i)=>G(t,60,.06,i*.08))},setVolume(t){A=Math.max(0,Math.min(1,t));try{localStorage.setItem(Te,String(A))}catch{}},getVolume(){return A},setEnabled(t){N=t;try{localStorage.setItem(Ae,String(t))}catch{}},isEnabled(){return N}};function It(t,i,l=[]){const r=t.trim().toLowerCase();if(!r)return 0;const o=i.toLowerCase();if(o===r)return 0;if(o.startsWith(r))return 1;if(o.split(/[\s/-]+/).some(p=>p.startsWith(r)))return 2;if(o.includes(r))return 3;let c=-1;for(const p of l){const h=p.toLowerCase(),y=h===r?4:h.startsWith(r)?5:h.includes(r)?6:-1;y>=0&&(c<0||y<c)&&(c=y)}return c}function Pt(t,i){return i.trim()?t.map((l,r)=>({item:l,i:r,s:It(i,l.label,l.keywords)})).filter(l=>l.s>=0).sort((l,r)=>l.s-r.s||l.i-r.i).map(l=>l.item):[...t]}const qt="https://github.com/SubhanshuMG/my-portfolio",Ee=["Navigate","Actions","Preferences","Social"];function Ne(t){try{return localStorage.getItem(t)==="1"}catch{return!1}}function Ut(t,i){try{i?localStorage.setItem(t,"1"):localStorage.setItem(t,"0")}catch{}}function Bt(t){t?document.documentElement.setAttribute("data-palette","cb"):document.documentElement.removeAttribute("data-palette")}function Gt({className:t}
1){return n.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057c.002.022.013.043.031.056a19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03z"})})}const Vt='a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ht(t){const[i,l]=a.useState(null);return a.useEffect(()=>{if(!t)return;const r=window.visualViewport;if(!r)return;const o=()=>l(r.height);return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o)}},[t]),i}function eo({defaultOpen:t=!1}={}){const[i,l]=a.useState(t),r=a.useRef(t),o=qe(),[c,p]=a.useState(""),[h,y]=a.useState(0),[S,L]=a.useState(!1),[w,te]=a.useState(!1),[je,oe]=a.useState(!1),[_,Re]=a.useState(()=>Ne("pref_colorblind")),D=a.useSyncExternalStore(B.subscribe,B.getMode),O=a.useRef(null),F=a.useRef(null),K=a.useRef(null),z=a.useRef(null),M=a.useRef(null),I=a.useRef(!1),P=a.useRef(!1),W=Me(),ae=Ht(i),d=a.useCallback(()=>{l(!1),p(""),y(0),V.playClose()},[]),$=_e("palette",i,d),{pathname:C}=Ie(),ne=a.useRef(C);a.useEffect(()=>{ne.current!==C&&(ne.current=C,!Ue(C)&&(P.current=!0,l(!1),p(""),y(0)))},[C]);const se=a.useCallback(()=>{navigator.clipboard.writeText(v.email),L(!0),setTimeout(()=>L(!1),2e3),d()},[d]),q=a.useCallback(()=>{te(!0),setTimeout(()=>te(!1),2e3)},[]),ie=a.useCallback(async()=>{const e=window.location.href,s=navigator;try{typeof s.share=="function"?await s.share({url:e}):(await navigator.clipboard.writeText(e),q())}catch{}d()},[d,q]),re=a.useCallback(async()=>{try{await navigator.clipboard.writeText(window.location.href),q()}catch{}d()},[d,q]),ce=a.useCallback(()=>{d(),setTimeout(()=>oe(!0),60)},[d]),le=a.useCallback(()=>{const e=!Ne("pref_colorblind");Ut("pref_colorblind",e),Bt(e),Re(e),d()},[d]),ue=a.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"}),d()},[d]),de=a.useCallback(()=>{d(),setTimeout(()=>window.dispatchEvent(new KeyboardEvent("keydown",{key:"?"})),100)},[d]),u=a.useCallback(e=>{const s=e.split(/[?#]/)[0]||"/";if(s!==C){Be(s,{opaque:!1}).then(d),W(e);return}W(e),d()},[W,d,C]),x=a.useCallback(e=>{window.open(e,"_blank","noopener,noreferrer"),d()},[d]),X=a.useMemo(()=>[{id:"home",label:"Home",description:"Landing page & hero",icon:Qe,group:"Navigate",action:()=>u("/"),keywords:["index","landing"]},{id:"github",label:"Open Source",description:"GitHub repos, contributions & OSS work",icon:Ze,group:"Navigate",action:()=>u("/github"),keywords:["github","git","repos","contributions","oss"]},{id:"blogs",label:"Blogs",description:"Articles on DevOps, Cloud & Security",icon:he,group:"Navigate",action:()=>u("/blogs"),keywords:["posts","articles","writing","hashnode","devops"]},{id:"career",label:"Career",description:"Work history, roles & experience timeline",icon:be,group:"Navigate",action:()=>u("/career"),keywords:["work","experience","jobs","employment","history"]},{id:"certifications",label:"Certifications",description:"AWS, Oracle, Docker & 20+ credentials",icon:et,group:"Navigate",action:()=>u("/certifications"),keywords:["certs","aws","oracle","badges","credentials"]},{id:"services",label:"Services",description:"Consulting, audits & freelance offerings",icon:ye,group:"Navigate",action:()=>u("/services"),keywords:["freelance","consulting","upwork","pricing","hire"]},{id:"about",label:"About",description:"Bio, skills, stack & background",icon:tt,group:"Navigate",action:()=>u("/about"),keywords:["bio","profile","me","skills","stack"]},{id:"contact",label:"Contact",description:"Send a message or book an intro call",icon:Q,group:"Navigate",action:()=>u("/contact"),keywords:["email","message","hire","call","book"]},{id:"now",label:"Now",description:"What I'm currently building, learning & doing",icon:ot,group:"Navigate",action:()=>u("/now"),keywords:["current","status","doing","building","now"]},{id:"music",label:"Music",description:"Spotify dashboard: now playing, history & top tracks",icon:we,group:"Navigate",action:()=>u("/music"),keywords:["spotify","now playing","listening","playlist","songs","lyrics"]},{id:"case-studies",label:"Case Studies",description:"Architecture deep-dives for selected projects",icon:he,group:"Navigate",action:()=>u("/case-studies"),keywords:["projects","architecture","deep dive","case study"]},{id:"uses",label:"Uses",description:"My full dev setup: hardware, tools, stack",icon:ye,group:"Navigate",action:()=>u("/uses"),keywords:["setup","tools","hardware","dotfiles","gear"]},{id:"resume",label:"Resume",description:"View resume as PDF, YAML, or JSON",icon:xe,group:"Navigate",action:()=>u("/resume"),keywords:["cv","pdf","yaml","json","download","hire"]},{id:"terminal",label:"Terminal",description:"Shell + AI playground, Claude-powered",icon:ve,group:"Navigate",action:()=>u("/terminal"),keywords:["shell","bash","cli","ai","playground","terminal"]},{id:"commit-art",label:"Commit Art",description:"Generative art from Git commits",icon:at,group:"Navigate",action:()=>u("/commit-art"),keywords:["art","generative","sha","canvas","visual"]},{id:"universe",label:"Universe",description:"The constellation: every post, project & role as a 3D star map",icon:nt,group:"Navigate",action:()=>u("/universe"),keywords:["constellation","star map","graph","3d","galaxy","nodes","explore"]},{id:"creations",label:"Creations",description:"Apps, tools & things I have built",icon:st,group:"Navigate",action:()=>u("/creations"),keywords:["apps","tools","built","ship","saas","products","creations"]},{id:"playground",label:"Playground",description:"Interactive demos & experiments",icon:it,group:"Navigate",action:()=>u("/playground"),keywords:["demos","experiments","interactive","sandbox"]},{id:"hire",label:"Hire",description:"Engagement options, pricing & next steps",icon:rt,group:"Navigate",action:()=>u("/hire"),keywords:["hire","work with me","engage","consulting","pricing","rates"]},{id:"status",label:"Status",description:"Live uptime & system health dashboard",icon:ct,group:"Navigate",action:()=>u("/status"),keywords:["uptime","status","health","monitor","incidents"]},{id:"trace-request",label:"Trace My Request",description:"Your own page load as a waterfall: DNS, TLS, edge POP, paints",icon:lt,group:"Navigate",action:()=>u("/status#your-request"),keywords:["trace","waterfall","request","latency","ttfb","edge","pop","performance","timing","lcp"]},{id:"postmortems",label:"Postmortems",description:"Incidents on this site, written up blameless",icon:ut,group:"Navigate",action:()=>u("/status#postmortems"),keywords:["postmortem","post-mortem","incident","incidents","outage","rca","root cause","retro"]},{id:"changelog",label:"Changelog",description:"Every commit to this site, grouped by week",icon:dt,group:"Navigate",action:()=>u("/changelog"),keywords:["commits","git","log","history","changes","releases"]},{id:"secrets",label:"Secrets",description:"Easter eggs & hidden features index",icon:pt,group:"Navigate",action:()=>u("/secrets"),keywords:["easter eggs","eggs","hidden","konami","secrets","tricks"]},{id:"interests",label:"Pursuits",description:"The file: bike, games, roads, cats, Iceland, the sky",icon:mt,group:"Navigate",action:()=>u("/pursuits"),keywords:["pursuits","interests","hobbies","life","bike","motorcycle","harley","harley-davidson","x440","x440t","ride","riding","games","gaming","nfs","need for speed","most wanted","gta","crysis","rog","football","badminton","travel","backpacking","bali","singapore","thailand","iceland","cats","food","foodie","workout","gym","pilot","fighter pilot","astronaut","space","sky"]},{id:"cats",label:"Xelix",description:"Linux and Xenix, and the little universe they share",icon:Z,group:"Navigate",action:()=>u("/cats"),keywords:["cat","cats","pets","linux","xenix","xelix","together","kitten"]}
1,{id:"cat-linux",label:"Linux",description:"Her little universe",icon:Z,group:"Navigate",action:()=>u("/cats/linux"),keywords:["linux","cat","persian","princess","her","xelix"]},{id:"cat-xenix",label:"Xenix",description:"His little universe",icon:Z,group:"Navigate",action:()=>u("/cats/xenix"),keywords:["xenix","cat","british longhair","gentleman","him","xelix"]},{id:"book-call",label:"Book a Call",description:"Schedule an intro on Cal",icon:ft,group:"Actions",action:()=>x(He),keywords:["cal","calendly","meeting","schedule","intro","book"]},{id:"subscribe",label:"Subscribe to Blog",description:"Get new essays in your inbox",icon:gt,group:"Actions",action:ce,keywords:["email","newsletter","mailing list","subscribe","updates"]},{id:"share-page",label:w?"Copied!":"Share This Page",description:w?"URL copied to clipboard":"Open the native share sheet, or copy the URL",icon:w?ee:ht,group:"Actions",action:ie,keywords:["share","send","native share","url","link"]},{id:"copy-url",label:w?"Copied!":"Copy Current URL",description:w?"URL copied to clipboard":window.location.href,icon:w?ee:bt,group:"Actions",action:re,keywords:["url","link","clipboard","copy","address"]},{id:"email-me",label:"Email Me",description:"Open mail client to [email protected]",icon:Q,group:"Actions",action:()=>{d(),window.location.href="mailto:[email protected]"},keywords:["email","mail","mailto","contact","reach out"]},{id:"view-source",label:"View Source on GitHub",description:"github.com/SubhanshuMG/my-portfolio",icon:yt,group:"Actions",action:()=>x(qt),keywords:["source","code","repo","repository","github","oss"]},{id:"copy-email",label:S?"Email Copied!":"Copy Email",description:v.email,icon:S?ee:Q,group:"Actions",action:se,keywords:["clipboard","gmail"]},{id:"resume-dl",label:"Download Resume",description:"Open the DevSecOps resume PDF in a new tab",icon:wt,group:"Actions",action:()=>x(v.resumeUrl),keywords:["cv","pdf","resume","download","drive"]},{id:"publication",label:"View Research Paper",description:"Cloud security for healthcare, JMSS journal",icon:xe,group:"Actions",action:()=>x(v.publicationUrl),keywords:["research","paper","journal","cloud","security","healthcare"]},{id:"refresh-cache",label:o.status==="stalled"?"Reload Now":o.cooldownLeft>0?`Refreshed · ${o.cooldownLeft}s`:"Refresh Cached Data",description:"Clear this device's cached data and reload",icon:xt,group:"Actions",action:()=>{d(),o.refresh()},keywords:["refresh","reload","cache","clear cache","stale","hard refresh","update","bust"]},{id:"scroll-top",label:"Scroll to Top",description:"Jump back to the top of the page",icon:vt,group:"Actions",action:ue,keywords:["top","up","beginning"]},{id:"shortcuts",label:"Keyboard Shortcuts",description:"View all available shortcuts",icon:kt,group:"Actions",action:de,keywords:["keys","hotkeys","help"]},{id:"open-terminal",label:"Open Terminal",description:"Interactive shell, subhanshu@devsecops · ` to toggle",icon:ve,group:"Actions",action:()=>{d(),setTimeout(()=>window.dispatchEvent(new Event("open-terminal")),120)},keywords:["terminal","shell","tty","bash","zsh","cli","interactive","command"]},{id:"ask-ai",label:"Ask AI",description:"Ask the portfolio guide about my work, stack or availability",icon:St,group:"Actions",action:()=>{d(),setTimeout(()=>Pe(),120)},keywords:["ai","assistant","chat","ask","question","guide","bot","help"]},{id:"hr-view",label:D?"Career: Full-Time View":"Career: Show All Experiences",description:D?"Switch back to full-time roles only":"Include contracts, freelance & internships",icon:be,group:"Actions",secret:!0,keywords:["fulltime","full-time","focus","all","show all","experiences","filter"],action:()=>{B.setMode(!D),u("/career")}},{id:"pref-colorblind",label:_?"Disable Colorblind-Safe Palette":"Enable Colorblind-Safe Palette",description:_?"Switch back to cyan + violet accents":"Use amber + blue accents for higher distinction",icon:Ct,group:"Preferences",action:le,keywords:["colorblind","cb","palette","contrast","a11y","amber","blue"]},{id:"gh-social",label:"GitHub",description:"github.com/SubhanshuMG",icon:Et,group:"Social",action:()=>
1x(v.socialLinks.github),keywords:["code","repos","oss"]},{id:"li-social",label:"LinkedIn",description:"linkedin.com/in/subhanshumg",icon:Nt,group:"Social",action:()=>x(v.socialLinks.linkedin),keywords:["connect","profile","job"]},{id:"tw-social",label:"Twitter / X",description:"@SubhanshuMG",icon:At,group:"Social",action:()=>x(v.socialLinks.twitter),keywords:["x","tweet"]},{id:"ig-social",label:"Instagram",description:"@subhanshu_mg",icon:Tt,group:"Social",action:()=>x(v.socialLinks.instagram),keywords:["photos","ig"]},{id:"sp-social",label:"Spotify",description:"Music I code to",icon:we,group:"Social",action:()=>x(v.socialLinks.spotify),keywords:["music","playlist"]},{id:"uw-social",label:"Upwork",description:"Hire me for freelance work",icon:jt,group:"Social",action:()=>x(v.socialLinks.upwork),keywords:["freelance","hire"]},{id:"dc-social",label:"Discord",description:"Chat on Discord",icon:Gt,group:"Social",action:()=>x(v.socialLinks.discord),keywords:["chat","dm","discord"]},{id:"mc-social",label:"Send Message",description:"Chat or leave a message",icon:Rt,group:"Social",action:()=>u("/contact"),keywords:["message","chat","dm"]}],[S,w,o,_,D,u,x,se,ue,de,d,ie,re,ce,le]),U=a.useMemo(()=>Pt(c?X:X.filter(e=>!e.secret),c),[X,c]),Y=a.useMemo(()=>{const e={};for(const s of U)e[s.group]||(e[s.group]=[]),e[s.group].push(s);return e},[U]),E=a.useMemo(()=>Ee.flatMap(e=>Y[e]??[]),[Y]);a.useEffect(()=>{B.setHint(i&&U.some(e=>e.id==="hr-view"))},[i,U]),a.useEffect(()=>{y(0)},[c]),a.useEffect(()=>{if(!F.current)return;const e=F.current.querySelector('[data-active="true"]');e==null||e.scrollIntoView({block:"nearest"})},[h]),a.useEffect(()=>(i?(window.dispatchEvent(new Event("lenis-stop")),document.body.style.overflow="hidden"):(window.dispatchEvent(new Event("lenis-start")),document.body.style.overflow=""),()=>{window.dispatchEvent(new Event("lenis-start")),document.body.style.overflow=""}),[i]);const pe=a.useCallback(e=>{I.current=!0,J("cmd_palette_action",{id:e.id,label:e.label,group:e.group}),e.action()},[]);a.useEffect(()=>{r.current&&(r.current=!1,J("cmd_palette_open"),V.playOpen())},[]),a.useEffect(()=>{function e(s){(s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="k"&&(s.preventDefault(),l(b=>(b?V.playClose():(J("cmd_palette_open"),V.playOpen()),!b)))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),a.useEffect(()=>{if(i){M.current=Ge(),I.current=!1,P.current=!1;const m=document.activeElement;z.current=m instanceof HTMLElement&&m!==document.body?m:null;const f=setTimeout(()=>{var g;return(g=O.current)==null?void 0:g.focus()},50);return()=>clearTimeout(f)}const e=z.current;z.current=null;const s=M.current;if(M.current=null,$.current)return;if(s==="menu"&&!I.current&&!P.current){Ve();return}if(!e||!e.isConnected)return;const b=Fe(e)?e:Ke();b==null||b.focus({preventScroll:!0})},[i,$]),a.useEffect(()=>{if(!i)return;const e=f=>{const g=K.current;return!!g&&!(f instanceof Node&&g.contains(f))};let s=!1;const b=f=>{var k;if(s||!e(f.target))return;const g=f.target;if(!(g instanceof Element&&g.closest('[role="dialog"][data-state="open"]'))){s=!0;try{(k=O.current)==null||k.focus({preventScroll:!0})}finally{s=!1}}},m=f=>{var g;e(document.activeElement)&&(f.key==="Escape"?(f.preventDefault(),d()):f.key==="Tab"&&(f.preventDefault(),(g=O.current)==null||g.focus({preventScroll:!0})))};return document.addEventListener("focusin",b),document.addEventListener("keydown",m),()=>{document.removeEventListener("focusin",b),document.removeEventListener("keydown",m)}},[i,d]);function Le(e){if(e.key==="Escape"){d();return}if(e.key==="Tab"){const s=K.current;if(!s)return;const b=Array.from(s.querySelectorAll(Vt)).filter(k=>k.offsetParent!==null);if(b.length===0){e.preventDefault();return}const m=b[0],f=b[b.length-1],g=s.contains(document.activeElement);e.shiftKey&&(document.activeElement===m||!g)?(e.preventDefault(),f.focus()):!e.shiftKey&&(document.activeElement===f||!g)&&(e.preventDefault(),m.focus());return}if(e.key==="ArrowDown")e.preventDefault(),y(s=>Math.min(s+1,E.length-1));else if(e.key==="ArrowUp")e.preventDefault(),y(s=>Math.max(s-1,0));else if(e.key==="Enter"){e.preventDefault();const s=E[h];s&&pe(s)}}const De=!i&&M.current==="menu"&&!I.current&&!P.current&&!$.current;return n.jsxs(n.Fragment,{children:[n.jsx(We,{open:je,onOpenChange:oe,children:n.jsxs($e,{className:"sm:max-w-md p-0 bg-background border-border",children:[n.jsxs(Xe,{className:"px-6 pt-6",children:[n.jsx(Ye,{className:"text-base font-light",children:"Subscribe to the blog"}),n.jsx(Je,{className:"text-xs text-muted-foreground font-light",children:"New essays on DevOps, cloud, and security. No spam."})]}),n.jsx("div",{className:"px-6 pb-6 pt-2",children:n.jsx(ze,{source:"palette"})})]})}),n.jsx(Mt,{children:i&&n.jsxs(n.Fragment,{children:[n.jsx(ke.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0,transition:De?{duration:T.micro,delay:T.quick}:{duration:T.quick,ease:fe}},transition:{duration:T.quick,ease:me},className:"fixed inset-0 z-[200] bg-black/60 backdrop-blur-sm",onClick:d,"aria-hidden":"true"},"backdrop"),n.jsx(ke.div,{initial:{opacity:0,scale:.96,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.97,y:-6,transition:{duration:T.quick,ease:fe}},transition:{duration:T.base,ease:me},ref:K,role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"fixed left-1/2 -translate-x-1/2 z-[201] w-full max-w-lg mx-auto px-4",style:{top:"max(calc(env(safe-area-inset-top, 0px) + 12px), 12svh)"},onKeyDown:Le,children:n.jsxs("div",{className:"bg-background border border-border rounded-xl shadow-2xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[n.jsx(Lt,{className:"size-4 text-muted-foreground shrink-0"}),n.jsx("input",{ref:O,value:c,onChange:e=>p(e.target.value),placeholder:"Search pages, actions, or run a commandâ¦","aria-label":"Search pages and actions",role:"combobox","aria-expanded":E.length>0,"aria-controls":"palette-list","aria-autocomplete":"list","aria-activedescendant":E[h]?`palette-item-${E[h].id}`:void 0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,enterKeyHint:"go",className:"flex-1 min-w-0 bg-transparent text-sm font-light outline-none placeholder:text-muted-foreground/60 text-foreground"}),n.jsx("kbd",{className:"hidden sm:flex items-center gap-1 text-[10px] text-muted-foreground/50 font-mono border border-border rounded px-1.5 py-0.5",children:"ESC"}),n.jsx("button",{type:"button",onClick:d,"aria-label":"Close command palette",className:"sm:hidden -my-2 -mr-2 flex size-11 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60",children:n.jsx(Dt,{className:"size-4"})})]}),n.jsx("div",{ref:F,id:"palette-list",role:"listbox","aria-label":"Results",className:"overflow-y-auto overscroll-contain py-2",style:{maxHeight:ae!=null?`min(60svh, calc(${ae}px - 12rem))`:"60svh"},"data-lenis-prevent":!0,children:E.length===0?n.jsxs("p",{role:"presentation",className:"py-8 text-center text-sm text-muted-foreground font-light",children:['No results for "',c,'"']}):Ee.map(e=>{const s=Y[e];if(!(s!=null&&s.length))return null;const b=E.indexOf(s[0]);return n.jsxs("div",{role:"group","aria-labelledby":`palette-group-${e}`,className:"mb-1",children:[n.jsx("p",{id:`palette-group-${e}`,className:"px-4 py-1.5 text-[10px] font-medium tracking-widest uppercase text-muted-foreground/50",children:e}),s.map((m,f)=>{const g=b+f,k=g===h,Oe=m.icon;return n.jsxs("button",{id:`palette-item-${m.id}`,type:"button",role:"option","aria-selected":k,tabIndex:-1,"data-active":k,onClick:()=>pe(m),onMouseEnter:()=>y(g),className:ge("w-full min-h-11 flex items-center gap-3 px-4 py-2.5 text-left transition-colors duration-100 cursor-pointer",k?"bg-muted/60 text-foreground":"text-foreground/70 hover:text-foreground"),children:[n.jsx("span",{className:ge("flex items-center justify-center size-7 rounded-md border transition-colors duration-100",k?"border-border bg-background text-foreground":"border-transparent text-muted-foreground"),children:n.jsx(Oe,{className:"size-3.5"})}),n.jsxs("span",{className:"flex-1 min-w-0",children:[n.jsx("span",{className:"block text-sm font-light leading-tight",children:m.label}),m.description&&n.jsx("span",{className:"block text-xs text-muted-foreground/60 font-light truncate mt-0.5",children:m.description})]}),k&&n.jsx("kbd",{className:"hidden sm:flex shrink-0 text-[10px] text-muted-foreground/50 font-mono border border-border rounded px-1.5 py-0.5",children:"âµ"})]},m.id)})]},e)})}),n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-t border-border text-[10px] text-muted-foreground/40 font-light",children:[n.jsxs("span",{className:"hidden sm:flex items-center gap-1.5",children:[n.jsx(Ot,{className:"size-3"})," K to open · ESC to close"]}),n.jsx("span",{className:"sm:hidden",children:"Tap a result"}),n.jsxs("span",{className:"hidden sm:flex items-center gap-2",children:[n.jsx("span",{children:"ââ navigate"}),n.jsx("span",{children:"âµ select"})]})]})]})},"panel")]})})]})}export{eo as CommandPalette};
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.