(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{57900:(e,t,r)=>{Promise.resolve().then(r.bind(r,45967)),Promise.resolve().then(r.bind(r,32264)),Promise.resolve().then(r.t.bind(r,54724,23)),Promise.resolve().then(r.t.bind(r,15532,23)),Promise.resolve().then(r.t.bind(r,51480,23)),Promise.resolve().then(r.bind(r,53828)),Promise.resolve().then(r.bind(r,14678)),Promise.resolve().then(r.t.bind(r,99582,23)),Promise.resolve().then(r.t.bind(r,35786,23))},53828:(e,t,r)=>{"use strict";r.d(t,{default:()=>y});var a=r(95155),o=r(12115),i=r(11536),n=r(25683),s=r(26899),l=r(63585),c=r(31586);let d=()=>{let{isDarkMode:e,toggleDarkMode:t}=(0,l.D)(),[r,d]=(0,o.useState)(!1),u=(0,o.useRef)(null),h=(0,o.useCallback)(e=>{u.current&&!u.current.contains(e.target)&&d(!1)},[]);(0,o.useEffect)(()=>{if(r)return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[r,h]);let p=(0,o.useCallback)(()=>{d(e=>!e)},[]);(0,o.useEffect)(()=>{if(r){let e=()=>{d(!1)};return window.addEventListener("scroll",e,{passive:!0}),()=>{window.removeEventListener("scroll",e)}}},[r]),(0,o.useEffect)(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[r]);let m=(0,o.useMemo)(()=>[{id:"dark-mode-toggle",icon:e?(0,a.jsx)(i.FaSun,{size:20}):(0,a.jsx)(i.FaMoon,{size:20}),label:"Toggle Dark Mode",onClick:t},{id:"projects",icon:(0,a.jsx)(i.FaProjectDiagram,{size:20}),label:"Projects",link:"/projects"},{id:"articles",icon:(0,a.jsx)(i.FaNewspaper,{size:20}),label:"Articles",link:"/blog"},{id:"portfolio",icon:(0,a.jsx)(i.FaBriefcase,{size:20}),label:"Portfolio",link:"/"}],[e,t]);return(0,a.jsxs)("div",{ref:u,className:"fixed bottom-4 right-4 z-50 flex flex-col items-end space-y-4",children:[(0,a.jsx)(n.N,{children:r&&m.map((e,t)=>(0,a.jsxs)(s.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,delay:.05*t},children:[e.onClick?(0,a.jsx)(s.P.button,{onClick:e.onClick,"data-tooltip-id":"".concat(e.id,"-tooltip"),"data-tooltip-content":e.label,whileHover:{scale:1.1},whileTap:{scale:.9},className:"flex pointer-events-auto items-center justify-center rounded-full bg-primary-700 text-primary-100 dark:text-primary-900 dark:bg-primary-100 p-3 shadow-md transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 hover:bg-primary-800 dark:hover:bg-primary-200","aria-label":e.label,children:e.icon}):(0,a.jsx)(s.P.a,{href:e.link,"data-tooltip-id":"".concat(e.id,"-tooltip"),"data-tooltip-content":e.label,whileHover:{scale:1.1},whileTap:{scale:.9},className:"flex items-center justify-center rounded-full bg-primary-700 text-primary-100 dark:text-primary-900 dark:bg-primary-100 p-3 shadow-md transition-colors duration-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 hover:bg-primary-800 dark:hover:bg-primary-200","aria-label":e.label,children:e.icon}),e&&(0,a.jsx)(c.Tooltip,{id:"".concat(e.id,"-tooltip"),place:"left"})]},e.id))}),(0,a.jsx)(s.P.button,{onClick:p,"data-tooltip-id":"main-fab-tooltip","data-tooltip-content":r?"Close Menu":"Open Menu",className:"z-50 pointer-events-auto inline-flex items-center justify-center rounded-full bg-primary-700 p-4 shadow-lg transition-colors duration-300 dark:bg-primary-100 text-white dark:text-primary-950 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 hover:bg-primary-800 dark:hover:bg-primary-200",whileHover:{scale:1.1},whileTap:{scale:.9},"aria-label":r?"Close Menu":"Open Menu",children:r?(0,a.jsx)(i.FaTimes,{size:24}):(0,a.jsx)(i.FaPlus,{size:24})}),(0,a.jsx)(c.Tooltip,{id:"main-fab-tooltip",place:"left"})]})};var u=r(48407);let h=e=>{let t;switch(e){case"hero":default:t=0;break;case"about":t=2;break;case"featured":t=5;break;case"skills":t=10;break;case"experience":t=20;break;case"projects":case"writing":t=30;break;case"education":t=60;break;case"contact":t=75;break;case"app-wide":t=150}return t},p=e=>{let{size:t,color:r,top:o,left:i,animate:n,pulse:s,float:l}=e;return(0,a.jsx)("div",{className:"absolute rounded-full ".concat(n?"animate-spin":""," ").concat(s?"animate-pulse":""," ").concat(l?"animate-float-slow":""),style:{width:"".concat(t/2,"px"),height:"".concat(t/2,"px"),backgroundColor:r,top:o,left:i,boxShadow:"0 1px 2px 1px white, 0 0 50px ".concat(r,", 0 0 100px ").concat(r)}})},m=e=>{let{id:t="app-wide"}=e,r=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=r.current;if(!e)return;let a=e.getContext("2d");if(!a)return;let o=()=>{e.width=window.innerWidth,e.height=window.innerHeight};o(),window.addEventListener("resize",o);let i=Array.from({length:"app-wide"===t?75:h(t)}).map(()=>({x:Math.random()*e.width,y:Math.random()*e.height,size:2*Math.random()+1,alpha:.8*Math.random()+.2})),n=()=>{a.clearRect(0,0,e.width,e.height),i.forEach(e=>{a.fillStyle="rgba(255, 255, 255, ".concat(e.alpha,")"),a.beginPath(),a.arc(e.x,e.y,e.size,0,Math.PI/2),a.fill()}),requestAnimationFrame(n)};return n(),()=>{window.removeEventListener("resize",o)}},[t]),(0,a.jsx)("canvas",{ref:r,className:"absolute top-0 w-full min-h-full -z-20 pointer-events-none"})},f=e=>{let{id:t="app-wide"}=e,r=(0,o.useMemo)(()=>Array.from({length:h(t)}).map((e,r)=>({key:"".concat(t,"-star-").concat(r),size:5*Math.random()+1,color:"var(--accent-".concat(["one","two","three","four","five"][Math.floor(5*Math.random())],")"),top:"".concat(100*Math.random(),"%"),left:"".concat(100*Math.random(),"%"),animate:.3>Math.random(),pulse:.5>Math.random(),float:.1>Math.random()})),[t]);return(0,a.jsx)("span",{className:"absolute top-0 w-full min-h-full -z-20 pointer-events-none",children:r.map(e=>(0,a.jsx)(p,{size:e.size,color:e.color,top:e.top,left:e.left,animate:e.animate,pulse:e.pulse,float:e.float},e.key))})},b=e=>{let{id:t="app-wide",children:r}=e,[i,n]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{n(!0)},[]),i)?(0,a.jsxs)("span",{className:"relative w-full min-h-full h-full -z-20",children:[r,(0,a.jsx)(m,{id:t}),(0,a.jsx)(f,{id:t})]}):null};var g=r(76046);let w=(0,o.createContext)(void 0),x=e=>{let{children:t}=e,[r,i]=(0,o.useState)(()=>window.localStorage.getItem("siteTheme")||"app-wide"),n=(0,g.usePathname)(),s=e=>{i(e),window.localStorage.setItem("siteTheme",e)};return(0,o.useEffect)(()=>{n.startsWith("/blog")&&"writing"!==r?s("writing"):n.startsWith("/projects")&&"projects"!==r?s("projects"):n.startsWith("/blog")||n.startsWith("/projects")||"app-wide"===r||s("app-wide")},[n,r]),(0,a.jsx)(w.Provider,{value:{siteTheme:r,setSiteTheme:i,updateTheme:s},children:(0,a.jsx)(l.L,{children:t})})},v=()=>{let e=(0,o.useContext)(w);if(!e)throw Error("useSiteTheme must be used within a ThemeProvider");return e};function y(e){let{children:t}=e;return(0,a.jsxs)(x,{children:[(0,a.jsx)(k,{children:(0,a.jsx)(u.z,{children:t})}),(0,a.jsx)(d,{})]})}function k(e){let{children:t}=e,{siteTheme:r}=v(),[i,n]=(0,o.useState)("");return(0,o.useEffect)(()=>{(async function(){"projects"===r?n("bg-projects-light dark:bg-projects-dark text-primary-950 dark:text-secondary-100"):"writing"===r?n("bg-writing-light dark:bg-writing-dark text-primary-950 dark:text-secondary-100"):n("bg-app-gradient-light dark:bg-app-gradient-dark text-primary-950 dark:text-secondary-100")})();let e=document.querySelector("body");e&&(e.dataset.id=r,e.className=i)},[r,i]),(0,o.useEffect)(()=>{let e=document.querySelector("body");e&&!e.className.includes(i)&&(e.className=i)},[i]),(0,a.jsx)(x,{children:(0,a.jsx)("div",{className:"relative min-h-screen w-full z-0 ".concat(i),children:(0,a.jsx)(b,{id:"app-wide",children:t})})})}},14678:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});var a=r(95155),o=r(12115);class i extends o.Component{static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Error caught by ErrorBoundary:",e,t)}render(){return this.state.hasError?(0,a.jsx)("h1",{children:"Something went wrong."}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}}let n=i},63585:(e,t,r)=>{"use strict";r.d(t,{D:()=>c,L:()=>l});var a=r(95155),o=r(12115);let i=e=>{document.documentElement.classList.toggle("dark",e)},n=()=>{{let e=localStorage.getItem("theme");return e?"dark"===e:window.matchMedia("(prefers-color-scheme: dark)").matches}},s=(0,o.createContext)(void 0),l=e=>{let{children:t}=e,[r,l]=(0,o.useState)(n);(0,o.useEffect)(()=>{localStorage.setItem("theme",r?"dark":"light"),i(r)},[r]);let c=(0,o.useCallback)(()=>{l(e=>{let t=!e;return i(t),t})},[]),d=(0,o.useMemo)(()=>({isDarkMode:r,toggleDarkMode:c}),[r,c]);return(0,a.jsx)(s.Provider,{value:d,children:t})},c=()=>{let e=(0,o.useContext)(s);if(!e)throw Error("useDarkMode must be used within a DarkModeProvider");return e}},35786:()=>{},99582:()=>{}},e=>{var t=t=>e(e.s=t);e.O(0,[9265,4523,6711,8736,6899,1586,5548,629,8407,8441,1517,7358],()=>t(57900)),_N_E=e.O()}]);