super-time-tracker-ui 0.1.33 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/standalone/next-output/BUILD_ID +1 -1
  2. package/dist/standalone/next-output/build-manifest.json +3 -3
  3. package/dist/standalone/next-output/server/app/_global-error.html +1 -1
  4. package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
  5. package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
  11. package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
  13. package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
  14. package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
  15. package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
  16. package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
  17. package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
  18. package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
  19. package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
  20. package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
  21. package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
  22. package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
  23. package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
  24. package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
  25. package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
  26. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
  27. package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
  28. package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
  29. package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
  30. package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
  31. package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
  32. package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
  33. package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
  34. package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
  35. package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
  36. package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
  37. package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
  38. package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
  39. package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
  40. package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
  41. package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
  42. package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
  43. package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
  44. package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
  45. package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
  46. package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
  47. package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
  48. package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
  49. package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
  50. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0fzz02j._.js +3 -0
  51. package/dist/standalone/next-output/server/chunks/ssr/_0fzq9xc._.js +3 -0
  52. package/dist/standalone/next-output/server/chunks/ssr/_0hy_8.b._.js +3 -0
  53. package/dist/standalone/next-output/server/chunks/ssr/_0ntfdc9._.js +3 -0
  54. package/dist/standalone/next-output/server/chunks/ssr/_0p5_u-y._.js +1 -1
  55. package/dist/standalone/next-output/server/chunks/ssr/_0q214m8._.js +3 -0
  56. package/dist/standalone/next-output/server/chunks/ssr/{_0-a9ia4._.js → _0syjj1b._.js} +2 -2
  57. package/dist/standalone/next-output/server/chunks/ssr/{_10c-dv7._.js → _0zfyg1r._.js} +2 -2
  58. package/dist/standalone/next-output/server/chunks/ssr/_11je2nt._.js +1 -1
  59. package/dist/standalone/next-output/server/chunks/ssr/components_0isp.qn._.js +1 -1
  60. package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +1 -1
  61. package/dist/standalone/next-output/server/middleware-build-manifest.js +3 -3
  62. package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
  63. package/dist/standalone/next-output/server/pages/500.html +1 -1
  64. package/dist/standalone/next-output/static/chunks/03dh~3.gq~kw7.js +1 -0
  65. package/dist/standalone/next-output/static/chunks/{049ufrw2rog87.js → 0aru5x_.qsjc3.js} +1 -1
  66. package/dist/standalone/next-output/static/chunks/0c0i5ey6h8qet.js +1 -0
  67. package/dist/standalone/next-output/static/chunks/{0ufz8oxu3.gqp.js → 0c2088mpz.z.3.js} +1 -1
  68. package/dist/standalone/next-output/static/chunks/0jn1~13s4qy3c.js +1 -0
  69. package/dist/standalone/next-output/static/chunks/0jwrz3zhj9oat.js +1 -0
  70. package/dist/standalone/next-output/static/chunks/0mcmtes_owmfo.js +1 -0
  71. package/dist/standalone/next-output/static/chunks/{0yd454vuc8vdt.js → 0njpt~3f0nhto.js} +1 -1
  72. package/dist/standalone/next-output/static/chunks/{03lov4c0_c3q~.js → 0s5i31vj2y6n7.js} +1 -1
  73. package/dist/standalone/package.json +1 -1
  74. package/package.json +1 -1
  75. package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0qwn._e._.js +0 -3
  76. package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +0 -3
  77. package/dist/standalone/next-output/server/chunks/ssr/_01m_4io._.js +0 -3
  78. package/dist/standalone/next-output/server/chunks/ssr/_0l~yvzl._.js +0 -3
  79. package/dist/standalone/next-output/server/chunks/ssr/_0t2td71._.js +0 -3
  80. package/dist/standalone/next-output/static/chunks/0ahw3noqs1atp.js +0 -1
  81. package/dist/standalone/next-output/static/chunks/0hse41v5a2z.p.js +0 -1
  82. package/dist/standalone/next-output/static/chunks/0q1lqhczpaxed.js +0 -1
  83. package/dist/standalone/next-output/static/chunks/0xalmh45.srx..js +0 -1
  84. package/dist/standalone/next-output/static/chunks/0xeacy6yprulb.js +0 -1
  85. package/dist/standalone/next-output/static/chunks/10hpcjpra-dzn.js +0 -1
  86. /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_buildManifest.js +0 -0
  87. /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_clientMiddlewareManifest.js +0 -0
  88. /package/dist/standalone/next-output/static/{X1tXHWU8OQsHkaFGwq5aW → o0yrmO-jZI10Gicr4syI_}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(44066)._(e.r(78677)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(29158);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(31047),a=e.r(63334);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return y}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(44066),s=e.r(54710),i=o._(e.r(29158)),l=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),f=e.r(20321);e.r(90503);let _=e.r(38520),p=e.r(19947),h=e.r(59246),m=e.r(99046);function g(t){var r,n;let a,o,g,[y,x]=(0,i.useOptimistic)(p.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:k,as:w,children:S,prefetch:j=null,passHref:E,replace:O,shallow:N,scroll:T,onClick:A,onMouseEnter:C,onTouchStart:L,legacyBehavior:R=!1,onNavigate:U,transitionTypes:P,ref:I,unstable_dynamicOnHover:D,...M}=t;a=S,R&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let F=i.default.useContext(u.AppRouterContext),G=!1!==j,$=!1!==j?null===(n=j)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,K="string"==typeof(r=w||k)?r:(0,l.formatUrl)(r);if(R){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(a)}let q=R?o&&"object"==typeof o&&o.ref:I,Y=i.default.useCallback(e=>(null!==F&&(v.current=(0,p.mountLinkInstance)(e,K,F,$,G,x)),()=>{v.current&&((0,p.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,p.unmountPrefetchableInstance)(e)}),[G,K,F,$,x]),B={ref:(0,c.useMergedRef)(Y,q),onClick(t){R||"function"!=typeof A||A(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!F||t.defaultPrevented||function(t,r,n,a,o,s,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,h.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,a?"replace":"push",!1===o?_.ScrollBehavior.NoScroll:_.ScrollBehavior.Default,n.current,l)})}}(t,K,v,O,T,U,P)},onMouseEnter(e){R||"function"!=typeof C||C(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),F&&G&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),F&&G&&(0,p.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(K)?B.href=K:R&&!E&&("a"!==o.type||"href"in o.props)||(B.href=(0,f.addBasePath)(K)),g=R?i.default.cloneElement(o,B):(0,s.jsx)("a",{...M,...B,children:a}),(0,s.jsx)(b.Provider,{value:y,children:g})}e.r(10364);let b=(0,i.createContext)(p.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),a.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),a=e.i(32417),o=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[s,i]=(0,r.useState)(null),[l,u]=(0,r.useState)(!1),c=(0,a.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:s,is_pending:l,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,o.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/",label:"Tracker",match:e=>"/"===e}];function o(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":a?"page":void 0,children:n.label},n.href)})})}],45200);var s=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,s.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(o,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let a=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(a))}catch{return r}}],73205);var n=e.i(34869),a=e.i(92629);let o=(0,n.create_ui_preference_store)({storage_key:a.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:a.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function s(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,o],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return s()}],76003);var i=e.i(17798),l=e.i(46549),u=e.i(10464),c=e.i(35434),d=e.i(61834),f=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===s()?"light":"dark";(0,i.apply_theme)(e),(0,f.write_stored_theme)(e),u.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),u.theme_mode_preference.notify(),(0,c.notify_theme_subscribers)(),(0,l.notify_settings_saved)()}],38240)},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),a=e.i(29158),o=e.i(37399),s=e.i(90463),i=e.i(46549),l=e.i(73205),u=e.i(66295),c=e.i(2268),d=e.i(32792),f=e.i(90299),_=e.i(28274),p=e.i(76003),h=e.i(35434),m=e.i(38240),g=e.i(22373),b=e.i(25204),y=e.i(77882);let x="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},k=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),w=(0,n.usePathname)()??"/",S=(0,a.useSyncExternalStore)(h.subscribe_theme,p.get_theme_snapshot,p.get_theme_server_snapshot),j=(0,a.useSyncExternalStore)(c.cloud_sync_enabled_preference.subscribe,c.cloud_sync_enabled_preference.get_snapshot,c.cloud_sync_enabled_preference.get_server_snapshot),E=(0,a.useSyncExternalStore)(f.tracker_shortcut_map_preference.subscribe,f.tracker_shortcut_map_preference.get_snapshot,f.tracker_shortcut_map_preference.get_server_snapshot),O=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),N=(0,u.parse_tracker_shortcut_map)(E),T=new Set((0,l.parse_topbar_quick_actions)(O)),A=g.topbar_quick_action_ids.filter(e=>!T.has(e)),C=Array.from(new Set([...Array.from(k),...A])),{email:L,is_configured:R,is_pending:U,sign_out:P}=(0,y.use_supabase_auth_session)(),[I,D]=(0,a.useState)(!1),M=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!I)return;let e=e=>{null===M.current||M.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[I]);let F=()=>{D(!1)};return(0,b.use_escape_to_cancel)(F,I),(0,t.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":I,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(o.HamburgerIcon,{})}),I?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[R&&null!==L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:L,children:L})}):null,C.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:x,role:"menuitem",onClick:F,children:n.label})},e)}),R?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitemcheckbox","aria-checked":"true"===j,onClick:()=>{let e="true"===j?"false":"true";c.cloud_sync_enabled_preference.write(e),c.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==L&&(0,_.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===j?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===j?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{F(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===S?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===S?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{let e;F(),e=N.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),R?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{F(),e.push((0,s.build_auth_page_href)("sign_in",w))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${x} text-danger`,role:"menuitem",disabled:U,onClick:()=>{F(),P()},children:U?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let w=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",o=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),s=(0,a.useMemo)(()=>(0,l.parse_topbar_quick_actions)(o),[o]);if(0===s.length)return null;let i=w.filter(e=>s.includes(e.id));return 0===i.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:i.map(n=>{let a=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":a?"page":void 0,children:n.label},n.id)})})}],76080)},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),a=e.i(1976),o=e.i(76080),s=e.i(45958),i=e.i(71060),l=e.i(29539);function u(){let e=((0,i.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(s.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function c({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(s.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(s.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(c,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(o.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(u,{}),(0,t.jsx)(a.TopbarOverflowMenu,{})]})]})]})})}],75404)},7902,e=>{"use strict";var t=e.i(46549);e.s(["persist_ui_preference",0,function(e,r){e.read()!==r&&(e.write(r),e.notify(),(0,t.notify_settings_saved)())}])},31113,e=>{"use strict";e.s(["normalize_stored_tag",0,function(e){let t=e.trim().replace(/^@+/,"");if(0===t.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(t))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${t}`}])},14260,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(18774),a=e.i(52405),o=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:s,known_tags:i,placeholder:l,disabled:u=!1,autoFocus:c=!1,on_change:d}){let f=(0,r.useRef)(null),_=(0,r.useRef)(null),p=(0,r.useRef)(null),[h,m]=(0,r.useState)(0),[g,b]=(0,r.useState)(0),y=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let a=r.slice(n+1);return/\s/.test(a)?null:{query:a,start_index:n,end_index:t}}(s,h),x=null===y?[]:function(e,t,r=10){let n=t.toLowerCase();return e.filter(e=>{let t=e.replace(/^@/,"").toLowerCase();return 0===n.length||t.startsWith(n)}).slice(0,r)}(i,y.query),v=null!==y&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,o.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(y.query,i),k=null!==y&&x.length>0&&!v&&!u;(0,r.useLayoutEffect)(()=>{null!==p.current&&null!==f.current&&(f.current.setSelectionRange(p.current,p.current),m(p.current),p.current=null)},[s]),(0,r.useEffect)(()=>{b(0)},[s,h,x.length]);let w=()=>{m(f.current?.selectionStart??s.length)},S=()=>{b(0)},j=e=>{let t,r,a;if(null===y)return;let{next_text:o,next_cursor:i}=(t=(0,n.format_display_tag)(e),r=s.slice(0,y.start_index),a=s.slice(y.end_index),{next_text:`${r}${t}${a}`,next_cursor:r.length+t.length});p.current=i,d(o),S()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:f,id:e,type:"text",role:"combobox",className:(0,a.get_input_class_name)(),value:s,placeholder:l,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":k,"aria-controls":k?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),m(e.target.selectionStart??e.target.value.length)},onClick:w,onKeyUp:w,onKeyDown:e=>{if(k){if("ArrowDown"===e.key){e.preventDefault(),b(e=>(e+1)%x.length);return}if("ArrowUp"===e.key){e.preventDefault(),b(e=>(e-1+x.length)%x.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=x[g];void 0!==t&&j(t);return}"Escape"===e.key&&(e.preventDefault(),S())}},onBlur:()=>{window.setTimeout(S,120)}}),k?(0,t.jsx)("ul",{ref:_,id:`${e}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:x.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===g,children:(0,t.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${r===g?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),j(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},47540,e=>{"use strict";var t=e.i(31113);e.s(["tags_are_equal",0,function(e,r){try{return(0,t.normalize_stored_tag)(e)===(0,t.normalize_stored_tag)(r)}catch{return!1}}])},85323,e=>{"use strict";var t=e.i(49087);e.s(["notify_desktop",0,function(e){if((0,t.notify_in_app)({title:e.title,body:e.body}),"u"<typeof Notification||"u">typeof document&&"visible"===document.visibilityState&&document.hasFocus()||"granted"!==Notification.permission)return;let{body:r,tag:n,title:a}=e,o={body:r,...void 0!==n?{tag:n}:{}};try{new Notification(a,o)}catch{}},"supports_desktop_notifications",0,function(){return"u">typeof Notification}])},48541,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DESKTOP_NOTIFICATIONS_STORAGE_KEY,default_value:r.DESKTOP_NOTIFICATIONS_DEFAULT,is_valid:e=>"true"===e||"false"===e});e.s(["desktop_notifications_preference",0,n])},83821,60145,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=30&&t<=720}});e.s(["daily_focus_target_minutes_preference",0,n],83821);let a=(0,t.create_ui_preference_store)({storage_key:r.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=60&&t<=4200}});e.s(["weekly_focus_target_minutes_preference",0,a],60145)},1238,51703,74597,77130,56442,73228,e=>{"use strict";e.s(["parse_focus_goals_by_name",0,function(e){if(0===e.length)return{};try{let t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))return{};let r={};for(let[e,n]of Object.entries(t)){if(null===n||"object"!=typeof n)continue;let t={};"string"==typeof n.daily&&n.daily.length>0&&(t.daily=n.daily),"string"==typeof n.weekly&&n.weekly.length>0&&(t.weekly=n.weekly),(void 0!==t.daily||void 0!==t.weekly)&&(r[e]=t)}return r}catch{return{}}}],1238);var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SCOPE_STORAGE_KEY,default_value:r.FOCUS_GOAL_SCOPE_DEFAULT,is_valid:e=>"global"===e||"sheet"===e||"tag"===e});e.s(["focus_goal_scope_preference",0,n],51703);let a=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SHEET_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_SHEET_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_sheet_name_preference",0,a],74597);let o=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_TAG_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_TAG_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_tag_name_preference",0,o],77130);let s=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_SHEET_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_SHEET_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_sheet_preference",0,s],56442);let i=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_TAG_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_TAG_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_tag_preference",0,i],73228)},15526,e=>{"use strict";let t="super-time-tracker-pomodoro-active-entry";e.s(["clear_pomodoro_task_entry_marker",0,function(){try{window.localStorage.removeItem(t)}catch{}},"is_pomodoro_task_entry",0,function(e){let r=(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return null;try{let t=JSON.parse(e);if("string"==typeof t.sheetName&&t.sheetName.length>0&&"number"==typeof t.entryId&&Number.isInteger(t.entryId))return{sheetName:t.sheetName,entryId:t.entryId}}catch{}return null}catch{return null}})();return null!==r&&r.sheetName===e.sheetName&&r.entryId===e.id},"mark_pomodoro_task_entry",0,function(e){try{let r={sheetName:e.sheetName,entryId:e.id};window.localStorage.setItem(t,JSON.stringify(r))}catch{}}])},75899,e=>{"use strict";var t=e.i(39552);e.s(["format_time",0,function(e,r="12h"){return(0,t.format)(new Date(e),"24h"===r?"HH:mm":"h:mm a")}])},35923,e=>{"use strict";var t=e.i(29158),r=e.i(97891);e.s(["use_time_format",0,function(){return(0,t.useSyncExternalStore)(r.time_format_preference.subscribe,r.time_format_preference.get_snapshot,r.time_format_preference.get_server_snapshot)}])},60529,e=>{"use strict";e.s(["format_entry_count_label",0,function(e){return 0===e?null:1===e?"1 entry":`${e} entries`}])},53754,7554,76379,e=>{"use strict";var t=e.i(29158),r=e.i(14974);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,a=r.length>0,o="Stop the active timer and save this entry?";return n&&a?o=`Stop the timer at "${t}" and save a checkout note?`:n?o=`Stop the timer and check out at "${t}"?`:a&&(o="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:o,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var a=e.i(97026);function o(){return"true"===(0,t.useSyncExternalStore)(a.confirm_before_checkout_preference.subscribe,a.confirm_before_checkout_preference.get_snapshot,a.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,o],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:a}=(0,r.useConfirmDialog)(),s=o();return(0,t.useCallback)(async t=>(!s||!!await a(n(t)))&&(e(t),!0),[a,s,e])}],53754)},50459,e=>{"use strict";e.s(["prompt_check_out_at",0,function(){let e=window.prompt("Check out at what time?","30 minutes ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}])},36178,68713,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),a=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==a&&a.length>0&&(r.note=a),r}],36178);var t=e.i(26740),r=e.i(15526);e.s(["finish_running_pomodoro_timer",0,function(){try{let e=window.localStorage.getItem(t.POMODORO_STORAGE_KEY);if(null===e)return;let n=JSON.parse(e),a=n.state;if(a?.status!=="running")return;let o={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(o)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}],68713)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(44066)._(e.r(78677)),s=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(29158);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=o(e,n)),t&&(a.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(31047),a=e.r(63334);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return y}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let o=e.r(44066),s=e.r(54710),i=o._(e.r(29158)),l=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),f=e.r(20321);e.r(90503);let _=e.r(38520),h=e.r(19947),p=e.r(59246),m=e.r(99046);function g(t){var r,n;let a,o,g,[y,x]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:w,as:k,children:S,prefetch:j=null,passHref:E,replace:O,shallow:N,scroll:T,onClick:A,onMouseEnter:C,onTouchStart:L,legacyBehavior:R=!1,onNavigate:U,transitionTypes:P,ref:I,unstable_dynamicOnHover:D,...M}=t;a=S,R&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let F=i.default.useContext(u.AppRouterContext),G=!1!==j,$=!1!==j?null===(n=j)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,K="string"==typeof(r=k||w)?r:(0,l.formatUrl)(r);if(R){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(a)}let q=R?o&&"object"==typeof o&&o.ref:I,Y=i.default.useCallback(e=>(null!==F&&(v.current=(0,h.mountLinkInstance)(e,K,F,$,G,x)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[G,K,F,$,x]),B={ref:(0,c.useMergedRef)(Y,q),onClick(t){R||"function"!=typeof A||A(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!F||t.defaultPrevented||function(t,r,n,a,o,s,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,a?"replace":"push",!1===o?_.ScrollBehavior.NoScroll:_.ScrollBehavior.Default,n.current,l)})}}(t,K,v,O,T,U,P)},onMouseEnter(e){R||"function"!=typeof C||C(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),F&&G&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),F&&G&&(0,h.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(K)?B.href=K:R&&!E&&("a"!==o.type||"href"in o.props)||(B.href=(0,f.addBasePath)(K)),g=R?i.default.cloneElement(o,B):(0,s.jsx)("a",{...M,...B,children:a}),(0,s.jsx)(b.Provider,{value:y,children:g})}e.r(10364);let b=(0,i.createContext)(h.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let a=(0,t.useRef)(e);a.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),a.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),a=e.i(32417),o=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[s,i]=(0,r.useState)(null),[l,u]=(0,r.useState)(!1),c=(0,a.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:s,is_pending:l,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,o.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let a=[{href:"/",label:"Tracker",match:e=>"/"===e}];function o(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:a.map(n=>{let a=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":a?"page":void 0,children:n.label},n.href)})})}],45200);var s=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,s.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(o,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let a=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(a))}catch{return r}}],73205);var n=e.i(34869),a=e.i(92629);let o=(0,n.create_ui_preference_store)({storage_key:a.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:a.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function s(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,o],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return s()}],76003);var i=e.i(17798),l=e.i(46549),u=e.i(10464),c=e.i(35434),d=e.i(61834),f=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===s()?"light":"dark";(0,i.apply_theme)(e),(0,f.write_stored_theme)(e),u.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),u.theme_mode_preference.notify(),(0,c.notify_theme_subscribers)(),(0,l.notify_settings_saved)()}],38240)},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),a=e.i(29158),o=e.i(37399),s=e.i(90463),i=e.i(46549),l=e.i(73205),u=e.i(66295),c=e.i(2268),d=e.i(32792),f=e.i(90299),_=e.i(28274),h=e.i(76003),p=e.i(35434),m=e.i(38240),g=e.i(22373),b=e.i(25204),y=e.i(77882);let x="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},w=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),k=(0,n.usePathname)()??"/",S=(0,a.useSyncExternalStore)(p.subscribe_theme,h.get_theme_snapshot,h.get_theme_server_snapshot),j=(0,a.useSyncExternalStore)(c.cloud_sync_enabled_preference.subscribe,c.cloud_sync_enabled_preference.get_snapshot,c.cloud_sync_enabled_preference.get_server_snapshot),E=(0,a.useSyncExternalStore)(f.tracker_shortcut_map_preference.subscribe,f.tracker_shortcut_map_preference.get_snapshot,f.tracker_shortcut_map_preference.get_server_snapshot),O=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),N=(0,u.parse_tracker_shortcut_map)(E),T=new Set((0,l.parse_topbar_quick_actions)(O)),A=g.topbar_quick_action_ids.filter(e=>!T.has(e)),C=Array.from(new Set([...Array.from(w),...A])),{email:L,is_configured:R,is_pending:U,sign_out:P}=(0,y.use_supabase_auth_session)(),[I,D]=(0,a.useState)(!1),M=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!I)return;let e=e=>{null===M.current||M.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[I]);let F=()=>{D(!1)};return(0,b.use_escape_to_cancel)(F,I),(0,t.jsxs)("div",{className:"relative shrink-0",ref:M,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":I,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(o.HamburgerIcon,{})}),I?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[R&&null!==L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:L,children:L})}):null,C.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:x,role:"menuitem",onClick:F,children:n.label})},e)}),R?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitemcheckbox","aria-checked":"true"===j,onClick:()=>{let e="true"===j?"false":"true";c.cloud_sync_enabled_preference.write(e),c.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==L&&(0,_.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===j?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===j?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{F(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===S?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===S?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{let e;F(),e=N.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),R?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===L?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:x,role:"menuitem",onClick:()=>{F(),e.push((0,s.build_auth_page_href)("sign_in",k))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${x} text-danger`,role:"menuitem",disabled:U,onClick:()=>{F(),P()},children:U?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let k=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",o=(0,a.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),s=(0,a.useMemo)(()=>(0,l.parse_topbar_quick_actions)(o),[o]);if(0===s.length)return null;let i=k.filter(e=>s.includes(e.id));return 0===i.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:i.map(n=>{let a=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${a?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":a?"page":void 0,children:n.label},n.id)})})}],76080)},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),a=e.i(1976),o=e.i(76080),s=e.i(45958),i=e.i(71060),l=e.i(29539);function u(){let e=((0,i.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(s.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function c({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(s.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(s.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(c,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(o.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(u,{}),(0,t.jsx)(a.TopbarOverflowMenu,{})]})]})]})})}],75404)},7902,e=>{"use strict";var t=e.i(46549);e.s(["persist_ui_preference",0,function(e,r){e.read()!==r&&(e.write(r),e.notify(),(0,t.notify_settings_saved)())}])},31113,e=>{"use strict";e.s(["normalize_stored_tag",0,function(e){let t=e.trim().replace(/^@+/,"");if(0===t.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(t))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${t}`}])},14260,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(18774),a=e.i(52405),o=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:s,known_tags:i,placeholder:l,disabled:u=!1,autoFocus:c=!1,on_change:d}){let f=(0,r.useRef)(null),_=(0,r.useRef)(null),h=(0,r.useRef)(null),[p,m]=(0,r.useState)(0),[g,b]=(0,r.useState)(0),y=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let a=r.slice(n+1);return/\s/.test(a)?null:{query:a,start_index:n,end_index:t}}(s,p),x=null===y?[]:function(e,t,r=10){let n=t.toLowerCase();return e.filter(e=>{let t=e.replace(/^@/,"").toLowerCase();return 0===n.length||t.startsWith(n)}).slice(0,r)}(i,y.query),v=null!==y&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,o.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(y.query,i),w=null!==y&&x.length>0&&!v&&!u;(0,r.useLayoutEffect)(()=>{null!==h.current&&null!==f.current&&(f.current.setSelectionRange(h.current,h.current),m(h.current),h.current=null)},[s]),(0,r.useEffect)(()=>{b(0)},[s,p,x.length]);let k=()=>{m(f.current?.selectionStart??s.length)},S=()=>{b(0)},j=e=>{let t,r,a;if(null===y)return;let{next_text:o,next_cursor:i}=(t=(0,n.format_display_tag)(e),r=s.slice(0,y.start_index),a=s.slice(y.end_index),{next_text:`${r}${t}${a}`,next_cursor:r.length+t.length});h.current=i,d(o),S()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:f,id:e,type:"text",role:"combobox",className:(0,a.get_input_class_name)(),value:s,placeholder:l,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),m(e.target.selectionStart??e.target.value.length)},onClick:k,onKeyUp:k,onKeyDown:e=>{if(w){if("ArrowDown"===e.key){e.preventDefault(),b(e=>(e+1)%x.length);return}if("ArrowUp"===e.key){e.preventDefault(),b(e=>(e-1+x.length)%x.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=x[g];void 0!==t&&j(t);return}"Escape"===e.key&&(e.preventDefault(),S())}},onBlur:()=>{window.setTimeout(S,120)}}),w?(0,t.jsx)("ul",{ref:_,id:`${e}-tag-suggestions`,role:"listbox",className:"absolute left-0 right-0 top-full z-20 mt-1 max-h-48 list-none overflow-y-auto rounded-md border border-panel-border bg-panel p-1.5 shadow-md",children:x.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===g,children:(0,t.jsx)("button",{type:"button",className:`block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover ${r===g?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),j(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},47540,e=>{"use strict";var t=e.i(31113);e.s(["tags_are_equal",0,function(e,r){try{return(0,t.normalize_stored_tag)(e)===(0,t.normalize_stored_tag)(r)}catch{return!1}}])},85323,e=>{"use strict";var t=e.i(49087);e.s(["notify_desktop",0,function(e){if((0,t.notify_in_app)({title:e.title,body:e.body}),"u"<typeof Notification||"u">typeof document&&"visible"===document.visibilityState&&document.hasFocus()||"granted"!==Notification.permission)return;let{body:r,tag:n,title:a}=e,o={body:r,...void 0!==n?{tag:n}:{}};try{new Notification(a,o)}catch{}},"supports_desktop_notifications",0,function(){return"u">typeof Notification}])},48541,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DESKTOP_NOTIFICATIONS_STORAGE_KEY,default_value:r.DESKTOP_NOTIFICATIONS_DEFAULT,is_valid:e=>"true"===e||"false"===e});e.s(["desktop_notifications_preference",0,n])},1238,51703,74597,77130,56442,73228,e=>{"use strict";e.s(["parse_focus_goals_by_name",0,function(e){if(0===e.length)return{};try{let t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))return{};let r={};for(let[e,n]of Object.entries(t)){if(null===n||"object"!=typeof n)continue;let t={};"string"==typeof n.daily&&n.daily.length>0&&(t.daily=n.daily),"string"==typeof n.weekly&&n.weekly.length>0&&(t.weekly=n.weekly),(void 0!==t.daily||void 0!==t.weekly)&&(r[e]=t)}return r}catch{return{}}}],1238);var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SCOPE_STORAGE_KEY,default_value:r.FOCUS_GOAL_SCOPE_DEFAULT,is_valid:e=>"global"===e||"sheet"===e||"tag"===e});e.s(["focus_goal_scope_preference",0,n],51703);let a=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_SHEET_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_SHEET_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_sheet_name_preference",0,a],74597);let o=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOAL_TAG_NAME_STORAGE_KEY,default_value:r.FOCUS_GOAL_TAG_NAME_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["focus_goal_tag_name_preference",0,o],77130);let s=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_SHEET_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_SHEET_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_sheet_preference",0,s],56442);let i=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_GOALS_PER_TAG_STORAGE_KEY,default_value:r.FOCUS_GOALS_PER_TAG_DEFAULT,is_valid:e=>{if(0===e.length)return!1;try{let t=JSON.parse(e);return null!==t&&"object"==typeof t&&!Array.isArray(t)}catch{return!1}}});e.s(["focus_goals_per_tag_preference",0,i],73228)},19946,e=>{"use strict";var t=e.i(29158),r=e.i(72270),n=e.i(4572);e.s(["use_confirm_dialog",0,function(){let e=(0,t.useContext)(r.ConfirmDialogContext);if(null!==e)return e;let a=(0,n.get_registered_confirm_dialog)();if(null!==a)return{confirm:a};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},75899,e=>{"use strict";var t=e.i(39552);e.s(["format_time",0,function(e,r="12h"){return(0,t.format)(new Date(e),"24h"===r?"HH:mm":"h:mm a")}])},35923,e=>{"use strict";var t=e.i(29158),r=e.i(97891);e.s(["use_time_format",0,function(){return(0,t.useSyncExternalStore)(r.time_format_preference.subscribe,r.time_format_preference.get_snapshot,r.time_format_preference.get_server_snapshot)}])},60529,e=>{"use strict";e.s(["format_entry_count_label",0,function(e){return 0===e?null:1===e?"1 entry":`${e} entries`}])},15526,e=>{"use strict";let t="super-time-tracker-pomodoro-active-entry";e.s(["clear_pomodoro_task_entry_marker",0,function(){try{window.localStorage.removeItem(t)}catch{}},"is_pomodoro_task_entry",0,function(e){let r=(()=>{try{let e=window.localStorage.getItem(t);if(null===e)return null;try{let t=JSON.parse(e);if("string"==typeof t.sheetName&&t.sheetName.length>0&&"number"==typeof t.entryId&&Number.isInteger(t.entryId))return{sheetName:t.sheetName,entryId:t.entryId}}catch{}return null}catch{return null}})();return null!==r&&r.sheetName===e.sheetName&&r.entryId===e.id},"mark_pomodoro_task_entry",0,function(e){try{let r={sheetName:e.sheetName,entryId:e.id};window.localStorage.setItem(t,JSON.stringify(r))}catch{}}])},83821,60145,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=30&&t<=720}});e.s(["daily_focus_target_minutes_preference",0,n],83821);let a=(0,t.create_ui_preference_store)({storage_key:r.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:r.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=60&&t<=4200}});e.s(["weekly_focus_target_minutes_preference",0,a],60145)},53754,7554,76379,e=>{"use strict";var t=e.i(29158),r=e.i(19946);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,a=r.length>0,o="Stop the active timer and save this entry?";return n&&a?o=`Stop the timer at "${t}" and save a checkout note?`:n?o=`Stop the timer and check out at "${t}"?`:a&&(o="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:o,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var a=e.i(97026);function o(){return"true"===(0,t.useSyncExternalStore)(a.confirm_before_checkout_preference.subscribe,a.confirm_before_checkout_preference.get_snapshot,a.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,o],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:a}=(0,r.use_confirm_dialog)(),s=o();return(0,t.useCallback)(async t=>(!s||!!await a(n(t)))&&(e(t),!0),[a,s,e])}],53754)},50459,e=>{"use strict";e.s(["prompt_check_out_at",0,function(){let e=window.prompt("Check out at what time?","30 minutes ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}])},36178,68713,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),a=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==a&&a.length>0&&(r.note=a),r}],36178);var t=e.i(26740),r=e.i(15526);e.s(["finish_running_pomodoro_timer",0,function(){try{let e=window.localStorage.getItem(t.POMODORO_STORAGE_KEY);if(null===e)return;let n=JSON.parse(e),a=n.state;if(a?.status!=="running")return;let o={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(o)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}],68713)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22482,e=>{"use strict";var t=e.i(54710),n=e.i(45958),r=e.i(29158),s=e.i(14260),a=e.i(96947),i=e.i(52663),l=e.i(52405),o=e.i(69472),c=e.i(84545),d=e.i(50937),u=e.i(83327),m=e.i(49532),_=e.i(59515);function p(e){try{window.localStorage.setItem("super-time-tracker-entry-templates",JSON.stringify(e))}catch{}}function h({known_tags:e,on_submit:n,is_pending:g}){let[f,x]=(0,r.useState)([]),[b,y]=(0,r.useState)(""),[v,k]=(0,r.useState)(""),[w,N]=(0,r.useState)(""),[j,S]=(0,r.useState)(null),[E,C]=(0,r.useState)(!1),T=(0,r.useSyncExternalStore)(c.entry_suggestion_provider_preference.subscribe,c.entry_suggestion_provider_preference.get_snapshot,c.entry_suggestion_provider_preference.get_server_snapshot),$=(0,r.useSyncExternalStore)(u.openai_api_key_preference.subscribe,u.openai_api_key_preference.get_snapshot,u.openai_api_key_preference.get_server_snapshot),I=(0,r.useSyncExternalStore)(o.claude_api_key_preference.subscribe,o.claude_api_key_preference.get_snapshot,o.claude_api_key_preference.get_server_snapshot),M=(0,r.useSyncExternalStore)(d.google_ai_api_key_preference.subscribe,d.google_ai_api_key_preference.get_snapshot,d.google_ai_api_key_preference.get_server_snapshot),D=(0,a.get_api_key_for_suggestion_provider)(T,{openai:$,claude:I,google_ai:M}),L="none"!==T&&D.trim().length>0;(0,r.useEffect)(()=>{x((0,m.read_entry_templates)())},[]);let A=(0,r.useMemo)(()=>f.find(e=>e.id===b)??null,[f,b]),R=async()=>{if(L){C(!0),S(null);try{let e=await (0,_.request_ai_entry_description_suggestion)({provider:T,api_key:D,context:v,notes:""});k(e)}catch(e){S(e instanceof Error?e.message:String(e))}finally{C(!1)}}};return(0,t.jsxs)("form",{className:"flex flex-col gap-2 border border-panel-border bg-panel p-[1.1rem] shadow-sm",onSubmit:e=>{e.preventDefault();let t=v.trim();if(0===t.length)return;let r=w.trim();n({description:t,...r.length>0?{at:r}:{}}),k(""),N("")},children:[(0,t.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-description",children:"What are you working on?"}),(0,t.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[(0,t.jsxs)("select",{className:(0,l.get_input_class_name)(),value:b,disabled:g||0===f.length,onChange:e=>{let t=e.target.value;y(t);let n=f.find(e=>e.id===t)??null;null!==n&&k(n.description)},children:[(0,t.jsx)("option",{value:"",children:0===f.length?"No templates":"Use a template…"}),f.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:g||0===v.trim().length,onClick:()=>{let e=v.trim();if(0===e.length)return;let t=e.slice(0,40),n=globalThis.prompt("Template name",t.length>0?t:"New template");if(null===n)return;let r=n.trim();if(0===r.length)return;let s="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,a=[...f,{id:s,name:r,description:e}];x(a),y(s),p(a)},children:"Save template"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:g||null===A,onClick:()=>{if(null===A)return;let e=f.filter(e=>e.id!==A.id);x(e),y(""),p(e)},children:"Delete template"})]}),(0,t.jsxs)("div",{className:`grid gap-2 max-[860px]:grid-cols-1 ${L?"grid-cols-[minmax(0,1fr)_auto_auto]":"grid-cols-[minmax(0,1fr)_auto]"}`,children:[(0,t.jsx)(s.TagAutocompleteInput,{id:"check-in-description",value:v,known_tags:e,placeholder:"e.g. crafting something @design",disabled:g,autoFocus:!0,on_change:k}),L?(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:g||E,onClick:()=>void R(),title:"Suggest description with AI",children:E?"Suggesting…":"Suggest"}):null,(0,t.jsx)("button",{type:"submit",className:(0,i.get_button_class_name)("primary"),disabled:g||0===v.trim().length,children:"Check in"})]}),null===j?null:(0,t.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:j}),(0,t.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-at",children:["Start time"," ",(0,t.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,t.jsx)("input",{id:"check-in-at",className:(0,l.get_input_class_name)(),value:w,onChange:e=>N(e.target.value),placeholder:"e.g. 30 minutes ago",disabled:g})]})}var g=e.i(50994);let f=(0,r.forwardRef)(function({known_tags:e,is_pending:n,on_submit:s,trailing:a},l){let o="true"===(0,r.useSyncExternalStore)(g.check_in_form_collapsed_preference.subscribe,g.check_in_form_collapsed_preference.get_snapshot,g.check_in_form_collapsed_preference.get_server_snapshot),[c,d]=(0,r.useState)(!o);return((0,r.useImperativeHandle)(l,()=>({expand_and_focus:()=>{d(!0),globalThis.requestAnimationFrame(()=>{let e=document.getElementById("check-in-description");e instanceof HTMLElement&&e.focus()})}}),[]),o&&!c)?(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("primary"),disabled:n,onClick:()=>d(!0),children:"Check in"}),a]}):(0,t.jsx)(h,{known_tags:e,is_pending:n,on_submit:e=>{s(e),o&&d(!1)}})});var x=e.i(14974),b=e.i(29539),y=e.i(32584),v=e.i(1238),k=e.i(83821),w=e.i(51703),N=e.i(74597),j=e.i(77130),S=e.i(56442),E=e.i(73228),C=e.i(56996),T=e.i(8654),$=e.i(76900),I=e.i(60145),M=e.i(26740),D=e.i(1800);function L({on_check_in_shortcut:e,has_running_timer:n=!1}){var s;let a=(0,D.use_duration_format)(),i=(0,r.useSyncExternalStore)(C.focus_nudges_enabled_preference.subscribe,C.focus_nudges_enabled_preference.get_snapshot,C.focus_nudges_enabled_preference.get_server_snapshot),l=(0,r.useSyncExternalStore)(k.daily_focus_target_minutes_preference.subscribe,k.daily_focus_target_minutes_preference.get_snapshot,k.daily_focus_target_minutes_preference.get_server_snapshot),o=(0,r.useSyncExternalStore)(I.weekly_focus_target_minutes_preference.subscribe,I.weekly_focus_target_minutes_preference.get_snapshot,I.weekly_focus_target_minutes_preference.get_server_snapshot),c=(0,r.useSyncExternalStore)(T.no_log_reminder_minutes_preference.subscribe,T.no_log_reminder_minutes_preference.get_snapshot,T.no_log_reminder_minutes_preference.get_server_snapshot),d=(0,r.useSyncExternalStore)($.overwork_alert_hours_preference.subscribe,$.overwork_alert_hours_preference.get_snapshot,$.overwork_alert_hours_preference.get_server_snapshot),u=(0,r.useSyncExternalStore)(w.focus_goal_scope_preference.subscribe,w.focus_goal_scope_preference.get_snapshot,w.focus_goal_scope_preference.get_server_snapshot),m=(0,r.useSyncExternalStore)(N.focus_goal_sheet_name_preference.subscribe,N.focus_goal_sheet_name_preference.get_snapshot,N.focus_goal_sheet_name_preference.get_server_snapshot),_=(0,r.useSyncExternalStore)(j.focus_goal_tag_name_preference.subscribe,j.focus_goal_tag_name_preference.get_snapshot,j.focus_goal_tag_name_preference.get_server_snapshot),p=(0,r.useSyncExternalStore)(S.focus_goals_per_sheet_preference.subscribe,S.focus_goals_per_sheet_preference.get_snapshot,S.focus_goals_per_sheet_preference.get_server_snapshot),h=(0,r.useSyncExternalStore)(E.focus_goals_per_tag_preference.subscribe,E.focus_goals_per_tag_preference.get_snapshot,E.focus_goals_per_tag_preference.get_server_snapshot),[g,f]=(0,r.useState)(null),[x,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>{try{var e;let t=globalThis.localStorage.getItem(M.POMODORO_STORAGE_KEY);if(null===t)return null;let n=JSON.parse(t).state;if(n?.status!=="running"||null==n.deadline_at_ms)return null;let r=Math.max(0,n.deadline_at_ms-Date.now()),s=Math.floor(r/6e4),a=Math.floor(r%6e4/1e3);return{phase_label:(e=n.phase,"work"===e?"Focus":"short_break"===e?"Short break":"Long break"),remaining_label:`${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}}catch{return null}},t=globalThis.setTimeout(()=>{b(e())},0),n=globalThis.setInterval(()=>{b(e())},1e3);return()=>{globalThis.clearTimeout(t),globalThis.clearInterval(n)}},[]),(0,r.useEffect)(()=>{if("true"!==i)return;let e=!1,t=async()=>{try{var t,n,r;let s=new URLSearchParams;s.set("scope",(t=u,n=m,r=_,"sheet"===t&&0===n.length||"tag"===t&&0===r.length?"global":t)),"sheet"===u&&m.length>0&&s.set("sheet",m),"tag"===u&&_.length>0&&s.set("tag",_);let a=await fetch(`/api/focus-nudges/status?${s.toString()}`);if(!a.ok)return;let i=await a.json();e||f(i)}catch{}};t();let n=globalThis.setInterval(()=>{t()},6e4);return()=>{e=!0,globalThis.clearInterval(n)}},[i,u,m,_]);let F=(0,r.useMemo)(()=>{if("true"!==i||null===g)return null;let{daily_minutes:e,weekly_minutes:t}=function(e){if("sheet"===e.scope&&e.sheet_name.length>0){let t=(0,v.parse_focus_goals_by_name)(e.per_sheet_json)[e.sheet_name];return void 0===t?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:t.daily??e.global_daily,weekly_minutes:t.weekly??e.global_weekly}}if("tag"===e.scope&&e.tag_name.length>0){let t=(0,v.parse_focus_goals_by_name)(e.per_tag_json)[e.tag_name];return void 0===t?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:t.daily??e.global_daily,weekly_minutes:t.weekly??e.global_weekly}}return{daily_minutes:e.global_daily,weekly_minutes:e.global_weekly}}({scope:u,sheet_name:m,tag_name:_,per_sheet_json:p,per_tag_json:h,global_daily:l,global_weekly:o});if(null===e||null===t)return{kind:"alert",tone:"info",title:A("daily",u,m,_),detail:"No goals configured yet for this scope. Set daily and weekly targets in Goal settings."};let r=6e4*Number.parseInt(e,10),s=6e4*Number.parseInt(t,10),f=36e5*Number.parseInt(d,10),x=Number.parseInt(c,10);return null!==g.activeTimerDurationMs&&g.activeTimerDurationMs>=f?{kind:"alert",tone:"warning",title:"Overwork alert",detail:`Current session is ${(0,y.format_duration)(g.activeTimerDurationMs,a)}. Consider a short break.`}:!n&&null!==g.minutesSinceLastLog&&g.minutesSinceLastLog>=x?{kind:"alert",tone:"warning",title:"Gentle reminder",detail:`No time logged for ${g.minutesSinceLastLog} min. Start a timer when you are back on task.`,show_check_in_shortcut:!0}:g.todayTrackedMs<r?{kind:"progress",scope:"daily",title:A("daily",u,m,_),tracked_ms:g.todayTrackedMs,target_ms:r}:g.weekTrackedMs<s?{kind:"progress",scope:"weekly",title:A("weekly",u,m,_),tracked_ms:g.weekTrackedMs,target_ms:s}:{kind:"alert",tone:"success",title:"Targets met",detail:"Daily and weekly focus goals are on track."}},[l,a,i,d,n,u,m,_,p,h,c,g,o]);if(null===F)return null;if("progress"===F.kind)return(0,t.jsx)(R,{scope:F.scope,title:F.title,tracked_ms:F.tracked_ms,target_ms:F.target_ms,duration_format:a,activePomodoro:x});let U="warning"===(s=F.tone)?"mb-4 rounded-md border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text":"success"===s?"mb-4 rounded-md border border-accent-border bg-accent-soft px-3 py-2.5 text-accent":"mb-4 rounded-md border border-panel-border bg-panel px-3 py-2.5 text-foreground";return(0,t.jsxs)("section",{className:U,"aria-live":"polite","aria-atomic":"true",children:[(0,t.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:F.title}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.82rem] leading-relaxed",children:F.detail}),F.show_check_in_shortcut&&void 0!==e?(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-current bg-transparent px-2 py-1 text-[0.75rem] font-semibold",onClick:e,children:"Check in"}):null]})]})}function A(e,t,n,r){let s="daily"===e?"Relevant goal":"Weekly goal";return"sheet"===t&&n.length>0?`${s} \xb7 ${n}`:"tag"===t&&r.length>0?`${s} \xb7 @${r}`:s}function R({scope:e,title:r,tracked_ms:s,target_ms:a,duration_format:i,activePomodoro:l}){let o=a>0?Math.min(100,s/a*100):0,c=Math.max(0,a-s);return(0,t.jsx)("section",{className:"mb-4 rounded-md border border-panel-border bg-panel px-4 py-3 shadow-sm","aria-label":r,"aria-live":"polite",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-stretch justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:r}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:["daily"===e?(0,t.jsx)(n.default,{href:"/settings/goals#focus-goals-nudges",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-panel-border text-muted no-underline hover:bg-surface-hover hover:text-foreground","aria-label":"Open daily focus target settings",title:"Daily focus target settings",children:(0,t.jsx)(b.SettingsIcon,{})}):null,(0,t.jsxs)("p",{className:"m-0 font-mono text-[0.78rem] font-semibold text-accent",children:[Math.round(o),"%"]})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("p",{className:"m-0 font-mono text-[1.35rem] font-semibold leading-none text-foreground",children:[(0,y.format_duration)(s,i),(0,t.jsxs)("span",{className:"ml-1 text-[0.85rem] font-medium text-muted",children:["/ ",(0,y.format_duration)(a,i)]})]}),(0,t.jsxs)("p",{className:"m-0 text-[0.78rem] text-muted",children:[(0,y.format_duration)(c,i)," left"," ","daily"===e?"today":"this week"]})]}),(0,t.jsx)("progress",{className:"mt-3 h-1.5 w-full overflow-hidden rounded-full bg-accent-soft [&::-webkit-progress-bar]:rounded-full [&::-webkit-progress-bar]:bg-accent-soft [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:bg-accent [&::-moz-progress-bar]:rounded-full [&::-moz-progress-bar]:bg-accent",max:100,value:Math.round(o)})]}),null===l?null:(0,t.jsxs)("aside",{className:"min-w-52 rounded-md border border-panel-border bg-surface-raised px-3 py-2.5",children:[(0,t.jsx)("p",{className:"m-0 text-[0.68rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Active Pomodoro"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.82rem] font-semibold text-foreground",children:l.phase_label}),(0,t.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.25rem] font-semibold leading-none text-accent",children:l.remaining_label})]})]})})}var F=e.i(71060),U=e.i(83391);function O(e,t,n){if(0===e.length)return null;let r=e.findIndex(e=>e.name===t),s=((-1===r?0:r)+("next"===n?1:-1)+e.length)%e.length;return e[s]?.name??null}var P=e.i(14574),q=e.i(66295),z=e.i(90299),G=e.i(53754),H=e.i(99211);function K({sheets:e,active_sheet_name:n,active_entry:s,is_pending:a,check_in_form_ref:i,active_entry_panel_ref:l,on_select_sheet:o,on_check_out:c}){let d=(0,F.useRouter)(),[u,m]=(0,r.useState)(!1),_=(0,G.useCheckOutAction)(c),p=(0,r.useSyncExternalStore)(z.tracker_shortcut_map_preference.subscribe,z.tracker_shortcut_map_preference.get_snapshot,z.tracker_shortcut_map_preference.get_server_snapshot),h=(0,r.useMemo)(()=>(0,q.parse_tracker_shortcut_map)(p),[p]),g=h.help,f="?"===g?"?":g.toUpperCase(),x=(0,r.useMemo)(()=>{let t=null!==s,r="?"===g?["shift"]:[];return[{id:"help",label:f,description:"Show keyboard shortcuts",key:g,modifiers:r,action:()=>{m(e=>!e)}},{id:"check-in",label:h["check-in"].toUpperCase(),description:"Check in (focus description)",key:h["check-in"],is_available:()=>!a&&!t,action:()=>{i.current?.expand_and_focus()}},{id:"check-out",label:h["check-out"].toUpperCase(),description:"Check out",key:h["check-out"],is_available:()=>!a&&t,action:()=>{_()}},{id:"edit-entry",label:h["edit-entry"].toUpperCase(),description:"Edit active entry",key:h["edit-entry"],is_available:()=>!a&&t,action:()=>{l.current?.start_edit()}},{id:"add-note",label:h["add-note"].toUpperCase(),description:"Add note to active entry",key:h["add-note"],is_available:()=>!a&&t,action:()=>{l.current?.start_add_note()}},{id:"pomodoro",label:h.pomodoro.toUpperCase(),description:"Open Pomodoro",key:h.pomodoro,is_available:()=>!a,action:()=>{d.push("/pomodoro")}},{id:"previous-sheet",label:h["previous-sheet"],description:"Previous sheet",key:h["previous-sheet"],is_available:()=>!a&&e.length>1,action:()=>{let t=O(e,n,"previous");null!==t&&t!==n&&o(t)}},{id:"next-sheet",label:h["next-sheet"],description:"Next sheet",key:h["next-sheet"],is_available:()=>!a&&e.length>1,action:()=>{let t=O(e,n,"next");null!==t&&t!==n&&o(t)}}]},[s,l,n,i,_,a,o,d,g,f,h,e]);return((0,H.use_document_keyboard_shortcuts)(x),u)?(0,t.jsx)(U.KeyboardShortcutsDialog,{sections:(0,P.get_tracker_keyboard_shortcut_sections)(h),on_close:()=>m(!1)}):null}var J=e.i(18774),B=e.i(31113),W=e.i(72550);function Y(){try{let e=window.localStorage.getItem(W.SHEET_TAG_FILTERS_STORAGE_KEY);if(null===e)return{};let t=JSON.parse(e);if(null===t||"object"!=typeof t)return{};return t}catch{return{}}}function Q(e){let t=Y()[e]??[],n=[],r=new Set;for(let e of t)try{let t=(0,B.normalize_stored_tag)(e);r.has(t)||(r.add(t),n.push(t))}catch{continue}return n}var V=e.i(86580);function X(e){return(0,V.get_stable_sheet_tag_filter_snapshot)(e,Q(e))}function Z(){return V.EMPTY_SHEET_TAG_FILTER}var ee=e.i(98425),et=e.i(27850);function en(e,t){let n=Y();0===t.length?delete n[e]:n[e]=t;try{window.localStorage.setItem(W.SHEET_TAG_FILTERS_STORAGE_KEY,JSON.stringify(n)),(0,et.schedule_ui_preferences_cloud_sync)()}catch{}(0,ee.notify_sheet_tag_filters_subscribers)()}var er=e.i(47540),es=e.i(62796);function ea(){return(0,r.useSyncExternalStore)(es.tag_filter_mode_preference.subscribe,es.tag_filter_mode_preference.get_snapshot,es.tag_filter_mode_preference.get_server_snapshot)}function ei({sheet_name:e,sheet_tags:n}){let s=ea(),a=(0,r.useSyncExternalStore)(ee.subscribe_sheet_tag_filters,()=>X(e),Z);if((0,r.useEffect)(()=>{!function(e,t){let n=Q(e);if(0===n.length)return;let r=n.filter(e=>t.some(t=>(0,er.tags_are_equal)(e,t)));r.length!==n.length&&en(e,r)}(e,n.map(e=>e.name))},[e,n]),0===n.length)return null;let l=a.length>0;return(0,t.jsxs)("fieldset",{className:"m-0 flex flex-wrap items-center gap-x-3 gap-y-2 border-0 p-0",children:[(0,t.jsx)("legend",{className:"sr-only",children:"Filter by tag"}),(0,t.jsx)("h2",{className:"m-0 shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:"Filter by tag"}),(0,t.jsx)("p",{className:"m-0 shrink-0 text-[0.8rem] text-muted",children:"any"===s?"Show entries that include any selected tag.":"Show entries that include every selected tag."}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-0 flex-wrap justify-end gap-1",children:[n.map(n=>{let r=a.some(e=>(0,er.tags_are_equal)(e,n.name));return(0,t.jsxs)("button",{type:"button",className:`${(0,i.get_button_class_name)("ghost","small")} ${r?"border-accent-border bg-accent-soft text-foreground":""}`,"aria-pressed":r,onClick:()=>{var t;let r,s;return t=n.name,r=(0,B.normalize_stored_tag)(t),void((s=Q(e)).some(e=>(0,er.tags_are_equal)(e,r))?en(e,s.filter(e=>!(0,er.tags_are_equal)(e,r))):en(e,[...s,r]))},children:[(0,J.format_display_tag)(n.name),(0,t.jsxs)("span",{className:"ml-1 font-normal text-muted",children:["(",n.entryCount,")"]})]},n.name)}),l?(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost","small"),onClick:()=>en(e,[]),children:"Clear filter"}):null]})]})}var el=e.i(87231),eo=e.i(56586);function ec({query:e,active_sheet:r,is_pending:s=!1,on_query_change:a}){let o=e.trim(),c=(0,el.build_entry_search_href)({...(0,eo.get_empty_entry_search_filters)(),query:o,sheetName:r});return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Search entries"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)("input",{type:"search",className:(0,l.get_input_class_name)("compact"),placeholder:"Search description, tags, notes…",value:e,disabled:s,"aria-label":"Search entries on this sheet",onChange:e=>a(e.target.value)}),o.length>0?(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost","small"),disabled:s,onClick:()=>a(""),children:"Clear"}):null]})]}),o.length>0?(0,t.jsx)(n.default,{className:"self-start text-[0.8rem] font-semibold text-accent no-underline hover:underline",href:c,children:"Search all sheets with filters"}):(0,t.jsx)(n.default,{className:"self-start text-[0.8rem] font-semibold text-muted no-underline hover:text-accent hover:underline",href:"/search",children:"Open global search"})]})}var ed=e.i(41619),eu=e.i(19946),em=e.i(37399);let e_="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55";function ep({sheet_name:e,is_pending:n,can_delete:s,on_rename:a,on_delete:i}){let[l,o]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!l)return;let e=e=>{null===c.current||c.current.contains(e.target)||o(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[l]);let d=()=>{o(!1)};return(0,t.jsxs)("div",{className:"relative shrink-0 self-center",ref:c,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":`Actions for sheet ${e}`,"aria-expanded":l,"aria-haspopup":"menu",disabled:n,onClick:()=>o(e=>!e),children:(0,t.jsx)(em.HamburgerIcon,{})}),l?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:e_,role:"menuitem",disabled:n,onClick:()=>{d(),a()},children:"Rename"})}),(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${e_} text-danger`,role:"menuitem",disabled:n||!s,title:s?void 0:"Cannot delete the last sheet",onClick:()=>{d(),i()},children:"Delete sheet"})})]}):null]})}var eh=e.i(91966),eg=e.i(25204);function ef({sheets:e,db_path:n,on_select:s,on_create:a,on_rename:o,on_delete:c,is_pending:d}){let{confirm:u}=(0,eu.use_confirm_dialog)(),m=(0,eh.use_confirm_destructive_actions)(),_=e.length>1,[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),[x,b]=(0,r.useState)(null),[y,v]=(0,r.useState)(""),k=()=>{h(!1),f("")},w=()=>{b(null),v("")};(0,eg.use_escape_to_cancel)(w,null!==x),(0,eg.use_escape_to_cancel)(k,p);let N=e=>{if(e.preventDefault(),null===x)return;let t=y.trim();0===t.length||t===x||o(x,t),w()};return(0,t.jsxs)("aside",{className:"flex min-w-0 flex-col gap-3 max-[860px]:min-w-0",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheets"}),(0,t.jsx)("ul",{className:"m-0 flex min-h-0 flex-1 list-none flex-col gap-1.5 p-0",children:e.map(e=>(0,t.jsx)("li",{className:"min-w-0",children:x===e.name?(0,t.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-1.5",onSubmit:N,children:[(0,t.jsx)("input",{className:(0,l.get_input_class_name)("compact"),value:y,onChange:e=>v(e.target.value),disabled:d,autoFocus:!0}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)("button",{type:"submit",className:`${(0,i.get_button_class_name)("ghost")} flex-1`,disabled:d||0===y.trim().length,children:"Save"}),(0,t.jsx)("button",{type:"button",className:`${(0,i.get_button_class_name)("ghost")} flex-1`,disabled:d,onClick:w,children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"flex min-w-0 items-stretch gap-1",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 cursor-pointer items-center justify-between gap-2 rounded-md border border-transparent bg-transparent px-2.5 py-2 text-left transition-[background-color,color] duration-150 hover:bg-surface-hover",disabled:d&&!e.isActive,onClick:()=>s(e.name),children:[(0,t.jsx)("span",{className:`min-w-0 flex-1 truncate font-semibold ${e.isActive||e.hasActiveEntry?"text-accent":""}`,children:e.name}),(0,t.jsx)("span",{className:`shrink-0 text-xs whitespace-nowrap ${e.hasActiveEntry?"text-accent":"text-muted"}`,children:e.hasActiveEntry?"● active":`${e.entryCount} entries`})]}),(0,t.jsx)(ep,{sheet_name:e.name,is_pending:d,can_delete:_,on_rename:()=>{var t;b(t=e.name),v(t)},on_delete:async()=>{var t,n,r;let s;(!m||await u((t=e.name,n=e.entryCount,r=e.hasActiveEntry,s=0===n?"":` This will delete ${n} ${1===n?"entry":"entries"}.`,{title:"Delete sheet?",message:`Delete "${t}"?${s}${r?" This will stop the active timer.":""}`,confirmLabel:"Delete sheet",variant:"danger"})))&&c(e.name)}})]})},e.name))}),p?(0,t.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-2",onSubmit:e=>{e.preventDefault();let t=g.trim();0!==t.length&&(a(t),k())},children:[(0,t.jsx)("input",{className:(0,l.get_input_class_name)("compact"),value:g,onChange:e=>f(e.target.value),placeholder:"New sheet name",disabled:d,autoFocus:!0}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)("button",{type:"submit",className:`${(0,i.get_button_class_name)("ghost")} flex-1`,disabled:d||0===g.trim().length,children:"Add"}),(0,t.jsx)("button",{type:"button",className:`${(0,i.get_button_class_name)("ghost")} flex-1`,disabled:d,onClick:k,children:"Cancel"})]})]}):(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:d,onClick:()=>h(!0),children:"Add sheet"}),(0,t.jsx)("p",{className:"mt-auto shrink-0 overflow-wrap-anywhere border-t border-panel-border pt-3 font-mono text-[0.65rem] leading-snug text-muted",title:n,children:n})]})}var ex=e.i(60935);function eb(){return"true"===(0,r.useSyncExternalStore)(ex.timer_show_seconds_preference.subscribe,ex.timer_show_seconds_preference.get_snapshot,ex.timer_show_seconds_preference.get_server_snapshot)}function ey({entry:e,in_bar:n,is_pending:s,initial_at:a,on_cancel:o,on_submit:c}){let d=(0,D.use_duration_format)(),u=eb(),[m,_]=(0,r.useState)(()=>Date.now()-new Date(e.start).getTime()),[p,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(a??""),x=(0,r.useRef)(null);(0,eg.use_escape_to_cancel)(o),(0,r.useEffect)(()=>{x.current?.focus()},[]),(0,r.useEffect)(()=>{_(Date.now()-new Date(e.start).getTime());let t=globalThis.setInterval(()=>{_(Date.now()-new Date(e.start).getTime())},1e3);return()=>globalThis.clearInterval(t)},[e.start]);let b=(0,y.format_duration)(m,d,u),v=e.description||"Untitled entry";return(0,t.jsxs)("form",{className:"flex min-w-0 flex-col gap-4","aria-label":"Check out form",onSubmit:e=>{e.preventDefault();let t=p.trim(),n=g.trim(),r=t.length>0,s=n.length>0;r||s?c({...s?{at:n}:{},...r?{note:t}:{}}):c(void 0)},children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.68rem] font-bold uppercase leading-none tracking-wider text-danger",children:"Checking out"}),(0,t.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.05rem] font-[650] leading-tight tracking-tight min-[560px]:text-[1.15rem]",children:v})]}),(0,t.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.4rem] font-medium leading-none tracking-tight text-accent min-[560px]:text-[1.6rem]",children:b})]}),e.tags.length>0?(0,t.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:e.tags.map(e=>(0,t.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-[0.72rem] text-tag-text",children:(0,J.format_display_tag)(e)},e))}):null,(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 min-[640px]:grid-cols-[minmax(0,1fr)_minmax(10rem,14rem)]",children:[(0,t.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-note",children:[(0,t.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["Note ",(0,t.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,t.jsx)("input",{ref:x,id:"checkout-note",className:(0,l.get_input_class_name)("compact"),value:p,onChange:e=>h(e.target.value),placeholder:"Wrap-up, blockers, next steps…",disabled:s})]}),(0,t.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-at",children:[(0,t.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["End time ",(0,t.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,t.jsx)("input",{id:"checkout-at",className:(0,l.get_input_class_name)("compact"),value:g,onChange:e=>f(e.target.value),placeholder:"e.g. now, 30 minutes ago, 5:30pm",disabled:s})]})]}),(0,t.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${n?"":"pt-1"}`,children:[(0,t.jsx)("button",{type:"submit",className:(0,i.get_button_class_name)("danger-solid"),disabled:s,children:"Confirm check out"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:s,onClick:o,children:"Cancel"})]})]})}function ev(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",role:"presentation","aria-hidden":"true",focusable:"false",children:(0,t.jsx)("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7L12 3zM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14zM5 15l.9 2.1L8 18l-2.1.9L5 21l-.9-2.1L2 18l2.1-.9L5 15z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}var ek=e.i(44356);function ew({entry:e,known_tags:n,is_pending:l,on_save:m,on_cancel:p}){let h=(0,r.useMemo)(()=>(0,ek.build_resume_description)(e.description,e.tags),[e.description,e.tags]),[g,f]=(0,r.useState)(h),[x,b]=(0,r.useState)(!1),[y,v]=(0,r.useState)(null),k=(0,r.useSyncExternalStore)(c.entry_suggestion_provider_preference.subscribe,c.entry_suggestion_provider_preference.get_snapshot,c.entry_suggestion_provider_preference.get_server_snapshot),w=(0,r.useSyncExternalStore)(u.openai_api_key_preference.subscribe,u.openai_api_key_preference.get_snapshot,u.openai_api_key_preference.get_server_snapshot),N=(0,r.useSyncExternalStore)(o.claude_api_key_preference.subscribe,o.claude_api_key_preference.get_snapshot,o.claude_api_key_preference.get_server_snapshot),j=(0,r.useSyncExternalStore)(d.google_ai_api_key_preference.subscribe,d.google_ai_api_key_preference.get_snapshot,d.google_ai_api_key_preference.get_server_snapshot),S=(0,a.get_api_key_for_suggestion_provider)(k,{openai:w,claude:N,google_ai:j}),E="none"!==k&&S.trim().length>0;(0,r.useEffect)(()=>{f((0,ek.build_resume_description)(e.description,e.tags))},[e.description,e.id,e.sheetName,e.tags]),(0,eg.use_escape_to_cancel)(p);let C=async()=>{if(E){b(!0),v(null);try{let t=e.notes.map(e=>e.text).join("\n"),n=await (0,_.request_ai_entry_description_suggestion)({provider:k,api_key:S,context:g,notes:t});f(n)}catch(e){v(e instanceof Error?e.message:String(e))}finally{b(!1)}}};return(0,t.jsxs)("form",{className:"flex min-w-0 flex-1 flex-col gap-2",onSubmit:e=>{e.preventDefault();let t=g.trim();t===h.trim()?p():m(t)},children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2 max-[700px]:flex-col",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(s.TagAutocompleteInput,{id:`active-entry-description-${e.id}`,value:g,known_tags:n,placeholder:"e.g. crafting something @design",disabled:l,autoFocus:!0,on_change:f})}),(0,t.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2 max-[700px]:w-full",children:[E?(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost","small"),disabled:l||x,title:"Revise description with AI","aria-label":"Revise description with AI",onClick:()=>void C(),children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(ev,{}),x?"Revising…":"Revise with AI"]})}):null,(0,t.jsx)("button",{type:"submit",className:(0,i.get_button_class_name)("primary","small"),disabled:l||g.trim()===h.trim(),children:"Save"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost","small"),disabled:l,onClick:p,children:"Cancel"})]})]}),null===y?null:(0,t.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:y})]})}var eN=e.i(50459);let ej=`${(0,i.get_button_class_name)("danger-solid")} rounded-none first:rounded-l-[0.65rem] last:rounded-r-[0.65rem] not-first:-ml-px not-first:min-w-12 not-first:border-l not-first:border-l-[color-mix(in_srgb,#ffffff_30%,var(--danger-solid))] min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1 max-[560px]:basis-1/2`;function eS({in_bar:e=!1,is_pending:n,on_start_checkout:r}){return(0,t.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${e?"max-[560px]:w-full":"min-w-30 max-[560px]:w-full"}`,children:[(0,t.jsx)("button",{type:"button",className:ej,disabled:n,onClick:()=>r(),children:"Check out"}),(0,t.jsx)("button",{type:"button",className:ej,disabled:n,title:"Check out at a specific time",onClick:()=>{let e=(0,eN.prompt_check_out_at)();null!==e&&r(e)},children:"@"})]})}var eE=e.i(28098),eC=e.i(7568),eT=e.i(4903);function e$({on_submit:e,on_cancel:n,is_pending:s,in_active_panel:a=!1,in_bar:o=!1,allow_at:c=!1}){let[d,u]=(0,r.useState)(""),[m,_]=(0,r.useState)("");return(0,eg.use_escape_to_cancel)(()=>n?.(),void 0!==n),(0,t.jsxs)("form",{className:`flex flex-col gap-2 ${a&&!o?"border-t border-accent-border pt-4":o?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:t=>{t.preventDefault();let n=d.trim();if(0===n.length)return;let r=m.trim();e(n,r.length>0?r:void 0),u(""),_("")},children:[(0,t.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-text",children:"Add note"}),(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2 max-[860px]:grid-cols-1",children:[(0,t.jsx)("input",{id:"note-text",className:(0,l.get_input_class_name)(),value:d,onChange:e=>u(e.target.value),placeholder:"Pair with alice on the widget",disabled:s,autoFocus:!0}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-[860px]:w-full",children:[(0,t.jsx)("button",{type:"submit",className:(0,i.get_button_class_name)("ghost"),disabled:s||0===d.trim().length,children:"Save note"}),void 0===n?null:(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:s,onClick:n,children:"Cancel"})]})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-at",children:["Note time"," ",(0,t.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,t.jsx)("input",{id:"note-at",className:(0,l.get_input_class_name)(),value:m,onChange:e=>_(e.target.value),placeholder:"e.g. 30 minutes ago",disabled:s})]}):null]})}var eI=e.i(34937),eM=e.i(76379),eD=e.i(7554),eL=e.i(27707);let eA=(0,r.forwardRef)(function({entry:e,sheets:n,known_tags:s,in_bar:a=!1,on_check_out:l,on_delete:o,on_edit:c,on_move:d,on_add_note:u,on_edit_note:m,on_delete_note:_,is_pending:p},h){var g;let f,{confirm:x}=(0,eu.use_confirm_dialog)(),b=(0,eh.use_confirm_destructive_actions)(),v=(0,eM.use_confirm_before_checkout)(),k=(0,D.use_duration_format)(),w=eb(),[N,j]=(0,r.useState)(e.durationMs),[S,E]=(0,r.useState)(!1),[C,T]=(0,r.useState)(!1),[$,I]=(0,r.useState)(!1),[M,L]=(0,r.useState)(!1),[A,R]=(0,r.useState)(void 0);(0,r.useImperativeHandle)(h,()=>({start_edit:()=>{S||C||M||E(!0)},start_add_note:()=>{S||C||$||M||I(!0)}}),[$,S,C,M]),(0,r.useEffect)(()=>{I(!1),E(!1),T(!1),L(!1),R(void 0)},[e.id,e.sheetName]),(0,r.useEffect)(()=>{j(e.durationMs);let t=globalThis.setInterval(()=>{j(Date.now()-new Date(e.start).getTime())},1e3);return()=>globalThis.clearInterval(t)},[e.durationMs,e.start]);let F=()=>{L(!1),R(void 0)},U=async e=>{(!v||await x((0,eD.get_check_out_confirm_dialog)(e)))&&(l(e),F())},O=(g=S||C||M,f="flex flex-col gap-4 rounded-lg border border-accent-border p-[1.1rem] shadow-sm",a?g?`${f} rounded-md border border-accent-border bg-[color-mix(in_srgb,var(--panel)_70%,var(--background))] p-3.5`:"flex flex-col gap-3 border-0 bg-transparent p-0 shadow-none":`${f} bg-[image:var(--active-panel-bg)]`),P=async t=>{let n,r,s=e.notes.find(e=>e.timestamp===t);(!b||await x({title:"Delete note?",message:(r=(n=(s?.text??"").trim()).length>80?`${n.slice(0,80)}…`:n).length>0?`Remove this note? "${r}"`:"Remove this note?",confirmLabel:"Delete",variant:"danger"}))&&_(t)},q=(0,t.jsx)(eE.EntryActionsMenu,{current_sheet_name:e.sheetName,sheets:n,is_pending:p,on_edit:()=>T(!0),on_show_add_note_form:()=>I(!0),on_move:d,on_delete:async()=>{(!b||await x((0,eL.get_delete_entry_confirm_dialog)(e)))&&o()}});return M?(0,t.jsx)("section",{className:O,"aria-label":"Check out active entry",children:(0,t.jsx)(ey,{entry:e,in_bar:a,is_pending:p,initial_at:A,on_cancel:F,on_submit:e=>{U(e)}})}):C?(0,t.jsx)("section",{className:O,children:(0,t.jsx)(eC.EntryEditForm,{entry:e,known_tags:s,is_pending:p,in_active_panel:!0,times_only:!0,start_only:!0,on_cancel:()=>T(!1),on_save:e=>{c(e),T(!1)}})}):(0,t.jsxs)("section",{className:O,children:[(0,t.jsxs)("div",{className:"flex min-w-0 shrink-0 items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[a?null:(0,t.jsx)("span",{className:"self-start rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),S?(0,t.jsx)(ew,{entry:e,known_tags:s,is_pending:p,on_cancel:()=>E(!1),on_save:e=>{c({description:e}),E(!1)}}):(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,t.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.12rem] font-[650] leading-tight tracking-tight min-[560px]:text-xl",children:e.description||"Untitled entry"}),(0,t.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Edit description",title:"Edit description",disabled:p||$,onClick:()=>E(!0),children:(0,t.jsx)(eI.PencilIcon,{})})]})]}),a?null:(0,t.jsx)("div",{className:"max-[560px]:self-end",children:q})]}),(0,t.jsxs)("div",{className:`flex shrink-0 items-end justify-between gap-4 max-[860px]:flex-col max-[860px]:items-stretch ${a?"px-3":""}`,children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.65rem] font-medium leading-none tracking-tight text-accent min-[440px]:text-[1.85rem] min-[560px]:text-[2rem]",children:(0,y.format_duration)(N,k,w)}),S||0===e.tags.length?null:(0,t.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:e.tags.map(e=>(0,t.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,J.format_display_tag)(e)},e))})]}),(0,t.jsxs)("div",{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2 max-[560px]:flex-col max-[560px]:items-stretch ${a?"w-full":"min-w-30 max-[860px]:w-full max-[860px]:justify-stretch"}`,children:[$?null:(0,t.jsx)("button",{type:"button",className:`${(0,i.get_button_class_name)("ghost")} min-w-0 min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1`,disabled:p||S,onClick:()=>I(!0),children:"Add note"}),(0,t.jsx)(eS,{in_bar:a,is_pending:p,on_start_checkout:e=>{p||(E(!1),T(!1),I(!1),R(e),L(!0))}})]})]}),(0,t.jsx)(eT.EntryNotesList,{notes:e.notes,variant:"panel",in_bar:a,is_pending:p,on_edit_note:m,on_delete_note:P}),$?(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(e$,{in_active_panel:!0,in_bar:a,allow_at:!0,is_pending:p,on_cancel:()=>I(!1),on_submit:(e,t)=>{u(e,t),I(!1)}})}):null]})});var eR=e.i(15526);let eF=(0,r.forwardRef)(function({active_entry:e,sheets:n,known_tags:s,is_pending:a,on_check_out:i,on_delete:l,on_edit:o,on_move:c,on_add_note:d,on_edit_note:u,on_delete_note:m},_){let{confirm:p}=(0,eu.use_confirm_dialog)(),h=(0,eh.use_confirm_destructive_actions)(),g=(0,r.useRef)(null);return((0,r.useImperativeHandle)(_,()=>({start_edit:()=>{g.current?.start_edit()},start_add_note:()=>{g.current?.start_add_note()}})),null===e)?null:(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted whitespace-nowrap truncate",children:["Sheet ",e.sheetName]}),(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),(0,eR.is_pomodoro_task_entry)(e)?(0,t.jsx)("span",{className:"shrink-0 rounded-full border border-panel-border bg-surface-raised px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-foreground",children:"Pomodoro"}):null,(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(eE.EntryActionsMenu,{current_sheet_name:e.sheetName,sheets:n,is_pending:a,on_edit:()=>g.current?.start_edit(),on_show_add_note_form:()=>g.current?.start_add_note(),on_move:c,on_delete:async()=>{(!h||await p((0,eL.get_delete_entry_confirm_dialog)(e)))&&l()}})})]}),(0,t.jsx)(eA,{ref:g,entry:e,sheets:n,known_tags:s,in_bar:!0,is_pending:a,on_check_out:i,on_delete:l,on_edit:o,on_move:c,on_add_note:d,on_edit_note:u,on_delete_note:m},`${e.sheetName}-${e.id}`)]})});var eU=e.i(16967);let eO="super-time-tracker";function eP({active_entry:e}){let t="true"===(0,r.useSyncExternalStore)(eU.timer_in_title_preference.subscribe,eU.timer_in_title_preference.get_snapshot,eU.timer_in_title_preference.get_server_snapshot),n=(0,D.use_duration_format)(),s=eb(),[a,i]=(0,r.useState)(e?.durationMs??0);return(0,r.useEffect)(()=>{if(null===e)return void i(0);i(e.durationMs);let t=window.setInterval(()=>{i(Date.now()-new Date(e.start).getTime())},1e3);return()=>window.clearInterval(t)},[e]),(0,r.useEffect)(()=>{if(!t||null===e){document.title=eO;return}let r=e.description.trim()||"Tracking",i=(0,y.format_duration)(a,n,s);return document.title=`${i} — ${r}`,()=>{document.title=eO}},[e,n,a,s,t]),null}var eq=e.i(75404),ez=e.i(36178),eG=e.i(68713);function eH(e){return`${e.sheetName}:${e.id}`}var eK=e.i(67999),eJ=e.i(85323),eB=e.i(76709),eW=e.i(17857),eY=e.i(3159),eQ=e.i(51229),eV=e.i(17003);function eX(e){let t=e.activeSheetName;null!==t&&(0,eV.write_active_sheet_preference)(t)}var eZ=e.i(65742),e0=e.i(48541),e1=e.i(20397);e.s(["TrackerApp",0,function({initial_state:e}){let[s,a]=(0,r.useState)(e),[l,o]=(0,r.useState)(null),[c,d]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!1),[_,p]=(0,r.useState)(""),h=(0,r.useRef)(e);(0,r.useEffect)(()=>{eX(e)},[e]);let g=async e=>{d(!0),o(null);try{let t=await e(),n=null!==s.activeEntry&&null===t.activeEntry,r=s.runningEntry,i=t.runningEntry;if(eX(t),a(t),n&&(0,eG.finish_running_pomodoro_timer)(),!k)return;if(null===r&&null!==i)return void(0,eJ.notify_desktop)({title:"Tracking started",body:`${i.description||"Untitled entry"} (${i.sheetName})`,tag:"tracker-running-entry"});if(null!==r&&null===i)return void(0,eJ.notify_desktop)({title:"Tracking stopped",body:`${r.description||"Untitled entry"} (${r.sheetName})`,tag:"tracker-running-entry"});null!==r&&null!==i&&eH(r)!==eH(i)&&(0,eJ.notify_desktop)({title:"Tracking switched",body:`${i.description||"Untitled entry"} (${i.sheetName})`,tag:"tracker-running-entry"})}catch(e){o(e instanceof Error?e.message:String(e))}finally{d(!1)}},b=s.activeSheetName??s.sheets.find(e=>e.isActive)?.name??"main",y=ea(),v=(0,e1.use_entry_list_sort)(),k="true"===(0,r.useSyncExternalStore)(e0.desktop_notifications_preference.subscribe,e0.desktop_notifications_preference.get_snapshot,e0.desktop_notifications_preference.get_server_snapshot),w="true"===(0,r.useSyncExternalStore)(eZ.clear_tag_filters_on_sheet_change_preference.subscribe,eZ.clear_tag_filters_on_sheet_change_preference.get_snapshot,eZ.clear_tag_filters_on_sheet_change_preference.get_server_snapshot),N=(0,r.useRef)(null),j=(0,r.useRef)(null),S=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!w||null===N.current||N.current===b){N.current=b;return}en(b,[]),N.current=b},[b,w]),(0,r.useEffect)(()=>{p("")},[b]);let E=(0,r.useSyncExternalStore)(ee.subscribe_sheet_tag_filters,()=>X(b),Z),C=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let n of e){let e=new Set;for(let r of n.tags)try{let n=(0,B.normalize_stored_tag)(r);if(e.has(n))continue;e.add(n),t.set(n,(t.get(n)??0)+1)}catch{continue}}return[...t.entries()].map(([e,t])=>({name:e,entryCount:t})).sort((e,t)=>e.name.localeCompare(t.name))})(s.activeSheetEntries),[s.activeSheetEntries]),T=(0,r.useMemo)(()=>{var e;let t;if(u)return[];let n=[...(e=function(e,t,n="all"){return 0===t.length?e:e.filter(e=>(function(e,t,n="all"){return 0===t.length||("any"===n?t.some(t=>e.tags.some(e=>(0,er.tags_are_equal)(e,t))):t.every(t=>e.tags.some(e=>(0,er.tags_are_equal)(e,t))))})(e,t,n))}(s.activeSheetEntries,E,y),0===(t=_.trim()).length?e:e.filter(e=>(function(e,t){let n=t.trim().toLowerCase();if(0===n.length)return{matches:!0,noteSnippet:null};let r=e.description.toLowerCase().includes(n),s=e.sheetName.toLowerCase().includes(n),a=e.tags.some(e=>e.toLowerCase().includes(n));if(r||s||a)return{matches:!0,noteSnippet:null};for(let t of e.noteTexts)if(t.toLowerCase().includes(n))return{matches:!0,noteSnippet:function(e,t){let n=e.toLowerCase().indexOf(t);if(n<0)return e.slice(0,120);let r=Math.max(0,n-40),s=Math.min(e.length,n+t.length+40),a=r>0?"…":"",i=s<e.length?"…":"";return`${a}${e.slice(r,s)}${i}`}(t,n)};return{matches:!1,noteSnippet:null}})({sheetName:e.sheetName,description:e.description,tags:e.tags,noteTexts:e.notes.map(e=>e.text)},t).matches))];switch(v){case"oldest":return n.sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());case"duration":return n.sort((e,t)=>t.durationMs-e.durationMs);case"description":return n.sort((e,t)=>{let n=e.description.trim()||"Untitled entry",r=t.description.trim()||"Untitled entry";return n.localeCompare(r)});default:return n.sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime())}},[s.activeSheetEntries,E,y,v,_,u]),$=(0,r.useMemo)(()=>(0,eK.get_serialized_entries_total_ms)(T),[T]);(0,r.useEffect)(()=>(0,eB.subscribe_tracker_state_sync)(()=>{c||u||fetch("/api/state").then(async e=>{if(!e.ok)throw Error("Failed to refresh tracker state");return await e.json()}).then(e=>{eX(e),a(t=>(null===t.activeEntry?null:`${t.activeEntry.sheetName}:${t.activeEntry.id}`)===(null===e.activeEntry?null:`${e.activeEntry.sheetName}:${e.activeEntry.id}`)?t:e)}).catch(()=>{})}),[c,u]);let I=u?`Loading entries for "${b}"…`:_.trim().length>0?E.length>0?`No entries on sheet "${b}" match your search and selected tags.`:`No entries on sheet "${b}" match your search.`:E.length>0?"any"===y?`No entries on sheet "${b}" match any selected tag.`:`No entries on sheet "${b}" match all selected tags.`:`No entries on sheet "${b}".`,M=e=>{let t;if(e===b&&!u)return;h.current=s;let n=(t=s.runningEntries.find(t=>t.sheetName===e)??null,{...s,activeSheetName:e,sheets:s.sheets.map(t=>({...t,isActive:t.name===e})),activeEntry:t,activeSheetEntries:s.activeSheetEntries,activeSheetTotalMs:s.activeSheetTotalMs});eX(n),a(n),m(!0),o(null),(0,eQ.post_tracker_action)("/api/sheet",{name:e}).then(e=>{eX(e),a(e)}).catch(e=>{o(e instanceof Error?e.message:String(e)),a(h.current)}).finally(()=>{m(!1)})},D=(e,t,n)=>(0,eY.patch_tracker_action)("/api/entry",{sheetName:e,entryId:t,...n});return(0,t.jsxs)(x.ConfirmDialogProvider,{children:[(0,t.jsx)(eP,{active_entry:s.activeEntry}),(0,t.jsx)(K,{sheets:s.sheets,active_sheet_name:b,active_entry:s.activeEntry,is_pending:c,check_in_form_ref:j,active_entry_panel_ref:S,on_select_sheet:M,on_check_out:e=>g(()=>(0,eQ.post_tracker_action)("/api/out",(0,ez.build_check_out_request_payload)(b,e)))}),(0,t.jsx)("div",{className:"relative z-1",children:(0,t.jsx)(eq.TrackerTopbar,{})}),(0,t.jsxs)("div",{className:"mx-auto max-w-[1120px] px-4 pb-10 pt-4 sm:px-5 sm:pt-5",children:[null!==l?(0,t.jsx)("p",{className:"mb-4 border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text",children:l}):null,(0,t.jsx)(L,{has_running_timer:null!==s.runningEntry,on_check_in_shortcut:()=>{j.current?.expand_and_focus()}}),(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(14rem,18rem)_minmax(0,1fr)] items-stretch border border-panel-border bg-panel shadow-sm max-[960px]:grid-cols-1",children:[(0,t.jsx)("div",{className:"flex min-h-0 min-w-0 flex-col border-r border-panel-border p-4 max-[860px]:border-r-0 max-[860px]:border-b",children:(0,t.jsx)(ef,{sheets:s.sheets,db_path:s.dbPath,is_pending:c,on_select:M,on_create:e=>g(()=>(0,eQ.post_tracker_action)("/api/sheet",{name:e})),on_rename:(e,t)=>g(()=>(0,eY.patch_tracker_action)("/api/sheet",{name:e,newName:t})),on_delete:e=>g(()=>(0,eQ.post_tracker_action)("/api/sheet",{name:e,delete:!0}))})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,t.jsxs)("section",{className:"flex min-w-0 flex-col gap-4 border-b border-panel-border border-l-4 border-l-accent p-4",children:[null===s.activeEntry?(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-panel-border bg-background px-3 py-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Quick action"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.9rem] font-medium",children:"Jump into Pomodoro without leaving the tracker."})]}),(0,t.jsxs)(n.default,{href:"/pomodoro",className:`${(0,i.get_button_class_name)("primary")} inline-flex min-w-40 flex-col items-center justify-center whitespace-nowrap text-center`,"aria-label":"Open Pomodoro timer",children:[(0,t.jsx)("span",{className:"text-white text-[0.9rem] leading-none",children:"Start Pomodoro"}),(0,t.jsx)("span",{className:"text-white mt-1 text-[0.72rem] font-medium leading-none opacity-85",children:"Focus timer"})]})]}):null,(0,t.jsx)(eF,{ref:S,active_entry:s.activeEntry,sheets:s.sheets,known_tags:s.knownTags,is_pending:c,on_check_out:e=>g(()=>(0,eQ.post_tracker_action)("/api/out",(0,ez.build_check_out_request_payload)(b,e))),on_delete:()=>g(()=>(0,eQ.post_tracker_action)("/api/entry",{sheetName:b,entryId:s.activeEntry?.id})),on_edit:e=>g(()=>D(b,s.activeEntry?.id??0,e)),on_move:e=>g(()=>(0,eQ.post_tracker_action)("/api/entry/move",{sheetName:b,entryId:s.activeEntry?.id,targetSheetName:e})),on_add_note:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/note",{text:e,...void 0!==t?{at:t}:{},sheetName:b,entryId:s.activeEntry?.id})),on_edit_note:(e,t)=>g(()=>(0,eY.patch_tracker_action)("/api/note",{sheetName:b,entryId:s.activeEntry?.id,timestamp:e,text:t})),on_delete_note:e=>g(()=>(0,eW.delete_tracker_action)("/api/note",{sheetName:b,entryId:s.activeEntry?.id,timestamp:e}))}),null===s.activeEntry?(0,t.jsx)(f,{ref:j,known_tags:s.knownTags,is_pending:c,trailing:(0,t.jsx)("p",{className:"m-0 text-[0.85rem] leading-tight text-muted",children:"Not tracking"}),on_submit:e=>g(()=>(0,eQ.post_tracker_action)("/api/in",{...e,sheetName:b}))}):null]}),(0,t.jsx)("section",{className:"flex min-w-0 flex-col gap-4 p-4",children:(0,t.jsx)(ed.EntryList,{title:"Entries",entries:T,merge_context_entries:s.activeSheetEntries,sheets:s.sheets,known_tags:s.knownTags,total_ms:$,empty_message:I,is_pending:c,show_sheet_name:!1,header_extra:(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsx)(ec,{query:_,active_sheet:b,is_pending:c,on_query_change:p}),(0,t.jsx)(ei,{sheet_name:b,sheet_tags:C})]}),on_delete:e=>g(()=>(0,eQ.post_tracker_action)("/api/entry",{sheetName:e.sheetName,entryId:e.id})),on_edit:(e,t)=>g(()=>D(e.sheetName,e.id,t)),on_move:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/entry/move",{sheetName:e.sheetName,entryId:e.id,targetSheetName:t})),on_move_many:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/entry/move-bulk",{entries:e.map(e=>({sheetName:e.sheetName,entryId:e.id})),targetSheetName:t})),on_delete_many:e=>g(()=>(0,eQ.post_tracker_action)("/api/entry/delete-bulk",{entries:e.map(e=>({sheetName:e.sheetName,entryId:e.id}))})),on_edit_note:(e,t,n)=>g(()=>(0,eY.patch_tracker_action)("/api/note",{sheetName:e.sheetName,entryId:e.id,timestamp:t,text:n})),on_add_note:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/note",{sheetName:e.sheetName,entryId:e.id,text:t})),on_resume:e=>g(()=>(0,eQ.post_tracker_action)("/api/in",{description:(0,ek.build_resume_description)(e.description,e.tags),sheetName:e.sheetName})),on_split:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/entry/split",{sheetName:e.sheetName,entryId:e.id,at:t})),on_merge:(e,t)=>g(()=>(0,eQ.post_tracker_action)("/api/entry/merge",{sheetName:e.sheetName,entryId:e.id,direction:t}))})})]})]})]})]})}],22482)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19946,e=>{"use strict";var t=e.i(29158),r=e.i(72270),n=e.i(4572);e.s(["use_confirm_dialog",0,function(){let e=(0,t.useContext)(r.ConfirmDialogContext);if(null!==e)return e;let s=(0,n.get_registered_confirm_dialog)();if(null!==s)return{confirm:s};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),l=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",o=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),o&&"object"==typeof o&&(o=String(a.urlQueryToSearchParams(o)));let u=e.search||o&&`?${o}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||l.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${i}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return _}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),l=e.r(54710),i=a._(e.r(29158)),o=e.r(42552),c=e.r(61717),u=e.r(37879),d=e.r(31047),h=e.r(20321);e.r(90503);let f=e.r(38520),m=e.r(19947),p=e.r(59246),g=e.r(99046);function b(t){var r,n;let s,a,b,[_,y]=(0,i.useOptimistic)(m.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:j,as:w,children:k,prefetch:N=null,passHref:S,replace:C,shallow:P,scroll:E,onClick:T,onMouseEnter:L,onTouchStart:O,legacyBehavior:A=!1,onNavigate:R,transitionTypes:M,ref:W,unstable_dynamicOnHover:D,...$}=t;s=k,A&&("string"==typeof s||"number"==typeof s)&&(s=(0,l.jsx)("a",{children:s}));let U=i.default.useContext(c.AppRouterContext),I=!1!==N,q=!1!==N?null===(n=N)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(r=w||j)?r:(0,o.formatUrl)(r);if(A){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(s)}let K=A?a&&"object"==typeof a&&a.ref:W,F=i.default.useCallback(e=>(null!==U&&(v.current=(0,m.mountLinkInstance)(e,B,U,q,I,y)),()=>{v.current&&((0,m.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,m.unmountPrefetchableInstance)(e)}),[I,B,U,q,y]),z={ref:(0,u.useMergedRef)(F,K),onClick(t){A||"function"!=typeof T||T(t),A&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,s,a,l,o){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,n.current,o)})}}(t,B,v,C,E,R,M)},onMouseEnter(e){A||"function"!=typeof L||L(e),A&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),U&&I&&(0,m.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){A||"function"!=typeof O||O(e),A&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),U&&I&&(0,m.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,d.isAbsoluteUrl)(B)?z.href=B:A&&!S&&("a"!==a.type||"href"in a.props)||(z.href=(0,h.addBasePath)(B)),b=A?i.default.cloneElement(a,z):(0,l.jsx)("a",{...$,...z,children:s}),(0,l.jsx)(x.Provider,{value:_,children:b})}e.r(10364);let x=(0,i.createContext)(m.IDLE_LINK_STATUS),_=()=>(0,i.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},90463,e=>{"use strict";e.s(["build_auth_page_href",0,function(e,t){let r="sign_in"===e?"/login":"/register",n=t.trim();return 0===n.length||"/"===n?r:`${r}?next=${encodeURIComponent(n)}`}])},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[l,i]=(0,r.useState)(null),[o,c]=(0,r.useState)(!1),u=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!u)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:l,is_pending:o,sign_out:(0,r.useCallback)(async()=>{c(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var l=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,l.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},73205,2268,76003,38240,e=>{"use strict";let t=new Set(e.i(22373).topbar_quick_action_ids),r=["today","search","reporting","pomodoro"];e.s(["parse_topbar_quick_actions",0,function(e){try{let n=JSON.parse(e);if(!Array.isArray(n))return r;let s=n.filter(e=>"string"==typeof e&&t.has(e));return Array.from(new Set(s))}catch{return r}}],73205);var n=e.i(34869),s=e.i(92629);let a=(0,n.create_ui_preference_store)({storage_key:s.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:s.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function l(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,a],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return l()}],76003);var i=e.i(17798),o=e.i(46549),c=e.i(10464),u=e.i(35434),d=e.i(61834),h=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===l()?"light":"dark";(0,i.apply_theme)(e),(0,h.write_stored_theme)(e),c.theme_mode_preference.write(e),(0,d.write_document_preference_cookies)({theme_mode:e,theme:e}),c.theme_mode_preference.notify(),(0,u.notify_theme_subscribers)(),(0,o.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,76080,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),l=e.i(90463),i=e.i(46549),o=e.i(73205),c=e.i(66295),u=e.i(2268),d=e.i(32792),h=e.i(90299),f=e.i(28274),m=e.i(76003),p=e.i(35434),g=e.i(38240),b=e.i(22373),x=e.i(25204),_=e.i(77882);let y="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit no-underline hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55",v={today:{href:"/today",label:"Today"},search:{href:"/search",label:"Search"},sheets:{href:"/sheets",label:"Sheets"},reporting:{href:"/reporting",label:"Reporting"},pomodoro:{href:"/pomodoro",label:"Pomodoro"},"manage-tags":{href:"/settings/tags",label:"Manage tags"},"sync-settings":{href:"/settings/cloud-sync",label:"Sync settings"}},j=new Set(["manage-tags","pomodoro","sync-settings"]);e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),w=(0,n.usePathname)()??"/",k=(0,s.useSyncExternalStore)(p.subscribe_theme,m.get_theme_snapshot,m.get_theme_server_snapshot),N=(0,s.useSyncExternalStore)(u.cloud_sync_enabled_preference.subscribe,u.cloud_sync_enabled_preference.get_snapshot,u.cloud_sync_enabled_preference.get_server_snapshot),S=(0,s.useSyncExternalStore)(h.tracker_shortcut_map_preference.subscribe,h.tracker_shortcut_map_preference.get_snapshot,h.tracker_shortcut_map_preference.get_server_snapshot),C=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),P=(0,c.parse_tracker_shortcut_map)(S),E=new Set((0,o.parse_topbar_quick_actions)(C)),T=b.topbar_quick_action_ids.filter(e=>!E.has(e)),L=Array.from(new Set([...Array.from(j),...T])),{email:O,is_configured:A,is_pending:R,sign_out:M}=(0,_.use_supabase_auth_session)(),[W,D]=(0,s.useState)(!1),$=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!W)return;let e=e=>{null===$.current||$.current.contains(e.target)||D(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[W]);let U=()=>{D(!1)};return(0,x.use_escape_to_cancel)(U,W),(0,t.jsxs)("div",{className:"relative shrink-0",ref:$,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","aria-label":"Open menu","aria-expanded":W,"aria-haspopup":"menu",onClick:()=>D(e=>!e),children:(0,t.jsx)(a.HamburgerIcon,{})}),W?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-50 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[A&&null!==O?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:O,children:O})}):null,L.map(e=>{let n=v[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:y,role:"menuitem",onClick:U,children:n.label})},e)}),A?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitemcheckbox","aria-checked":"true"===N,onClick:()=>{let e="true"===N?"false":"true";u.cloud_sync_enabled_preference.write(e),u.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==O&&(0,f.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"true"===N?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===N?"On":"Off"})]})})}):null,(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{U(),(0,g.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===k?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===k?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{let e;U(),e=P.help,document.dispatchEvent(new KeyboardEvent("keydown",{key:e,shiftKey:"?"===e,bubbles:!0}))},children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsx)("span",{children:"Keyboard shortcuts"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===O?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:y,role:"menuitem",onClick:()=>{U(),e.push((0,l.build_auth_page_href)("sign_in",w))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${y} text-danger`,role:"menuitem",disabled:R,onClick:()=>{U(),M()},children:R?"Signing out…":"Sign out"})})]}):null]}):null]})}],1976);let w=[{id:"today",href:"/today",label:"Today"},{id:"search",href:"/search",label:"Search"},{id:"sheets",href:"/sheets",label:"Sheets"},{id:"reporting",href:"/reporting",label:"Reporting"},{id:"pomodoro",href:"/pomodoro",label:"Pomodoro"},{id:"manage-tags",href:"/settings/tags",label:"Tags"},{id:"sync-settings",href:"/settings/cloud-sync",label:"Sync"}];e.s(["TopbarQuickActions",0,function(){let e=(0,n.usePathname)()??"/",a=(0,s.useSyncExternalStore)(d.topbar_quick_actions_preference.subscribe,d.topbar_quick_actions_preference.get_snapshot,d.topbar_quick_actions_preference.get_server_snapshot),l=(0,s.useMemo)(()=>(0,o.parse_topbar_quick_actions)(a),[a]);if(0===l.length)return null;let i=w.filter(e=>l.includes(e.id));return 0===i.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:i.map(n=>{let s=e.startsWith(n.href);return(0,t.jsx)(r.default,{href:n.href,className:`rounded-full px-2.5 py-1 text-[0.78rem] font-semibold no-underline transition-colors duration-150 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":s?"page":void 0,children:n.label},n.id)})})}],76080)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(76080),l=e.i(45958),i=e.i(71060),o=e.i(29539);function c(){let e=((0,i.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(l.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(o.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(l.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(l.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(a.TopbarQuickActions,{}),(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(c,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],75404)},42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/quick-actions",label:"Quick actions",match:e=>e.startsWith("/settings/quick-actions")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/notifications",label:"Notifications",match:e=>e.startsWith("/settings/notifications")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":s?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},7902,e=>{"use strict";var t=e.i(46549);e.s(["persist_ui_preference",0,function(e,r){e.read()!==r&&(e.write(r),e.notify(),(0,t.notify_settings_saved)())}])},88019,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(90463),a=e.i(52663),l=e.i(77882);e.s(["CloudAccountSetting",0,function(){let e=(0,n.usePathname)()??"/settings/cloud-sync",{email:i,is_configured:o,is_pending:c,sign_out:u}=(0,l.use_supabase_auth_session)();if(!o)return null;let d=(0,s.build_auth_page_href)("sign_in",e);return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Account"}),(0,t.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"When signed in, tracker data and settings sync to your Supabase project instead of the local db.json file."})]}),null===i?(0,t.jsx)(r.default,{href:d,className:`${(0,a.get_button_class_name)("primary","small")} self-start no-underline`,children:"Sign in to enable cloud sync"}):(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("p",{className:"m-0 text-[0.85rem]",children:["Signed in as ",(0,t.jsx)("span",{className:"font-semibold",children:i})]}),(0,t.jsx)("button",{type:"button",className:`${(0,a.get_button_class_name)("ghost","small")} self-start`,disabled:c,onClick:()=>void u(),children:c?"Signing out…":"Sign out"})]})]})}])},98516,e=>{"use strict";var t=e.i(54710),r=e.i(71060),n=e.i(29158),s=e.i(19946),a=e.i(37193),l=e.i(52663),i=e.i(28274),o=e.i(77882);e.s(["CloudSyncActions",0,function(){let e=(0,r.useRouter)(),{confirm:c}=(0,s.use_confirm_dialog)(),{email:u,is_configured:d}=(0,o.use_supabase_auth_session)(),[h,f]=(0,n.useState)(null),[m,p]=(0,n.useState)(!0),[g,b]=(0,n.useState)(null),[x,_]=(0,n.useState)(null),[y,v]=(0,n.useState)(null),j=async()=>{try{let e=await fetch("/api/sync/status");if(!e.ok)throw Error("Failed to load sync status");let t=await e.json();f(t)}catch(e){v((0,a.message_from_unknown_error)(e,"Failed to load sync status"))}finally{p(!1)}};if((0,n.useEffect)(()=>{d?j():p(!1)},[d,u]),!d||null===u)return null;let w=async t=>{if(await c("push"===t?{title:"Push local to cloud?",message:"Merge your local db.json into the cloud database. Entries with the same id are combined; local data wins when they conflict.",confirmLabel:"Push to cloud",variant:"danger"}:{title:"Pull cloud to local?",message:"Merge the cloud database into your local db.json. Entries with the same id are combined; cloud data wins when they conflict.",confirmLabel:"Pull from cloud",variant:"danger"})){b(t),_(null),v(null);try{await (0,i.run_tracker_db_cloud_sync)({action:t,on_complete:()=>{e.refresh()}}),_("push"===t?"Cloud database merged with local file.":"Local db.json merged with cloud database."),await j()}catch(e){v((0,a.message_from_unknown_error)(e,"Sync action failed"))}finally{b(null)}}},k=h?.local_imported_at!==null&&h?.local_imported_at!==void 0?new Date(h.local_imported_at).toLocaleString():"never";return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Manual sync"}),(0,t.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"Merge local db.json with your cloud database. Conflicting entries keep the most recent timer; push favors local, pull favors cloud."})]}),m?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-muted",children:"Loading sync status…"}):(0,t.jsxs)("dl",{className:"m-0 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-[0.82rem]",children:[(0,t.jsx)("dt",{className:"text-muted",children:"Cloud sheets"}),(0,t.jsx)("dd",{className:"m-0 font-mono",children:h?.cloud_sheet_count??0}),(0,t.jsx)("dt",{className:"text-muted",children:"Last local import"}),(0,t.jsx)("dd",{className:"m-0 font-mono",children:k})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:null!==g,onClick:()=>void w("push"),children:"push"===g?"Pushing…":"Push local → cloud"}),(0,t.jsx)("button",{type:"button",className:(0,l.get_button_class_name)("ghost","small"),disabled:null!==g,onClick:()=>void w("pull"),children:"pull"===g?"Pulling…":"Pull cloud → local"})]}),null===x?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:x}),null===y?null:(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:y})]})}])},4259,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(410),s=e.i(7902);e.s(["GreedyCloudSyncSetting",0,function(){let e=(0,r.useSyncExternalStore)(n.greedy_cloud_sync_preference.subscribe,n.greedy_cloud_sync_preference.get_snapshot,n.greedy_cloud_sync_preference.get_server_snapshot);return(0,t.jsxs)("label",{"aria-label":"Greedy cloud sync",className:"flex w-full cursor-pointer items-center gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",className:"shrink-0",checked:"true"===e,onChange:e=>{var t;return t=e.target.checked,void(0,s.persist_ui_preference)(n.greedy_cloud_sync_preference,t?"true":"false")}}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Greedy cloud sync"}),(0,t.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"When on, merge with the cloud when you move between pages and after each change. When off, merge once per session and push only when entries, notes, or sheets change—not when switching sheets."})]})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,90503,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},31047,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return w},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return _},ST:function(){return h},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return m},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return x}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function m(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&m(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let _="u">typeof performance,h=_&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class w extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},78677,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},37193,e=>{"use strict";e.s(["message_from_unknown_error",0,function(e,t){return e instanceof Error?e.message:"string"==typeof e?e:t}])},49087,e=>{"use strict";let t=new Set;e.s(["notify_in_app",0,function(e){t.forEach(t=>{t(e)})},"subscribe_in_app_notifications",0,function(e){return t.add(e),()=>{t.delete(e)}}])},17003,e=>{"use strict";var t=e.i(27850),r=e.i(72550);e.s(["write_active_sheet_preference",0,function(e){let n=e.trim();if(0!==n.length){try{window.localStorage.setItem(r.ACTIVE_SHEET_STORAGE_KEY,n),(0,t.schedule_ui_preferences_cloud_sync)()}catch{}try{let e=encodeURIComponent(n);document.cookie=`${r.ACTIVE_SHEET_COOKIE_NAME}=${e}; Path=/; Max-Age=31536000; SameSite=Lax`}catch{}}}])},67321,e=>{"use strict";var t=e.i(17003);e.s(["navigate_to_tracker_sheet",0,function(e){(0,t.write_active_sheet_preference)(e)}])},56996,8654,76900,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.FOCUS_NUDGES_ENABLED_STORAGE_KEY,default_value:r.FOCUS_NUDGES_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});e.s(["focus_nudges_enabled_preference",0,n],56996);let s=(0,t.create_ui_preference_store)({storage_key:r.NO_LOG_REMINDER_MINUTES_STORAGE_KEY,default_value:r.NO_LOG_REMINDER_MINUTES_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=5&&t<=240}});e.s(["no_log_reminder_minutes_preference",0,s],8654);let a=(0,t.create_ui_preference_store)({storage_key:r.OVERWORK_ALERT_HOURS_STORAGE_KEY,default_value:r.OVERWORK_ALERT_HOURS_DEFAULT,is_valid:e=>{if(!/^\d+$/.test(e))return!1;let t=Number.parseInt(e,10);return t>=1&&t<=16}});e.s(["overwork_alert_hours_preference",0,a],76900)},80808,71122,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=/^([01]\d|2[0-3]):[0-5]\d$/,s=(0,t.create_ui_preference_store)({storage_key:r.WORK_HOURS_END_STORAGE_KEY,default_value:r.WORK_HOURS_END_DEFAULT,is_valid:e=>n.test(e)});e.s(["work_hours_end_preference",0,s],80808);let a=/^([01]\d|2[0-3]):[0-5]\d$/,o=(0,t.create_ui_preference_store)({storage_key:r.WORK_HOURS_START_STORAGE_KEY,default_value:r.WORK_HOURS_START_DEFAULT,is_valid:e=>a.test(e)});e.s(["work_hours_start_preference",0,o],71122)},52405,e=>{"use strict";e.s(["get_input_class_name",0,function(e="default"){let t="box-border max-w-full min-w-0 w-full rounded-[0.65rem] border border-panel-border bg-input-bg px-3 py-2.5 font-inherit text-inherit transition-[background-color,border-color] duration-200 focus:border-input-focus-border focus:outline-none";return"compact"===e?`${t} px-2.5 py-2`:t}])},52663,e=>{"use strict";e.s(["get_button_class_name",0,function(e="ghost",t="default"){return`cursor-pointer appearance-none rounded-[0.65rem] border border-transparent font-inherit font-semibold disabled:cursor-not-allowed disabled:opacity-55 ${({default:"px-3.5 py-2.5",small:"px-2.5 py-1.5 text-xs"})[t]} ${({primary:"border-accent-border bg-[var(--accent)] text-[var(--accent-text-on)]",ghost:"border-panel-border bg-ghost-bg text-inherit",danger:"border-danger-border bg-danger-soft text-danger","danger-solid":"border-danger-border bg-[var(--danger-solid)] text-[var(--danger-text-on)]"})[e]}`}])},18774,e=>{"use strict";e.s(["format_display_tag",0,function(e){return e.startsWith("@")?e:`@${e}`}])},72270,4572,e=>{"use strict";let t=(0,e.i(29158).createContext)(null);e.s(["ConfirmDialogContext",0,t],72270);let r=null;e.s(["get_registered_confirm_dialog",0,function(){return r},"register_confirm_dialog",0,function(e){r=e}],4572)},39474,13349,20993,e=>{"use strict";var t=e.i(410);function r(){return"true"===t.greedy_cloud_sync_preference.read()}e.s(["is_greedy_cloud_sync_enabled",0,r],13349);var n=e.i(32417),s=e.i(44171),a=e.i(28274);let o=null,i=Promise.resolve();function l(){(0,n.is_supabase_configured)()&&(0,s.is_cloud_sync_enabled)()&&(null!==o&&clearTimeout(o),o=setTimeout(()=>{o=null,i=i.then(()=>(0,a.run_tracker_db_cloud_sync)()).catch(()=>{})},400))}function c(){r()&&l()}e.s(["schedule_tracker_db_cloud_sync",0,c],20993),e.s(["push_tracker_db_cloud_after_change",0,function(){r()?c():l()}],39474)},44356,97176,51229,e=>{"use strict";var t=e.i(18774);e.s(["build_resume_description",0,function(e,r){let n=e.trim(),s=n.length>0?n:"Untitled entry",a=r.map(e=>(0,t.format_display_tag)(e)).join(" ");return a.length>0?`${s} ${a}`.trim():s}],44356);var r=e.i(13349);async function n(e){let t=await fetch("/api/sheet/active",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});if(!t.ok)throw Error((await t.json()).error??"Failed to update active sheet in cloud")}var s=e.i(39474),a=e.i(20993);function o(e,t){if("/api/sheet"===e&&"object"==typeof t&&null!==t&&!0!==t.delete&&!(0,r.is_greedy_cloud_sync_enabled)()){let e=t.name?.trim()??"";e.length>0&&n(e).catch(()=>{});return}(0,r.is_greedy_cloud_sync_enabled)()?(0,a.schedule_tracker_db_cloud_sync)():(0,s.push_tracker_db_cloud_after_change)()}e.s(["notify_tracker_db_cloud_sync",0,o],97176);let i=new Set(["/api/note"]);async function l(e,t){let r={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},n=await fetch(e,r);if(!n.ok){var s,a;let t,o=(await n.json()).error??"Request failed";if(s=e,a=o,i.has(s)&&((t=a.toLowerCase()).includes("duplicate key")||t.includes("unique constraint"))){if(await new Promise(e=>{setTimeout(e,25)}),!(n=await fetch(e,r)).ok)throw Error((await n.json()).error??o)}else throw Error(o)}let l=await n.json();return o(e,t),l}e.s(["post_tracker_action",0,l],51229)},87231,e=>{"use strict";e.s(["build_entry_search_href",0,function(e){let t=new URLSearchParams;e.query.trim().length>0&&t.set("q",e.query.trim()),e.sheetName.trim().length>0&&t.set("sheet",e.sheetName.trim()),e.tag.trim().length>0&&t.set("tag",e.tag.trim()),e.fromDate.trim().length>0&&t.set("from",e.fromDate.trim()),e.toDate.trim().length>0&&t.set("to",e.toDate.trim());let r=t.toString();return r.length>0?`/search?${r}`:"/search"}])},56586,e=>{"use strict";let t={query:"",sheetName:"",tag:"",fromDate:"",toDate:""};e.s(["get_empty_entry_search_filters",0,function(){return{...t}}])},17993,e=>{"use strict";var t=e.i(29158);e.s(["use_debounced_value",0,function(e,r){let[n,s]=(0,t.useState)(e);return(0,t.useEffect)(()=>{let t=window.setTimeout(()=>{s(e)},r);return()=>{window.clearTimeout(t)}},[e,r]),n}])},83391,14574,48054,99211,e=>{"use strict";var t=e.i(54710),r=e.i(29158);function n({label:e,description:r,compact:s}){return(0,t.jsxs)("div",{className:"contents",children:[(0,t.jsx)("dt",{className:"m-0",children:(0,t.jsx)("kbd",{className:`inline-block min-w-7 rounded border border-panel-border bg-surface text-center font-mono font-semibold text-foreground ${s?"px-1 py-0.5 text-[0.7rem]":"px-1.5 py-0.5 text-[0.78rem]"}`,children:e})}),(0,t.jsx)("dd",{className:`m-0 self-center leading-snug text-muted ${s?"text-[0.8rem]":"text-[0.9rem]"}`,children:r})]})}function s({sections:e,compact:r=!1}){return(0,t.jsx)("div",{className:`flex flex-col ${r?"gap-2.5":"gap-4"}`,children:e.map(e=>(0,t.jsxs)("section",{children:[(0,t.jsx)("h3",{className:`m-0 font-semibold uppercase tracking-[0.04em] text-muted ${r?"text-[0.65rem]":"text-[0.72rem]"}`,children:e.title}),(0,t.jsx)("dl",{className:`m-0 grid grid-cols-[auto_minmax(0,1fr)] ${r?"mt-1.5 gap-x-3 gap-y-1.5":"mt-2 gap-x-4 gap-y-2"}`,children:e.entries.map(s=>(0,t.jsx)(n,{label:s.label,description:s.description,compact:r},`${e.title}-${s.label}-${s.description}`))})]},e.title))})}var a=e.i(52663);e.s(["KeyboardShortcutsDialog",0,function({sections:e,on_close:n}){let o=(0,r.useId)(),i=(0,r.useRef)(null);return(0,r.useEffect)(()=>{i.current?.focus();let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n]),(0,t.jsxs)("div",{className:"fixed inset-0 z-100 flex items-center justify-center p-5",role:"presentation",children:[(0,t.jsx)("button",{type:"button",className:"absolute inset-0 cursor-default border-0 bg-overlay p-0","aria-label":"Dismiss dialog",onClick:n}),(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":o,className:"relative z-1 w-full max-w-lg rounded-lg border border-panel-border bg-panel p-5 shadow-md",children:[(0,t.jsx)("h2",{id:o,className:"m-0 text-[1.1rem] font-[650] tracking-tight",children:"Keyboard shortcuts"}),(0,t.jsx)("div",{className:"mt-4 max-h-[min(28rem,70vh)] overflow-y-auto pr-1",children:(0,t.jsx)(s,{sections:e})}),(0,t.jsx)("div",{className:"mt-5 flex justify-end",children:(0,t.jsx)("button",{ref:i,type:"button",className:(0,a.get_button_class_name)("primary"),onClick:n,children:"Close"})})]})]})}],83391);var o=e.i(22373);e.s(["get_tracker_keyboard_shortcut_sections",0,function(e=o.tracker_shortcut_defaults){return[...function(e="?"){return[{title:"General",entries:[{label:"Ctrl+P",description:"Open command palette"},{label:e,description:"Show keyboard shortcuts"}]}]}("?"===e.help?"?":e.help.toUpperCase()),{title:"Tracker",entries:[{label:e["check-in"].toUpperCase(),description:"Check in (focus description)"},{label:e["check-out"].toUpperCase(),description:"Check out"},{label:e["edit-entry"].toUpperCase(),description:"Edit active entry description"},{label:e["add-note"].toUpperCase(),description:"Add note to active entry"},{label:e.pomodoro.toUpperCase(),description:"Open Pomodoro"},{label:e["previous-sheet"],description:"Previous sheet"},{label:e["next-sheet"],description:"Next sheet"}]}]}],14574);var i=e.i(72074);function l(e){let t=e.target;if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;let r=t.tagName;return"INPUT"===r||"TEXTAREA"===r||"SELECT"===r}e.s(["should_ignore_keyboard_shortcut",0,l],48054),e.s(["use_document_keyboard_shortcuts",0,function(e){let t=(0,r.useRef)(e);t.current=e,(0,r.useEffect)(()=>{let e=e=>{if(!l(e)&&!(0,i.is_modal_dialog_open)()){for(let r of t.current)if(r.is_available?.()!==!1&&function(e,t){let r=t.modifiers??[],n=r.includes("alt"),s=r.includes("ctrl"),a=r.includes("meta"),o=r.includes("shift");return e.altKey===n&&e.ctrlKey===s&&e.metaKey===a&&e.shiftKey===o&&(1===e.key.length?e.key.toLowerCase():e.key)===(1===t.key.length?t.key.toLowerCase():t.key)}(e,r)){e.preventDefault(),r.action();return}}};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[])}],99211)},49532,14974,e=>{"use strict";let t=e=>"object"==typeof e&&null!==e&&"string"==typeof e.id&&"string"==typeof e.name&&"string"==typeof e.description;e.s(["read_entry_templates",0,function(){try{let e=window.localStorage.getItem("super-time-tracker-entry-templates");if(null===e)return[];let r=JSON.parse(e);if(!Array.isArray(r))return[];return r.filter(t)}catch{return[]}}],49532);var r=e.i(54710),n=e.i(29158),s=e.i(52663);function a({options:e,on_confirm:t,on_cancel:o}){let i=(0,n.useId)(),l=(0,n.useRef)(null),c=(0,n.useRef)(null),{cancelLabel:u="Cancel",confirmLabel:d="Confirm",message:m,title:f,variant:p="default"}=e;(0,n.useEffect)(()=>{let e=l.current;if(null!==e&&!e.open)return e.showModal(),()=>{e.open&&e.close()}},[]),(0,n.useEffect)(()=>{c.current?.focus()},[]);let _=()=>{l.current?.close(),o()};return(0,r.jsxs)("dialog",{ref:l,"aria-labelledby":i,className:"fixed inset-0 z-100 m-0 flex max-h-none w-full max-w-none items-center justify-center border-0 bg-transparent p-5 backdrop:bg-overlay open:flex",onCancel:e=>{e.preventDefault(),_()},children:[(0,r.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Dismiss dialog",className:"absolute inset-0 z-0 cursor-default border-0 bg-transparent p-0",onClick:_}),(0,r.jsxs)("div",{className:"relative z-1 w-full max-w-md rounded-lg border border-panel-border bg-panel p-5 shadow-md",children:[(0,r.jsx)("h2",{id:i,className:"m-0 text-[1.1rem] font-[650] tracking-tight",children:f}),(0,r.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:m}),(0,r.jsxs)("div",{className:"mt-5 flex flex-wrap justify-end gap-2",children:[(0,r.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("ghost"),onClick:_,children:u}),(0,r.jsx)("button",{ref:c,type:"button",className:(0,s.get_button_class_name)("danger"===p?"danger":"primary"),onClick:t,children:d})]})]})]})}var o=e.i(72270),i=e.i(4572);e.s(["ConfirmDialogProvider",0,function({children:e}){let[t,s]=(0,n.useState)(null),l=(0,n.useCallback)(e=>new Promise(t=>{s({options:e,resolve:t})}),[]);(0,i.register_confirm_dialog)(l),(0,n.useEffect)(()=>((0,i.register_confirm_dialog)(l),()=>{(0,i.register_confirm_dialog)(null)}),[l]);let c=(0,n.useMemo)(()=>({confirm:l}),[l]),u=e=>{t?.resolve(e),s(null)};return(0,r.jsxs)(o.ConfirmDialogContext.Provider,{value:c,children:[e,null===t?null:(0,r.jsx)(a,{options:t.options,on_confirm:()=>u(!0),on_cancel:()=>u(!1)})]})}],14974)},64324,e=>{"use strict";var t=e.i(54710),r=e.i(71060),n=e.i(29158),s=e.i(83391),a=e.i(14574),o=e.i(66295),i=e.i(90299),l=e.i(99211);function c(){let e=(0,r.usePathname)(),[c,u]=(0,n.useState)(!1),d="/"===e,m=(0,n.useSyncExternalStore)(i.tracker_shortcut_map_preference.subscribe,i.tracker_shortcut_map_preference.get_snapshot,i.tracker_shortcut_map_preference.get_server_snapshot),f=(0,n.useMemo)(()=>(0,o.parse_tracker_shortcut_map)(m),[m]),p=f.help,_=(0,n.useMemo)(()=>{if(d)return[];let e="?"===p?["shift"]:[];return[{id:"help",label:"?"===p?"?":p.toUpperCase(),description:"Show keyboard shortcuts",key:p,modifiers:e,action:()=>{u(e=>!e)}}]},[p,d]);return((0,l.use_document_keyboard_shortcuts)(_),c&&!d)?(0,t.jsx)(s.KeyboardShortcutsDialog,{sections:(0,a.get_tracker_keyboard_shortcut_sections)(f),on_close:()=>u(!1)}):null}var u=e.i(52405);function d({items:e,query:r,is_loading:s,error:a,on_query_change:o,on_select:i,on_close:l}){var c;let m=(0,n.useId)(),f=(0,n.useRef)(null),p=(0,n.useRef)(null),[_,h]=(0,n.useState)(0),g=(0,n.useMemo)(()=>(function(e){let t=new Map;for(let r of e){let e=t.get(r.group)??[];e.push(r),t.set(r.group,e)}return Array.from(t.entries()).map(([e,t])=>({label:e,items:t}))})(e),[e]),y=(0,n.useMemo)(()=>g.flatMap(e=>e.items),[g]),b=(0,n.useMemo)(()=>{let e=new Map;return y.forEach((t,r)=>{e.set(t.id,r)}),e},[y]),w=0===y.length?0:Math.min(_,y.length-1),v=(c=y.length,!s&&0===c&&null===a);(0,n.useEffect)(()=>{let e=f.current;if(null!==e&&!e.open)return e.showModal(),()=>{e.open&&e.close()}},[]),(0,n.useEffect)(()=>{p.current?.focus()},[]);let x=()=>{f.current?.close(),l()};return(0,t.jsxs)("dialog",{ref:f,"aria-labelledby":m,"data-command-palette-dialog":"true",className:"fixed inset-0 z-100 m-0 flex max-h-none w-full max-w-none items-start justify-center border-0 bg-transparent p-4 pt-[12vh] backdrop:bg-overlay open:flex sm:p-6 sm:pt-[12vh]",onCancel:e=>{e.preventDefault(),x()},children:[(0,t.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Close command palette",className:"absolute inset-0 z-0 cursor-default border-0 bg-transparent p-0",onClick:x}),(0,t.jsxs)("div",{className:"relative z-1 flex w-full max-w-xl flex-col overflow-hidden rounded-lg border border-panel-border bg-panel shadow-lg",children:[(0,t.jsx)("p",{id:m,className:"sr-only",children:"Command palette"}),(0,t.jsxs)("div",{className:"border-b border-panel-border px-3 py-3",children:[(0,t.jsx)("label",{className:"sr-only",htmlFor:`${m}-input`,"aria-label":"Search commands",children:"Search commands"}),(0,t.jsx)("input",{ref:p,id:`${m}-input`,type:"search",autoComplete:"off",spellCheck:!1,placeholder:"Search sheets, entries, templates, reporting…",className:(0,u.get_input_class_name)("compact"),value:r,onChange:e=>{var t;return t=e.target.value,void(h(0),o(t))},onKeyDown:e=>{if((e.metaKey||e.ctrlKey)&&!e.altKey&&"k"===e.key.toLowerCase()){e.preventDefault(),e.stopPropagation(),x();return}if("Escape"===e.key){e.preventDefault(),x();return}if("ArrowDown"===e.key){if(e.preventDefault(),0===y.length)return;h(e=>(e+1)%y.length);return}if("ArrowUp"===e.key){if(e.preventDefault(),0===y.length)return;h(e=>0===e?y.length-1:e-1);return}if("Enter"===e.key){e.preventDefault();let t=y[w];void 0!==t&&i(t)}}})]}),(0,t.jsxs)("div",{className:"max-h-[min(24rem,55vh)] overflow-y-auto px-2 py-2","aria-live":"polite",children:[null===a?null:(0,t.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-danger",children:a}),s&&0===y.length?(0,t.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-muted",children:"Loading…"}):null,v?(0,t.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-muted",children:"No matching commands."}):null,g.map(e=>(0,t.jsxs)("section",{className:"mb-2 last:mb-0","aria-label":e.label,children:[(0,t.jsx)("h2",{className:"m-0 px-2 py-1 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:e.label}),(0,t.jsx)("ul",{className:"m-0 list-none p-0",children:e.items.map(e=>{let r=b.get(e.id)??0,n=r===w;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",className:`flex w-full cursor-pointer flex-col gap-0.5 rounded-md border-0 px-2.5 py-2 text-left font-inherit transition-colors duration-150 ${n?"bg-accent-soft text-foreground":"bg-transparent text-inherit hover:bg-surface-hover"}`,onMouseEnter:()=>h(r),onClick:()=>i(e),children:[(0,t.jsx)("span",{className:"text-[0.9rem] font-semibold",children:e.title}),void 0===e.subtitle?null:(0,t.jsx)("span",{className:"text-[0.78rem] text-muted",children:e.subtitle})]})},e.id)})})]},e.label))]}),(0,t.jsxs)("div",{className:"border-t border-panel-border px-3 py-2 text-[0.72rem] text-muted",children:[(0,t.jsx)("span",{className:"font-mono",children:"↑↓"})," navigate ·"," ",(0,t.jsx)("span",{className:"font-mono",children:"↵"})," select ·"," ",(0,t.jsx)("span",{className:"font-mono",children:"esc"})," close ·"," ",(0,t.jsx)("span",{className:"font-mono",children:"Ctrl+P"})," toggle"]})]})]})}var m=e.i(18774),f=e.i(49532);let p=[{id:"nav-tracker",kind:"navigate",group:"Pages",title:"Open Tracker",keywords:["home","tracker","timer"],href:"/"},{id:"nav-today",kind:"navigate",group:"Pages",title:"Open Today",keywords:["today","focus","daily"],href:"/today"},{id:"nav-sheets",kind:"navigate",group:"Pages",title:"Open Sheets",keywords:["sheets","projects","hub"],href:"/sheets"},{id:"nav-reporting",kind:"navigate",group:"Pages",title:"Open Reporting",keywords:["reporting","stats","analytics"],href:"/reporting"},{id:"nav-search",kind:"navigate",group:"Pages",title:"Search entries",keywords:["search","find","entries","notes","tags"],href:"/search"},{id:"nav-pomodoro",kind:"navigate",group:"Pages",title:"Open Pomodoro",keywords:["pomodoro","focus","timer"],href:"/pomodoro"},{id:"nav-settings",kind:"navigate",group:"Pages",title:"Open Settings",keywords:["settings","preferences"],href:"/settings"}],_=[{shortcut:"today",title:"Reporting: Today",keywords:["today","reporting"]},{shortcut:"yesterday",title:"Reporting: Yesterday",keywords:["yesterday"]},{shortcut:"week",title:"Reporting: This week",keywords:["week","reporting"]},{shortcut:"month",title:"Reporting: This month",keywords:["month","reporting"]},{shortcut:"last_month",title:"Reporting: Last month",keywords:["last month","reporting"]},{shortcut:"year",title:"Reporting: This year",keywords:["year","reporting"]},{shortcut:"last_year",title:"Reporting: Last year",keywords:["last year","reporting"]}];function h(e){let t=e.tags.map(e=>(0,m.format_display_tag)(e)).join(" ");return t.length>0?`${e.sheetName} \xb7 ${t}`:e.sheetName}var g=e.i(87231),y=e.i(56586),b=e.i(44356),w=e.i(67321),v=e.i(49087),x=e.i(76709),k=e.i(51229);async function E({item:e,pathname:t,navigate:r}){switch(e.kind){case"navigate":case"reporting_range":if(void 0===e.href)return;r(e.href);return;case"sheet":if(void 0===e.sheetName)return;await N(e.sheetName,t,r);return;case"template_check_in":{let n=e.description?.trim()??"";if(0===n.length)return;await S({description:n,sheet_name:e.sheetName,pathname:t,navigate:r});return}case"resume_last":case"resume_entry":{let n=e.description??"",s=e.tags??[];await S({description:(0,b.build_resume_description)(n,s),sheet_name:e.sheetName,pathname:t,navigate:r});return}default:return}}async function N(e,t,r){(0,w.navigate_to_tracker_sheet)(e),await (0,k.post_tracker_action)("/api/sheet",{name:e}),(0,x.notify_tracker_state_sync)(),"/"!==t&&r("/")}async function S({description:e,sheet_name:t,pathname:r,navigate:n}){let s=t?.trim()??"";s.length>0&&((0,w.navigate_to_tracker_sheet)(s),await (0,k.post_tracker_action)("/api/sheet",{name:s}));try{await (0,k.post_tracker_action)("/api/in",{description:e,...s.length>0?{sheetName:s}:{}}),(0,x.notify_tracker_state_sync)(),"/"!==r&&n("/"),(0,v.notify_in_app)({title:"Checked in",body:e})}catch(e){throw(0,v.notify_in_app)({title:"Check-in failed",body:e instanceof Error?e.message:String(e)}),e}}async function j(e){let t=new URLSearchParams;e.trim().length>0&&t.set("q",e.trim());let r=t.size>0?`?${t.toString()}`:"",n=await fetch(`/api/command-palette${r}`,{method:"GET",cache:"no-store"});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error??"Failed to load command palette data");return await n.json()}var C=e.i(72074),T=e.i(48054),R=e.i(37193),P=e.i(17993);let O={activeSheetName:null,sheets:[],lastCompletedEntry:null,matchingEntries:[]};function $(){var e;let s=(0,r.useRouter)(),a=(0,r.usePathname)()??"/",[o,i]=(0,n.useState)(!1),[l,c]=(0,n.useState)(""),u=(0,P.use_debounced_value)(l,200),[m,b]=(0,n.useState)(O),[w,v]=(0,n.useState)(!1),[x,k]=(0,n.useState)(null);e=(0,n.useCallback)(()=>{i(e=>(e&&c(""),!e))},[]),(0,n.useEffect)(()=>{let t=t=>{let r=t.target,n=r instanceof HTMLElement&&null!==r.closest('[data-command-palette-dialog="true"]');if((!(0,T.should_ignore_keyboard_shortcut)(t)||n)&&(t.metaKey||t.ctrlKey)&&!t.altKey&&"p"===t.key.toLowerCase()){if(t.preventDefault(),(0,C.is_modal_dialog_open)()&&null===document.querySelector('[data-command-palette-dialog="true"]'))return;e()}};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e]),(0,n.useEffect)(()=>{if(!o)return;let e=!1;return(async()=>{v(!0),k(null);try{let t=await j(u);e||b(t)}catch(t){e||k((0,R.message_from_unknown_error)(t,"Failed to load commands"))}finally{e||v(!1)}})(),()=>{e=!0}},[o,u]);let N=(0,n.useMemo)(()=>{var e;let t,r=(e=function({snapshot:e,include_templates:t=!0}){var r,n;let s=[...p,..._.map(e=>{var t;return{id:`reporting-${e.shortcut}`,kind:"reporting_range",group:"Reporting ranges",title:e.title,keywords:e.keywords,href:(t=e.shortcut,`/reporting?range=${encodeURIComponent(t)}`),reportingRange:e.shortcut}})];if(null!==e.lastCompletedEntry&&s.push({id:"resume-last",kind:"resume_last",group:"Recent",title:"Resume last entry",subtitle:h(r=e.lastCompletedEntry),keywords:["resume","last",r.description,r.sheetName,...r.tags],sheetName:r.sheetName,entryId:r.id,description:r.description,tags:r.tags}),t&&1)for(let t of(0,f.read_entry_templates)())s.push({id:`template-${t.id}`,kind:"template_check_in",group:"Check in with template",title:`Check in: ${t.name}`,subtitle:t.description,keywords:["check in","template",t.name,t.description],description:t.description,sheetName:e.activeSheetName??void 0});for(let t of e.sheets)s.push({id:`sheet-${t.name}`,kind:"sheet",group:"Sheets",title:`Open sheet: ${t.name}`,subtitle:t.hasActiveEntry?"Timer running":void 0,keywords:["sheet",t.name,"project"],sheetName:t.name});let a=new Set;for(let t of e.matchingEntries){let e=`${t.sheetName}:${t.id}`;a.has(e)||(a.add(e),s.push((n=t,{id:`resume-${n.sheetName}-${n.id}`,kind:"resume_entry",group:"Entries",title:`Resume: ${n.description||"Untitled entry"}`,subtitle:h(n),keywords:["resume",n.description,n.sheetName,...n.tags],sheetName:n.sheetName,entryId:n.id,description:n.description,tags:n.tags})))}return s}({snapshot:m}),0===(t=l.trim().toLowerCase()).length?e:e.filter(e=>[e.title,e.subtitle??"",...e.keywords].join(" ").toLowerCase().includes(t))),n=l.trim();return 0===n.length?r:[{id:"search-all-entries",kind:"navigate",group:"Search",title:`Search all entries for "${n}"`,subtitle:"Open search with filters",keywords:["search",n],href:(0,g.build_entry_search_href)({...(0,y.get_empty_entry_search_filters)(),query:n})},...r]},[m,l]),S=(0,n.useCallback)(async e=>{i(!1),c("");try{await E({item:e,pathname:a,navigate:e=>{s.push(e)}})}catch{}},[a,s]),$=(0,n.useCallback)(()=>{i(!1),c("")},[]);return o?(0,t.jsx)(d,{items:N,query:l,is_loading:w,error:x,on_query_change:c,on_select:e=>{S(e)},on_close:$}):null}var D=e.i(83105),L=e.i(18324),I=e.i(89497),A=e.i(13582);async function U(){await (0,A.with_ui_preferences_merge_guard)(async()=>{let e=(0,I.collect_ui_preferences_from_window)(),t=await fetch("/api/ui-preferences/merge-on-load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:e})});if(!t.ok)throw Error((await t.json()).error??"UI preferences merge on load failed");let r=await t.json();(0,L.apply_ui_preferences_from_record)(r.preferences??{})})}var M=e.i(76670),K=e.i(44171),F=e.i(32417),G=e.i(28274),z=e.i(13349);function q(){return(0,z.is_greedy_cloud_sync_enabled)()}function H({children:e}){let s=(0,r.useRouter)(),a=(0,r.usePathname)(),o=(0,n.useRef)(null),i=(0,n.useRef)(!0),l=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{if(!(0,F.is_supabase_configured)()||!(0,K.is_cloud_sync_enabled)())return;let e=(0,D.create_browser_supabase_client)(),t=e=>{!q()&&(0,M.has_tracker_db_merged_this_browser_session)()?U().catch(()=>{}):(0,G.run_tracker_db_cloud_sync)({merge_on_load:!0,on_complete:e?()=>{s.refresh()}:void 0}).catch(()=>{})};e.auth.getSession().then(({data:{session:e}})=>{l.current=e?.user.id??null,null!==e&&t(!1)}).catch(()=>{l.current=null});let{data:{subscription:r}}=e.auth.onAuthStateChange((e,r)=>{if("SIGNED_IN"===e){let e=r?.user.id??null;if(void 0===l.current||e===l.current)return;l.current=e,(0,M.clear_tracker_db_merged_this_browser_session)(),o.current=null,i.current=!0,t(!0);return}"SIGNED_OUT"===e&&(l.current=null,(0,M.clear_tracker_db_merged_this_browser_session)(),o.current=null,i.current=!0,s.refresh())});return()=>{r.unsubscribe()}},[s]),(0,n.useEffect)(()=>{if((0,F.is_supabase_configured)()&&(0,K.is_cloud_sync_enabled)()&&q()){if(i.current){i.current=!1,o.current=a;return}o.current!==a&&(o.current=a,(0,G.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{}))}},[a]),(0,t.jsx)(t.Fragment,{children:e})}var W=e.i(14974),B=e.i(56996),V=e.i(8654),Y=e.i(76900),J=e.i(80808),Q=e.i(71122);let X=e=>{let t=/^([01]\d|2[0-3]):([0-5]\d)$/.exec(e);return null===t?null:60*Number.parseInt(t[1],10)+Number.parseInt(t[2],10)};function Z(){let e=(0,n.useSyncExternalStore)(B.focus_nudges_enabled_preference.subscribe,B.focus_nudges_enabled_preference.get_snapshot,B.focus_nudges_enabled_preference.get_server_snapshot),t=(0,n.useSyncExternalStore)(V.no_log_reminder_minutes_preference.subscribe,V.no_log_reminder_minutes_preference.get_snapshot,V.no_log_reminder_minutes_preference.get_server_snapshot),r=(0,n.useSyncExternalStore)(Y.overwork_alert_hours_preference.subscribe,Y.overwork_alert_hours_preference.get_snapshot,Y.overwork_alert_hours_preference.get_server_snapshot),s=(0,n.useSyncExternalStore)(Q.work_hours_start_preference.subscribe,Q.work_hours_start_preference.get_snapshot,Q.work_hours_start_preference.get_server_snapshot),a=(0,n.useSyncExternalStore)(J.work_hours_end_preference.subscribe,J.work_hours_end_preference.get_snapshot,J.work_hours_end_preference.get_server_snapshot),o=(0,n.useRef)(0),i=(0,n.useRef)(null);return(0,n.useEffect)(()=>{"Notification"in window&&"true"===e&&"default"===window.Notification.permission&&window.Notification.requestPermission()},[e]),(0,n.useEffect)(()=>{if(!("Notification"in window)||"true"!==e)return;let n=60*Math.max(1,Number.parseInt(r,10)||1)*6e4,l=60*Math.max(1,Number.parseInt(t,10)||1)*1e3,c=(e,t)=>{"granted"===window.Notification.permission&&new window.Notification(e,{body:t})},u=async()=>{try{let e=await fetch("/api/state",{cache:"no-store"});if(!e.ok)return;let t=(await e.json()).runningEntry,u=new Date,d=u.getTime();if(null===t&&((e,t,r)=>{let n=X(t),s=X(r);if(null===n||null===s)return!1;let a=e.getDay();if(0===a||6===a)return!1;let o=60*e.getHours()+e.getMinutes();return n<=s?o>=n&&o<s:o>=n||o<s})(u,s,a)&&d-o.current>=l&&(c("No active timer during work hours","Start tracking or check in to keep your work log current."),o.current=d),null!=t){let e=Date.parse(t.start);if(Number.isFinite(e)){let s=`${t.sheetName}-${t.id}`;d-e>=n&&i.current!==s&&(c("Long-running timer detected",`Timer has been running for over ${r}h. Consider splitting: ${t.description}`),i.current=s)}}else i.current=null}catch{}};u();let d=window.setInterval(()=>{u()},6e4);return()=>{window.clearInterval(d)}},[e,t,r,a,s]),null}var ee=e.i(52663);let et="super-time-tracker-pwa-install-notice-dismissed";function er(){let[e,r]=(0,n.useState)(null),[s,a]=(0,n.useState)(!0),[o,i]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{let e=window.matchMedia("(display-mode: standalone)").matches||"standalone"in navigator&&!0===navigator.standalone,t="true"===window.localStorage.getItem(et);if(e||t)return void a(!0);a(!1);let n=e=>{e.preventDefault(),r(e)},s=()=>{window.localStorage.setItem(et,"true"),a(!0),r(null)};return window.addEventListener("beforeinstallprompt",n),window.addEventListener("appinstalled",s),()=>{window.removeEventListener("beforeinstallprompt",n),window.removeEventListener("appinstalled",s)}},[]),s)?null:(0,t.jsxs)("aside",{className:"fixed right-4 bottom-4 z-50 w-[min(22rem,calc(100vw-2rem))] rounded-md border border-accent-border bg-panel p-3.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.9rem] font-semibold",children:"Install app"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.82rem] leading-snug text-muted",children:null!==e?"Install Super Time Tracker for offline use and a faster startup.":"Install from your browser menu to enable app-style launch and offline support."}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[null!==e?(0,t.jsx)("button",{type:"button",className:(0,ee.get_button_class_name)("primary","small"),disabled:o,onClick:()=>{i(!0),e.prompt().then(async()=>{"accepted"===(await e.userChoice).outcome&&(window.localStorage.setItem(et,"true"),a(!0))}).finally(()=>{i(!1),r(null)})},children:o?"Opening…":"Install"}):null,(0,t.jsx)("button",{type:"button",className:(0,ee.get_button_class_name)("ghost","small"),onClick:()=>{window.localStorage.setItem(et,"true"),a(!0)},children:"Dismiss"})]})]})}var en=e.i(47149);function es(){var e;let[r,s]=(0,n.useState)(null);if((0,n.useEffect)(()=>{let e=null,t=(0,en.subscribe_cloud_db_sync)(t=>{s(t),null!==e&&(clearTimeout(e),e=null),(t?.phase==="success"||t?.phase==="error")&&(e=setTimeout(()=>{s(null),e=null},2800))});return()=>{t(),null!==e&&clearTimeout(e)}},[]),null===r)return null;let a="syncing"===r.phase,o="error"===r.phase,i="success"===(e=r.phase)?100:"error"===e?0:null;return(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"w-full rounded-md border border-accent-border bg-panel px-4 py-3 text-[0.88rem] font-medium text-foreground shadow-md",children:[(0,t.jsx)("p",{className:"m-0 mb-2.5 leading-snug",children:r.message}),(0,t.jsx)("div",{className:"h-1 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--accent)_22%,var(--panel-border))]","aria-hidden":"true",children:a?(0,t.jsx)("div",{className:"cloud-db-sync-progress-indeterminate h-full w-1/3 rounded-full bg-accent"}):(0,t.jsx)("div",{className:`h-full rounded-full transition-[width] duration-300 ease-out ${o?"bg-danger":"bg-accent"}`,style:{width:`${i??0}%`}})})]})}function ea(){let[e,r]=(0,n.useState)(null);return((0,n.useEffect)(()=>{let e=null,t=(0,v.subscribe_in_app_notifications)(t=>{r(t),null!==e&&clearTimeout(e),e=setTimeout(()=>{r(null),e=null},3200)});return()=>{t(),null!==e&&clearTimeout(e)}},[]),null===e)?null:(0,t.jsxs)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"w-full rounded-md border border-accent-border bg-panel px-4 py-2.5 text-foreground shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.84rem] font-semibold",children:e.title}),(0,t.jsx)("p",{className:"m-0 mt-0.5 text-[0.8rem] leading-snug text-muted",children:e.body})]})}var eo=e.i(46549);function ei(){let[e,r]=(0,n.useState)(null);return((0,n.useEffect)(()=>{let e=null,t=(0,eo.subscribe_settings_saved)(t=>{r(t),null!==e&&clearTimeout(e),e=setTimeout(()=>{r(null),e=null},2800)});return()=>{t(),null!==e&&clearTimeout(e)}},[]),null===e)?null:(0,t.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"w-full rounded-md border border-accent-border bg-panel px-4 py-2.5 text-[0.88rem] font-medium text-foreground shadow-md transition-[opacity,transform] duration-200",children:e||eo.SETTINGS_SAVED_DEFAULT_MESSAGE})}function el(){return(0,t.jsxs)("div",{className:"pointer-events-none fixed z-50 flex w-[min(22rem,calc(100vw-2rem))] flex-col items-end gap-2 right-[max(1rem,env(safe-area-inset-right,0px))] bottom-[max(1rem,env(safe-area-inset-bottom,0px))]",children:[(0,t.jsx)(ea,{}),(0,t.jsx)(es,{}),(0,t.jsx)(ei,{})]})}e.s(["AppProviders",0,function({children:e}){return(0,t.jsx)(W.ConfirmDialogProvider,{children:(0,t.jsxs)(H,{children:[e,(0,t.jsx)(c,{}),(0,t.jsx)($,{}),(0,t.jsx)(Z,{}),(0,t.jsx)(el,{}),(0,t.jsx)(er,{})]})})}],64324)},19943,e=>{"use strict";var t=e.i(29158),r=e.i(53602);e.s(["DocumentPreferencesInit",0,function(){return(0,t.useLayoutEffect)(()=>{(0,r.apply_ui_preferences_dom_from_window)()},[]),null}])},33334,e=>{"use strict";var t=e.i(29158);e.s(["PwaRegister",0,function(){return(0,t.useEffect)(()=>{"serviceWorker"in navigator&&"caches"in window&&navigator.serviceWorker.register("/sw.js").then(()=>{let e;0!==(e="u"<typeof document?[]:[...new Set([...Array.from(document.querySelectorAll("script[src]")).map(e=>e.src).filter(e=>e.length>0),...Array.from(document.querySelectorAll('link[rel="stylesheet"],link[rel="modulepreload"],link[rel="preload"][as="script"],link[rel="preload"][as="style"]')).map(e=>e.href).filter(e=>e.length>0)])].filter(e=>{try{return new URL(e).origin===window.location.origin}catch{return!1}})).length&&caches.open("super-time-tracker-shell-v1").then(t=>Promise.all(e.map(e=>fetch(e,{cache:"no-store"}).then(r=>r.ok?t.put(e,r.clone()):Promise.resolve()).catch(()=>Promise.resolve()))))})},[]),null}])},89391,e=>{"use strict";var t=e.i(29158),r=e.i(17798),n=e.i(35434),s=e.i(70223),a=e.i(10464),o=e.i(61834),i=e.i(81553);e.s(["ThemeModeSystemListener",0,function(){return(0,t.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: light)"),t=()=>{if("system"!==a.theme_mode_preference.read())return;let e=(0,s.resolve_theme_mode_to_theme)("system");(0,r.apply_theme)(e),(0,i.write_stored_theme)(e),(0,o.write_document_preference_cookies)({theme_mode:"system",theme:e}),(0,n.notify_theme_subscribers)()};return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)}},[]),null}])},10289,e=>{"use strict";var t=e.i(29158),r=e.i(53602),n=e.i(60609);e.s(["UiPreferencesDocumentSync",0,function(){return(0,t.useEffect)(()=>{let e=()=>{(0,r.apply_ui_preferences_dom_from_window)()};return window.addEventListener(n.UI_PREFERENCES_APPLIED_EVENT,e),()=>{window.removeEventListener(n.UI_PREFERENCES_APPLIED_EVENT,e)}},[]),null}])}]);