(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[345],{1095:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var r=s(5155);s(2115);var n=s(8100);let l=e=>{let{titleOnly:t=!1,currentPage:s=null}=e;return(0,r.jsx)("div",{className:"bg-mystic-400 shadow-lg",children:(0,r.jsx)(n.default,{titleOnly:t,currentPage:s})})}},2012:()=>{},2528:(e,t,s)=>{"use strict";s.d(t,{A:()=>c,AuthProvider:()=>a});var r=s(5155),n=s(2115),l=s(5695);let o=(0,n.createContext)(null),a=e=>{let{children:t}=e,[s,a]=(0,n.useState)(null),[c,i]=(0,n.useState)(null),[d,u]=(0,n.useState)(!0),x=(0,l.useRouter)();return(0,n.useEffect)(()=>{let e=localStorage.getItem("authToken");e&&(i(e),a({isAuthenticated:!0})),u(!1)},[]),(0,r.jsx)(o.Provider,{value:{user:s,token:c,login:e=>{localStorage.setItem("authToken",e),i(e),a({isAuthenticated:!0}),console.log("User logged in, token stored.")},logout:()=>{localStorage.removeItem("authToken"),i(null),a(null),console.log("User logged out, token removed."),x.push("/login")},isLoading:d},children:t})},c=()=>{let e=(0,n.useContext)(o);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},2613:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var r=s(5155);s(2115);var n=s(6874),l=s.n(n),o=s(1095);function a(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{}),(0,r.jsxs)("div",{className:"container mx-auto py-16 px-4 min-h-[60vh] flex flex-col items-center justify-center",children:[(0,r.jsx)("h1",{className:"text-6xl font-bold mb-4 text-river-400",children:"404"}),(0,r.jsx)("h2",{className:"text-3xl font-semibold mb-8 text-mystic-600",children:"Page Not Found"}),(0,r.jsxs)("div",{className:"prose max-w-none text-content text-center mb-12",children:[(0,r.jsx)("p",{className:"text-xl",children:"The page you're looking for doesn't exist or has been moved."}),(0,r.jsx)("p",{className:"text-lg text-mystic-500",children:"Let's get you back on track to your recovery journey."})]}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4",children:[(0,r.jsx)(l(),{href:"/",className:"bg-river-500 hover:bg-river-400 text-white font-bold py-3 px-6 rounded-sm shadow-md/30 hover:shadow-md/50 transition-colors",children:"Return Home"}),(0,r.jsx)(l(),{href:"/contact",className:"bg-mystic-200 hover:bg-mystic-300 text-mystic-700 font-bold py-3 px-6 rounded-sm shadow-md/30 hover:shadow-md/50 transition-colors",children:"Contact Support"})]})]})]})}s(2012)},3611:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var r=s(5155),n=s(2115),l=s(6874),o=s.n(l),a=s(2528);let c=e=>{let{currentPage:t=null}=e,{user:s,logout:l}=(0,a.A)(),[c,i]=(0,n.useState)("release"),[d,u]=(0,n.useState)(!1),x=(0,n.useRef)(null);return(0,n.useEffect)(()=>{i("pre-early-access")},[]),(0,n.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,r.jsx)("div",{className:"space-x-4 flex items-center",children:s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o(),{href:"/progress",className:"".concat("progress"===t?"text-sand-400 font-bold":"hover:text-indigo-200"),children:"Progress"}),(0,r.jsx)(o(),{href:"/stats",className:"".concat("stats"===t?"text-sand-400 font-bold":"hover:text-indigo-200"),children:"Stats"}),(0,r.jsx)(o(),{href:"/inventory",className:"".concat("inventory"===t?"text-sand-400 font-bold":"hover:text-indigo-200"),children:"Inventory"}),(0,r.jsxs)("div",{className:"relative inline-block margin-top-[-4px] relative top-[2px]",ref:x,children:[(0,r.jsx)("button",{onClick:()=>u(!d),className:"flex items-center justify-center w-8 h-8 rounded-full bg-sand-600 hover:bg-sand-500 transition-colors cursor-pointer",children:(0,r.jsx)("svg",{className:"w-5 h-5 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),d&&(0,r.jsxs)("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50",children:[(0,r.jsx)(o(),{href:"/account",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>u(!1),children:"Account"}),(0,r.jsx)(o(),{href:"/subscription",className:"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>u(!1),children:"Subscription"}),(0,r.jsx)("hr",{className:"my-1"}),(0,r.jsx)("button",{onClick:()=>{u(!1),l()},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Logout"})]})]})]}):(0,r.jsx)(r.Fragment,{children:"pre-early-access"!==c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o(),{href:"/signup",className:"hover:text-indigo-200",children:"Sign Up"}),(0,r.jsx)(o(),{href:"/login",className:"hover:text-indigo-200",children:"Login"})]})})})}},5061:(e,t,s)=>{Promise.resolve().then(s.bind(s,2613))},8100:(e,t,s)=>{"use strict";s.d(t,{default:()=>a});var r=s(5155),n=s(6874),l=s.n(n),o=s(3611);s(2115);let a=e=>{let{titleOnly:t=!1,currentPage:s=null}=e;return(0,r.jsx)("header",{className:"text-white p-4 w-full",children:(0,r.jsxs)("nav",{className:"container mx-auto flex justify-between items-center",children:[(0,r.jsxs)(l(),{href:"/",className:"text-xl font-bold text-sand-300",children:["Prudence",(0,r.jsx)("span",{className:"text-danger-500",children:"Thirty"})]}),!t&&(0,r.jsx)(o.default,{currentPage:s})]})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[773,244,441,684,358],()=>t(5061)),_N_E=e.O()}]);