(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8450],{3809:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(902),o=r(95155);function a(e){let{locale:t,...r}=e;if(!t)throw Error(void 0);return(0,o.jsx)(n.Dk,{locale:t,...r})}},5379:(e,t,r)=>{"use strict";r.d(t,{D:()=>c,N:()=>u});var n=r(12115),o=(e,t,r,n,o,a,s,l)=>{let i=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&a?o.map(e=>a[e]||e):o;r?(i.classList.remove(...n),i.classList.add(a&&a[t]?a[t]:t)):i.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(i.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=s&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},a=["light","dark"],s="(prefers-color-scheme: dark)",l=n.createContext(void 0),i={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=n.useContext(l))?e:i},u=e=>n.useContext(l)?n.createElement(n.Fragment,null,e.children):n.createElement(d,{...e}),m=["light","dark"],d=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:i=!0,storageKey:c="theme",themes:u=m,defaultTheme:d=o?"system":"light",attribute:g="data-theme",value:S,children:b,nonce:p,scriptProps:k}=e,[w,T]=n.useState(()=>f(c,d)),[E,C]=n.useState(()=>"system"===w?y():w),P=S?Object.values(S):u,I=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=y());let n=S?S[t]:t,s=r?v(p):null,l=document.documentElement,c=e=>{"class"===e?(l.classList.remove(...P),n&&l.classList.add(n)):e.startsWith("data-")&&(n?l.setAttribute(e,n):l.removeAttribute(e))};if(Array.isArray(g)?g.forEach(c):c(g),i){let e=a.includes(d)?d:null,r=a.includes(t)?t:e;l.style.colorScheme=r}null==s||s()},[p]),A=n.useCallback(e=>{let t="function"==typeof e?e(w):e;T(t);try{localStorage.setItem(c,t)}catch(e){}},[w]),N=n.useCallback(e=>{C(y(e)),"system"===w&&o&&!t&&I("system")},[w,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),n.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?T(e.newValue):A(d))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[A]),n.useEffect(()=>{I(null!=t?t:w)},[t,w]);let O=n.useMemo(()=>({theme:w,setTheme:A,forcedTheme:t,resolvedTheme:"system"===w?E:w,themes:o?[...u,"system"]:u,systemTheme:o?E:void 0}),[w,A,t,E,o,u]);return n.createElement(l.Provider,{value:O},n.createElement(h,{forcedTheme:t,storageKey:c,attribute:g,enableSystem:o,enableColorScheme:i,defaultTheme:d,value:S,themes:u,nonce:p,scriptProps:k}),b)},h=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:a,enableSystem:s,enableColorScheme:l,defaultTheme:i,value:c,themes:u,nonce:m,scriptProps:d}=e,h=JSON.stringify([a,r,i,t,u,c,s,l]).slice(1,-1);return n.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(o.toString(),")(").concat(h,")")}})}),f=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},v=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},y=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},6707:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,AuthProvider:()=>s});var n=r(95155),o=r(12115);let a=(0,o.createContext)(void 0);function s(e){let{children:t}=e,[r,s]=(0,o.useState)(null),[l,i]=(0,o.useState)(null),[c,u]=(0,o.useState)(!0);(0,o.useEffect)(()=>{window.KOMERO=!0;let e=localStorage.getItem("authToken"),t=localStorage.getItem("user");if(e&&t)try{s(JSON.parse(t)),i(e)}catch(e){localStorage.removeItem("authToken"),localStorage.removeItem("user")}u(!1)},[]);let m=async(e,t)=>{try{let r=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(!r.ok)return null;let n=await r.json(),o=n.token;return localStorage.setItem("authToken",o),localStorage.setItem("user",JSON.stringify(n.user)),s(n.user),i(o),{user:n.user,token:o}}catch(e){return null}};return(0,n.jsx)(a.Provider,{value:{user:r,token:l,login:m,logout:()=>{s(null),i(null),localStorage.removeItem("user"),localStorage.removeItem("authToken")},isLoading:c,getToken:()=>l||localStorage.getItem("authToken")},children:t})}function l(){let e=(0,o.useContext)(a);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}},35293:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>a});var n=r(95155);r(12115);var o=r(5379);function a(e){let{children:t,...r}=e;return(0,n.jsx)(o.N,{...r,children:t})}},46310:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,79225,23)),Promise.resolve().then(r.bind(r,35293)),Promise.resolve().then(r.bind(r,6707)),Promise.resolve().then(r.bind(r,64707)),Promise.resolve().then(r.bind(r,3809)),Promise.resolve().then(r.t.bind(r,60391,23)),Promise.resolve().then(r.bind(r,18720))},60391:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback', system-ui, arial",fontStyle:"normal"},className:"__className_f367f3"}},79225:()=>{}},e=>{e.O(0,[6025,6230,8311,4707,8720,8441,1255,7358],()=>e(e.s=46310)),_N_E=e.O()}]);