(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{4061:(e,t,n)=>{"use strict";n.d(t,{ThemeProvider:()=>a});var o=n(95155),r=n(90872);function a(e){let{children:t}=e,[n,a]=(0,r.hJ)();return(0,o.jsx)(o.Fragment,{children:t})}},17731:(e,t,n)=>{Promise.resolve().then(n.bind(n,4061)),Promise.resolve().then(n.t.bind(n,30206,23)),Promise.resolve().then(n.t.bind(n,68424,23)),Promise.resolve().then(n.t.bind(n,41290,23)),Promise.resolve().then(n.t.bind(n,83428,23))},30206:e=>{e.exports={style:{fontFamily:"'Noto Sans', 'Noto Sans Fallback'",fontStyle:"normal"},className:"__className_a95ab5",variable:"__variable_a95ab5"}},41290:()=>{},68424:e=>{e.exports={style:{fontFamily:"'Noto Sans Arabic', 'Noto Sans Arabic Fallback'",fontStyle:"normal"},className:"__className_35258b",variable:"__variable_35258b"}},83428:()=>{},90872:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>u,KR:()=>c,Kv:()=>i,P1:()=>_,d7:()=>m,hJ:()=>l,ox:()=>s,r6:()=>d});var o=n(12115),r=n(85400);let a=()=>window.fetch("https://ipapi.co/json").then(e=>e.json()).catch(e=>console.log(e));function s(){console.log("%c %s","font-family:monospace",'\n __  __     __  __     ______       __        _____      __\n/\\ \\/ /    /\\ \\_\\ \\   /\\  __ \\     /\\ \\      /\\  __ \\   /\\ \\\n\\ \\  _"-.  \\ \\  __ \\  \\ \\ \\/\\ \\   _\\_\\ \\     \\ \\  __ \\  \\ \\ \\\n \\ \\_\\ \\_\\  \\ \\_\\ \\_\\  \\ \\_____\\ /\\_____\\     \\ \\_\\ \\_\\  \\ \\_\\\n  \\/_/\\/_/   \\/_/\\/_/   \\/_____/ \\/_____/      \\/_/\\/_/   \\/_/\n\n\nGreetings traveller,\n\nI am ✨Khoj✨, your open-source, personal AI copilot.\n\nSee my source code at https://github.com/khoj-ai/khoj\nRead my operating manual at https://docs.khoj.dev\n')}function i(){let{data:e,error:t,isLoading:n}=(0,r.Ay)("/api/ip",a,{revalidateOnFocus:!1});return{locationData:e,locationDataError:t,locationDataLoading:n}}function c(){let[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let e=()=>{window.innerWidth<=768?t(!0):t(!1)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let _=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{attributes:!0,characterData:!0,childList:!0,subtree:!0};o.useEffect(()=>{if(e.current){let o=new MutationObserver(t);return o.observe(e.current,n),()=>o.disconnect()}},[e,t,n])};function l(){let[e,t]=(0,o.useState)(!1),[n,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{"dark"===localStorage.getItem("theme")?(document.documentElement.classList.add("dark"),t(!0)):"light"===localStorage.getItem("theme")?(document.documentElement.classList.remove("dark"),t(!1)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(document.documentElement.classList.add("dark"),t(!0)),r(!0)},[]),(0,o.useEffect)(()=>{n&&(e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",e?"dark":"light"))},[e,n]),[e,t]}let u=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(2)," KB"):"".concat((e/1048576).toFixed(2)," MB");function m(e,t){let[n,r]=(0,o.useState)(e);return(0,o.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}let d=e=>{try{let t=new Date(e),n=new Date,o=Math.floor((n.getTime()-t.getTime())/6e4);if(o<1)return"just now";if(o<60)return"".concat(o," minutes ago");if(o<120)return"1 hour ago";if(o<1440)return"".concat(Math.floor(o/60)," hours ago");return new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(t)}catch(t){return console.error("Error formatting date:",t),e}}}},e=>{e.O(0,[3655,1741,3943,5400,8441,1255,7358],()=>e(e.s=17731)),_N_E=e.O()}]);