1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19610,e=>{"use strict";var t=e.i(95688);let r=null,s=!1,i=0,n=0,a=null,o=!1,l=0;function c(e="home"){s||(r=Date.now(),s=!0,window.addEventListener("beforeunload",()=>{if(!r)return;let t=JSON.stringify({event_name:`${e}_page_leave`,event_data:{time_spent_seconds:Math.round((Date.now()-r)/1e3)},session_id:x()});navigator.sendBeacon?navigator.sendBeacon("/api/analytics",t):fetch("/api/analytics",{method:"POST",headers:{"Content-Type":"application/json"},body:t,keepalive:!0}).catch(()=>{}),r=null}))}function d(){if(o)return;o=!0;let e=e=>{if(!a||a.completedChunks>=a.chunkCount)return;let t=Date.now();if(t-l<1e3)return;l=t;let r=t-a.startTime,s=a.chunkCount>0?Math.round(a.completedChunks/a.chunkCount*100):0,i=JSON.stringify({event_name:"task_session_ended",event_data:{task_id:a.taskId,completed_chunks:a.completedChunks,chunk_count:a.chunkCount,completion_percentage:s,time_on_task_ms:r,trigger:e},session_id:x()}),n=JSON.stringify({session_id:x(),task_id:a.taskId,event_type:"session_ended",completed_chunks:a.completedChunks,chunk_count:a.chunkCount,total_active_time_ms:r});navigator.sendBeacon?(navigator.sendBeacon("/api/analytics",i),navigator.sendBeacon("/api/task-session",n)):(fetch("/api/analytics",{method:"POST",headers:{"Content-Type":"application/json"},body:i,keepalive:!0}).catch(()=>{}),fetch("/api/task-session",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{}))};window.addEventListener("beforeunload",()=>e("beforeunload")),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&e("visibilitychange")})}function f(e,t,r){if(!e){a=null;return}let s=!a||a.taskId!==e;a={taskId:e,chunkCount:t,completedChunks:r,startTime:s?Date.now():a.startTime}}function u(){a=null}function h(){return a?Date.now()-a.startTime:0}function x(){let e=localStorage.getItem("unstuck_session_id");if(e)try{let{sessionId:t,timestamp:r}=JSON.parse(e);if(Date.now()-r<864e5)return t}catch(e){}let t=`${Date.now()}-${Math.random().toString(36).substring(2,11)}`;return localStorage.setItem("unstuck_session_id",JSON.stringify({sessionId:t,timestamp:Date.now()})),t}async function p(){try{let e=x();if(!e)return;let t=await fetch("/api/link-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:e})});if(t.ok){let e=await t.json();console.log("Session linked:",e.linked)}}catch{}}async function m(e,t={},r=null){try{let s=x(),a=Date.now();if(e.endsWith("_page_view")){if(a-i<3e4)return;i=a}if("prompt_shown"===e){if(a-n<3e4)return;n=a}let o={event_name:e,event_data:t,session_id:s,user_id:r};console.log("[DEBUG analytics.js] trackEvent called:",e,"payload:",o),fetch("/api/analytics",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(t=>{if(console.log("[DEBUG analytics.js] Response status:",t.status,"for event:",e),!t.ok)return t.text().then(r=>{console.error("[DEBUG analytics.js] Analytics API error:",t.status,r,"for event:",e)})}).catch(t=>{console.error("[DEBUG analytics.js] Fetch error for event:",e,t)}),window.gtag?.("event",e,t)}catch{}}function y(){return`task_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function g(e,r,s=null,i=null,n=null,a=null,o=null,l=null,c=!1,d=null){try{let f,u=x();if(!u)return null;let h=s||y(),p=new Date,m=p.getHours(),g=p.getDay();return fetch("/api/task-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:u,task_id:h,task_input:e,chunks:r,device_type:(f=navigator.userAgent||"",/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(f)?"mobile":"desktop"),platform:(0,t.getAppContext)(),prompt_id:i,user_id:n,task_category:a,hour_of_day:m,day_of_week:g,timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return null}}(),timezone_offset:new Date().getTimezoneOffset(),breakdown_latency_ms:o,embedding:l,context_applied:c,context_source_task:d})}).catch(()=>{}),h}catch{return null}}function b(e,t,r,s=null,i=null,n=null){try{let a=x();if(!a)return;fetch("/api/task-session",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:a,task_id:s,event_type:e,completed_chunks:t,completed_chunk_indices:i,chunk_count:r,total_active_time_ms:n})}).catch(()=>{})}catch{}}function j(e,t,r){m("session_resumed",{resumed_session_id:e,completed_chunks:t,total_chunks:r,completion_percentage:r>0?Math.round(t/r*100):0})}e.s(["clearCurrentTaskState",()=>u,"createTaskSession",()=>g,"generateTaskId",()=>y,"getCurrentTaskTime",()=>h,"getSessionId",()=>x,"initTaskSessionTracking",()=>d,"initTimeTracking",()=>c,"linkSessionToUser",()=>p,"setCurrentTaskState",()=>f,"trackEvent",()=>m,"trackSessionResumed",()=>j,"updateTaskSession",()=>b])},79065,46773,e=>{"use strict";var t=e.i(71645);let r="unstuck_anonymous_id";function s(){let e=localStorage.getItem(r);return e||(e="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"undefined"!=typeof crypto&&crypto.getRandomValues?"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=15&crypto.getRandomValues(new Uint8Array(1))[0];return("x"===e?t:3&t|8).toString(16)}):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),localStorage.setItem(r,e)),e}function i(){let[e,r]=(0,t.useState)(null),[i,n]=(0,t.useState)(!0),[a,o]=(0,t.useState)(null),l=(0,t.useCallback)(async()=>{try{n(!0),o(null);let e=s(),t=new URLSearchParams;e&&t.set("anonymousId",e);let i=await fetch(`/api/usage/today?${t.toString()}`),a=await i.json();r(a)}catch(e){console.error("[useUsage] Error fetching usage:",e),o(e),r({count:0,lifetimeCount:0,dailyLimit:3,welcomeLimit:5,inWelcomePeriod:!0,isOverDailyLimit:!1,welcomeRemaining:5})}finally{n(!1)}},[]);return(0,t.useEffect)(()=>
1{l()},[l]),{usage:e,loading:i,error:a,refreshUsage:l,updateUsage:(0,t.useCallback)(e=>{e&&r(e)},[]),inWelcomePeriod:e?.inWelcomePeriod??!0,isOverDailyLimit:e?.isOverDailyLimit??!1,lifetimeCount:e?.lifetimeCount??0,welcomeLimit:e?.welcomeLimit??5,welcomeRemaining:e?.welcomeRemaining??5,isPremium:e?.isPremium??!1}}e.s(["getAnonymousId",()=>s],46773),e.s(["useUsage",()=>i],79065)},16015,(e,t,r)=>{},98547,(e,t,r)=>{var s=e.i(47167);e.r(16015);var i=e.r(71645),n=i&&"object"==typeof i&&"default"in i?i:{default:i},a=void 0!==s.default&&s.default.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,r=t.name,s=void 0===r?"stylesheet":r,i=t.optimizeForSpeed,n=void 0===i?a:i;c(o(s),"`name` must be a string"),this._name=s,this._deletedRulePlaceholder="#"+s+"-deleted-rule____{}",c("boolean"==typeof n,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=n,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var l="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=l?l.getAttribute("content"):null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(e,t){if(c(o(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var r=this.getSheet();"number"!=typeof t&&(t=r.cssRules.length);try{r.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var s=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,s))}return this._rulesCount++},r.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var r="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!r.cssRules[e])return e;r.deleteRule(e);try{r.insertRule(t,e)}catch(s){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,e)}}else{var s=this._tags[e];c(s,"old rule at index `"+e+"` not found"),s.textContent=t}return e},r.deleteRule=function(e){if("undefined"==typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},r.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,r){return r?t=t.concat(Array.prototype.map.call(e.getSheetForTag(r).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},r.makeStyleTag=function(e,t,r){t&&c(o(t),"makeStyleTag accepts only strings as second parameter");var s=document.createElement("style");this._nonce&&s.setAttribute("nonce",this._nonce),s.type="text/css",s.setAttribute("data-"+e,""),t&&s.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return r?i.insertBefore(s,r):i.appendChild(s),s},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0},f={};function u(e,t){if(!t)return"jsx-"+e;var r=String(t),s=e+r;return f[s]||(f[s]="jsx-"+d(e+"-"+r)),f[s]}function h(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var r=e+t;return f[r]||(f[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),f[r]}var x=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,s=void 0===r?null:r,i=t.optimizeForSpeed,n=void 0!==i&&i;this._sheet=s||new l({name:"styled-jsx",optimizeForSpeed:n}),this._sheet.inject(),s&&"boolean"==typeof n&&(this._sheet.setOptimizeForSpeed(n),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),s=r.styleId,i=r.rules;if(s in this._instancesCounts){this._instancesCounts[s]+=1;return}var n=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[s]=n,this._instancesCounts[s]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var s=this._fromServer&&this._fromServer[r];s?(s.parentNode.removeChild(s),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],s=e[1];return n.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:s}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,s=e.id;if(r){var i=u(s,r);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return h(i,e)}):[h(i,t)]}}return{styleId:u(s),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),p=i.createContext(null);function m(){return new x}function y(){return i.useContext(p)}p.displayName="StyleSheetContext";var g=n.default.useInsertionEffect||n.default.useLayoutEffect,b="undefined"!=typeof window?m():void 0;function j(e){var t=b||y();return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}j.dynamic=function(e){return e.map(function(e){return u(e[0],e[1])}).join(" ")},r.StyleRegistry=function(e){var t=e.registry,r=e.children,s=i.useContext(p),a=i.useState(function(){return s||t||m()})[0];return n.default.createElement(p.Provider,{value:a},r)},r.createStyleRegistry=m,r.style=j,r.useStyleRegistry=y},37902,(e,t,r)=>{t.exports=e.r(98547).style},15165,e=>{"use strict";var t=e.i(43476),r=e.i(37902);function s({size:e=64,className:s=""}){return(0,t.jsxs)("div",{className:`jsx-4ae44e947c686bd9 flex items-center justify-center ${s}`,children:[(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:e,height:e,className:"jsx-4ae44e947c686bd9 logo-loader",children:[(0,t.jsxs)("defs",{className:"jsx-4ae44e947c686bd9",children:[(0,t.jsxs)("linearGradient",{id:"brainGradLoader",x1:"0%",y1:"100%",x2:"100%",y2:"0%",className:"jsx-4ae44e947c686bd9",children:[(0,t.jsx)("stop",{offset:"0%",style:{stopColor:"#9333ea"},className:"jsx-4ae44e947c686bd9"}
1),(0,t.jsx)("stop",{offset:"50%",style:{stopColor:"#a855f7"},className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("stop",{offset:"100%",style:{stopColor:"#c084fc"},className:"jsx-4ae44e947c686bd9"})]}),(0,t.jsxs)("filter",{id:"sparkGlowLoader",className:"jsx-4ae44e947c686bd9",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"6",result:"blur",className:"jsx-4ae44e947c686bd9"}),(0,t.jsxs)("feMerge",{className:"jsx-4ae44e947c686bd9",children:[(0,t.jsx)("feMergeNode",{in:"blur",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic",className:"jsx-4ae44e947c686bd9"})]})]})]}),(0,t.jsx)("path",{d:"M240 80 C150 80 80 160 80 270 C80 380 150 440 240 440 L240 80Z",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("path",{d:"M272 80 C362 80 432 160 432 270 C432 380 362 440 272 440 L272 80Z",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("line",{x1:"256",y1:"80",x2:"256",y2:"440",stroke:"url(#brainGradLoader)",strokeWidth:"12",strokeLinecap:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("path",{d:"M185 175 Q150 200 185 225",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"10",strokeLinecap:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("path",{d:"M175 280 Q140 305 175 330",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"10",strokeLinecap:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("path",{d:"M327 175 Q362 200 327 225",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"10",strokeLinecap:"round",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("path",{d:"M337 280 Q372 305 337 330",fill:"none",stroke:"url(#brainGradLoader)",strokeWidth:"10",strokeLinecap:"round",className:"jsx-4ae44e947c686bd9"}
1),(0,t.jsx)("circle",{cx:"195",cy:"365",r:"8",fill:"url(#brainGradLoader)",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("circle",{cx:"317",cy:"365",r:"8",fill:"url(#brainGradLoader)",className:"jsx-4ae44e947c686bd9"}),(0,t.jsx)("circle",{cx:"256",cy:"260",r:"24",fill:"#c084fc",filter:"url(#sparkGlowLoader)",className:"jsx-4ae44e947c686bd9 spark-outer"}),(0,t.jsx)("circle",{cx:"256",cy:"260",r:"12",fill:"#ffffff",className:"jsx-4ae44e947c686bd9 spark-inner"})]}),(0,t.jsx)(r.default,{id:"4ae44e947c686bd9",children:".spark-outer.jsx-4ae44e947c686bd9{transform-origin:256px 260px;animation:2s ease-in-out infinite sparkPulse}.spark-inner.jsx-4ae44e947c686bd9{transform-origin:256px 260px;animation:2s ease-in-out infinite sparkPulseInner}@keyframes sparkPulse{0%,to{opacity:.6;transform:scale(1)}50%{opacity:1;transform:scale(1.2)}}@keyframes sparkPulseInner{0%,to{opacity:.8;transform:scale(1)}50%{opacity:1;transform:scale(1.1)}}"})]})}function i({size:e=64,className:r=""}){return(0,t.jsx)("div",{className:`flex items-center justify-center ${r}`,children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",width:e,height:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"brainGradStatic",x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[(0,t.jsx)("stop",{offset:"0%",style:{stopColor:"#9333ea"}}),(0,t.jsx)("stop",{offset:"50%",style:{stopColor:"#a855f7"}}),(0,t.jsx)("stop",{offset:"100%",style:{stopColor:"#c084fc"}})]}),(0,t.jsxs)("filter",{id:"sparkGlowStatic",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"6",result:"blur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"blur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsx)("path",{d:"M240 80 C150 80 80 160 80 270 C80 380 150 440 240 440 L240 80Z",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M272 80 C362 80 432 160 432 270 C432 380 362 440 272 440 L272 80Z",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("line",{x1:"256",y1:"80",x2:"256",y2:"440",stroke:"url(#brainGradStatic)",strokeWidth:"12",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M185 175 Q150 200 185 225",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"10",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M175 280 Q140 305 175 330",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"10",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M327 175 Q362 200 327 225",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"10",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M337 280 Q372 305 337 330",fill:"none",stroke:"url(#brainGradStatic)",strokeWidth:"10",strokeLinecap:"round"}
1),(0,t.jsx)("circle",{cx:"195",cy:"365",r:"8",fill:"url(#brainGradStatic)"}),(0,t.jsx)("circle",{cx:"317",cy:"365",r:"8",fill:"url(#brainGradStatic)"}),(0,t.jsx)("circle",{cx:"256",cy:"260",r:"24",fill:"#c084fc",filter:"url(#sparkGlowStatic)",opacity:"0.9"}),(0,t.jsx)("circle",{cx:"256",cy:"260",r:"12",fill:"#ffffff"})]})})}e.s(["Logo",()=>i,"default",()=>s])},59715,58285,e=>{"use strict";var t=e.i(43476),r=e.i(71645);function s({className:e="w-32 h-32",animate:r=!0}){return(0,t.jsxs)("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"starGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#c084fc"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]}),(0,t.jsxs)("filter",{id:"starGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"coloredBlur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsx)("g",{className:r?"badge-orbit-ring":"",children:(0,t.jsx)("circle",{cx:"50",cy:"50",r:"42",stroke:"#06b6d4",strokeWidth:"1.5",fill:"none",opacity:"0.4",strokeDasharray:"8 12"})}),(0,t.jsx)("path",{className:r?"badge-float":"",d:"M50 12 L53 38 L78 28 L60 48 L88 55 L62 58 L70 82 L50 64 L30 82 L38 58 L12 55 L40 48 L22 28 L47 38 Z",fill:"url(#starGradient)",filter:"url(#starGlow)"}),(0,t.jsx)("circle",{className:r?"badge-breathe":"",cx:"50",cy:"50",r:"10",fill:"#06b6d4",opacity:"0.6"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"5",fill:"#fff",opacity:"0.9"}),(0,t.jsx)("circle",{className:r?"badge-sparkle":"",cx:"88",cy:"30",r:"3",fill:"#06b6d4"}),(0,t.jsx)("circle",{className:r?"badge-sparkle-delayed":"",cx:"15",cy:"40",r:"2.5",fill:"#a85
15f7"}),(0,t.jsx)("circle",{className:r?"badge-sparkle":"",cx:"80",cy:"75",r:"2",fill:"#c084fc"}),(0,t.jsx)("circle",{className:r?"badge-sparkle-delayed-2":"",cx:"25",cy:"78",r:"2",fill:"#06b6d4"})]})}function i({className:e="w-32 h-32",animate:r=!0}){return(0,t.jsxs)("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"moonGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#e9d5ff"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#c084fc"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]}),(0,t.jsxs)("radialGradient",{id:"moonInnerGlow",cx:"30%",cy:"30%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#fff",stopOpacity:"0.3"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#fff",stopOpacity:"0"})]}),(0,t.jsxs)("filter",{id:"moonGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"2",result:"coloredBlur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"coloredBlur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsx)("g",{className:r?"badge-orbit-ring-slow":"",children:(0,t.jsx)("circle",{cx:"50",cy:"50",r:"44",stroke:"#a855f7",strokeWidth:"1",fill:"none",opacity:"0.3",strokeDasharray:"4 8"})}),(0,t.jsxs)("g",{className:r?"badge-orbit-ring-reverse":"",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"38",stroke:"#06b6d4",strokeWidth:"1.5",fill:"none",opacity:"0.4",strokeDasharray:"6 10"}),(0,t.jsx)("circle",{cx:"50",cy:"12",r:"2.5",fill:"#06b6d4"}),(0,t.jsx)("circle",{cx:"88",cy:"50",r:"2",fill:"#c084fc"})]}),(0,t.jsx)("path",{className:r?"badge-float":"",d:"M58 15 C75 20, 85 35, 85 50 C85 70, 70 85, 50 85 C35 85, 22 75, 18 60 C30 70, 45 65, 52 50 C58 38, 50 25, 40 22 C48 15, 52 14, 58 15 Z",fill:"url(#moonGradient)",filter:"url(#moonGlow)"}
1),(0,t.jsx)("circle",{cx:"55",cy:"45",r:"5",fill:"#a855f7",opacity:"0.3"}),(0,t.jsx)("circle",{cx:"45",cy:"60",r:"3",fill:"#a855f7",opacity:"0.25"}),(0,t.jsx)("circle",{cx:"62",cy:"65",r:"4",fill:"#a855f7",opacity:"0.2"}),(0,t.jsx)("ellipse",{cx:"60",cy:"35",rx:"8",ry:"12",fill:"url(#moonInnerGlow)"}),(0,t.jsx)("circle",{className:r?"badge-twinkle":"",cx:"25",cy:"25",r:"2",fill:"#fff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed":"",cx:"78",cy:"28",r:"1.5",fill:"#06b6d4"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed-2":"",cx:"20",cy:"70",r:"1.5",fill:"#c084fc"}),(0,t.jsx)("circle",{className:r?"badge-twinkle":"",cx:"82",cy:"72",r:"2",fill:"#fff"})]})}function n({className:e="w-32 h-32",animate:r=!0}){return(0,t.jsxs)("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("linearGradient",{id:"planetGradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#06b6d4"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#a855f7"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#7c3aed"})]}),(0,t.jsxs)("linearGradient",{id:"ringGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0"}),(0,t.jsx)("stop",{offset:"30%",stopColor:"#06b6d4",stopOpacity:"0.8"}),(0,t.jsx)("stop",{offset:"70%",stopColor:"#c084fc",stopOpacity:"0.8"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#c084fc",stopOpacity:"0"})]}),(0,t.jsxs)("filter",{id:"planetGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"2.5",result:"coloredBlur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"coloredBlur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsxs)("g",{className:r?"badge-orbit-ring":"",children:[(0,t.jsx)("circle",{cx:"50",cy:"50",r:"46",stroke:"#a855f7",strokeWidth:"1",fill:"none",opacity:"0.25",strokeDasharray:"3 9"}),(0,t.jsx)("circle",{cx:"96",cy:"50",r:"2",fill:"#06b6d4",className:r?"badge-sparkle":""}),(0,t.jsx)("circle",{cx:"4",cy:"50",r:"1.5",fill:"#c084fc",className:r?"badge-sparkle-delayed":""})]}),(0,t.jsx)("ellipse",{cx:"50",cy:"52",rx:"38",ry:"10",stroke:"url(#ringGradient)",strokeWidth:"3",fill:"none",opacity:"0.5",style:{clipPath:"inset(50% 0 0 0)"}}),(0,t.jsx)("circle",{className:r?"badge-breathe":"",cx:"50",cy:"50",r:"22",fill:"url(#planetGradient)",filter:"url(#planetGlow)"}),(0,t.jsx)("ellipse",{cx:"50",cy:"42",rx:"18",ry:"4",fill:"#06b6d4",opacity:"0.3"}),(0,t.jsx)("ellipse",{cx:"50",cy:"54",rx:"20",ry:"5",fill:"#c084fc",opacity:"0.25"}),(0,t.jsx)("ellipse",{cx:"50",cy:"62",rx:"14",ry:"3",fill:"#06b6d4",opacity:"0.2"}),(0,t.jsx)("ellipse",{cx:"42",cy:"40",rx:"8",ry:"10",fill:"#fff",opacity:"0.15"}),(0,t.jsx)("ellipse",{cx:"50",cy:"52",rx:"38",ry:"10",stroke:"url(#ringGradient)",strokeWidth:"3.5",fill:"none",style:{clipPath:"inset(0 0 50% 0)"}}),(0,t.jsxs)("g",{className:r?"badge-orbit-ring-reverse":"",children:[(0,t.jsx)("circle",{cx:"50",cy:"14",r:"4",fill:"#e9d5ff"}),(0,t.jsx)("circle",{cx:"50",cy:"14",r:"2",fill:"#fff",opacity:"0.5"})]}),(0,t.jsx)("circle",{className:r?"badge-twinkle":"",cx:"15",cy:"25",r:"1.5",fill:"#fff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed":"",cx:"88",cy:"30",r:"2",fill:"#06b6d4"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed-2":"",cx:"12",cy:"75",r:"1.5",fill:"#c084fc"})]})}function a({className:e="w-32 h-32",animate:r=!0}){return(0,t.jsxs)("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("radialGradient",{id:"sunGradient",cx:"50%",cy:"50%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#fef08a"}),(0,t.jsx)("stop",{offset:"40%",stopColor:"#fbbf24"}),(0,t.jsx)("stop",{offset:"70%",stopColor:"#f59e0b"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#a855f7"})]}),(0,t.jsxs)("radialGradient",{id:"sunCoreGlow",cx:"50%",cy:"50%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#fff"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#fef9c3"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#fbbf24"})]}),(0,t.jsxs)("filter",{id:"sunGlow",x:"-100%",y:"-100%",width:"300%",height:"300%",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"4",result:"coloredBlur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"coloredBlur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsx)("g",{className:r?"badge-orbit-ring-slow":"",children:(0,t.jsx)("circle",{cx:"50",cy:"50",r:"46",stroke:"#f59e0b",strokeWidth:"1",fill:"none",opacity:"0.3",strokeDasharray:"5 7"})}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse":"",children:[(0,t.jsx)("path",{d:"M50 8 L53 22 L47 22 Z",fill:"#fbbf24",opacity:"0.8"}
1),(0,t.jsx)("path",{d:"M50 92 L53 78 L47 78 Z",fill:"#a855f7",opacity:"0.7"})]}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse-delayed":"",children:[(0,t.jsx)("path",{d:"M8 50 L22 47 L22 53 Z",fill:"#f59e0b",opacity:"0.7"}),(0,t.jsx)("path",{d:"M92 50 L78 47 L78 53 Z",fill:"#c084fc",opacity:"0.7"})]}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse":"",children:[(0,t.jsx)("path",{d:"M20 20 L30 28 L26 32 Z",fill:"#fbbf24",opacity:"0.6"}),(0,t.jsx)("path",{d:"M80 80 L70 72 L74 68 Z",fill:"#a855f7",opacity:"0.6"})]}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse-delayed":"",children:[(0,t.jsx)("path",{d:"M80 20 L70 28 L74 32 Z",fill:"#f59e0b",opacity:"0.6"}),(0,t.jsx)("path",{d:"M20 80 L30 72 L26 68 Z",fill:"#c084fc",opacity:"0.6"})]}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse":"",children:[(0,t.jsx)("path",{d:"M28 12 L33 24 L29 26 Z",fill:"#fbbf24",opacity:"0.5"}),(0,t.jsx)("path",{d:"M72 88 L67 76 L71 74 Z",fill:"#a855f7",opacity:"0.5"})]}),(0,t.jsxs)("g",{className:r?"badge-ray-pulse-delayed":"",children:[(0,t.jsx)("path",{d:"M88 28 L76 33 L74 29 Z",fill:"#f59e0b",opacity:"0.5"}),(0,t.jsx)("path",{d:"M12 72 L24 67 L26 71 Z",fill:"#c084fc",opacity:"0.5"})]}),(0,t.jsx)("circle",{className:r?"badge-breathe":"",cx:"50",cy:"50",r:"20",fill:"url(#sunGradient)",filter:"url(#sunGlow)"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"12",fill:"url(#sunCoreGlow)",opacity:"0.9"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"6",fill:"#fff"}),(0,t.jsx)("ellipse",{cx:"40",cy:"42",rx:"5",ry:"3",fill:"#fff",opacity:"0.4",transform:"rotate(-20 40 42)"}),(0,t.jsxs)("g",{className:r?"badge-orbit-ring":"",children:[(0,t.jsx)("circle",{cx:"50",cy:"6",r:"2.5",fill:"#06b6d4"}),(0,t.jsx)("circle",{cx:"94",cy:"50",r:"2",fill:"#c084fc"}),(0,t.jsx)("circle",{cx:"50",cy:"94",r:"2",fill:"#06b6d4"}
1),(0,t.jsx)("circle",{cx:"6",cy:"50",r:"2.5",fill:"#a855f7"})]})]})}function o({className:e="w-32 h-32",animate:r=!0}){return(0,t.jsxs)("svg",{viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[(0,t.jsxs)("defs",{children:[(0,t.jsxs)("radialGradient",{id:"galaxyCore",cx:"50%",cy:"50%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#fff"}),(0,t.jsx)("stop",{offset:"20%",stopColor:"#e9d5ff"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#a855f7"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#a855f7",stopOpacity:"0"})]}),(0,t.jsxs)("linearGradient",{id:"armGradient1",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#c084fc",stopOpacity:"0.9"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#a855f7",stopOpacity:"0.6"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#06b6d4",stopOpacity:"0.3"})]}),(0,t.jsxs)("linearGradient",{id:"armGradient2",x1:"100%",y1:"0%",x2:"0%",y2:"100%",children:[(0,t.jsx)("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.9"}),(0,t.jsx)("stop",{offset:"50%",stopColor:"#a855f7",stopOpacity:"0.6"}),(0,t.jsx)("stop",{offset:"100%",stopColor:"#c084fc",stopOpacity:"0.3"})]}),(0,t.jsxs)("filter",{id:"galaxyGlow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[(0,t.jsx)("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),(0,t.jsxs)("feMerge",{children:[(0,t.jsx)("feMergeNode",{in:"coloredBlur"}),(0,t.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,t.jsx)("g",{className:r?"badge-orbit-ring-slow":"",children:(0,t.jsx)("circle",{cx:"50",cy:"50",r:"47",stroke:"#a855f7",strokeWidth:"0.5",fill:"none",opacity:"0.2",strokeDasharray:"2 6"})}),(0,t.jsxs)("g",{className:r?"badge-spiral-rotate":"",children:[(0,t.jsx)("path",{d:"M50 50 Q65 35, 75 25 Q85 18, 90 22 Q88 30, 78 38 Q65 50, 50 50",fill:"url(#armGradient1)",opacity:"0.7",filter:"url(#galaxyGlow)"}),(0,t.jsx)("path",{d:"M50 50 Q58 42, 68 35 Q75 30, 80 32 Q78 38, 70 44 Q60 52, 50 50",fill:"#c084fc",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"72",cy:"32",r:"1.5",fill:"#fff",className:r?"badge-twinkle":""}),(0,t.jsx)("circle",{cx:"82",cy:"26",r:"1",fill:"#e9d5ff",className:r?"badge-twinkle-delayed":""}),(0,t.jsx)("circle",{cx:"65",cy:"40",r:"1",fill:"#06b6d4",className:r?"badge-twinkle-delayed-2":""})]}),(0,t.jsxs)("g",{className:r?"badge-spiral-rotate":"",children:[(0,t.jsx)("path",{d:"M50 50 Q35 65, 25 75 Q18 85, 22 90 Q30 88, 38 78 Q50 65, 50 50",fill:"url(#armGradient2)",opacity:"0.7",filter:"url(#galaxyGlow)"}),(0,t.jsx)("path",{d:"M50 50 Q42 58, 35 68 Q30 75, 32 80 Q38 78, 44 70 Q52 60, 50 50",fill:"#06b6d4",opacity:"0.4"}),(0,t.jsx)("circle",{cx:"28",cy:"72",r:"1.5",fill:"#fff",className:r?"badge-twinkle-delayed":""}),(0,t.jsx)("circle",{cx:"22",cy:"82",r:"1",fill:"#e9d5ff",className:r?"badge-twinkle":""}),(0,t.jsx)("circle",{cx:"38",cy:"65",r:"1",fill:"#c084fc",className:r?"badge-twinkle-delayed-2":""})]}),(0,t.jsxs)("g",{className:r?"badge-spiral-rotate-reverse":"",children:[(0,t.jsx)("path",{d:"M50 50 Q40 35, 35 22 Q32 15, 38 14 Q44 18, 48 30 Q52 42, 50 50",fill:"#a85
15f7",opacity:"0.4"}),(0,t.jsx)("path",{d:"M50 50 Q60 65, 65 78 Q68 85, 62 86 Q56 82, 52 70 Q48 58, 50 50",fill:"#06b6d4",opacity:"0.4"})]}),(0,t.jsx)("circle",{className:r?"badge-breathe":"",cx:"50",cy:"50",r:"12",fill:"url(#galaxyCore)",filter:"url(#galaxyGlow)"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"6",fill:"#e9d5ff",opacity:"0.9"}),(0,t.jsx)("circle",{cx:"50",cy:"50",r:"3",fill:"#fff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle":"",cx:"15",cy:"20",r:"1",fill:"#fff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed":"",cx:"85",cy:"18",r:"1.5",fill:"#06b6d4"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed-2":"",cx:"12",cy:"78",r:"1",fill:"#c084fc"}),(0,t.jsx)("circle",{className:r?"badge-twinkle":"",cx:"88",cy:"82",r:"1.5",fill:"#fff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed":"",cx:"20",cy:"45",r:"0.8",fill:"#e9d5ff"}),(0,t.jsx)("circle",{className:r?"badge-twinkle-delayed-2":"",cx:"80",cy:"55",r:"0.8",fill:"#e9d5ff"})]})}async function l(e,t="en"){try{let r=`/imgs/badges/${e.id}/${e.id}-cycle-${e.cycle||1}-${"th"===t?"th":"en"}.mp4`,s=await fetch(r);if(!s.ok)return console.error("Failed to fetch badge video:",s.status),!1;let i=await s.blob();if(navigator.share&&navigator.canShare){let t={files:[new File([i],`${e.title}-badge.mp4`,{type:"video/mp4"})],title:`${e.title} Badge Earned!`,text:e.shareText};if(navigator.canShare(t))try{return await navigator.share(t),"shared"}catch(e){if("AbortError"===e.name)return!1;console.error("Share failed, falling back to download:",e)}}let n=URL.createObjectURL(i),a=document.createElement("a");return a.href=n,a.download=`unstuck-${e.title.toLowerCase()}-badge.mp4`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),"downloaded"}catch(e){return console.error("Failed to fetch/share badge video:",e),!1}}e.s(["GalaxyBadge",()=>o,"MoonBadge",()=>i,"PlanetBadge",()=>n,"StarBadge",()=>s,"SunBadge",()=>a],58285);var c=e.i(24991);function d({badge:e,onClose:d}){let{t:f,language:u}=(0,c.useTranslation)(),[h,x]=(0,r.useState)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null);if(!e)return null;(0,r.useEffect)(()=>{x(null);let e=()=>{"visible"===document.visibilityState&&x(e=>"generating"===e?null:e)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e),m.current&&clearTimeout(m.current)}},[]);let y=async()=>{x("generating");let t=await l(e,u);"shared"===t?(x("shared"),m.current=setTimeout(()=>x(null),2e3)):"downloaded"===t?(x("downloaded"),m.current=setTimeout(()=>x(null),2e3)):x(null)},g={star:s,moon:i,planet:n,sun:a,galaxy:o}[e.id];return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-fade-in",children:(0,t.jsxs)("div",{className:"relative w-full max-w-md bg-[#12121a] rounded-3xl p-8 shadow-2xl border border-[#1e1e2e] animate-celebration-pop",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-3xl opacity-10 pointer-events-none",style:{background:`radial-gradient(circle at 50% 40%, ${e.color} 0%, transparent 70%)`}}),(0,t.jsxs)("div",{className:"relative z-10 flex flex-col items-center text-center",children:[(0,t.jsxs)("div",{ref:p,style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",marginBottom:"32px",backgroundColor:"#12121a",borderRadius:"24px",padding:"32px",border:"1px solid #1e1e2e"},children:[(0,t.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"24px",opacity:.1,pointerEvents:"none",background:`radial-gradient(circle at 50% 40%, ${e.color} 0%, transparent 70%)`}}),(0,t.jsxs)("div",{style:{position:"relative",zIndex:10,display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,t.jsx)("div",{style:{marginBottom:"24px"},children:(0,t.jsx)("h2",{style:{fontSize:"24px",fontWeight:"bold",color:"#ffffff",margin:0},children:f("achievements.badgeEarned")})}),(0,t.jsx)("div",{style:{marginBottom:"8px",width:"160px",height:"160px",display:"flex",alignItems:"center",justifyContent:"center"},children:g&&(0,t.jsx)(g,{style:{width:"160px",height:"160px"},animate:!0})}),e.cycle>1&&(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",marginBottom:"16
1px"},children:Array.from({length:e.cycle}).map((e,r)=>(0,t.jsx)("span",{style:{fontSize:"0.625rem",color:"#a855f7"},children:"â"},r))}),(0,t.jsx)("h3",{style:{fontSize:"30px",fontWeight:"bold",color:"#ffffff",marginBottom:"8px",marginTop:0},children:f(`achievements.badges.${e.id}.title`)}),(0,t.jsx)("p",{style:{fontSize:"18px",color:"#d1d5db",fontStyle:"italic",marginBottom:"24px",marginTop:0},children:f(`achievements.badges.${e.id}.summary`)}),(0,t.jsxs)("div",{style:{borderTop:"1px solid rgba(30, 30, 46, 0.5)",paddingTop:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",lineHeight:0},children:[(0,t.jsx)("img",{src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' width='20' height='20'%3E%3Cdefs%3E%3ClinearGradient id='brainGrad' x1='0%25' y1='100%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' style='stop-color:%239333ea'/%3E%3Cstop offset='50%25' style='stop-color:%23a855f7'/%3E%3Cstop offset='100%25' style='stop-color:%23c084fc'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M240 80 C150 80 80 160 80 270 C80 380 150 440 240 440 L240 80Z' fill='none' stroke='url(%23brainGrad)' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M272 80 C362 80 432 160 432 270 C432 380 362 440 272 440 L272 80Z' fill='none' stroke='url(%23brainGrad)' stroke-width='16' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline x1='256' y1='80' x2='256' y2='440' stroke='url(%23brainGrad)' stroke-width='12' stroke-linecap='round'/%3E%3Cpath d='M185 175 Q150 200 185 225' fill='none' stroke='url(%23brainGrad)' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M175 280 Q140 305 175 330' fill='none' stroke='url(%23brainGrad)' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M327 175 Q362 200 327 225' fill='none' stroke='url(%23brainGrad)' stroke-width='10' stroke-linecap='round'/%3E%3Cpath d='M337 280 Q372 305 337 330' fill='none' stroke='url(%23brainGrad)' stroke-width='10' stroke-linecap='round'/%3E%3Ccircle cx='195' cy='365' r='8' fill='url(%23brainGrad)'/%3E%3Ccircle cx='317' cy='365' r='8' fill='url(%23brainGrad)'/%3E%3Ccircle cx='256' cy='260' r='24' fill='%23c084fc' opacity='0.9'/%3E%3Ccircle cx='256' cy='260' r='12' fill='%23ffffff'/%3E%3C/svg%3E",alt:"",width:"20",height:"20",style:{display:"block",flexShrink:0,width:"20px",height:"20px"}}),(0,t.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"rgba(209, 213, 219, 0.6)",lineHeight:"normal"},children:f("achievements.appName")})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 w-full",children:[(0,t.jsx)("button",{onClick:d,className:"w-full px-6 py-3 bg-[#a855f7] hover:bg-[#9333ea] text-white font-medium rounded-xl transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] shadow-md shadow-[#a855f7]/20 cursor-pointer",children:"Continue"}),(0,t.jsxs)("button",{onClick:y,disabled:"generating"===h,className:"w-full px-6 py-3 bg-[#a855f7]/20 hover:bg-[#a855f7]/30 text-[#a855f7] hover:text-white font-medium rounded-xl border border-[#a855f7]/30 transition-all duration-200 disabled:opacity-50 cursor-pointer",children:["generating"===h&&"â³ Generating...","shared"===h&&"â Shared!","downloaded"===h&&"â Downloaded!",!h&&"Share"]})]})]})]})})}e.s(["default",()=>d],59715)},95364,82695,78899,e=>{"use strict";var t=e.i(57787);function r(){return window.location.hostname.includes("staging")}let s=[{id:"30min",label:"30 min",ms:18e5},{id:"1hour",label:"1 hour",ms:36e5},{id:"2hours",label:"2 hours",ms:72e5},{id:"tomorrow",label:"Tomorrow",ms:null}],i={id:"5min",label:"5 min",ms:3e5},n=[{id:"5min",label:"5 min",ms:3e5},{id:"10min",label:"10 min",ms:6e5},{id:"15min",label:"15 min",ms:9e5}];function a(){return r()?n:(0,t.getLocalSettings)().timing5min?[i,...s]:s}function o(){return a()}function l(e){let t=new Date,s=a();if("tomorrow"===e&&!r()){let e=new Date(t);return e.setDate(e.getDate()+1),e.setHours(9,0,0,0),e}let i=s.find(t=>t.id===e),n=i?.ms||s[0].ms;return new Date(t.getTime()+n)}function c(e,t=null){let r=e-new Date,s=Math.round(r/6e4),i=Math.round(r/36e5);return s<=0?t?t("time.soon"):"soon":s<=60?t?t("time.minuteShort",{count:s}):`${s}m`:i<24?t?t("time.hourShort",{count:i}):`${i}h`:e.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function d(){let e=new Date;return{hour_of_day:e.getHours(),day_of_week:e.getDay(),is_staging:r()}}function f(e){if(!e)return!1;let t=new Date,s=r()?18e5:864e5;return t.getTime()-e.getTime()>=s}function u(e,t=null){if(!e)return null;let r=new Date().getTime()-e.getTime(),s=Math.round(r/6e4),i=Math.round(r/36e5),n=Math.round(r/864e5);return s<60?t?t(1===s?"time.minute":"time.minutes",{count:s}):`${s} minute${1!==s?"s":""}`:i<24?t?t(1===i?"time.hour":"time.hours",{count:i}):`${i} hour${1!==i?"s":""}`:t?t(1===n?"time.day":"time.days",{count:n}):`${n} day${1!==n?"s":""}`}e.s(["calculateReminderTime",()=>l,"formatNudgeTime",()=>c,"getRemindOptions",()=>o,"getTimeSinceActive",()=>u,"getTimingAnalyticsContext",()=>d,"shouldShowWelcomeBack",()=>f],95364);var h=e.i(43476),x=e.i(24991),p=e.i(72294);let m=[{id:"crushed_it",Icon:p.FlexIcon,labelKey:"reflection.crushedIt",celebration:"full",markComplete:!0},{id:"most",Icon:p.SmileIcon,labelKey:"reflection.didMost",celebration:"full",markComplete:!0},{id:"some",Icon:p.ThumbsUpIcon,labelKey:"reflection.didSome",celebration:"gentle",markComplete:!0}
1,{id:"not_yet",Icon:p.RefreshIcon,labelKey:"reflection.notYet",celebration:"none",markComplete:!1}];function y({onSelect:e,disabled:t=!1}){let{t:r}=(0,x.useTranslation)();return t?(0,h.jsx)("div",{className:"w-full max-w-md mx-auto animate-fade-in",children:(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"w-10 h-10 border-2 border-[#a855f7] border-t-transparent rounded-full animate-spin mx-auto mb-4"}),(0,h.jsx)("p",{className:"text-[#d1d5db]",children:r("common.loading")})]})}):(0,h.jsxs)("div",{className:"w-full max-w-md mx-auto animate-fade-in",children:[(0,h.jsx)("div",{className:"text-center mb-8",children:(0,h.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-[#f0f0f5] mb-2",children:r("reflection.title")})}),(0,h.jsx)("div",{className:"space-y-3",children:m.map(s=>(0,h.jsxs)("button",{type:"button",onClick:()=>e(s),disabled:t,className:`w-full p-4 rounded-xl transition-all duration-200 2 hover:scale-[1.02] active:scale-[0.98] cursor-pointer 3 disabled:opacity-50 disabled:cursor-not-allowed 4 flex items-center gap-3 text-lg font-medium 5 ${"crushed_it"===s.id?"bg-[#10b981] hover:bg-[#059669] text-white shadow-lg shadow-[#10b981]/20 hover:shadow-[#10b981]/40":"not_yet"===s.id?"bg-[#0a0a0f] hover:bg-[#12121a] text-[#d1d5db] hover:text-[#f0f0f5] border border-[#1e1e2e]/50 hover:border-[#1e1e2e]":"bg-[#12121a] hover:bg-[#1e1e2e] text-[#f0f0f5] border border-[#1e1e2e] hover:border-[#a855f7]/50"}`,children:[(0,h.jsx)(s.Icon,{className:"w-7 h-7"}),(0,h.jsx)("span",{children:r(s.labelKey)})]},s.id))}),(0,h.jsx)("p",{className:"mt-8 text-center text-[#d1d5db]/50 text-sm",children:r("reflection.subtitle")})]})}e.s(["default",()=>y],82695);var g=e.i(71645),b=e.i(18566),j={};!function e(t,r,s,i){var n,a,o,l,c,d,f,u,h,x,p,m=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),y="function"==typeof Path2D&&"function"==typeof DOMMatrix;function g(){}function b(e){var s=r.exports.Promise,i=void 0!==s?s:t.Promise;return"function"==typeof i?new i(e):(e(g,g),null)}var j=(n=function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),r=e.getContext("2d");r.fillRect(0,0,1,1);var s=e.transferToImageBitmap();r.createPattern(s,"no-repeat")}catch(e){return!1}return!0}(),a=new Map,{transform:function(e){if(n)return e;if(a.has(e))return a.get(e);var t=new OffscreenCanvas(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),a.set(e,t),t},clear:function(){a.clear()}}),v=(c=Math.floor(1e3/60),d={},f=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(o=function(e){var t=Math.random();return d[t]=requestAnimationFrame(function r(s){f===s||f+c-1<s?(f=s,delete d[t],e()):d[t]=requestAnimationFrame(r)}),t},l=function(e){d[e]&&cancelAnimationFrame(d[e])}):(o=function(e){return setTimeout(e,c)},l=function(e){return clearTimeout(e)}),{frame:o,cancel:l}),w=(x={},function(){if(u)return u;if(!s&&m){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {\n if (msg.data.options) {\n CONFETTI(msg.data.options).then(function () {\n if (msg.data.callback) {\n postMessage({ callback: msg.data.callback });\n }\n });\n } else if (msg.data.reset) {\n CONFETTI && CONFETTI.reset();\n } else if (msg.data.resize) {\n SIZE.width = msg.data.resize.width;\n SIZE.height = msg.data.resize.height;\n } else if (msg.data.canvas) {\n SIZE.width = msg.data.canvas.width;\n SIZE.height = msg.data.canvas.height;\n CONFETTI = module.exports.create(msg.data.canvas);\n }\n}"].join("\n");try{u=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn("ð Could not load worker",e),null}var r=u;function i(e,t){r.postMessage({options:e||{},callback:t})}r.init=function(e){var t=e.transferControlToOffscreen();r.postMessage({canvas:t},[t])},r.fire=function(e,t,s){if(h)return i(e,null),h;var n=Math.random().toString(36).slice(2);return h=b(function(t){function a(e){e.data.callback===n&&(delete x[n],r.removeEventListener("message",a),h=null,j.clear(),s(),t())}
5r.addEventListener("message",a),i(e,n),x[n]=a.bind(null,{data:{callback:n}})})},r.reset=function(){for(var e in r.postMessage({reset:!0}),x)x[e](),delete x[e]}}return u}),k={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function S(e,t,r){var s;return s=e&&null!=e[t]?e[t]:k[t],r?r(s):s}function _(e){return e<0?0:Math.floor(e)}function C(e){return parseInt(e,16)}function N(e){return e.map(M)}function M(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:C(t.substring(0,2)),g:C(t.substring(2,4)),b:C(t.substring(4,6))}}function L(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function T(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function G(e,r){var n,a=!e,o=!!S(r||{},"resize"),l=!1,c=S(r,"disableForReducedMotion",Boolean),d=m&&S(r||{},"useWorker")?w():null,f=a?L:T,u=!!e&&!!d&&!!e.__confetti_initialized,h="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function x(r){var x,p=c||S(r,"disableForReducedMotion",Boolean),m=S(r,"zIndex",Number);if(p&&h)return b(function(e){e()});a&&n?e=n.canvas:a&&!e&&((x=document.createElement("canvas")).style.position="fixed",x.style.top="0px",x.style.left="0px",x.style.pointerEvents="none",x.style.zIndex=m,e=x,document.body.appendChild(e)),o&&!u&&f(e);var g={width:e.width,height:e.height};function w(){if(d){var t={getBoundingClientRect:function(){if(!a)return e.getBoundingClientRect()}};f(t),d.postMessage({resize:{width:t.width,height:t.height}});return}g.width=g.height=null}function k(){n=null,o&&(l=!1,t.removeEventListener("resize",w)),a&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,u=!1)}return(d&&!u&&d.init(e),u=!0,d&&(e.__confetti_initialized=!0),o&&!l&&(l=!0,t.addEventListener("resize",w,!1)),d)?d.fire(r,g,k):function(t,r,a){for(var o,l,c,d,u,h,x,p=S(t,"particleCount",_),m=S(t,"angle",Number),g=S(t,"spread",Number),w=S(t,"startVelocity",Number),k=S(t,"decay",Number),C=S(t,"gravity",Number),M=S(t,"drift",Number),L=S(t,"colors",N),T=S(t,"ticks",Number),G=S(t,"shapes"),I=S(t,"scalar"),R=!!S(t,"flat"),E=((o=S(t,"origin",Object)).x=S(o,"x",Number),o.y=S(o,"y",Number),o),O=p,B=[],D=e.width*E.x,P=e.height*E.y;O--;)B.push(function(e){var t=e.angle*(Math.PI/180),r=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:10*Math.random(),wobbleSpeed:Math.min(.11,.1*Math.random()+.05),velocity:.5*e.startVelocity+Math.random()*e.startVelocity,angle2D:-t+(.5*r-Math.random()*r),tiltAngle:(.5*Math.random()+.25)
5*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*e.gravity,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}({x:D,y:P,angle:m,spread:g,startVelocity:w,color:L[O%L.length],shape:G[Math.floor(Math.random()*(G.length-0))+0],ticks:T,decay:k,gravity:C,drift:M,scalar:I,flat:R}));return n?n.addFettis(B):(l=e,u=B.slice(),h=l.getContext("2d"),x=b(function(e){function t(){c=d=null,h.clearRect(0,0,r.width,r.height),j.clear(),a(),e()}c=v.frame(function e(){s&&(r.width!==i.width||r.height!==i.height)&&(r.width=l.width=i.width,r.height=l.height=i.height),r.width||r.height||(f(l),r.width=l.width,r.height=l.height),h.clearRect(0,0,r.width,r.height),(u=u.filter(function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var r,s,i,n,a,o,l,c,d,f,u,h,x,p,m,g,b=t.tick++/t.totalTicks,v=t.x+t.random*t.tiltCos,w=t.y+t.random*t.tiltSin,k=t.wobbleX+t.random*t.tiltCos,S=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-b)+")",e.beginPath(),y&&"path"===t.shape.type&&"string"==typeof t.shape.path&&Array.isArray(t.shape.matrix)){e.fill((r=t.shape.path,s=t.shape.matrix,i=t.x,n=t.y,a=.1*Math.abs(k-v),o=.1*Math.abs(S-w),l=Math.PI/10*t.wobble,c=new Path2D(r),(d=new Path2D).addPath(c,new DOMMatrix(s)),(f=new Path2D).addPath(d,new DOMMatrix([Math.cos(l)*a,Math.sin(l)*a,-Math.sin(l)*o,Math.cos(l)*o,i,n])),f))}else if("bitmap"===t.shape.type){var _=Math.PI/10*t.wobble,C=.1*Math.abs(k-v),N=.1*Math.abs(S-w),M=t.shape.bitmap.width*t.scalar,L=t.shape.bitmap.height*t.scalar,T=new DOMMatrix([Math.cos(_)*C,Math.sin(_)*C,-Math.sin(_)*N,Math.cos(_)*N,t.x,t.y]);T.multiplySelf(new DOMMatrix(t.shape.matrix));var G=e.createPattern(j.transform(t.shape.bitmap),"no-repeat");G.setTransform(T),e.globalAlpha=1-b,e.fillStyle=G,e.fillRect(t.x-M/2,t.y-L/2,M,L),e.globalAlpha=1}else if("circle"===t.shape)e.ellipse?e.ellipse(t.x,t.y,Math.abs(k-v)*t.ovalScalar,Math.abs(S-w)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):(u=t.x,h=t.y,x=Math.abs(k-v)*t.ovalScalar,p=Math.abs(S-w)*t.ovalScalar,m=Math.PI/10*t.wobble,g=2*Math.PI,e.save(),e.translate(u,h),e.rotate(m),e.scale(x,p),e.arc(0,0,1,0,g,void 0),e.restore());else if("star"===t.shape)for(var I=Math.PI/2*3,R=4*t.scalar,E=8*t.scalar,O=t.x,B=t.y,D=5,P=Math.PI/5;D--;)O=t.x+Math.cos(I)*E,B=t.y+Math.sin(I)*E,e.lineTo(O,B),I+=P,O=t.x+Math.cos(I)*R,B=t.y+Math.sin(I)*R,e.lineTo(O,B),I+=P;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(w)),e.lineTo(Math.floor(k),Math.floor(S)),e.lineTo(Math.floor(v),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}(h,e)})).length?c=v.frame(e):t()}),d=t}),(n={addFettis:function(e){return u=u.concat(e),x},canvas:l,promise:x,reset:function(){c&&v.cancel(c),d&&d()}}).promise)}(r,g,k)}return x.reset=function(){d&&d.reset(),n&&n.reset()},x}function I(){return p||(p=G(null,{useWorker:!0,resize:!0})),p}r.exports=function(){return I().apply(this,arguments)},r.exports.reset=function(){I().reset()},r.exports.create=G,r.exports.shapeFromPath=function(e){if(!y)throw Error("path confetti are not supported in this browser");"string"==typeof e?s=e:(s=e.path,i=e.matrix);var t=new Path2D(s),r=document.createElement("canvas").getContext("2d");if(!i){for(var s,i,n,a,o=1e3,l=1e3,c=0,d=0,f=0;f<1e3;f+=2)for(var u=0;u<1e3;u+=2)r.isPointInPath(t,f,u,"nonzero")&&(o=Math.min(o,f),l=Math.min(l,u),c=Math.max(c,f),d=Math.max(d,u));n=c-o;var h=Math.min(10/n,10/(a=d-l));i=[h,0,0,h,-Math.round(n/2+o)*h,-Math.round(a/2+l)*h]}return{type:"path",path:s,matrix:i}},r.exports.shapeFromText=function(e){var t,r=1,s="#000000",i='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';"string"==typeof e?t=e:(t=e.text,r="scalar"in e?e.scalar:r,i="fontFamily"in e?e.fontFamily:i,s="color"in e?e.color:s);var n=10*r,a=""+n+"px "+i,o=new OffscreenCanvas(n,n),l=o.getContext("2d");l.font=a;var c=l.measureText(t),d=Math.ceil(c.actualBoundingBoxRight+c.actualBoundingBoxLeft),f=Math.ceil(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent),u=c.actualBoundingBoxLeft+2,h=c.actualBoundingBoxAscent+2;d+=4,f+=4,(l=(o=new OffscreenCanvas(d,f)).getContext("2d")).font=a,l.fillStyle=s,l.fillText(t,u,h);var x=1/r;return{type:"bitmap",bitmap:o.transferToImageBitmap(),matrix:[x,0,0,x,-d*x/2,-f*x/2]}}}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),j,!1);let v=j.exports;function w({type:e}){(0,b.useRouter)();let{t}=(0,x.useTranslation)();return((0,g.useEffect)(()=>{let t,r;"crushed"===e&&(t=Date.now()+3e3,(r=()=>{v({particleCount:3,angle:60,spread:55,origin:{x:0,y:.7},colors:["#a855f7","#10b981","#22d3ee","#fbbf24"]}),v({particleCount:3,angle:120,spread:55,origin:{x:1,y:.7},colors:["#a855f7","#10b981","#22d3ee","#fbbf24"]}),Date.now()<t&&requestAnimationFrame(r)})(),setTimeout(()=>{v({particleCount:100,spread:70,origin:{x:.5,y:.5},colors:["#a855f7","#10b981","#22d3ee","#fbbf24"]})},500))},[e]),"gentle"===e)?(0,h.jsx)("main",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center px-4",children:(0,h.jsxs)("div",{className:"text-center animate-fade-in",children:[(0,h.jsx)("div",{className:"mb-6 flex justify-center",children:(0,h.jsx)(p.HeartIcon,{className:"w-16 h-16"})}),(0,h.jsx)("h1",{className:"text-2xl sm:text-3xl font-medium text-[#f0f0f5] mb-3",children:t("celebration.gentleTitle")}),(0,h.jsx)("p",{className:"text-[#d1d5db] text-lg mb-8",children:t("celebration.someDone")}),(0,h.jsx)("p",{className:"text-[#d1d5db]/50 text-sm",children:t("common.loading")})]})}):(0,h.jsx)("main",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center px-4",children:(0,h.jsxs)("div",{className:"text-center animate-fade-in",children:[(0,h.jsx)("div",{className:"mb-6 flex justify-center",children:(0,h.jsx)(p.PartyIcon,{className:"w-20 h-20"})}),(0,h.jsx)("h1",{className:"text-3xl sm:text-4xl font-bold text-[#10b981] mb-3",children:t("celebration.crushedItTitle")}),(0,h.jsx)("p",{className:"text-[#d1d5db] text-lg mb-8",children:t("celebration.taskDone")}),(0,h.jsx)("div",{className:"h-1 w-24 mx-auto rounded-full bg-gradient-to-r from-[#a85
55f7] to-[#10b981] animate-shimmer"}),(0,h.jsx)("p",{className:"mt-8 text-[#d1d5db]/50 text-sm",children:t("common.loading")})]})})}j.exports.create,e.s(["default",()=>w],78899)},17802,2673,e=>{"use strict";function t(e,t){if(!t?.enabled||!t.start||!t.end)return!1;let r=60*e.getHours()+e.getMinutes(),[s,i]=t.start.split(":").map(Number),[n,a]=t.end.split(":").map(Number),o=60*s+i,l=60*n+a;return o>l?r>=o||r<l:r>=o&&r<l}function r(e){if(!e?.start||!e?.end)return"";let t=e=>{let[t,r]=e.split(":").map(Number),s=t>=12?"pm":"am",i=t%12||12;return 0===r?`${i}${s}`:`${i}:${r.toString().padStart(2,"0")}${s}`};return`${t(e.start)} - ${t(e.end)}`}e.s(["formatQuietHours",()=>r,"isInQuietHours",()=>t],17802);var s=e.i(43476),i=e.i(71645),n=e.i(24991),a=e.i(26732),o=e.i(19610);function l({isOpen:e,onClose:t,onSubmit:r,task:l,existingContexts:c=[],loadingContexts:d=!1,currentTaskCategory:f=null}){let{t:u}=(0,n.useTranslation)(),{data:h}=(0,a.useSession)(),[x,p]=(0,i.useState)(""),[m,y]=(0,i.useState)(!1),[g,b]=(0,i.useState)([]),[j,v]=(0,i.useState)(null),[w,k]=(0,i.useState)({}),[S,_]=(0,i.useState)(!1),[C,N]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{!e||d||c.length>0||(async()=>{_(!0);try{let e=(0,o.getSessionId)(),t=new URLSearchParams;!h?.user&&e&&t.append("session_id",e);let r=await fetch(`/api/context/categories?${t}`),s=await r.json();b(s.categories?.map(e=>e.category)||[])}catch(e){console.error("[ContextModal] Failed to fetch categories:",e),b([])}finally{_(!1)}})()},[e,d,c,h]),(0,i.useEffect)(()=>{!j||w[j]||(async()=>{try{let e=(0,o.getSessionId)(),t=new URLSearchParams({category:j});!h?.user&&e&&t.append("session_id",e);let r=await fetch(`/api/context/by-category?${t}`),s=await r.json();k(e=>({...e,[j]:s.contexts||[]}))}catch(e){console.error("[ContextModal] Failed to fetch category contexts:",e),k(e=>({...e,[j]:[]}))}})()},[j,h,w]),!e)return null;let M=c.length>0?c[0].context_text.split("\n\n---\n\n"):[],L=(()=>{if(C)return g;if(f&&g.includes(f)){let e=g.filter(e=>e!==f);return[f,...e].slice(0,2)}return g.slice(0,2)})(),T=async e=>{if(e.preventDefault(),x.trim()&&!m){y(!0);try{await r(x.trim()),p("")}finally{y(!1)}}},G=()=>{m||(p(""),v(null),k({}),N(!1),t())};return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm animate-fade-in",onClick:G,children:(0,s.jsxs)("div",{className:"w-full max-w-lg bg-[#12121a] border border-[#1e1e2e] rounded-2xl p-6 shadow-2xl animate-scale-in",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("h2",{className:"text-xl font-bold text-[#f0f0f5] mb-2",children:u("home.contextModalTitle")}),(0,s.jsxs)("p",{className:"text-sm text-[#d1d5db]/70",children:[u("home.contextModalSubtitle"),' "',(0,s.jsx)("span",{className:"text-[#a855f7]",children:l.length>40?l.substring(0,40)+"...":l}),'"']})]}),!d&&0===M.length&&!S&&g.length>0&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-[#d1d5db]/70 mb-2",children:u("home.contextOrPick")}),(0,s.jsxs)("div",{className:"space-y-2",children:[L.map(e=>{let t=j===e,r=w[e]||[];return(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>v(t?null:e),className:"w-full px-3 py-2 bg-[#1e1e2e] hover:bg-[#2a2a3a] text-[#d1d5db] hover:text-[#a855f7] text-sm rounded-lg transition-all duration-200 cursor-pointer border border-[#1e1e2e] hover:border-[#a855f7]/30 flex items-center justify-between",children:[(0,s.jsx)("span",{className:"capitalize",children:e}),(0,s.jsx)("span",{className:"text-xs",children:t?"â¼":"â¶"})]}),t&&r.length>0&&(0,s.jsx)("div",{className:"mt-2 ml-3 space-y-1 animate-fade-in",children:r.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{p(e.text),v(null)},className:"w-full text-left px-3 py-2 bg-[#0a0a0f] hover:bg-[#12121a] border border-[#1e1e2e] hover:border-[#a855f7]/30 rounded-lg transition-all duration-200 cursor-pointer group",children:[(0,s.jsxs)("div",{className:"text-xs text-[#d1d5db]/50 mb-1",children:[u("home.contextFrom")," ",e.source_task.length>30?e.source_task.substring(0,30)+"...":e.source_task]}),(0,s.jsx)("div",{className:"text-sm text-[#f0f0f5] group-hover:text-[#a855f7]",children:e.text.length>80?e.text.substring(0,80)+"...":e.text})]},e.id))})]},e)}),!C&&g.length>2&&(0,s.jsx)("button",{type:"button",onClick:()=>N(!0),className:"w-full px-3 py-2 text-[#d1d5db]/70 hover:text-[#a855f7] text-xs transition-colors cursor-pointer text-center",children:u("home.contextBrowseAll",{count:g.length})})]})]}),!d&&0===M.length&&S&&(0,s.jsx)("div",{className:"mb-4 p-4 bg-[#0a0a0f] border border-[#1e1e2e] rounded-xl",children:(0,s.jsx)("div",{className:"text-sm text-[#d1d5db]/50 animate-pulse",children:u("home.contextLoading")})}),(0,s.jsxs)("form",{onSubmit:T,children:[(0,s.jsx)("textarea",{value:x,onChange:e=>p(e.target.value),placeholder:u("home.contextModalPlaceholder"),className:"w-full p-4 bg-[#0a0a0f] border border-[#1e1e2e] rounded-xl text-[#f0f0f5] placeholder-[#d1d5db]/40 focu
5s:outline-none focus:ring-2 focus:ring-[#a855f7]/50 focus:border-[#a855f7]/50 transition-all duration-200 resize-none",rows:4,maxLength:500,disabled:m,autoFocus:!0}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,s.jsxs)("span",{className:"text-xs text-[#d1d5db]/50",children:[x.length,"/500"]}),(0,s.jsx)("span",{className:"text-xs text-[#d1d5db]/70",children:u("home.contextModalSaved")})]}),(0,s.jsxs)("div",{className:"flex gap-3 mt-6",children:[(0,s.jsx)("button",{type:"button",onClick:G,disabled:m,className:"flex-1 px-4 py-3 bg-[#1e1e2e] hover:bg-[#2a2a3a] text-[#d1d5db] rounded-xl transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:u("common.cancel")}),(0,s.jsx)("button",{type:"submit",disabled:!x.trim()||m,className:"flex-1 px-4 py-3 bg-[#a855f7] hover:bg-[#9333ea] text-white font-medium rounded-xl transition-all duration-200 shadow-lg shadow-[#a855f7]/20 hover:shadow-[#a855f7]/40 hover:scale-[1.02] active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100",children:m?u("home.contextModalRegenerating"):u("home.contextModalRegenerate")})]})]})]})})}e.s(["default",()=>l],2673)},99820,e=>{e.v(e=>Promise.resolve().then(()=>e(72195)))}]);
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.