super-time-tracker-ui 0.1.42 → 0.1.45
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.
- package/dist/standalone/next-output/BUILD_ID +1 -1
- package/dist/standalone/next-output/build-manifest.json +3 -3
- package/dist/standalone/next-output/server/app/_global-error.html +1 -1
- package/dist/standalone/next-output/server/app/_global-error.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/login/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/login/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/login/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/offline/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/offline/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/offline/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/page/react-loadable-manifest.json +2 -2
- package/dist/standalone/next-output/server/app/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/register/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/register/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/register/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/reporting/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/reporting/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/reporting/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/review/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/review/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/review/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/search/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/search/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/search/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/ai-suggestions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/cloud-sync/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/data/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/display/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/goals/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/tags/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/sheets/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/sheets/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/sheets/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/templates/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/templates/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/templates/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/today/page/react-loadable-manifest.json +1 -1
- package/dist/standalone/next-output/server/app/today/page.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/today/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0sx0ra6._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0-4oz91._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/{_05ydjrh._.js → _0d1s~8c._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/_0ja6w18._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{_10utgt7._.js → _0rhx88g._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/_0sic8ed._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/components_end-of-day-review-view_tsx_0t6snsb._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/components_reporting-view_tsx_0-0ofcv._.js +1 -1
- package/dist/standalone/next-output/server/middleware-build-manifest.js +3 -3
- package/dist/standalone/next-output/server/pages/500.html +1 -1
- package/dist/standalone/next-output/static/chunks/0-niex.k_xqnu.js +1 -0
- package/dist/standalone/next-output/static/chunks/01_obgfd_d0-5.js +1 -0
- package/dist/standalone/next-output/static/chunks/{141j1htu_qj-p.js → 0feo1c5hcq~fw.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0io.jffavun5t.js → 0lbfeprw3roep.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0t3hajznk~j44.js → 0q_cw2e3uj20q.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0wd.8~gqkz5cp.css +3 -0
- package/dist/standalone/next-output/static/chunks/{09lddf9c4kn~5.js → 0ya1a.o~xsixd.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0gv5y9hez6j.f.js → 11~k89a6fiu2w.js} +1 -1
- package/dist/standalone/package.json +1 -1
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_02l2ykc._.js +0 -3
- package/dist/standalone/next-output/static/chunks/01op4gs840x6z.js +0 -1
- package/dist/standalone/next-output/static/chunks/05m~ilvrxjj14.css +0 -3
- package/dist/standalone/next-output/static/chunks/0yc_so6bvu6on.js +0 -1
- /package/dist/standalone/next-output/static/{l_mfwvHxStSDpzw8cKLu3 → y7QrkWDtEEq8SX6iBgDNU}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{l_mfwvHxStSDpzw8cKLu3 → y7QrkWDtEEq8SX6iBgDNU}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{l_mfwvHxStSDpzw8cKLu3 → y7QrkWDtEEq8SX6iBgDNU}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19946,e=>{"use strict";var t=e.i(51268),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 i=(0,n.get_registered_confirm_dialog)();if(null!==i)return{confirm:i};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},99997,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return a},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let s=e.r(44066)._(e.r(33434)),o=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",a=e.hash||"",l=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)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),a&&"#"!==a[0]&&(a="#"+a),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${i}${u}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return a(e)}},70782,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(51268);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=s(e,n)),t&&(i.current=s(t,n))},[e,t])}function s(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)},88334,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let n=e.r(69600),i=e.r(76636);function s(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},20612,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},70096,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return x}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let s=e.r(44066),o=e.r(8063),a=s._(e.r(51268)),l=e.r(99997),c=e.r(4411),u=e.r(70782),d=e.r(69600),m=e.r(31508);e.r(91946);let p=e.r(35302),h=e.r(92024),f=e.r(88334),_=e.r(44017);function g(t){var r,n;let i,s,g,[x,v]=(0,a.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,a.useRef)(null),{href:w,as:j,children:k,prefetch:N=null,passHref:S,replace:E,shallow:C,scroll:T,onClick:O,onMouseEnter:A,onTouchStart:L,legacyBehavior:I=!1,onNavigate:P,transitionTypes:D,ref:R,unstable_dynamicOnHover:$,...M}=t;i=k,I&&("string"==typeof i||"number"==typeof i)&&(i=(0,o.jsx)("a",{children:i}));let U=a.default.useContext(c.AppRouterContext),F=!1!==N,K=!1!==N?null===(n=N)||"auto"===n?_.FetchStrategy.PPR:_.FetchStrategy.Full:_.FetchStrategy.PPR,G="string"==typeof(r=j||w)?r:(0,l.formatUrl)(r);if(I){if(i?.$$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});s=a.default.Children.only(i)}let q=I?s&&"object"==typeof s&&s.ref:R,Y=a.default.useCallback(e=>(null!==U&&(y.current=(0,h.mountLinkInstance)(e,G,U,K,F,v)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,G,U,K,v]),B={ref:(0,u.useMergedRef)(Y,q),onClick(t){I||"function"!=typeof O||O(t),I&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,i,s,o,l){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,f.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(12178);a.default.startTransition(()=>{d(r,i?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,G,y,E,T,P,D)},onMouseEnter(e){I||"function"!=typeof A||A(e),I&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){I||"function"!=typeof L||L(e),I&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(G)?B.href=G:I&&!S&&("a"!==s.type||"href"in s.props)||(B.href=(0,m.addBasePath)(G)),g=I?a.default.cloneElement(s,B):(0,o.jsx)("a",{...M,...B,children:i}),(0,o.jsx)(b.Provider,{value:x,children:g})}e.r(20612);let b=(0,a.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,a.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(8063);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(8063);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(51268),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let i=(0,t.useRef)(e);i.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),i.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},77882,e=>{"use strict";var t=e.i(48042),r=e.i(51268),n=e.i(83105),i=e.i(32417),s=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,a]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),u=(0,i.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}})=>{a(e?.user.email??null)}).catch(()=>{a(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{a(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:o,is_pending:l,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,s.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},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)}`}])},75404,73205,e=>{"use strict";var t=e.i(8063),r=e.i(70096),n=e.i(48042);let i=[{href:"/",label:"Tracker",match:e=>"/"===e}];function s(){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:i.map(n=>{let i=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 ${i?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":i?"page":void 0,children:n.label},n.href)})})}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"})})}var a=e.i(77882);function l(){let{email:e,is_configured:r}=(0,a.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}var c=e.i(51268),u=e.i(37399),d=e.i(90463),m=e.i(46549),p=e.i(22373);let h=new Set(p.topbar_quick_action_ids),f=["today","review","templates","search","reporting","pomodoro"];function _(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return f;let r=t.filter(e=>"string"==typeof e&&h.has(e));return Array.from(new Set(r))}catch{return f}}e.s(["parse_topbar_quick_actions",0,_],73205);var g=e.i(66295),b=e.i(34869),x=e.i(92629);let v=(0,b.create_ui_preference_store)({storage_key:x.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:x.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});var y=e.i(32792),w=e.i(90299),j=e.i(28274);function k(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}function N(){return k()}function S(){return"dark"}var E=e.i(35434),C=e.i(17798),T=e.i(10464),O=e.i(61834),A=e.i(81553),L=e.i(25204);let I="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",P={today:{href:"/today",label:"Today"},review:{href:"/review",label:"Review"},templates:{href:"/templates",label:"Templates"},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"}},D=new Set(["manage-tags","pomodoro","templates","sync-settings"]);function R(){let e=(0,n.useRouter)(),i=(0,n.usePathname)()??"/",s=(0,c.useSyncExternalStore)(E.subscribe_theme,N,S),o=(0,c.useSyncExternalStore)(v.subscribe,v.get_snapshot,v.get_server_snapshot),l=(0,c.useSyncExternalStore)(w.tracker_shortcut_map_preference.subscribe,w.tracker_shortcut_map_preference.get_snapshot,w.tracker_shortcut_map_preference.get_server_snapshot),h=(0,c.useSyncExternalStore)(y.topbar_quick_actions_preference.subscribe,y.topbar_quick_actions_preference.get_snapshot,y.topbar_quick_actions_preference.get_server_snapshot),f=(0,g.parse_tracker_shortcut_map)(l),b=new Set(_(h)),x=p.topbar_quick_action_ids.filter(e=>!b.has(e)),R=Array.from(new Set([...Array.from(D),...x])),{email:$,is_configured:M,is_pending:U,sign_out:F}=(0,a.use_supabase_auth_session)(),[K,G]=(0,c.useState)(!1),q=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!K)return;let e=e=>{null===q.current||q.current.contains(e.target)||G(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[K]);let Y=()=>{G(!1)};return(0,L.use_escape_to_cancel)(Y,K),(0,t.jsxs)("div",{className:"relative shrink-0",ref:q,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":K,"aria-haspopup":"menu",onClick:()=>G(e=>!e),children:(0,t.jsx)(u.HamburgerIcon,{})}),K?(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:[M&&null!==$?(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:$,children:$})}):null,R.map(e=>{let n=P[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:I,role:"menuitem",onClick:Y,children:n.label})},e)}),M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:I,role:"menuitemcheckbox","aria-checked":"true"===o,onClick:()=>{let e="true"===o?"false":"true";v.write(e),v.notify(),(0,m.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==$&&(0,j.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"===o?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===o?"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:I,role:"menuitem",onClick:()=>{let e;Y(),e="dark"===k()?"light":"dark",(0,C.apply_theme)(e),(0,A.write_stored_theme)(e),T.theme_mode_preference.write(e),(0,O.write_document_preference_cookies)({theme_mode:e,theme:e}),T.theme_mode_preference.notify(),(0,E.notify_theme_subscribers)(),(0,m.notify_settings_saved)()},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:I,role:"menuitem",onClick:()=>{let e;Y(),e=f.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:"(?)"})]})})}),M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===$?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:I,role:"menuitem",onClick:()=>{Y(),e.push((0,d.build_auth_page_href)("sign_in",i))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${I} text-danger`,role:"menuitem",disabled:U,onClick:()=>{Y(),F()},children:U?"Signing out…":"Sign out"})})]}):null]}):null]})}let $=[{id:"today",href:"/today",label:"Today"},{id:"review",href:"/review",label:"Review"},{id:"templates",href:"/templates",label:"Templates"},{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"}];function M(){let e=(0,n.usePathname)()??"/",i=(0,c.useSyncExternalStore)(y.topbar_quick_actions_preference.subscribe,y.topbar_quick_actions_preference.get_snapshot,y.topbar_quick_actions_preference.get_server_snapshot),s=(0,c.useMemo)(()=>_(i),[i]);if(0===s.length)return null;let o=$.filter(e=>s.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(n=>{let i=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 ${i?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":i?"page":void 0,children:n.label},n.id)})})}var U=e.i(29539);function F(){let e=((0,n.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(r.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)(U.SettingsIcon,{})})}function K({current:e,parent:n}){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)(r.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==n.href?(0,t.jsx)(r.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:n.href,children:n.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:n.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)(K,{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)(s,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(M,{}),(0,t.jsx)(l,{}),(0,t.jsx)(F,{}),(0,t.jsx)(R,{})]})]})]})})}],75404)},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}])},18774,e=>{"use strict";e.s(["format_display_tag",0,function(e){return e.startsWith("@")?e:`@${e}`}])},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(8063),r=e.i(51268),n=e.i(18774),i=e.i(52405),s=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:o,known_tags:a,placeholder:l,disabled:c=!1,autoFocus:u=!1,on_change:d}){let m=(0,r.useRef)(null),p=(0,r.useRef)(null),h=(0,r.useRef)(null),[f,_]=(0,r.useState)(0),[g,b]=(0,r.useState)(0),x=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let i=r.slice(n+1);return/\s/.test(i)?null:{query:i,start_index:n,end_index:t}}(o,f),v=null===x?[]: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)}(a,x.query),y=null!==x&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,s.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(x.query,a),w=null!==x&&v.length>0&&!y&&!c;(0,r.useLayoutEffect)(()=>{null!==h.current&&null!==m.current&&(m.current.setSelectionRange(h.current,h.current),_(h.current),h.current=null)},[o]),(0,r.useEffect)(()=>{b(0)},[o,f,v.length]);let j=()=>{_(m.current?.selectionStart??o.length)},k=()=>{b(0)},N=e=>{let t,r,i;if(null===x)return;let{next_text:s,next_cursor:a}=(t=(0,n.format_display_tag)(e),r=o.slice(0,x.start_index),i=o.slice(x.end_index),{next_text:`${r}${t}${i}`,next_cursor:r.length+t.length});h.current=a,d(s),k()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",role:"combobox",className:(0,i.get_input_class_name)(),value:o,placeholder:l,disabled:c,autoFocus:u,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),_(e.target.selectionStart??e.target.value.length)},onClick:j,onKeyUp:j,onKeyDown:e=>{if(w){if("ArrowDown"===e.key){e.preventDefault(),b(e=>(e+1)%v.length);return}if("ArrowUp"===e.key){e.preventDefault(),b(e=>(e-1+v.length)%v.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=v[g];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),k())}},onBlur:()=>{window.setTimeout(k,120)}}),w?(0,t.jsx)("ul",{ref:p,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:v.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(),N(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},3159,e=>{"use strict";var t=e.i(97176);let r=new Set(["/api/note"]);async function n(e,n){let i={method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},s=await fetch(e,i);if(!s.ok){var o,a;let t,n=(await s.json()).error??"Request failed";if(o=e,a=n,r.has(o)&&((t=a.toLowerCase()).includes("duplicate key")||t.includes("unique constraint"))){if(await new Promise(e=>{setTimeout(e,25)}),!(s=await fetch(e,i)).ok)throw Error((await s.json()).error??n)}else throw Error(n)}let l=await s.json();return(0,t.notify_tracker_db_cloud_sync)(e,n),l}e.s(["patch_tracker_action",0,n])},67999,e=>{"use strict";e.s(["get_serialized_entries_total_ms",0,function(e){return e.reduce((e,t)=>e+t.durationMs,0)}])},39474,20993,e=>{"use strict";var t=e.i(13349),r=e.i(32417),n=e.i(44171),i=e.i(28274);let s=null,o=Promise.resolve();function a(){(0,r.is_supabase_configured)()&&(0,n.is_cloud_sync_enabled)()&&(null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,o=o.then(()=>(0,i.run_tracker_db_cloud_sync)()).catch(()=>{})},400))}function l(){(0,t.is_greedy_cloud_sync_enabled)()&&a()}e.s(["schedule_tracker_db_cloud_sync",0,l],20993),e.s(["push_tracker_db_cloud_after_change",0,function(){(0,t.is_greedy_cloud_sync_enabled)()?l():a()}],39474)},97176,e=>{"use strict";var t=e.i(13349);async function r(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 n=e.i(39474),i=e.i(20993);e.s(["notify_tracker_db_cloud_sync",0,function(e,s){if("/api/sheet"===e&&"object"==typeof s&&null!==s&&!0!==s.delete&&!(0,t.is_greedy_cloud_sync_enabled)()){let e=s.name?.trim()??"";e.length>0&&r(e).catch(()=>{});return}(0,t.is_greedy_cloud_sync_enabled)()?(0,i.schedule_tracker_db_cloud_sync)():(0,n.push_tracker_db_cloud_after_change)()}],97176)},44356,e=>{"use strict";var t=e.i(18774);e.s(["build_resume_description",0,function(e,r){let n=e.trim(),i=n.length>0?n:"Untitled entry",s=r.map(e=>(0,t.format_display_tag)(e)).join(" ");return s.length>0?`${i} ${s}`.trim():i}])},51229,e=>{"use strict";var t=e.i(97176);let r=new Set(["/api/note"]);async function n(e,n){let i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},s=await fetch(e,i);if(!s.ok){var o,a;let t,n=(await s.json()).error??"Request failed";if(o=e,a=n,r.has(o)&&((t=a.toLowerCase()).includes("duplicate key")||t.includes("unique constraint"))){if(await new Promise(e=>{setTimeout(e,25)}),!(s=await fetch(e,i)).ok)throw Error((await s.json()).error??n)}else throw Error(n)}let l=await s.json();return(0,t.notify_tracker_db_cloud_sync)(e,n),l}e.s(["post_tracker_action",0,n])},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{}}}])},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}}])},69472,84545,50937,83327,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.CLAUDE_API_KEY_STORAGE_KEY,default_value:r.CLAUDE_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["claude_api_key_preference",0,n],69472);let i=(0,t.create_ui_preference_store)({storage_key:r.ENTRY_SUGGESTION_PROVIDER_STORAGE_KEY,default_value:r.ENTRY_SUGGESTION_PROVIDER_DEFAULT,is_valid:e=>"none"===e||"openai"===e||"claude"===e||"google_ai"===e});e.s(["entry_suggestion_provider_preference",0,i],84545);let s=(0,t.create_ui_preference_store)({storage_key:r.GOOGLE_AI_API_KEY_STORAGE_KEY,default_value:r.GOOGLE_AI_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["google_ai_api_key_preference",0,s],50937);let o=(0,t.create_ui_preference_store)({storage_key:r.OPENAI_API_KEY_STORAGE_KEY,default_value:r.OPENAI_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["openai_api_key_preference",0,o],83327)},75899,35923,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")}],75899);var r=e.i(51268),n=e.i(97891);e.s(["use_time_format",0,function(){return(0,r.useSyncExternalStore)(n.time_format_preference.subscribe,n.time_format_preference.get_snapshot,n.time_format_preference.get_server_snapshot)}],35923)},69837,e=>{"use strict";var t=e.i(39552);e.s(["format_datetime_hint",0,function(e){return(0,t.format)(new Date(e),"MMM d, h:mm a")}])},92977,e=>{"use strict";var t=e.i(8063);e.s(["TrashIcon",0,function(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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:"M3 6h18"}),(0,t.jsx)("path",{d:"M8 6V4h8v2"}),(0,t.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,t.jsx)("path",{d:"M10 11v6"}),(0,t.jsx)("path",{d:"M14 11v6"})]})}])},35877,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DEBUG_LOGGING_STORAGE_KEY,default_value:r.DEBUG_LOGGING_DEFAULT,is_valid:e=>"true"===e||"false"===e});e.s(["debug_logging_preference",0,n])},96947,59515,91966,e=>{"use strict";e.s(["get_api_key_for_suggestion_provider",0,function(e,t){return"openai"===e?t.openai:"claude"===e?t.claude:"google_ai"===e?t.google_ai:""}],96947);var t=e.i(35877);async function r(e){if("none"===e.provider)throw Error("AI suggestion provider is disabled");let r="true"===t.debug_logging_preference.read(),n=Date.now(),i={provider:e.provider,context:e.context,notes:e.notes,debug_logging:r};r&&console.info("[ai-suggestion] client request start",{provider:e.provider,context_length:e.context.length,notes_length:e.notes.length});try{let t=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...i,api_key:e.api_key})});if(!t.ok){let i=await t.json().catch(()=>({}));throw r&&console.warn("[ai-suggestion] client request failed",{provider:e.provider,status:t.status,elapsed_ms:Date.now()-n,error:i.error??"Failed to suggest description"}),Error(i.error??"Failed to suggest description")}let s=await t.json(),o=s.description?.trim()??"";if(0===o.length)throw Error("Suggestion was empty");return r&&console.info("[ai-suggestion] client request success",{provider:e.provider,elapsed_ms:Date.now()-n,description_length:o.length}),o}catch(t){throw r&&console.error("[ai-suggestion] client request error",{provider:e.provider,elapsed_ms:Date.now()-n,error:t instanceof Error?t.message:String(t)}),t}}e.s(["request_ai_entry_description_suggestion",0,r],59515);var n=e.i(51268),i=e.i(36405);e.s(["use_confirm_destructive_actions",0,function(){return"true"===(0,n.useSyncExternalStore)(i.confirm_destructive_actions_preference.subscribe,i.confirm_destructive_actions_preference.get_snapshot,i.confirm_destructive_actions_preference.get_server_snapshot)}],91966)},98846,e=>{"use strict";var t=e.i(8063);e.s(["AiSparklesIcon",0,function(){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"})})}])},28098,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(37399),i=e.i(25204);let s="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";e.s(["EntryActionsMenu",0,function(e){var o,a,l,c,u,d;let{current_sheet_name:m,sheets:p,is_pending:h,on_edit:f,on_add_note:_,on_show_add_note_form:g,on_revise_description_ai:b,can_revise_description_ai:x=!1,on_resume:v,entry_is_active:y=!1,can_split:w=!1,on_split:j,can_merge_previous:k=!1,can_merge_next:N=!1,on_merge:S,on_delete:E,on_archive:C,on_unarchive:T,entry_is_archived:O=!1,on_move:A}=e,L=p.find(e=>e.name===m),I=y||L?.hasActiveEntry===!0&&!y,P=y?"This entry is already active":"Another entry is active on this sheet",D=p.filter(e=>e.name!==m&&!0!==e.archived),[R,$]=(0,r.useState)(!1),M=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!R)return;let e=e=>{null===M.current||M.current.contains(e.target)||$(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[R]);let U=()=>{$(!1)};return(0,i.use_escape_to_cancel)(U,R),(0,t.jsxs)("div",{className:"relative shrink-0",ref:M,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":"Entry actions","aria-expanded":R,"aria-haspopup":"menu",disabled:h,onClick:()=>$(e=>!e),children:(0,t.jsx)(n.HamburgerIcon,{})}),R?(0,t.jsxs)("div",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(o=h,a=U,l=f,(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:o,onClick:()=>{a(),l()},children:"Edit times"})})),function({is_pending:e,close_menu:r,on_show_add_note_form:n,on_add_note:i}){return void 0===n&&void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e,onClick:()=>{if(r(),void 0!==n)return void n();let e=function(){let e=window.prompt("Add note","");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}();null!==e&&void 0!==i&&i(e)},children:"Add note"})})}({is_pending:h,close_menu:U,on_show_add_note_form:g,on_add_note:_}),function({is_pending:e,can_revise_description_ai:r,close_menu:n,on_revise_description_ai:i}){return void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{n(),i()},children:"Revise description with AI"})})}({is_pending:h,can_revise_description_ai:x,close_menu:U,on_revise_description_ai:b}),function({is_pending:e,resume_blocked:r,resume_blocked_reason:n,close_menu:i,on_resume:o}){return void 0===o?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||r,title:r?n:void 0,onClick:()=>{i(),o()},children:"Resume"})})}({is_pending:h,resume_blocked:I,resume_blocked_reason:P,close_menu:U,on_resume:v}),function({is_pending:e,can_split:r,close_menu:n,on_split:i}){return void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Split into two entries at a time":"Only completed entries can be split",onClick:()=>{if(n(),!r)return;let e=function(){let e=window.prompt("Split at what time?","1 hour ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}();null!==e&&i(e)},children:"Split entry"})})}({is_pending:h,can_split:w,close_menu:U,on_split:j}),function({is_pending:e,can_merge_previous:r,can_merge_next:n,close_menu:i,on_merge:o}){return void 0===o?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Merge with the previous entry":"No touching previous entry",onClick:()=>{i(),r&&o("previous")},children:"Merge with previous"})}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!n,title:n?"Merge with the next entry":"No touching next entry",onClick:()=>{i(),n&&o("next")},children:"Merge with next"})})]})}({is_pending:h,can_merge_previous:k,can_merge_next:N,close_menu:U,on_merge:S}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),function({other_sheets:e,is_pending:r,close_menu:n,on_move:i}){return 0===e.length?(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:!0,children:"No other sheets"})}):e.map(e=>(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${s} pl-4`,role:"menuitem",disabled:r||e.hasActiveEntry,title:e.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{n(),i(e.name)},children:e.name})},e.name))}({other_sheets:D,is_pending:h,close_menu:U,on_move:A}),function({is_pending:e,entry_is_archived:r,entry_is_active:n,close_menu:i,on_archive:o,on_unarchive:a}){return r?void 0===a?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e,onClick:()=>{i(),a()},children:"Restore entry"})}):void 0===o?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||n,title:n?"Check out before archiving this entry":void 0,onClick:()=>{i(),o()},children:"Archive entry"})})}({is_pending:h,entry_is_archived:O,entry_is_active:y,close_menu:U,on_archive:C,on_unarchive:T}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(c=h,u=U,d=E,(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${s} text-danger`,role:"menuitem",disabled:c,onClick:()=>{u(),d()},children:"Delete"})}))]}):null]})}],28098)},7568,34937,4903,27707,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(69837),i=e.i(14260),s=e.i(98846),o=e.i(44356),a=e.i(52663),l=e.i(52405),c=e.i(25204);function u({rotated:e=!1,className:r=""}){return(0,t.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${e?"rotate-90":""} ${r}`.trim(),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:"m9 18 6-6-6-6"})})}e.s(["EntryEditForm",0,function({entry:e,known_tags:u,is_pending:d,initial_description_override:m,in_active_panel:p=!1,times_only:h=!1,start_only:f=!1,on_save:_,on_cancel:g,on_revise_ai:b,is_ai_revise_pending:x=!1}){let v=(0,r.useMemo)(()=>m??(0,o.build_resume_description)(e.description,e.tags),[e.description,e.tags,m]),[y,w]=(0,r.useState)(v),[j,k]=(0,r.useState)(""),[N,S]=(0,r.useState)("");(0,r.useEffect)(()=>{w(m??(0,o.build_resume_description)(e.description,e.tags)),k(""),S("")},[e.description,e.id,e.sheetName,e.tags,m]),(0,c.use_escape_to_cancel)(g);let E=e.isActive?"still running":(0,n.format_datetime_hint)(e.end??e.start),C=h?j.trim().length>0||!f&&N.trim().length>0:y.trim()!==v.trim()||j.trim().length>0||!f&&N.trim().length>0;return(0,t.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${p?"mt-2":""}`,onSubmit:e=>{e.preventDefault();let t=y.trim(),r=j.trim(),n=N.trim(),i={};h||t===v.trim()||(i.description=t),r.length>0&&(i.start=r),!f&&n.length>0&&(i.end=n),(void 0!==i.description||void 0!==i.start||void 0!==i.end)&&_(i)},children:[(0,t.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:h?"Edit times":"Edit entry"}),h?null:(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${e.id}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),void 0!==b?(0,t.jsxs)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center gap-1 rounded border-0 bg-transparent px-1.5 py-0.5 text-[0.72rem] text-muted shadow-none transition-opacity hover:opacity-75 disabled:cursor-not-allowed disabled:opacity-40",title:"Generate a new AI revision",disabled:d||x,onClick:b,children:[(0,t.jsx)(s.AiSparklesIcon,{}),x?"Generating…":"Regenerate"]}):null]}),(0,t.jsx)(i.TagAutocompleteInput,{id:`entry-description-${e.id}`,value:y,known_tags:u,placeholder:"e.g. crafting something @design",disabled:d,autoFocus:p,on_change:w})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,t.jsxs)("div",{className:`grid gap-2.5 max-[860px]:grid-cols-1 ${f?"grid-cols-1":"grid-cols-2"}`,children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${e.id}`,children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,t.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",(0,n.format_datetime_hint)(e.start)]}),(0,t.jsx)("input",{id:`entry-start-${e.id}`,className:(0,l.get_input_class_name)("compact"),value:j,onChange:e=>k(e.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:d,autoFocus:h&&p})]}),f?null:(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${e.id}`,children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,t.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",E]}),(0,t.jsx)("input",{id:`entry-end-${e.id}`,className:(0,l.get_input_class_name)("compact"),value:N,onChange:e=>S(e.target.value),placeholder:e.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:d})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"submit",className:(0,a.get_button_class_name)("primary","small"),disabled:d||!C,children:"Save"}),(0,t.jsx)("button",{type:"button",className:(0,a.get_button_class_name)("ghost","small"),disabled:d,onClick:g,children:"Cancel"})]})]})}],7568);var d=e.i(75899);function m({initial_text:e,is_pending:n,inline:i=!1,on_save:s,on_cancel:o}){let[u,d]=(0,r.useState)(e);(0,c.use_escape_to_cancel)(o);let p=Math.min(6,Math.max(2,e.split("\n").length)),h=i?`${(0,l.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,l.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,t.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:e=>{e.preventDefault();let t=u.trim();0!==t.length&&s(t)},children:[(0,t.jsx)("textarea",{className:h,value:u,rows:p,disabled:n,onChange:e=>d(e.target.value)}),(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)("button",{type:"button",className:(0,a.get_button_class_name)("ghost"),disabled:n,onClick:o,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:(0,a.get_button_class_name)("ghost"),disabled:n||0===u.trim().length,children:"Save"})]})]})}function p(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}e.s(["PencilIcon",0,p],34937);var h=e.i(92977),f=e.i(35923);let _="inline-flex h-6 w-6 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";function g({note:e,is_inline:r,is_panel_in_bar:n,is_pending:i,is_editing:s,time_format:o,on_cancel_edit:a,on_save:l,on_start_edit:c,on_delete:u,on_edit_note:f,on_delete_note:b}){let x=r?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":n?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",v=function({is_pending:e,on_start_edit:r,on_delete:n,on_edit_note:i,on_delete_note:s}){return void 0===i&&void 0===s?null:(0,t.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0===i?null:(0,t.jsx)("button",{type:"button",className:_,"aria-label":"Edit note",title:"Edit note",disabled:e,onClick:e=>{e.stopPropagation(),r()},children:(0,t.jsx)(p,{})}),void 0===s?null:(0,t.jsx)("button",{type:"button",className:`${_} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:e,onClick:e=>{e.stopPropagation(),n()},children:(0,t.jsx)(h.TrashIcon,{})})]})}({note:e,is_pending:i,on_start_edit:c,on_delete:u,on_edit_note:f,on_delete_note:b});return s?(0,t.jsx)("li",{className:x,children:(0,t.jsx)(m,{initial_text:e.text,inline:r,is_pending:i,on_cancel:a,on_save:l})}):r?(0,t.jsx)("li",{className:x,children:(0,t.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,t.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,t.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:e.timestamp,children:(0,d.format_time)(e.timestamp,o)}),(0,t.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:e.text})]}),v]})}):(0,t.jsxs)("li",{className:x,children:[(0,t.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,t.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:e.timestamp,children:(0,d.format_time)(e.timestamp,o)}),v]}),(0,t.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:e.text})]})}e.s(["EntryNotesList",0,function({notes:e,variant:n="panel",in_bar:i=!1,is_pending:s=!1,on_edit_note:o,on_delete_note:a}){var l;let c,d,m=(0,f.use_time_format)(),[p,h]=(0,r.useState)(null),[_,b]=(0,r.useState)("panel"===n&&!i);if(0===e.length)return null;let x=[...e].sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),v="inline"===n,y="panel"===n&&i,w=_||null!==p,j=(l=e.length,v?`${l} ${1===l?"note":"notes"}`:`Notes (${l})`),k=(c=[v?"m-0 w-full p-0":"border-t border-accent-border pt-3.5"],i&&!v&&c.push("border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]"),y&&w?c.push("flex min-h-0 flex-1 flex-col"):y&&c.push("flex shrink-0 flex-col"),c.join(" ")),N=v?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground",S=(d=w?"mt-1.5":"hidden",v?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${d}`:y?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${d}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${d}`);return(0,t.jsxs)("section",{className:k,"aria-label":"Entry notes",children:[(0,t.jsxs)("button",{type:"button",className:N,"aria-expanded":w,onClick:e=>{e.stopPropagation(),null===p&&b(e=>!e)},children:[(0,t.jsx)(u,{rotated:w}),(0,t.jsx)("span",{children:j})]}),(0,t.jsx)("ul",{className:S,children:x.map((e,r)=>(0,t.jsx)(g,{note:e,is_inline:v,is_panel_in_bar:y,is_pending:s,is_editing:p===e.timestamp,time_format:m,on_cancel_edit:()=>h(null),on_save:t=>{var r,n;return r=e.timestamp,n=e.text,void(o?.(r,n,t),h(null))},on_start_edit:()=>{var t;return t=e.timestamp,void(b(!0),h(t))},on_delete:()=>{var t,r;return t=e.timestamp,r=e.text,void(p===t&&h(null),a?.(t,r))},on_edit_note:o,on_delete_note:a},`${e.timestamp}-${r}`))})]})}],4903),e.s(["get_delete_entry_confirm_dialog",0,function(e){let t=e.description.trim()||"Untitled entry",r=e.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${t}" on sheet "${e.sheetName}"?${r}`,confirmLabel:"Delete",variant:"danger"}}],27707)},51408,e=>{"use strict";e.s(["format_unknown_error",0,function(e){if(e instanceof Error)return e.message;if("string"==typeof e)return e;if(null==e)return"Unknown error";if("number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return"Unknown error"}}])},20397,e=>{"use strict";var t=e.i(51268),r=e.i(4874);e.s(["use_entry_list_sort",0,function(){return(0,t.useSyncExternalStore)(r.entry_list_sort_preference.subscribe,r.entry_list_sort_preference.get_snapshot,r.entry_list_sort_preference.get_server_snapshot)}])},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:i}=e,s={body:r,...void 0!==n?{tag:n}:{}};try{new Notification(i,s)}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])},36178,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),i=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==i&&i.length>0&&(r.note=i),r}])},52161,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(52663),i=e.i(52405),s=e.i(25204);e.s(["NoteForm",0,function({on_submit:e,on_cancel:o,is_pending:a,in_active_panel:l=!1,in_bar:c=!1,allow_at:u=!1}){let[d,m]=(0,r.useState)(""),[p,h]=(0,r.useState)("");return(0,s.use_escape_to_cancel)(()=>o?.(),void 0!==o),(0,t.jsxs)("form",{className:`flex flex-col gap-2 ${l&&!c?"border-t border-accent-border pt-4":c?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:t=>{t.preventDefault();let r=d.trim();if(0===r.length)return;let n=p.trim();e(r,n.length>0?n:void 0),m(""),h("")},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,i.get_input_class_name)(),value:d,onChange:e=>m(e.target.value),placeholder:"Pair with alice on the widget",disabled:a,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,n.get_button_class_name)("ghost"),disabled:a||0===d.trim().length,children:"Save note"}),void 0===o?null:(0,t.jsx)("button",{type:"button",className:(0,n.get_button_class_name)("ghost"),disabled:a,onClick:o,children:"Cancel"})]})]}),u?(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,i.get_input_class_name)(),value:p,onChange:e=>h(e.target.value),placeholder:"e.g. 30 minutes ago",disabled:a})]}):null]})}],52161)},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{}}])},53754,7554,76379,e=>{"use strict";var t=e.i(51268),r=e.i(19946);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,i=r.length>0,s="Stop the active timer and save this entry?";return n&&i?s=`Stop the timer at "${t}" and save a checkout note?`:n?s=`Stop the timer and check out at "${t}"?`:i&&(s="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:s,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var i=e.i(97026);function s(){return"true"===(0,t.useSyncExternalStore)(i.confirm_before_checkout_preference.subscribe,i.confirm_before_checkout_preference.get_snapshot,i.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,s],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:i}=(0,r.use_confirm_dialog)(),o=s();return(0,t.useCallback)(async t=>(!o||!!await i(n(t)))&&(e(t),!0),[i,o,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}])},68713,e=>{"use strict";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),i=n.state;if(i?.status!=="running")return;let s={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(s)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}])},60812,49532,85910,92572,31363,3087,e=>{"use strict";var t=e.i(44356);e.s(["build_entry_template_description",0,function(e){return(0,t.build_resume_description)(e.description,e.tags??[])}],60812);let r=["defaultSheetName","shortcutKey","createdAt","lastUsedAt"],n=e=>"object"==typeof e&&null!==e&&"string"==typeof e.id&&"string"==typeof e.name&&"string"==typeof e.description,i=e=>{let t={id:e.id,name:e.name,description:e.description};for(let n of r){let r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r)}return Array.isArray(e.tags)&&(t.tags=e.tags.filter(e=>"string"==typeof e&&e.length>0)),"boolean"==typeof e.favorite&&(t.favorite=e.favorite),"boolean"==typeof e.pomodoroLinked&&(t.pomodoroLinked=e.pomodoroLinked),"number"==typeof e.useCount&&Number.isFinite(e.useCount)&&e.useCount>0&&(t.useCount=Math.round(e.useCount)),t};function s(){try{let e=window.localStorage.getItem("super-time-tracker-entry-templates");if(null===e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(n).map(i)}catch{return[]}}e.s(["read_entry_templates",0,s],49532);let o=[],a=null;function l(){a=null}e.s(["EMPTY_ENTRY_TEMPLATES",0,o,"get_stable_entry_templates_snapshot",0,function(e){let t=e.map(e=>[e.id,e.name,e.description,e.defaultSheetName??"",e.tags?.join(" ")??"",!0===e.favorite?"1":"0",e.shortcutKey??"",!0===e.pomodoroLinked?"1":"0",e.createdAt??"",e.lastUsedAt??"",String(e.useCount??0)].join("\0")).join("\n");if(null!==a&&a.templates_key===t)return a.snapshot;let r=0===e.length?o:Object.freeze(e.map(e=>({...e})));return a={templates_key:t,snapshot:r},r},"reset_entry_templates_snapshot_cache",0,l],85910);let c=new Set;function u(){l(),c.forEach(e=>{e()})}function d(e){if(void 0!==globalThis.window)try{globalThis.window.localStorage.setItem("super-time-tracker-entry-templates",JSON.stringify(e)),u()}catch{}}e.s(["notify_entry_templates_changed",0,u,"subscribe_entry_templates",0,function(e){return c.add(e),()=>{c.delete(e)}}],92572),e.s(["write_entry_templates",0,d],31363),e.s(["record_entry_template_usage",0,function(e){let t=s(),r=new Date().toISOString(),n=!1,i=t.map(t=>t.id!==e?t:(n=!0,{...t,lastUsedAt:r,useCount:(t.useCount??0)+1}));n&&d(i)}],3087)},19653,64803,14843,e=>{"use strict";var t=e.i(8063);e.s(["SaveIcon",0,function(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),(0,t.jsx)("path",{d:"M17 21v-8H7v8"}),(0,t.jsx)("path",{d:"M7 3v5h8"})]})}],19653);var r=e.i(52405);e.s(["get_select_class_name",0,function(e="default"){let t="compact"===e?"bg-[position:right_0.55rem_center]":"bg-[position:right_0.65rem_center]",n="compact"===e?"!pe-8":"!pe-9";return`${(0,r.get_input_class_name)(e)} cursor-pointer appearance-none bg-size-[1rem] bg-no-repeat ${n} bg-[image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")] ${t}`}],64803);var n=e.i(51268),i=e.i(85910),s=e.i(49532);function o(){return(0,i.get_stable_entry_templates_snapshot)((0,s.read_entry_templates)())}function a(){return i.EMPTY_ENTRY_TEMPLATES}var l=e.i(92572);e.s(["use_entry_templates",0,function(){return(0,n.useSyncExternalStore)(l.subscribe_entry_templates,o,a)}],14843)},6838,e=>{e.v(t=>Promise.all(["static/chunks/0fa.o-_asg9n7.js"].map(t=>e.l(t))).then(()=>t(19550)))},72432,e=>{e.v(t=>Promise.all(["static/chunks/0yc_so6bvu6on.js"].map(t=>e.l(t))).then(()=>t(11791)))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19946,e=>{"use strict";var t=e.i(51268),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 i=(0,n.get_registered_confirm_dialog)();if(null!==i)return{confirm:i};throw Error("use_confirm_dialog must be used within ConfirmDialogProvider")}])},99997,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return a},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let s=e.r(44066)._(e.r(33434)),o=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,n=e.protocol||"",i=e.pathname||"",a=e.hash||"",l=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)),l&&"object"==typeof l&&(l=String(s.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),a&&"#"!==a[0]&&(a="#"+a),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${i}${u}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return a(e)}},70782,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return i}});let n=e.r(51268);function i(e,t){let r=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=i.current;t&&(i.current=null,t())}else e&&(r.current=s(e,n)),t&&(i.current=s(t,n))},[e,t])}function s(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)},88334,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let n=e.r(69600),i=e.r(76636);function s(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,i.hasBasePath)(r.pathname)}catch(e){return!1}}},20612,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},70096,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return x}};for(var i in n)Object.defineProperty(r,i,{enumerable:!0,get:n[i]});let s=e.r(44066),o=e.r(8063),a=s._(e.r(51268)),l=e.r(99997),c=e.r(4411),u=e.r(70782),d=e.r(69600),m=e.r(31508);e.r(91946);let p=e.r(35302),h=e.r(92024),f=e.r(88334),_=e.r(44017);function g(t){var r,n;let i,s,g,[x,v]=(0,a.useOptimistic)(h.IDLE_LINK_STATUS),y=(0,a.useRef)(null),{href:w,as:j,children:k,prefetch:N=null,passHref:S,replace:E,shallow:C,scroll:T,onClick:O,onMouseEnter:A,onTouchStart:L,legacyBehavior:I=!1,onNavigate:P,transitionTypes:D,ref:R,unstable_dynamicOnHover:$,...M}=t;i=k,I&&("string"==typeof i||"number"==typeof i)&&(i=(0,o.jsx)("a",{children:i}));let U=a.default.useContext(c.AppRouterContext),F=!1!==N,K=!1!==N?null===(n=N)||"auto"===n?_.FetchStrategy.PPR:_.FetchStrategy.Full:_.FetchStrategy.PPR,G="string"==typeof(r=j||w)?r:(0,l.formatUrl)(r);if(I){if(i?.$$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});s=a.default.Children.only(i)}let q=I?s&&"object"==typeof s&&s.ref:R,Y=a.default.useCallback(e=>(null!==U&&(y.current=(0,h.mountLinkInstance)(e,G,U,K,F,v)),()=>{y.current&&((0,h.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,G,U,K,v]),B={ref:(0,u.useMergedRef)(Y,q),onClick(t){I||"function"!=typeof O||O(t),I&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,i,s,o,l){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,f.isLocalURL)(r)){i&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(12178);a.default.startTransition(()=>{d(r,i?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,G,y,E,T,P,D)},onMouseEnter(e){I||"function"!=typeof A||A(e),I&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){I||"function"!=typeof L||L(e),I&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),U&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(G)?B.href=G:I&&!S&&("a"!==s.type||"href"in s.props)||(B.href=(0,m.addBasePath)(G)),g=I?a.default.cloneElement(s,B):(0,o.jsx)("a",{...M,...B,children:i}),(0,o.jsx)(b.Provider,{value:x,children:g})}e.r(20612);let b=(0,a.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,a.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(8063);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(8063);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(51268),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let i=(0,t.useRef)(e);i.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),i.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},77882,e=>{"use strict";var t=e.i(48042),r=e.i(51268),n=e.i(83105),i=e.i(32417),s=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,a]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),u=(0,i.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}})=>{a(e?.user.email??null)}).catch(()=>{a(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{a(t?.user.email??null)});return()=>{t.unsubscribe()}},[u]),{is_configured:u,email:o,is_pending:l,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,s.notify_settings_saved)("Signed out"),e.refresh()}finally{c(!1)}},[e])}}])},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)}`}])},75404,73205,e=>{"use strict";var t=e.i(8063),r=e.i(70096),n=e.i(48042);let i=[{href:"/",label:"Tracker",match:e=>"/"===e}];function s(){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:i.map(n=>{let i=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 ${i?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":i?"page":void 0,children:n.label},n.href)})})}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"})})}var a=e.i(77882);function l(){let{email:e,is_configured:r}=(0,a.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}var c=e.i(51268),u=e.i(37399),d=e.i(90463),m=e.i(46549),p=e.i(22373);let h=new Set(p.topbar_quick_action_ids),f=["today","review","templates","search","reporting","pomodoro"];function _(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return f;let r=t.filter(e=>"string"==typeof e&&h.has(e));return Array.from(new Set(r))}catch{return f}}e.s(["parse_topbar_quick_actions",0,_],73205);var g=e.i(66295),b=e.i(34869),x=e.i(92629);let v=(0,b.create_ui_preference_store)({storage_key:x.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:x.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});var y=e.i(32792),w=e.i(90299),j=e.i(28274);function k(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}function N(){return k()}function S(){return"dark"}var E=e.i(35434),C=e.i(17798),T=e.i(10464),O=e.i(61834),A=e.i(81553),L=e.i(25204);let I="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",P={today:{href:"/today",label:"Today"},review:{href:"/review",label:"Review"},templates:{href:"/templates",label:"Templates"},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"}},D=new Set(["manage-tags","pomodoro","templates","sync-settings"]);function R(){let e=(0,n.useRouter)(),i=(0,n.usePathname)()??"/",s=(0,c.useSyncExternalStore)(E.subscribe_theme,N,S),o=(0,c.useSyncExternalStore)(v.subscribe,v.get_snapshot,v.get_server_snapshot),l=(0,c.useSyncExternalStore)(w.tracker_shortcut_map_preference.subscribe,w.tracker_shortcut_map_preference.get_snapshot,w.tracker_shortcut_map_preference.get_server_snapshot),h=(0,c.useSyncExternalStore)(y.topbar_quick_actions_preference.subscribe,y.topbar_quick_actions_preference.get_snapshot,y.topbar_quick_actions_preference.get_server_snapshot),f=(0,g.parse_tracker_shortcut_map)(l),b=new Set(_(h)),x=p.topbar_quick_action_ids.filter(e=>!b.has(e)),R=Array.from(new Set([...Array.from(D),...x])),{email:$,is_configured:M,is_pending:U,sign_out:F}=(0,a.use_supabase_auth_session)(),[K,G]=(0,c.useState)(!1),q=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(!K)return;let e=e=>{null===q.current||q.current.contains(e.target)||G(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[K]);let Y=()=>{G(!1)};return(0,L.use_escape_to_cancel)(Y,K),(0,t.jsxs)("div",{className:"relative shrink-0",ref:q,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":K,"aria-haspopup":"menu",onClick:()=>G(e=>!e),children:(0,t.jsx)(u.HamburgerIcon,{})}),K?(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:[M&&null!==$?(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:$,children:$})}):null,R.map(e=>{let n=P[e];return(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:n.href,className:I,role:"menuitem",onClick:Y,children:n.label})},e)}),M?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:I,role:"menuitemcheckbox","aria-checked":"true"===o,onClick:()=>{let e="true"===o?"false":"true";v.write(e),v.notify(),(0,m.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==$&&(0,j.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"===o?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===o?"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:I,role:"menuitem",onClick:()=>{let e;Y(),e="dark"===k()?"light":"dark",(0,C.apply_theme)(e),(0,A.write_stored_theme)(e),T.theme_mode_preference.write(e),(0,O.write_document_preference_cookies)({theme_mode:e,theme:e}),T.theme_mode_preference.notify(),(0,E.notify_theme_subscribers)(),(0,m.notify_settings_saved)()},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:I,role:"menuitem",onClick:()=>{let e;Y(),e=f.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:"(?)"})]})})}),M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===$?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:I,role:"menuitem",onClick:()=>{Y(),e.push((0,d.build_auth_page_href)("sign_in",i))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${I} text-danger`,role:"menuitem",disabled:U,onClick:()=>{Y(),F()},children:U?"Signing out…":"Sign out"})})]}):null]}):null]})}let $=[{id:"today",href:"/today",label:"Today"},{id:"review",href:"/review",label:"Review"},{id:"templates",href:"/templates",label:"Templates"},{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"}];function M(){let e=(0,n.usePathname)()??"/",i=(0,c.useSyncExternalStore)(y.topbar_quick_actions_preference.subscribe,y.topbar_quick_actions_preference.get_snapshot,y.topbar_quick_actions_preference.get_server_snapshot),s=(0,c.useMemo)(()=>_(i),[i]);if(0===s.length)return null;let o=$.filter(e=>s.includes(e.id));return 0===o.length?null:(0,t.jsx)("div",{className:"hidden items-center gap-1 min-[980px]:flex",children:o.map(n=>{let i=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 ${i?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,"aria-current":i?"page":void 0,children:n.label},n.id)})})}var U=e.i(29539);function F(){let e=((0,n.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(r.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)(U.SettingsIcon,{})})}function K({current:e,parent:n}){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)(r.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==n.href?(0,t.jsx)(r.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:n.href,children:n.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:n.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)(K,{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)(s,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(M,{}),(0,t.jsx)(l,{}),(0,t.jsx)(F,{}),(0,t.jsx)(R,{})]})]})]})})}],75404)},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}])},18774,e=>{"use strict";e.s(["format_display_tag",0,function(e){return e.startsWith("@")?e:`@${e}`}])},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(8063),r=e.i(51268),n=e.i(18774),i=e.i(52405),s=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:o,known_tags:a,placeholder:l,disabled:c=!1,autoFocus:u=!1,on_change:d}){let m=(0,r.useRef)(null),p=(0,r.useRef)(null),h=(0,r.useRef)(null),[f,_]=(0,r.useState)(0),[g,b]=(0,r.useState)(0),x=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let i=r.slice(n+1);return/\s/.test(i)?null:{query:i,start_index:n,end_index:t}}(o,f),v=null===x?[]: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)}(a,x.query),y=null!==x&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,s.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(x.query,a),w=null!==x&&v.length>0&&!y&&!c;(0,r.useLayoutEffect)(()=>{null!==h.current&&null!==m.current&&(m.current.setSelectionRange(h.current,h.current),_(h.current),h.current=null)},[o]),(0,r.useEffect)(()=>{b(0)},[o,f,v.length]);let j=()=>{_(m.current?.selectionStart??o.length)},k=()=>{b(0)},N=e=>{let t,r,i;if(null===x)return;let{next_text:s,next_cursor:a}=(t=(0,n.format_display_tag)(e),r=o.slice(0,x.start_index),i=o.slice(x.end_index),{next_text:`${r}${t}${i}`,next_cursor:r.length+t.length});h.current=a,d(s),k()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",role:"combobox",className:(0,i.get_input_class_name)(),value:o,placeholder:l,disabled:c,autoFocus:u,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),_(e.target.selectionStart??e.target.value.length)},onClick:j,onKeyUp:j,onKeyDown:e=>{if(w){if("ArrowDown"===e.key){e.preventDefault(),b(e=>(e+1)%v.length);return}if("ArrowUp"===e.key){e.preventDefault(),b(e=>(e-1+v.length)%v.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=v[g];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),k())}},onBlur:()=>{window.setTimeout(k,120)}}),w?(0,t.jsx)("ul",{ref:p,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:v.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(),N(e)},children:(0,n.format_display_tag)(e)})},e))}):null]})}],14260)},3159,e=>{"use strict";var t=e.i(97176);let r=new Set(["/api/note"]);async function n(e,n){let i={method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},s=await fetch(e,i);if(!s.ok){var o,a;let t,n=(await s.json()).error??"Request failed";if(o=e,a=n,r.has(o)&&((t=a.toLowerCase()).includes("duplicate key")||t.includes("unique constraint"))){if(await new Promise(e=>{setTimeout(e,25)}),!(s=await fetch(e,i)).ok)throw Error((await s.json()).error??n)}else throw Error(n)}let l=await s.json();return(0,t.notify_tracker_db_cloud_sync)(e,n),l}e.s(["patch_tracker_action",0,n])},67999,e=>{"use strict";e.s(["get_serialized_entries_total_ms",0,function(e){return e.reduce((e,t)=>e+t.durationMs,0)}])},39474,20993,e=>{"use strict";var t=e.i(13349),r=e.i(32417),n=e.i(44171),i=e.i(28274);let s=null,o=Promise.resolve();function a(){(0,r.is_supabase_configured)()&&(0,n.is_cloud_sync_enabled)()&&(null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,o=o.then(()=>(0,i.run_tracker_db_cloud_sync)()).catch(()=>{})},400))}function l(){(0,t.is_greedy_cloud_sync_enabled)()&&a()}e.s(["schedule_tracker_db_cloud_sync",0,l],20993),e.s(["push_tracker_db_cloud_after_change",0,function(){(0,t.is_greedy_cloud_sync_enabled)()?l():a()}],39474)},97176,e=>{"use strict";var t=e.i(13349);async function r(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 n=e.i(39474),i=e.i(20993);e.s(["notify_tracker_db_cloud_sync",0,function(e,s){if("/api/sheet"===e&&"object"==typeof s&&null!==s&&!0!==s.delete&&!(0,t.is_greedy_cloud_sync_enabled)()){let e=s.name?.trim()??"";e.length>0&&r(e).catch(()=>{});return}(0,t.is_greedy_cloud_sync_enabled)()?(0,i.schedule_tracker_db_cloud_sync)():(0,n.push_tracker_db_cloud_after_change)()}],97176)},44356,e=>{"use strict";var t=e.i(18774);e.s(["build_resume_description",0,function(e,r){let n=e.trim(),i=n.length>0?n:"Untitled entry",s=r.map(e=>(0,t.format_display_tag)(e)).join(" ");return s.length>0?`${i} ${s}`.trim():i}])},51229,e=>{"use strict";var t=e.i(97176);let r=new Set(["/api/note"]);async function n(e,n){let i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},s=await fetch(e,i);if(!s.ok){var o,a;let t,n=(await s.json()).error??"Request failed";if(o=e,a=n,r.has(o)&&((t=a.toLowerCase()).includes("duplicate key")||t.includes("unique constraint"))){if(await new Promise(e=>{setTimeout(e,25)}),!(s=await fetch(e,i)).ok)throw Error((await s.json()).error??n)}else throw Error(n)}let l=await s.json();return(0,t.notify_tracker_db_cloud_sync)(e,n),l}e.s(["post_tracker_action",0,n])},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{}}}])},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}}])},69472,84545,50937,83327,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.CLAUDE_API_KEY_STORAGE_KEY,default_value:r.CLAUDE_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["claude_api_key_preference",0,n],69472);let i=(0,t.create_ui_preference_store)({storage_key:r.ENTRY_SUGGESTION_PROVIDER_STORAGE_KEY,default_value:r.ENTRY_SUGGESTION_PROVIDER_DEFAULT,is_valid:e=>"none"===e||"openai"===e||"claude"===e||"google_ai"===e});e.s(["entry_suggestion_provider_preference",0,i],84545);let s=(0,t.create_ui_preference_store)({storage_key:r.GOOGLE_AI_API_KEY_STORAGE_KEY,default_value:r.GOOGLE_AI_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["google_ai_api_key_preference",0,s],50937);let o=(0,t.create_ui_preference_store)({storage_key:r.OPENAI_API_KEY_STORAGE_KEY,default_value:r.OPENAI_API_KEY_DEFAULT,is_valid:e=>e.trim().length>0});e.s(["openai_api_key_preference",0,o],83327)},75899,35923,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")}],75899);var r=e.i(51268),n=e.i(97891);e.s(["use_time_format",0,function(){return(0,r.useSyncExternalStore)(n.time_format_preference.subscribe,n.time_format_preference.get_snapshot,n.time_format_preference.get_server_snapshot)}],35923)},69837,e=>{"use strict";var t=e.i(39552);e.s(["format_datetime_hint",0,function(e){return(0,t.format)(new Date(e),"MMM d, h:mm a")}])},92977,e=>{"use strict";var t=e.i(8063);e.s(["TrashIcon",0,function(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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:"M3 6h18"}),(0,t.jsx)("path",{d:"M8 6V4h8v2"}),(0,t.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,t.jsx)("path",{d:"M10 11v6"}),(0,t.jsx)("path",{d:"M14 11v6"})]})}])},35877,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.DEBUG_LOGGING_STORAGE_KEY,default_value:r.DEBUG_LOGGING_DEFAULT,is_valid:e=>"true"===e||"false"===e});e.s(["debug_logging_preference",0,n])},96947,59515,91966,e=>{"use strict";e.s(["get_api_key_for_suggestion_provider",0,function(e,t){return"openai"===e?t.openai:"claude"===e?t.claude:"google_ai"===e?t.google_ai:""}],96947);var t=e.i(35877);async function r(e){if("none"===e.provider)throw Error("AI suggestion provider is disabled");let r="true"===t.debug_logging_preference.read(),n=Date.now(),i={provider:e.provider,context:e.context,notes:e.notes,debug_logging:r};r&&console.info("[ai-suggestion] client request start",{provider:e.provider,context_length:e.context.length,notes_length:e.notes.length});try{let t=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...i,api_key:e.api_key})});if(!t.ok){let i=await t.json().catch(()=>({}));throw r&&console.warn("[ai-suggestion] client request failed",{provider:e.provider,status:t.status,elapsed_ms:Date.now()-n,error:i.error??"Failed to suggest description"}),Error(i.error??"Failed to suggest description")}let s=await t.json(),o=s.description?.trim()??"";if(0===o.length)throw Error("Suggestion was empty");return r&&console.info("[ai-suggestion] client request success",{provider:e.provider,elapsed_ms:Date.now()-n,description_length:o.length}),o}catch(t){throw r&&console.error("[ai-suggestion] client request error",{provider:e.provider,elapsed_ms:Date.now()-n,error:t instanceof Error?t.message:String(t)}),t}}e.s(["request_ai_entry_description_suggestion",0,r],59515);var n=e.i(51268),i=e.i(36405);e.s(["use_confirm_destructive_actions",0,function(){return"true"===(0,n.useSyncExternalStore)(i.confirm_destructive_actions_preference.subscribe,i.confirm_destructive_actions_preference.get_snapshot,i.confirm_destructive_actions_preference.get_server_snapshot)}],91966)},98846,e=>{"use strict";var t=e.i(8063);e.s(["AiSparklesIcon",0,function(){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"})})}])},28098,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(37399),i=e.i(25204);let s="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";e.s(["EntryActionsMenu",0,function(e){var o,a,l,c,u,d;let{current_sheet_name:m,sheets:p,is_pending:h,on_edit:f,on_add_note:_,on_show_add_note_form:g,on_revise_description_ai:b,can_revise_description_ai:x=!1,on_resume:v,entry_is_active:y=!1,can_split:w=!1,on_split:j,can_merge_previous:k=!1,can_merge_next:N=!1,on_merge:S,on_delete:E,on_archive:C,on_unarchive:T,entry_is_archived:O=!1,on_move:A}=e,L=p.find(e=>e.name===m),I=y||L?.hasActiveEntry===!0&&!y,P=y?"This entry is already active":"Another entry is active on this sheet",D=p.filter(e=>e.name!==m&&!0!==e.archived),[R,$]=(0,r.useState)(!1),M=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!R)return;let e=e=>{null===M.current||M.current.contains(e.target)||$(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[R]);let U=()=>{$(!1)};return(0,i.use_escape_to_cancel)(U,R),(0,t.jsxs)("div",{className:"relative shrink-0",ref:M,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":"Entry actions","aria-expanded":R,"aria-haspopup":"menu",disabled:h,onClick:()=>$(e=>!e),children:(0,t.jsx)(n.HamburgerIcon,{})}),R?(0,t.jsxs)("div",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(o=h,a=U,l=f,(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:o,onClick:()=>{a(),l()},children:"Edit times"})})),function({is_pending:e,close_menu:r,on_show_add_note_form:n,on_add_note:i}){return void 0===n&&void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e,onClick:()=>{if(r(),void 0!==n)return void n();let e=function(){let e=window.prompt("Add note","");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}();null!==e&&void 0!==i&&i(e)},children:"Add note"})})}({is_pending:h,close_menu:U,on_show_add_note_form:g,on_add_note:_}),function({is_pending:e,can_revise_description_ai:r,close_menu:n,on_revise_description_ai:i}){return void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{n(),i()},children:"Revise description with AI"})})}({is_pending:h,can_revise_description_ai:x,close_menu:U,on_revise_description_ai:b}),function({is_pending:e,resume_blocked:r,resume_blocked_reason:n,close_menu:i,on_resume:o}){return void 0===o?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||r,title:r?n:void 0,onClick:()=>{i(),o()},children:"Resume"})})}({is_pending:h,resume_blocked:I,resume_blocked_reason:P,close_menu:U,on_resume:v}),function({is_pending:e,can_split:r,close_menu:n,on_split:i}){return void 0===i?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Split into two entries at a time":"Only completed entries can be split",onClick:()=>{if(n(),!r)return;let e=function(){let e=window.prompt("Split at what time?","1 hour ago");if(null===e)return null;let t=e.trim();return 0===t.length?null:t}();null!==e&&i(e)},children:"Split entry"})})}({is_pending:h,can_split:w,close_menu:U,on_split:j}),function({is_pending:e,can_merge_previous:r,can_merge_next:n,close_menu:i,on_merge:o}){return void 0===o?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!r,title:r?"Merge with the previous entry":"No touching previous entry",onClick:()=>{i(),r&&o("previous")},children:"Merge with previous"})}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||!n,title:n?"Merge with the next entry":"No touching next entry",onClick:()=>{i(),n&&o("next")},children:"Merge with next"})})]})}({is_pending:h,can_merge_previous:k,can_merge_next:N,close_menu:U,on_merge:S}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),function({other_sheets:e,is_pending:r,close_menu:n,on_move:i}){return 0===e.length?(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:!0,children:"No other sheets"})}):e.map(e=>(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${s} pl-4`,role:"menuitem",disabled:r||e.hasActiveEntry,title:e.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{n(),i(e.name)},children:e.name})},e.name))}({other_sheets:D,is_pending:h,close_menu:U,on_move:A}),function({is_pending:e,entry_is_archived:r,entry_is_active:n,close_menu:i,on_archive:o,on_unarchive:a}){return r?void 0===a?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e,onClick:()=>{i(),a()},children:"Restore entry"})}):void 0===o?null:(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:s,role:"menuitem",disabled:e||n,title:n?"Check out before archiving this entry":void 0,onClick:()=>{i(),o()},children:"Archive entry"})})}({is_pending:h,entry_is_archived:O,entry_is_active:y,close_menu:U,on_archive:C,on_unarchive:T}),(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("hr",{className:"my-1 border-0 border-t border-panel-border","aria-hidden":"true"})}),(c=h,u=U,d=E,(0,t.jsx)("div",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${s} text-danger`,role:"menuitem",disabled:c,onClick:()=>{u(),d()},children:"Delete"})}))]}):null]})}],28098)},7568,34937,4903,27707,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(69837),i=e.i(14260),s=e.i(98846),o=e.i(44356),a=e.i(52663),l=e.i(52405),c=e.i(25204);function u({rotated:e=!1,className:r=""}){return(0,t.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${e?"rotate-90":""} ${r}`.trim(),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:"m9 18 6-6-6-6"})})}e.s(["EntryEditForm",0,function({entry:e,known_tags:u,is_pending:d,initial_description_override:m,in_active_panel:p=!1,times_only:h=!1,start_only:f=!1,on_save:_,on_cancel:g,on_revise_ai:b,is_ai_revise_pending:x=!1}){let v=(0,r.useMemo)(()=>m??(0,o.build_resume_description)(e.description,e.tags),[e.description,e.tags,m]),[y,w]=(0,r.useState)(v),[j,k]=(0,r.useState)(""),[N,S]=(0,r.useState)("");(0,r.useEffect)(()=>{w(m??(0,o.build_resume_description)(e.description,e.tags)),k(""),S("")},[e.description,e.id,e.sheetName,e.tags,m]),(0,c.use_escape_to_cancel)(g);let E=e.isActive?"still running":(0,n.format_datetime_hint)(e.end??e.start),C=h?j.trim().length>0||!f&&N.trim().length>0:y.trim()!==v.trim()||j.trim().length>0||!f&&N.trim().length>0;return(0,t.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${p?"mt-2":""}`,onSubmit:e=>{e.preventDefault();let t=y.trim(),r=j.trim(),n=N.trim(),i={};h||t===v.trim()||(i.description=t),r.length>0&&(i.start=r),!f&&n.length>0&&(i.end=n),(void 0!==i.description||void 0!==i.start||void 0!==i.end)&&_(i)},children:[(0,t.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:h?"Edit times":"Edit entry"}),h?null:(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${e.id}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),void 0!==b?(0,t.jsxs)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center gap-1 rounded border-0 bg-transparent px-1.5 py-0.5 text-[0.72rem] text-muted shadow-none transition-opacity hover:opacity-75 disabled:cursor-not-allowed disabled:opacity-40",title:"Generate a new AI revision",disabled:d||x,onClick:b,children:[(0,t.jsx)(s.AiSparklesIcon,{}),x?"Generating…":"Regenerate"]}):null]}),(0,t.jsx)(i.TagAutocompleteInput,{id:`entry-description-${e.id}`,value:y,known_tags:u,placeholder:"e.g. crafting something @design",disabled:d,autoFocus:p,on_change:w})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,t.jsxs)("div",{className:`grid gap-2.5 max-[860px]:grid-cols-1 ${f?"grid-cols-1":"grid-cols-2"}`,children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${e.id}`,children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,t.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",(0,n.format_datetime_hint)(e.start)]}),(0,t.jsx)("input",{id:`entry-start-${e.id}`,className:(0,l.get_input_class_name)("compact"),value:j,onChange:e=>k(e.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:d,autoFocus:h&&p})]}),f?null:(0,t.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${e.id}`,children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,t.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",E]}),(0,t.jsx)("input",{id:`entry-end-${e.id}`,className:(0,l.get_input_class_name)("compact"),value:N,onChange:e=>S(e.target.value),placeholder:e.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:d})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"submit",className:(0,a.get_button_class_name)("primary","small"),disabled:d||!C,children:"Save"}),(0,t.jsx)("button",{type:"button",className:(0,a.get_button_class_name)("ghost","small"),disabled:d,onClick:g,children:"Cancel"})]})]})}],7568);var d=e.i(75899);function m({initial_text:e,is_pending:n,inline:i=!1,on_save:s,on_cancel:o}){let[u,d]=(0,r.useState)(e);(0,c.use_escape_to_cancel)(o);let p=Math.min(6,Math.max(2,e.split("\n").length)),h=i?`${(0,l.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,l.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,t.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:e=>{e.preventDefault();let t=u.trim();0!==t.length&&s(t)},children:[(0,t.jsx)("textarea",{className:h,value:u,rows:p,disabled:n,onChange:e=>d(e.target.value)}),(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)("button",{type:"button",className:(0,a.get_button_class_name)("ghost"),disabled:n,onClick:o,children:"Cancel"}),(0,t.jsx)("button",{type:"submit",className:(0,a.get_button_class_name)("ghost"),disabled:n||0===u.trim().length,children:"Save"})]})]})}function p(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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 20h9"}),(0,t.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}e.s(["PencilIcon",0,p],34937);var h=e.i(92977),f=e.i(35923);let _="inline-flex h-6 w-6 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";function g({note:e,is_inline:r,is_panel_in_bar:n,is_pending:i,is_editing:s,time_format:o,on_cancel_edit:a,on_save:l,on_start_edit:c,on_delete:u,on_edit_note:f,on_delete_note:b}){let x=r?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":n?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",v=function({is_pending:e,on_start_edit:r,on_delete:n,on_edit_note:i,on_delete_note:s}){return void 0===i&&void 0===s?null:(0,t.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0===i?null:(0,t.jsx)("button",{type:"button",className:_,"aria-label":"Edit note",title:"Edit note",disabled:e,onClick:e=>{e.stopPropagation(),r()},children:(0,t.jsx)(p,{})}),void 0===s?null:(0,t.jsx)("button",{type:"button",className:`${_} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:e,onClick:e=>{e.stopPropagation(),n()},children:(0,t.jsx)(h.TrashIcon,{})})]})}({note:e,is_pending:i,on_start_edit:c,on_delete:u,on_edit_note:f,on_delete_note:b});return s?(0,t.jsx)("li",{className:x,children:(0,t.jsx)(m,{initial_text:e.text,inline:r,is_pending:i,on_cancel:a,on_save:l})}):r?(0,t.jsx)("li",{className:x,children:(0,t.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,t.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,t.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:e.timestamp,children:(0,d.format_time)(e.timestamp,o)}),(0,t.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:e.text})]}),v]})}):(0,t.jsxs)("li",{className:x,children:[(0,t.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,t.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:e.timestamp,children:(0,d.format_time)(e.timestamp,o)}),v]}),(0,t.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:e.text})]})}e.s(["EntryNotesList",0,function({notes:e,variant:n="panel",in_bar:i=!1,is_pending:s=!1,on_edit_note:o,on_delete_note:a}){var l;let c,d,m=(0,f.use_time_format)(),[p,h]=(0,r.useState)(null),[_,b]=(0,r.useState)("panel"===n&&!i);if(0===e.length)return null;let x=[...e].sort((e,t)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),v="inline"===n,y="panel"===n&&i,w=_||null!==p,j=(l=e.length,v?`${l} ${1===l?"note":"notes"}`:`Notes (${l})`),k=(c=[v?"m-0 w-full p-0":"border-t border-accent-border pt-3.5"],i&&!v&&c.push("border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]"),y&&w?c.push("flex min-h-0 flex-1 flex-col"):y&&c.push("flex shrink-0 flex-col"),c.join(" ")),N=v?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground",S=(d=w?"mt-1.5":"hidden",v?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${d}`:y?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${d}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${d}`);return(0,t.jsxs)("section",{className:k,"aria-label":"Entry notes",children:[(0,t.jsxs)("button",{type:"button",className:N,"aria-expanded":w,onClick:e=>{e.stopPropagation(),null===p&&b(e=>!e)},children:[(0,t.jsx)(u,{rotated:w}),(0,t.jsx)("span",{children:j})]}),(0,t.jsx)("ul",{className:S,children:x.map((e,r)=>(0,t.jsx)(g,{note:e,is_inline:v,is_panel_in_bar:y,is_pending:s,is_editing:p===e.timestamp,time_format:m,on_cancel_edit:()=>h(null),on_save:t=>{var r,n;return r=e.timestamp,n=e.text,void(o?.(r,n,t),h(null))},on_start_edit:()=>{var t;return t=e.timestamp,void(b(!0),h(t))},on_delete:()=>{var t,r;return t=e.timestamp,r=e.text,void(p===t&&h(null),a?.(t,r))},on_edit_note:o,on_delete_note:a},`${e.timestamp}-${r}`))})]})}],4903),e.s(["get_delete_entry_confirm_dialog",0,function(e){let t=e.description.trim()||"Untitled entry",r=e.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${t}" on sheet "${e.sheetName}"?${r}`,confirmLabel:"Delete",variant:"danger"}}],27707)},51408,e=>{"use strict";e.s(["format_unknown_error",0,function(e){if(e instanceof Error)return e.message;if("string"==typeof e)return e;if(null==e)return"Unknown error";if("number"==typeof e||"boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);try{return JSON.stringify(e)}catch{return"Unknown error"}}])},20397,e=>{"use strict";var t=e.i(51268),r=e.i(4874);e.s(["use_entry_list_sort",0,function(){return(0,t.useSyncExternalStore)(r.entry_list_sort_preference.subscribe,r.entry_list_sort_preference.get_snapshot,r.entry_list_sort_preference.get_server_snapshot)}])},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:i}=e,s={body:r,...void 0!==n?{tag:n}:{}};try{new Notification(i,s)}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])},36178,e=>{"use strict";e.s(["build_check_out_request_payload",0,function(e,t){let r={sheetName:e},n=t?.at?.trim(),i=t?.note?.trim();return void 0!==n&&n.length>0&&(r.at=n),void 0!==i&&i.length>0&&(r.note=i),r}])},52161,e=>{"use strict";var t=e.i(8063),r=e.i(51268),n=e.i(52663),i=e.i(52405),s=e.i(25204);e.s(["NoteForm",0,function({on_submit:e,on_cancel:o,is_pending:a,in_active_panel:l=!1,in_bar:c=!1,allow_at:u=!1}){let[d,m]=(0,r.useState)(""),[p,h]=(0,r.useState)("");return(0,s.use_escape_to_cancel)(()=>o?.(),void 0!==o),(0,t.jsxs)("form",{className:`flex flex-col gap-2 ${l&&!c?"border-t border-accent-border pt-4":c?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:t=>{t.preventDefault();let r=d.trim();if(0===r.length)return;let n=p.trim();e(r,n.length>0?n:void 0),m(""),h("")},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,i.get_input_class_name)(),value:d,onChange:e=>m(e.target.value),placeholder:"Pair with alice on the widget",disabled:a,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,n.get_button_class_name)("ghost"),disabled:a||0===d.trim().length,children:"Save note"}),void 0===o?null:(0,t.jsx)("button",{type:"button",className:(0,n.get_button_class_name)("ghost"),disabled:a,onClick:o,children:"Cancel"})]})]}),u?(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,i.get_input_class_name)(),value:p,onChange:e=>h(e.target.value),placeholder:"e.g. 30 minutes ago",disabled:a})]}):null]})}],52161)},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{}}])},53754,7554,76379,e=>{"use strict";var t=e.i(51268),r=e.i(19946);function n(e){let t=e?.at?.trim()??"",r=e?.note?.trim()??"",n=t.length>0,i=r.length>0,s="Stop the active timer and save this entry?";return n&&i?s=`Stop the timer at "${t}" and save a checkout note?`:n?s=`Stop the timer and check out at "${t}"?`:i&&(s="Stop the timer and save this entry with your checkout note?"),{title:"Check out?",message:s,confirmLabel:"Check out",variant:"danger"}}e.s(["get_check_out_confirm_dialog",0,n],7554);var i=e.i(97026);function s(){return"true"===(0,t.useSyncExternalStore)(i.confirm_before_checkout_preference.subscribe,i.confirm_before_checkout_preference.get_snapshot,i.confirm_before_checkout_preference.get_server_snapshot)}e.s(["use_confirm_before_checkout",0,s],76379),e.s(["useCheckOutAction",0,function(e){let{confirm:i}=(0,r.use_confirm_dialog)(),o=s();return(0,t.useCallback)(async t=>(!o||!!await i(n(t)))&&(e(t),!0),[i,o,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}])},68713,e=>{"use strict";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),i=n.state;if(i?.status!=="running")return;let s={settings:n.settings??t.POMODORO_DEFAULT_SETTINGS,state:t.POMODORO_DEFAULT_STATE};window.localStorage.setItem(t.POMODORO_STORAGE_KEY,JSON.stringify(s)),(0,r.clear_pomodoro_task_entry_marker)()}catch{}}])},60812,49532,85910,92572,31363,3087,e=>{"use strict";var t=e.i(44356);e.s(["build_entry_template_description",0,function(e){return(0,t.build_resume_description)(e.description,e.tags??[])}],60812);let r=["defaultSheetName","shortcutKey","createdAt","lastUsedAt"],n=e=>"object"==typeof e&&null!==e&&"string"==typeof e.id&&"string"==typeof e.name&&"string"==typeof e.description,i=e=>{let t={id:e.id,name:e.name,description:e.description};for(let n of r){let r=e[n];"string"==typeof r&&r.trim().length>0&&(t[n]=r)}return Array.isArray(e.tags)&&(t.tags=e.tags.filter(e=>"string"==typeof e&&e.length>0)),"boolean"==typeof e.favorite&&(t.favorite=e.favorite),"boolean"==typeof e.pomodoroLinked&&(t.pomodoroLinked=e.pomodoroLinked),"number"==typeof e.useCount&&Number.isFinite(e.useCount)&&e.useCount>0&&(t.useCount=Math.round(e.useCount)),t};function s(){try{let e=window.localStorage.getItem("super-time-tracker-entry-templates");if(null===e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(n).map(i)}catch{return[]}}e.s(["read_entry_templates",0,s],49532);let o=[],a=null;function l(){a=null}e.s(["EMPTY_ENTRY_TEMPLATES",0,o,"get_stable_entry_templates_snapshot",0,function(e){let t=e.map(e=>[e.id,e.name,e.description,e.defaultSheetName??"",e.tags?.join(" ")??"",!0===e.favorite?"1":"0",e.shortcutKey??"",!0===e.pomodoroLinked?"1":"0",e.createdAt??"",e.lastUsedAt??"",String(e.useCount??0)].join("\0")).join("\n");if(null!==a&&a.templates_key===t)return a.snapshot;let r=0===e.length?o:Object.freeze(e.map(e=>({...e})));return a={templates_key:t,snapshot:r},r},"reset_entry_templates_snapshot_cache",0,l],85910);let c=new Set;function u(){l(),c.forEach(e=>{e()})}function d(e){if(void 0!==globalThis.window)try{globalThis.window.localStorage.setItem("super-time-tracker-entry-templates",JSON.stringify(e)),u()}catch{}}e.s(["notify_entry_templates_changed",0,u,"subscribe_entry_templates",0,function(e){return c.add(e),()=>{c.delete(e)}}],92572),e.s(["write_entry_templates",0,d],31363),e.s(["record_entry_template_usage",0,function(e){let t=s(),r=new Date().toISOString(),n=!1,i=t.map(t=>t.id!==e?t:(n=!0,{...t,lastUsedAt:r,useCount:(t.useCount??0)+1}));n&&d(i)}],3087)},19653,64803,14843,e=>{"use strict";var t=e.i(8063);e.s(["SaveIcon",0,function(){return(0,t.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",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:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),(0,t.jsx)("path",{d:"M17 21v-8H7v8"}),(0,t.jsx)("path",{d:"M7 3v5h8"})]})}],19653);var r=e.i(52405);e.s(["get_select_class_name",0,function(e="default"){let t="compact"===e?"bg-[position:right_0.55rem_center]":"bg-[position:right_0.65rem_center]",n="compact"===e?"!pe-8":"!pe-9";return`${(0,r.get_input_class_name)(e)} cursor-pointer appearance-none bg-size-[1rem] bg-no-repeat ${n} bg-[image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")] ${t}`}],64803);var n=e.i(51268),i=e.i(85910),s=e.i(49532);function o(){return(0,i.get_stable_entry_templates_snapshot)((0,s.read_entry_templates)())}function a(){return i.EMPTY_ENTRY_TEMPLATES}var l=e.i(92572);e.s(["use_entry_templates",0,function(){return(0,n.useSyncExternalStore)(l.subscribe_entry_templates,o,a)}],14843)},6838,e=>{e.v(t=>Promise.all(["static/chunks/0fa.o-_asg9n7.js"].map(t=>e.l(t))).then(()=>t(19550)))},72432,e=>{e.v(t=>Promise.all(["static/chunks/01_obgfd_d0-5.js"].map(t=>e.l(t))).then(()=>t(11791)))}]);
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[16229,a=>{"use strict";a.s(["message_from_unknown_error",0,function(a,b){return a instanceof Error?a.message:"string"==typeof a?a:b}])},19702,a=>{"use strict";a.s(["ACTIVE_SHEET_COOKIE_NAME",0,"stt-active-sheet","ACTIVE_SHEET_STORAGE_KEY",0,"super-time-tracker-active-sheet","COMPACT_LISTS_STORAGE_KEY",0,"super-time-tracker-compact-lists","DEFAULT_SHEET_FIXED_NAME_COOKIE_NAME",0,"stt-default-sheet-fixed-name","DEFAULT_SHEET_FIXED_NAME_STORAGE_KEY",0,"super-time-tracker-default-sheet-fixed-name","DEFAULT_SHEET_SESSION_MODE_COOKIE_NAME",0,"stt-default-sheet-session-mode","DEFAULT_SHEET_SESSION_MODE_DEFAULT",0,"last_viewed","DEFAULT_SHEET_SESSION_MODE_STORAGE_KEY",0,"super-time-tracker-default-sheet-session-mode","SHEET_TAG_FILTERS_STORAGE_KEY",0,"super-time-tracker-sheet-tag-filters"])},14679,a=>{"use strict";var b=a.i(72958),c=a.i(19702);a.s(["navigate_to_tracker_sheet",0,function(a){let d=a.trim();if(0!==d.length){try{window.localStorage.setItem(c.ACTIVE_SHEET_STORAGE_KEY,d),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}try{let a=encodeURIComponent(d);document.cookie=`${c.ACTIVE_SHEET_COOKIE_NAME}=${a}; Path=/; Max-Age=31536000; SameSite=Lax`}catch{}}}],14679)},34030,42676,6229,40663,30322,a=>{"use strict";function b(){return[]}a.s(["read_entry_templates",0,b],42676);let c=[],d=null;function e(){d=null}a.s(["EMPTY_ENTRY_TEMPLATES",0,c,"get_stable_entry_templates_snapshot",0,function(a){let b=a.map(a=>[a.id,a.name,a.description,a.defaultSheetName??"",a.tags?.join(" ")??"",!0===a.favorite?"1":"0",a.shortcutKey??"",!0===a.pomodoroLinked?"1":"0",a.createdAt??"",a.lastUsedAt??"",String(a.useCount??0)].join("\0")).join("\n");if(null!==d&&d.templates_key===b)return d.snapshot;let e=0===a.length?c:Object.freeze(a.map(a=>({...a})));return d={templates_key:b,snapshot:e},e},"reset_entry_templates_snapshot_cache",0,e],6229);let f=new Set;function g(){e(),f.forEach(a=>{a()})}function h(a){if(void 0!==globalThis.window)try{globalThis.window.localStorage.setItem("super-time-tracker-entry-templates",JSON.stringify(a)),g()}catch{}}a.s(["notify_entry_templates_changed",0,g,"subscribe_entry_templates",0,function(a){return f.add(a),()=>{f.delete(a)}}],40663),a.s(["write_entry_templates",0,h],30322),a.s(["record_entry_template_usage",0,function(a){let c=b(),d=new Date().toISOString(),e=!1,f=c.map(b=>b.id!==a?b:(e=!0,{...b,lastUsedAt:d,useCount:(b.useCount??0)+1}));e&&h(f)}],34030)},69749,a=>{"use strict";a.s(["get_input_class_name",0,function(a="default"){let b="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"===a?`${b} px-2.5 py-2`:b}])},48174,a=>{"use strict";a.s(["format_display_tag",0,function(a){return a.startsWith("@")?a:`@${a}`}])},59659,5796,a=>{"use strict";var b=a.i(87281);function c(){}function d(){(0,b.is_greedy_cloud_sync_enabled)()&&c()}a.i(63577),a.i(51652),a.i(74365),Promise.resolve(),a.s(["schedule_tracker_db_cloud_sync",0,d],5796),a.s(["push_tracker_db_cloud_after_change",0,function(){(0,b.is_greedy_cloud_sync_enabled)()?d():c()}],59659)},71034,a=>{"use strict";var b=a.i(87281);async function c(a){let b=await fetch("/api/sheet/active",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})});if(!b.ok)throw Error((await b.json()).error??"Failed to update active sheet in cloud")}var d=a.i(59659),e=a.i(5796);a.s(["notify_tracker_db_cloud_sync",0,function(a,f){if("/api/sheet"===a&&"object"==typeof f&&null!==f&&!0!==f.delete&&!(0,b.is_greedy_cloud_sync_enabled)()){let a=f.name?.trim()??"";a.length>0&&c(a).catch(()=>{});return}(0,b.is_greedy_cloud_sync_enabled)()?(0,e.schedule_tracker_db_cloud_sync)():(0,d.push_tracker_db_cloud_after_change)()}],71034)},50803,a=>{"use strict";var b=a.i(48174);a.s(["build_resume_description",0,function(a,c){let d=a.trim(),e=d.length>0?d:"Untitled entry",f=c.map(a=>(0,b.format_display_tag)(a)).join(" ");return f.length>0?`${e} ${f}`.trim():e}])},115,a=>{"use strict";var b=a.i(71034);let c=new Set(["/api/note"]);async function d(a,d){let e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)},f=await fetch(a,e);if(!f.ok){var g,h;let b,d=(await f.json()).error??"Request failed";if(g=a,h=d,c.has(g)&&((b=h.toLowerCase()).includes("duplicate key")||b.includes("unique constraint"))){if(await new Promise(a=>{setTimeout(a,25)}),!(f=await fetch(a,e)).ok)throw Error((await f.json()).error??d)}else throw Error(d)}let i=await f.json();return(0,b.notify_tracker_db_cloud_sync)(a,d),i}a.s(["post_tracker_action",0,d])},33272,a=>{"use strict";a.s(["build_entry_search_href",0,function(a){let b=new URLSearchParams;a.query.trim().length>0&&b.set("q",a.query.trim()),a.sheetName.trim().length>0&&b.set("sheet",a.sheetName.trim()),a.tag.trim().length>0&&b.set("tag",a.tag.trim()),a.fromDate.trim().length>0&&b.set("from",a.fromDate.trim()),a.toDate.trim().length>0&&b.set("to",a.toDate.trim());let c=b.toString();return c.length>0?`/search?${c}`:"/search"}])},38005,a=>{"use strict";let b={query:"",sheetName:"",tag:"",fromDate:"",toDate:""};a.s(["get_empty_entry_search_filters",0,function(){return{...b}}])},2837,a=>{"use strict";var b=a.i(59021);a.s(["use_debounced_value",0,function(a,c){let[d,e]=(0,b.useState)(a);return(0,b.useEffect)(()=>{let b=window.setTimeout(()=>{e(a)},c);return()=>{window.clearTimeout(b)}},[a,c]),d}])},71312,a=>{"use strict";var b=a.i(61401),c=a.i(60382),d=a.i(59021),e=a.i(69749);function f({items:a,query:c,is_loading:g,error:h,on_query_change:i,on_select:j,on_close:k}){var l;let m=(0,d.useId)(),n=(0,d.useRef)(null),o=(0,d.useRef)(null),[p,q]=(0,d.useState)(0),r=(0,d.useMemo)(()=>(function(a){let b=new Map;for(let c of a){let a=b.get(c.group)??[];a.push(c),b.set(c.group,a)}return Array.from(b.entries()).map(([a,b])=>({label:a,items:b}))})(a),[a]),s=(0,d.useMemo)(()=>r.flatMap(a=>a.items),[r]),t=(0,d.useMemo)(()=>{let a=new Map;return s.forEach((b,c)=>{a.set(b.id,c)}),a},[s]),u=0===s.length?0:Math.min(p,s.length-1),v=(l=s.length,!g&&0===l&&null===h);(0,d.useEffect)(()=>{let a=n.current;if(null!==a&&!a.open)return a.showModal(),()=>{a.open&&a.close()}},[]),(0,d.useEffect)(()=>{o.current?.focus()},[]);let w=()=>{n.current?.close(),k()};return(0,b.jsxs)("dialog",{ref:n,"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:a=>{a.preventDefault(),w()},children:[(0,b.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:w}),(0,b.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,b.jsx)("p",{id:m,className:"sr-only",children:"Command palette"}),(0,b.jsxs)("div",{className:"border-b border-panel-border px-3 py-3",children:[(0,b.jsx)("label",{className:"sr-only",htmlFor:`${m}-input`,"aria-label":"Search commands",children:"Search commands"}),(0,b.jsx)("input",{ref:o,id:`${m}-input`,type:"search",autoComplete:"off",spellCheck:!1,placeholder:"Search sheets, entries, templates, reporting…",className:(0,e.get_input_class_name)("compact"),value:c,onChange:a=>{var b;return b=a.target.value,void(q(0),i(b))},onKeyDown:a=>{if((a.metaKey||a.ctrlKey)&&!a.altKey&&"k"===a.key.toLowerCase()){a.preventDefault(),a.stopPropagation(),w();return}if("Escape"===a.key){a.preventDefault(),w();return}if("ArrowDown"===a.key){if(a.preventDefault(),0===s.length)return;q(a=>(a+1)%s.length);return}if("ArrowUp"===a.key){if(a.preventDefault(),0===s.length)return;q(a=>0===a?s.length-1:a-1);return}if("Enter"===a.key){a.preventDefault();let b=s[u];void 0!==b&&j(b)}}})]}),(0,b.jsxs)("div",{className:"max-h-[min(24rem,55vh)] overflow-y-auto px-2 py-2","aria-live":"polite",children:[null===h?null:(0,b.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-danger",children:h}),g&&0===s.length?(0,b.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-muted",children:"Loading…"}):null,v?(0,b.jsx)("p",{className:"m-0 px-2 py-3 text-[0.85rem] text-muted",children:"No matching commands."}):null,r.map(a=>(0,b.jsxs)("section",{className:"mb-2 last:mb-0","aria-label":a.label,children:[(0,b.jsx)("h2",{className:"m-0 px-2 py-1 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:a.label}),(0,b.jsx)("ul",{className:"m-0 list-none p-0",children:a.items.map(a=>{let c=t.get(a.id)??0,d=c===u;return(0,b.jsx)("li",{children:(0,b.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 ${d?"bg-accent-soft text-foreground":"bg-transparent text-inherit hover:bg-surface-hover"}`,onMouseEnter:()=>q(c),onClick:()=>j(a),children:[(0,b.jsx)("span",{className:"text-[0.9rem] font-semibold",children:a.title}),void 0===a.subtitle?null:(0,b.jsx)("span",{className:"text-[0.78rem] text-muted",children:a.subtitle})]})},a.id)})})]},a.label))]}),(0,b.jsxs)("div",{className:"border-t border-panel-border px-3 py-2 text-[0.72rem] text-muted",children:[(0,b.jsx)("span",{className:"font-mono",children:"↑↓"})," navigate ·"," ",(0,b.jsx)("span",{className:"font-mono",children:"↵"})," select ·"," ",(0,b.jsx)("span",{className:"font-mono",children:"esc"})," close ·"," ",(0,b.jsx)("span",{className:"font-mono",children:"Ctrl+P"})," toggle"]})]})]})}var g=a.i(48174);let h=[{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-review",kind:"navigate",group:"Pages",title:"Open End-of-day Review",keywords:["review","end of day","daily","cleanup","gaps"],href:"/review"},{id:"nav-templates",kind:"navigate",group:"Pages",title:"Open Template Library",keywords:["templates","library","check in","shortcuts"],href:"/templates"},{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"}],i=[{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 j(a){let b=a.tags.map(a=>(0,g.format_display_tag)(a)).join(" ");return b.length>0?`${a.sheetName} \xb7 ${b}`:a.sheetName}var k=a.i(33272),l=a.i(38005),m=a.i(50803),n=a.i(14679),o=a.i(97917),p=a.i(97063),q=a.i(115),r=a.i(34030);async function s({item:a,pathname:b,navigate:c}){switch(a.kind){case"navigate":case"reporting_range":if(void 0===a.href)return;c(a.href);return;case"sheet":if(void 0===a.sheetName)return;await t(a.sheetName,b,c);return;case"template_check_in":{let d=a.description?.trim()??"";if(0===d.length)return;await u({description:d,sheet_name:a.sheetName,pathname:b,navigate:c}),void 0!==a.templateId&&(0,r.record_entry_template_usage)(a.templateId);return}case"resume_last":case"resume_entry":{let d=a.description??"",e=a.tags??[];await u({description:(0,m.build_resume_description)(d,e),sheet_name:a.sheetName,pathname:b,navigate:c});return}default:return}}async function t(a,b,c){(0,n.navigate_to_tracker_sheet)(a),await (0,q.post_tracker_action)("/api/sheet",{name:a}),(0,p.notify_tracker_state_sync)(),"/"!==b&&c("/")}async function u({description:a,sheet_name:b,pathname:c,navigate:d}){let e=b?.trim()??"";e.length>0&&((0,n.navigate_to_tracker_sheet)(e),await (0,q.post_tracker_action)("/api/sheet",{name:e}));try{await (0,q.post_tracker_action)("/api/in",{description:a,...e.length>0?{sheetName:e}:{}}),(0,p.notify_tracker_state_sync)(),"/"!==c&&d("/"),(0,o.notify_in_app)({title:"Checked in",body:a})}catch(a){throw(0,o.notify_in_app)({title:"Check-in failed",body:a instanceof Error?a.message:String(a)}),a}}async function v(a){let b=new URLSearchParams;a.trim().length>0&&b.set("q",a.trim());let c=b.size>0?`?${b.toString()}`:"",d=await fetch(`/api/command-palette${c}`,{method:"GET",cache:"no-store"});if(!d.ok)throw Error((await d.json().catch(()=>({}))).error??"Failed to load command palette data");return await d.json()}var w=a.i(46299),x=a.i(80185),y=a.i(16229),z=a.i(2837);let A={activeSheetName:null,sheets:[],lastCompletedEntry:null,matchingEntries:[]};a.s(["CommandPaletteProvider",0,function(){var a;let e=(0,c.useRouter)(),g=(0,c.usePathname)()??"/",[m,n]=(0,d.useState)(!1),[o,p]=(0,d.useState)(""),q=(0,z.use_debounced_value)(o,200),[r,t]=(0,d.useState)(A),[u,B]=(0,d.useState)(!1),[C,D]=(0,d.useState)(null);a=(0,d.useCallback)(()=>{n(a=>(a&&p(""),!a))},[]),(0,d.useEffect)(()=>{let b=b=>{let c=b.target,d=c instanceof HTMLElement&&null!==c.closest('[data-command-palette-dialog="true"]');if((!(0,x.should_ignore_keyboard_shortcut)(b)||d)&&(b.metaKey||b.ctrlKey)&&!b.altKey&&"p"===b.key.toLowerCase()){if(b.preventDefault(),(0,w.is_modal_dialog_open)()&&null===document.querySelector('[data-command-palette-dialog="true"]'))return;a()}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[a]),(0,d.useEffect)(()=>{if(!m)return;let a=!1;return(async()=>{B(!0),D(null);try{let b=await v(q);a||t(b)}catch(b){a||D((0,y.message_from_unknown_error)(b,"Failed to load commands"))}finally{a||B(!1)}})(),()=>{a=!0}},[m,q]);let E=(0,d.useMemo)(()=>{var a;let b,c=(a=function({snapshot:a,include_templates:b=!0}){var c,d;let e=[...h,...i.map(a=>{var b;return{id:`reporting-${a.shortcut}`,kind:"reporting_range",group:"Reporting ranges",title:a.title,keywords:a.keywords,href:(b=a.shortcut,`/reporting?range=${encodeURIComponent(b)}`),reportingRange:a.shortcut}})];for(let b of(null!==a.lastCompletedEntry&&e.push({id:"resume-last",kind:"resume_last",group:"Recent",title:"Resume last entry",subtitle:j(c=a.lastCompletedEntry),keywords:["resume","last",c.description,c.sheetName,...c.tags],sheetName:c.sheetName,entryId:c.id,description:c.description,tags:c.tags}),a.sheets))e.push({id:`sheet-${b.name}`,kind:"sheet",group:"Sheets",title:`Open sheet: ${b.name}`,subtitle:b.hasActiveEntry?"Timer running":void 0,keywords:["sheet",b.name,"project"],sheetName:b.name});let f=new Set;for(let b of a.matchingEntries){let a=`${b.sheetName}:${b.id}`;f.has(a)||(f.add(a),e.push((d=b,{id:`resume-${d.sheetName}-${d.id}`,kind:"resume_entry",group:"Entries",title:`Resume: ${d.description||"Untitled entry"}`,subtitle:j(d),keywords:["resume",d.description,d.sheetName,...d.tags],sheetName:d.sheetName,entryId:d.id,description:d.description,tags:d.tags})))}return e}({snapshot:r}),0===(b=o.trim().toLowerCase()).length?a:a.filter(a=>[a.title,a.subtitle??"",...a.keywords].join(" ").toLowerCase().includes(b))),d=o.trim();return 0===d.length?c:[{id:"search-all-entries",kind:"navigate",group:"Search",title:`Search all entries for "${d}"`,subtitle:"Open search with filters",keywords:["search",d],href:(0,k.build_entry_search_href)({...(0,l.get_empty_entry_search_filters)(),query:d})},...c]},[r,o]),F=(0,d.useCallback)(async a=>{n(!1),p("");try{await s({item:a,pathname:g,navigate:a=>{e.push(a)}})}catch{}},[g,e]),G=(0,d.useCallback)(()=>{n(!1),p("")},[]);return m?(0,b.jsx)(f,{items:E,query:o,is_loading:u,error:C,on_query_change:p,on_select:a=>{F(a)},on_close:G}):null}],71312)},68524,a=>{a.n(a.i(71312))}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_02l2ykc._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68120,e=>{"use strict";var t=e.i(8063),a=e.i(48042),s=e.i(51268),r=e.i(32584),n=e.i(56812);let l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],o=[0,6,12,18];function i({heatmap:e,duration_format:a,week_starts_on:r}){let l=(0,n.week_starts_on_to_index)(r),u=(0,s.useMemo)(()=>Array.from({length:7},(e,t)=>(l+t)%7),[l]),x=(0,s.useMemo)(()=>{let t=new Map;for(let a of e)t.set(`${a.weekdayIndex}-${a.hourIndex}`,a.totalMs);return t},[e]),f=(0,s.useMemo)(()=>e.reduce((e,t)=>Math.max(e,t.totalMs),0),[e]),h=(0,s.useMemo)(()=>e.reduce((e,t)=>e+t.totalMs,0),[e]);return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3 rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h3",{className:"m-0 text-[0.95rem] font-semibold",children:"Activity heatmap"}),(0,t.jsx)("p",{className:"m-0 text-[0.78rem] text-muted",children:"When during the week you usually track time."})]}),0===h?(0,t.jsx)("p",{className:"m-0 py-6 text-center text-[0.85rem] text-muted",children:"Once you start logging time, your weekly rhythm appears here."}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsx)("div",{className:"min-w-[420px] pb-1",children:(0,t.jsxs)("div",{className:"grid grid-cols-[2rem_1fr] gap-x-2",children:[(0,t.jsx)("div",{}),(0,t.jsx)("div",{className:"relative h-3.5 w-full",children:o.map(e=>(0,t.jsx)("span",{className:"absolute -translate-x-1/2 text-[0.65rem] font-medium uppercase tracking-[0.06em] text-muted",style:{left:`${e/24*100}%`},children:c(e)},e))}),u.map(e=>(0,t.jsx)(d,{weekday_index:e,cell_lookup:x,max_cell_ms:f,duration_format:a},e))]})})}),(0,t.jsxs)("footer",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-[0.72rem] text-muted",children:[(0,t.jsx)("span",{children:"Less"}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:[.15,.35,.6,.85,1].map(e=>(0,t.jsx)("span",{className:"inline-block h-3 w-4 rounded-sm",style:{backgroundColor:m(e)}},e))}),(0,t.jsx)("span",{children:"More"})]})]})}function d({weekday_index:e,cell_lookup:a,max_cell_ms:s,duration_format:n}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"self-center text-[0.7rem] font-medium uppercase tracking-[0.06em] text-muted",children:l[e]}),(0,t.jsx)("div",{className:"grid gap-[2px]",style:{gridTemplateColumns:"repeat(24, minmax(0, 1fr))"},children:Array.from({length:24},(o,i)=>{let d=a.get(`${e}-${i}`)??0;return(0,t.jsx)("span",{className:"block aspect-square min-h-[14px] rounded-[3px]",style:{backgroundColor:m(s>0?d/s:0)},title:`${l[e]} ${c(i)}: ${(0,r.format_duration)(d,n)}`},i)})})]})}function c(e){return 0===e?"12a":12===e?"12p":e<12?`${e}a`:`${e-12}p`}function m(e){if(e<=0)return"color-mix(in srgb, var(--surface-raised) 80%, transparent)";let t=Math.min(100,Math.round(90*e)+10);return`color-mix(in srgb, var(--accent) ${t}%, transparent)`}function u(e){return Math.round(100*e)/100}function x({daily_buckets:e,duration_format:a,title:n="Time over days",subtitle:l}){let o=(0,s.useMemo)(()=>e.slice(-60),[e]),i=(0,s.useMemo)(()=>o.reduce((e,t)=>Math.max(e,t.totalMs),0),[o]),d=(0,s.useMemo)(()=>o.reduce((e,t)=>e+t.totalMs,0),[o]),c=(0,s.useMemo)(()=>{let e=o.filter(e=>e.totalMs>0).length;return 0===e?0:d/e},[o,d]),m=l??(0===o.length?"No data in this period.":`${o.length} day${1===o.length?"":"s"} \xb7 avg ${(0,r.format_duration)(c,a)} on active days`);return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3 rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h3",{className:"m-0 text-[0.95rem] font-semibold",children:n}),(0,t.jsx)("p",{className:"m-0 text-[0.78rem] text-muted",children:m})]}),0===o.length?(0,t.jsx)("p",{className:"m-0 py-6 text-center text-[0.85rem] text-muted",children:"Track time to populate this chart."}):(0,t.jsx)("div",{className:"flex h-44 items-end gap-[3px] overflow-x-auto pb-2",children:o.map(e=>{let s=i>0?u(e.totalMs/i*100):0,n=0===e.weekdayIndex||6===e.weekdayIndex,l=e.totalMs>0;return(0,t.jsx)("div",{className:"flex h-full min-w-[6px] flex-1 flex-col justify-end",title:`${e.dateLabel} \xb7 ${(0,r.format_duration)(e.totalMs,a)}`,role:"img","aria-label":`${e.dateLabel}: ${(0,r.format_duration)(e.totalMs,a)}`,children:(0,t.jsx)("div",{className:`w-full rounded-t-sm transition-all ${l?n?"bg-accent/60":"bg-accent":"bg-surface-raised"}`,style:{height:l?`${Math.max(2,s)}%`:"2px"}})},e.dateMs)})}),(0,t.jsxs)("footer",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 text-[0.72rem] text-muted",children:[(0,t.jsx)("span",{children:o.length>0?`${o[0].dateLabel} → ${o[o.length-1].dateLabel}`:""}),(0,t.jsxs)("span",{children:["Total ",(0,r.format_duration)(d,a)," · Peak"," ",(0,r.format_duration)(i,a)]})]})]})}var f=e.i(55437);function h({stats:e,duration_format:a}){let s=Math.round(100*(e.daysInMonth>0?e.trackedDays/e.daysInMonth:0));return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-5 rounded-md border border-panel-border bg-panel p-5 shadow-sm","aria-label":"Month in review",style:{backgroundImage:"linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 60%, transparent) 0%, transparent 70%)"},children:[(0,t.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-accent",children:"Month in review"}),(0,t.jsx)("h2",{className:"m-0 text-[1.25rem] font-[650] tracking-tight",children:e.monthLabel}),(0,t.jsx)("p",{className:"m-0 text-[0.85rem] text-muted",children:0===e.totalMs?"No time tracked this month yet — start a timer to fill this in.":`Tracked on ${e.trackedDays} of ${e.daysInMonth} days (${s}%).`})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,t.jsx)(g,{label:"Total this month",value:(0,r.format_duration)(e.totalMs,a),detail:0===e.totalMs?"—":`${(0,r.format_duration)(e.averageActiveDayMs,a)} per active day`}),(0,t.jsx)(g,{label:"Best day",value:0===e.bestDayMs?"—":(0,r.format_duration)(e.bestDayMs,a),detail:e.bestDayLabel??"No tracked days yet"}),(0,t.jsx)(g,{label:"Top sheet",value:e.topSheetName??"—",detail:0===e.topSheetMs?"No tracked sheets":(0,r.format_duration)(e.topSheetMs,a)}),(0,t.jsx)(g,{label:"Top tag",value:e.topTag??"—",detail:0===e.topTagMs?"Tag entries to surface":(0,r.format_duration)(e.topTagMs,a)})]}),(0,t.jsxs)("ul",{className:"m-0 grid grid-cols-1 gap-2 p-0 text-[0.85rem] sm:grid-cols-3",children:[(0,t.jsx)(p,{label:"Current streak",value:`${e.currentStreakDays} day${1===e.currentStreakDays?"":"s"}`}),(0,t.jsx)(p,{label:"Longest streak",value:`${e.longestStreakDays} day${1===e.longestStreakDays?"":"s"}`}),(0,t.jsx)(p,{label:"Longest entry",value:0===e.longestEntryMs?"—":(0,r.format_duration)(e.longestEntryMs,a)}),(0,t.jsx)(p,{label:"Entries logged",value:String(e.totalEntries)}),(0,t.jsx)(p,{label:"Tracked days",value:`${e.trackedDays} / ${e.daysInMonth}`}),(0,t.jsx)(p,{label:"Coverage",value:`${s}%`})]})]})}function g({label:e,value:a,detail:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1 rounded-md border border-panel-border bg-surface-raised/60 p-3.5",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-[0.06em] text-muted",children:e}),(0,t.jsx)("span",{className:"truncate font-mono text-[1.05rem] font-semibold",children:a}),(0,t.jsx)("span",{className:"text-[0.78rem] text-muted",children:s})]})}function p({label:e,value:a}){return(0,t.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-md border border-panel-border/60 bg-surface-raised/40 px-3 py-2",children:[(0,t.jsx)("span",{className:"text-[0.78rem] text-muted",children:e}),(0,t.jsx)("span",{className:"font-mono font-semibold",children:a})]})}var b=e.i(52663);let y=[{value:"duration",label:"Duration"},{value:"name",label:"Name"},{value:"entry_count",label:"Entries"},{value:"active_first",label:"Active first"}];function M({sort:e,on_sort_change:a}){return(0,t.jsxs)("fieldset",{className:"m-0 flex w-full max-w-2xl flex-col gap-2 border-0 p-0",children:[(0,t.jsx)("legend",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sort by"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"Sort sheets by",children:y.map(s=>{let r=e===s.value;return(0,t.jsx)("button",{type:"button",className:`${(0,b.get_button_class_name)("ghost","small")} ${r?"border-accent-border bg-accent-soft text-foreground":""}`,"aria-pressed":r,onClick:()=>a(s.value),children:s.label},s.value)})})]})}let j=["#2dd4bf","#60a5fa","#a78bfa","#f472b6","#fb923c","#facc15","#34d399","#22d3ee","#f87171","#c084fc","#fbbf24","#4ade80"];function w(e){return Math.round(100*e)/100}function v({tag_breakdown:e,duration_format:a}){let n=(0,s.useMemo)(()=>(function(e){let t=e.reduce((e,t)=>e+t.totalMs,0);if(0===t)return[];let a=[],s=0;return e.forEach((e,r)=>{var n,l,o;let i,d,c,m,u;if(e.totalMs<=0)return;let x=e.totalMs/t,f=s*Math.PI*2,h=(s+x)*Math.PI*2;s+=x,a.push({tag:e.tag,color:(n=e.tag,"Untagged"===n?"#64748b":j[r%j.length]),ratio:x,total_ms:e.totalMs,path_data:(l=f,o=h,i=k(l,70),d=k(o,70),c=k(o,38),m=k(l,38),u=+(o-l>Math.PI),`M ${i.x} ${i.y} A 70 70 0 ${u} 1 ${d.x} ${d.y} L ${c.x} ${c.y} A 38 38 0 ${u} 0 ${m.x} ${m.y} Z`)})}),a})(e),[e]),l=(0,s.useMemo)(()=>e.reduce((e,t)=>e+t.totalMs,0),[e]),o=n.slice(0,8),i=Math.max(0,n.length-8);return 0===n.length||0===l?(0,t.jsx)(N,{title:"Time by tag",subtitle:"No tagged time in this period.",children:(0,t.jsx)(_,{})}):(0,t.jsx)(N,{title:"Time by tag",subtitle:"Multi-tag entries are split evenly across their tags.",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:items-start",children:[(0,t.jsxs)("div",{className:"relative shrink-0",children:[(0,t.jsx)("svg",{viewBox:"0 0 160 160",className:"h-40 w-40",role:"img","aria-label":"Tag time distribution",children:1===n.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("circle",{cx:80,cy:80,r:70,fill:n[0].color}),(0,t.jsx)("circle",{cx:80,cy:80,r:38,fill:"var(--panel)"})]}):n.map(e=>(0,t.jsx)("path",{d:e.path_data,fill:e.color},e.tag))}),(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center",children:[(0,t.jsx)("span",{className:"text-[0.65rem] font-semibold uppercase tracking-[0.08em] text-muted",children:"Total"}),(0,t.jsx)("span",{className:"font-mono text-[0.85rem] font-semibold",children:(0,r.format_duration)(l,a)})]})]}),(0,t.jsxs)("ul",{className:"m-0 flex w-full flex-col gap-1.5 p-0",children:[o.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 text-[0.82rem]",children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"inline-block h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.tag}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-muted",children:[Math.round(100*e.ratio),"%"]}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-foreground",children:(0,r.format_duration)(e.total_ms,a)})]},e.tag)),i>0?(0,t.jsxs)("li",{className:"text-[0.78rem] text-muted",children:["+ ",i," more ",1===i?"tag":"tags"]}):null]})]})})}function N({title:e,subtitle:a,children:s}){return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3 rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h3",{className:"m-0 text-[0.95rem] font-semibold",children:e}),void 0!==a?(0,t.jsx)("p",{className:"m-0 text-[0.78rem] text-muted",children:a}):null]}),s]})}function _(){return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-3 text-center",children:[(0,t.jsx)("svg",{viewBox:"0 0 160 160",className:"h-28 w-28 opacity-40",role:"presentation",children:(0,t.jsx)("circle",{cx:80,cy:80,r:70,fill:"none",stroke:"var(--panel-border)",strokeWidth:32})}),(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-muted",children:"Tag your entries to see time distribution here."})]})}function k(e,t){return{x:w(80+t*Math.sin(e)),y:w(80-t*Math.cos(e))}}function D({trend:e,duration_format:a,current_label:s,previous_label:n}){var l;let o=(l=e.deltaMs)>0?{symbol:"▲",badge_class:"bg-accent-soft text-accent border border-accent-border"}:l<0?{symbol:"▼",badge_class:"bg-danger-soft text-danger border border-danger-border"}:{symbol:"—",badge_class:"bg-ghost-bg text-muted border border-panel-border"},i=function(e){if(0===e.previousMs)return 0===e.currentMs?"0%":"New";let t=100*Math.abs(e.deltaRatio);return t<.5?"~0%":`${t>=100?t.toFixed(0):t.toFixed(1)}%`}(e);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h3",{className:"m-0 text-[0.95rem] font-semibold",children:e.label}),(0,t.jsxs)("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[0.7rem] font-semibold ${o.badge_class}`,children:[o.symbol," ",i]})]}),(0,t.jsxs)("dl",{className:"m-0 grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("dt",{className:"m-0 text-[0.7rem] font-semibold uppercase tracking-[0.06em] text-muted",children:s}),(0,t.jsx)("dd",{className:"m-0 font-mono text-[1.05rem] font-semibold",children:(0,r.format_duration)(e.currentMs,a)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("dt",{className:"m-0 text-[0.7rem] font-semibold uppercase tracking-[0.06em] text-muted",children:n}),(0,t.jsx)("dd",{className:"m-0 font-mono text-[1.05rem] font-semibold text-muted",children:(0,r.format_duration)(e.previousMs,a)})]})]}),(0,t.jsx)("p",{className:"m-0 text-[0.78rem] text-muted",children:function(e,t){if(0===e.previousMs&&0===e.currentMs)return"No tracked time in either period.";if(0===e.previousMs)return`${(0,r.format_duration)(e.currentMs,t)} more than last period.`;if(0===e.deltaMs)return"Identical to the previous period.";let a=e.deltaMs>0?"more":"less";return`${(0,r.format_duration)(Math.abs(e.deltaMs),t)} ${a} than the previous period.`}(e,a)})]})}let $=[{value:"dashboard",label:"Dashboard"},{value:"sheets",label:"Sheets"}];function T({active_tab:e,on_change:a}){return(0,t.jsx)("div",{role:"tablist","aria-label":"Reporting view",className:"inline-flex w-full max-w-2xl items-center gap-1 self-center rounded-full border border-panel-border bg-surface-raised/50 p-1",children:$.map(s=>{let r=s.value===e;return(0,t.jsx)("button",{type:"button",role:"tab","aria-selected":r,className:`${(0,b.get_button_class_name)("ghost","small")} flex-1 rounded-full border-transparent ${r?"bg-accent text-accent-text-on":"bg-transparent text-muted"}`,onClick:()=>a(s.value),children:s.label},s.value)})})}function S({weekday_distribution:e,duration_format:a}){let n=(0,s.useMemo)(()=>e.reduce((e,t)=>Math.max(e,t.totalMs),0),[e]),l=(0,s.useMemo)(()=>e.reduce((e,t)=>e+t.totalMs,0),[e]);return(0,t.jsxs)("section",{className:"flex w-full flex-col gap-3 rounded-md border border-panel-border bg-panel p-4 shadow-sm",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h3",{className:"m-0 text-[0.95rem] font-semibold",children:"Day of week"}),(0,t.jsx)("p",{className:"m-0 text-[0.78rem] text-muted",children:"Where your week tends to lean."})]}),0===l?(0,t.jsx)("p",{className:"m-0 py-4 text-center text-[0.85rem] text-muted",children:"No tracked time in this period."}):(0,t.jsx)("ul",{className:"m-0 flex flex-col gap-1.5 p-0",children:e.map(e=>{let s=n>0?u(e.totalMs/n*100):0;return(0,t.jsxs)("li",{className:"grid grid-cols-[2.25rem_1fr_auto] items-center gap-2 text-[0.82rem]",children:[(0,t.jsx)("span",{className:"font-mono text-[0.78rem] text-muted",children:e.weekdayLabel}),(0,t.jsx)("span",{className:"block h-2 overflow-hidden rounded-full bg-surface-raised",role:"presentation",children:(0,t.jsx)("span",{className:"block h-full rounded-full bg-accent",style:{width:`${Math.max(s,4*(e.totalMs>0))}%`}})}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:(0,r.format_duration)(e.totalMs,a)})]},e.weekdayIndex)})})]})}var E=e.i(75404),O=e.i(98636),I=e.i(36519),C=e.i(19402),A=e.i(43864),L=e.i(29263);function R(e,t){return(0,L.toDate)(e,t?.in).getDay()}function B(e,t,a,s=Date.now()){let r=+e.start;return Math.max(0,Math.min(null===e.end?s:+e.end,a)-Math.max(r,t))}function F(e){let t=[];for(let a=0;a<7;a+=1)for(let s=0;s<24;s+=1){let r=`${a}-${s}`;t.push({weekdayIndex:a,hourIndex:s,totalMs:e.get(r)??0})}return t}var P=e.i(39552);function W(e,t,a,s=Date.now()){let r=[],n=(0,I.startOfDay)(new Date(t)),l=(0,I.startOfDay)(new Date(a));if(+n>+l)return r;let o=n;for(;+o<=+l;){let t=+(0,I.startOfDay)(o),a=+(0,A.endOfDay)(o),n=0;for(let r of e)for(let e of r.entries)n+=B(e,t,a,s);r.push({dateMs:t,dateLabel:(0,P.format)(o,"MMM d"),weekdayIndex:R(o),totalMs:n}),o=(0,O.addDays)(o,1)}return r}var U=e.i(22106),z=e.i(25402),K=e.i(61837);function Y(e,t,a,s=Date.now()){let r=0;for(let n of e)for(let e of n.entries)r+=B(e,t,a,s);return r}var q=e.i(31113);let H="Untagged";function V(e,t,a,s=Date.now()){let r=new Map,n=0;for(let l of e)for(let e of l.entries){let l=B(e,t,a,s);if(l<=0)continue;let o=[];for(let t of e.tags)try{o.push((0,q.normalize_stored_tag)(t))}catch{continue}let i=[...new Set(o)];if(n+=l,0===i.length){r.set(H,(r.get(H)??0)+l);continue}let d=l/i.length;for(let e of i)r.set(e,(r.get(e)??0)+d)}let l=[...r.entries()].map(([e,t])=>({tag:e,totalMs:t,ratio:n>0?t/n:0}));return l.sort((e,t)=>e.tag===H?1:t.tag===H?-1:t.totalMs-e.totalMs),l}var Z=e.i(67584),G=e.i(7312),J=e.i(78194);function Q(e,t,a=new Date,s=Date.now(),r=1){var n;let l=X(t,a,r),o="week"===t?(n=void 0,(0,O.addDays)(a,-7,n)):(0,J.subMonths)(a,1),i=X(t,o,r),d=Y(e,l.start,l.end,s),c=Y(e,i.start,i.end,s),m=d-c;return{label:"week"===t?"This week vs last week":"This month vs last month",currentMs:d,previousMs:c,deltaMs:m,deltaRatio:c>0?m/c:0}}function X(e,t,a){return"week"===e?{start:+(0,G.startOfWeek)(t,{weekStartsOn:a}),end:+(0,Z.endOfWeek)(t,{weekStartsOn:a})}:{start:+(0,K.startOfMonth)(t),end:+(0,U.endOfMonth)(t)}}function ee(e,t){return 0===t?0:e/t}function et(e,t=new Date,a=1){switch(e){case"week":return{startMs:+(0,G.startOfWeek)(t,{weekStartsOn:a}),endMs:+(0,Z.endOfWeek)(t,{weekStartsOn:a})};case"month":return{startMs:+(0,K.startOfMonth)(t),endMs:+(0,U.endOfMonth)(t)};default:return{startMs:+(0,I.startOfDay)(t),endMs:+(0,A.endOfDay)(t)}}}var ea=e.i(67999);function es(e,t){let a=new Set,s=[];for(let r of[...e,...t]){let e=`${r.timestamp.getTime()}:${r.text}`;a.has(e)||(a.add(e),s.push(r))}return s.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),s}var er=e.i(1997),en=e.i(54873),el=e.i(68462),eo=e.i(46748);let ei={from_date:"",to_date:""},ed=["today","yesterday","week","month","last_month","year","last_year"];function ec(e,t){let a=[...e];switch(t){case"name":a.sort((e,t)=>e.sheetName.localeCompare(t.sheetName));break;case"entry_count":a.sort((e,t)=>t.entryCount!==e.entryCount?t.entryCount-e.entryCount:t.totalMs-e.totalMs);break;case"active_first":a.sort((e,t)=>e.hasActiveEntry!==t.hasActiveEntry?e.hasActiveEntry?-1:1:t.totalMs-e.totalMs);break;default:a.sort((e,t)=>t.totalMs-e.totalMs)}return a}var em=e.i(1800),eu=e.i(12843);let ex={from_date:"",to_date:""};function ef({children:e}){return(0,t.jsx)("div",{className:"flex w-full max-w-5xl flex-col gap-5",children:e})}function eh({children:e}){return(0,t.jsx)("div",{className:"flex w-full max-w-2xl flex-col items-center gap-4",children:e})}function eg({label:e,value:a}){return(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:e}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[1.1rem] font-[650] tracking-tight",children:a})]})}function ep({title:e,aria_label:a,muted:s=!1,children:r}){return(0,t.jsxs)("section",{className:"flex w-full max-w-2xl flex-col gap-2",children:[(0,t.jsx)("h2",{className:`m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] ${s?"text-muted":"text-foreground"}`,children:e}),(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col gap-2 p-0","aria-label":a,children:r})]})}function eb({sheet:e,grand_total_ms:a,duration_format:s}){let n=a>0?Math.round(e.totalMs/a*100):0,l=a>0?u(e.totalMs/a*100):0;return(0,t.jsxs)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1rem] font-semibold",children:e.sheetName}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[0.95rem] font-semibold text-accent",children:(0,r.format_duration)(e.totalMs,s)})]}),(0,t.jsx)("div",{className:"mt-2.5 h-1.5 overflow-hidden rounded-full bg-surface-raised",role:"presentation",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent",style:{width:`${l}%`}})}),(0,t.jsxs)("p",{className:"m-0 mt-2 flex flex-wrap gap-x-3 gap-y-0.5 text-[0.82rem] text-muted",children:[(0,t.jsxs)("span",{children:[n,"% of total"]}),(0,t.jsxs)("span",{children:[e.entryCount," ",1===e.entryCount?"entry":"entries"]}),(0,t.jsx)("span",{children:0===e.entryCount?"No average":`${(0,r.format_duration)(e.averageEntryMs,s)} avg`}),e.hasActiveEntry?(0,t.jsx)("span",{className:"text-accent",children:"Timer running"}):null]})]})}function ey({sheet:e,in_range:a}){let s=a?"No time in range":0===e.entryCount?"No entries":"No tracked time";return(0,t.jsxs)("li",{className:"rounded-md border border-dashed border-panel-border bg-surface-raised/60 px-3.5 py-2.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("h3",{className:"m-0 min-w-0 truncate text-[0.95rem] font-medium text-muted",children:e.sheetName}),(0,t.jsx)("span",{className:"shrink-0 text-[0.82rem] text-muted",children:s})]}),e.hasActiveEntry?(0,t.jsx)("p",{className:"m-0 mt-1.5 text-[0.82rem] text-accent",children:"Timer running"}):null]})}e.s(["ReportingView",0,function({source_sheets:e,reference_now:l}){let o=(0,a.useSearchParams)(),d=(0,em.use_duration_format)(),c=(0,eu.use_week_starts_on)(),[m,u]=(0,s.useState)("dashboard"),[g,p]=(0,s.useState)(()=>er.default_reporting_sort_preference.get_server_snapshot()),[b,y]=(0,s.useState)(ex),[j,w]=(0,s.useState)(l);(0,s.useEffect)(()=>{y(function(e=el.default_reporting_range_preference.read(),t="monday"){return"none"===e?ei:(0,eo.get_reporting_date_range_shortcut_inputs)(e,new Date,(0,n.week_starts_on_to_index)(t))}(void 0,c)),p(er.default_reporting_sort_preference.read())},[c]),(0,s.useEffect)(()=>{let e=function(e){if(null===e)return null;let t=e.trim().toLowerCase();return ed.includes(t)?t:null}(o.get("range"));null!==e&&y((0,eo.get_reporting_date_range_shortcut_inputs)(e,new Date,(0,n.week_starts_on_to_index)(c)))},[o,c]),(0,s.useEffect)(()=>{w(l)},[l]),(0,s.useEffect)(()=>{w(Date.now())},[b,e,c]);let N=(0,s.useMemo)(()=>e.map(e=>({name:e.name,activeEntryID:e.activeEntryID,entries:e.entries.map(e=>({id:e.id,start:new Date(e.start),end:null===e.end?null:new Date(e.end),description:"",tags:e.tags,notes:[]}))})),[e]),_=(0,s.useMemo)(()=>(0,en.get_date_range_ms_from_inputs)(b.from_date,b.to_date),[b]),k=b.from_date.length>0!=b.to_date.length>0||b.from_date.length>0&&b.to_date.length>0&&null===_,$=(0,n.week_starts_on_to_index)(c),{stats:q,analytics:H}=(0,s.useMemo)(()=>({stats:function(e,t=null,a=Date.now(),s=1){let r=e.map(e=>{let s,r,n;return null===t?(s=function(e){let{activeEntryID:t,entries:a,name:s}=e;return(function(e){let t=new Map;for(let a of e){let e=t.get(a.id);if(void 0===e){t.set(a.id,a);continue}if(null===a.end&&null!==e.end){t.set(a.id,{...a,notes:es(a.notes,e.notes)});continue}if(null===e.end&&null!==a.end){t.set(a.id,{...e,notes:es(e.notes,a.notes)});continue}t.set(a.id,{...e,notes:es(e.notes,a.notes)})}return[...t.values()].sort((e,t)=>e.id-t.id)})(a).map(e=>{var a;return a=t===e.id&&null===e.end,{id:e.id,description:e.description,start:e.start.toISOString(),end:null===e.end?null:e.end.toISOString(),tags:e.tags,notes:e.notes.map(({timestamp:e,text:t})=>({timestamp:e.toISOString(),text:t})),sheetName:s,durationMs:function(e,t=Date.now()){let{end:a,start:s}=e;return Math.max(0,(null===a?t:+a)-s)}(e),isActive:a,...!0===e.archived?{archived:!0}:{}}})}(e),r=e.entries.length,n=(0,ea.get_serialized_entries_total_ms)(s),{sheetName:e.name,totalMs:n,entryCount:r,averageEntryMs:ee(n,r),hasActiveEntry:null!==e.activeEntryID}):function(e,t,a,s=Date.now()){let r=0,n=0,l=!1;for(let o of e.entries){let i=B(o,t,a,s);i<=0||(r+=i,n+=1,e.activeEntryID===o.id&&null===o.end&&(l=!0))}return{sheetName:e.name,totalMs:r,entryCount:n,averageEntryMs:ee(r,n),hasActiveEntry:l}}(e,t.startMs,t.endMs,a)}),{activeSheets:n,idleSheets:l}=function(e){let t=[],a=[];for(let s of e)0===s.entryCount||0===s.totalMs?a.push(s):t.push(s);return{activeSheets:t,idleSheets:a}}(r),o=r.reduce((e,t)=>e+t.totalMs,0),i=r.reduce((e,t)=>e+t.entryCount,0);return{activeSheets:n,idleSheets:l,grandTotalMs:o,totalEntryCount:i,grandAverageEntryMs:ee(o,i),periodTotals:null===t?function(e,t=new Date,a=Date.now(),s=1){let r=et("today",t,s),n=et("week",t,s),l=et("month",t,s);return{todayMs:Y(e,r.startMs,r.endMs,a),weekMs:Y(e,n.startMs,n.endMs,a),monthMs:Y(e,l.startMs,l.endMs,a)}}(e,new Date(a),a,s):{todayMs:0,weekMs:0,monthMs:0}}}(N,_,j,$),analytics:function(e,t,a=Date.now(),s=1){let r=new Date(a),n=(0,O.addDays)((0,I.startOfDay)(r),1)-1,l=+(0,I.startOfDay)((0,C.subDays)(r,29)),o=null===t?l:t.startMs,i=null===t?n:t.endMs,d=W(e,o,i,a),c=V(e,o,i,a),m=function(e,t=1){let a=Array(7).fill(0);for(let t of e)a[t.weekdayIndex]+=t.totalMs;let s=(0,G.startOfWeek)(new Date,{weekStartsOn:t});return Array.from({length:7},(e,r)=>{let n=(0,O.addDays)(s,r),l=(t+r)%7;return{weekdayIndex:l,weekdayLabel:(0,P.format)(n,"EEE"),totalMs:a[l]}})}(d,s);return{dailyBuckets:d,tagBreakdown:c,weekdayDistribution:m,heatmap:function(e,t,a,s=Date.now()){let r=new Map,n=(0,I.startOfDay)(new Date(t)),l=(0,I.startOfDay)(new Date(a));if(+n>+l)return F(r);let o=n;for(;+o<=+l;){let t=R(o),a=+o,n=+(0,A.endOfDay)(o);for(let l=0;l<24;l+=1){let o=a+36e5*l,i=Math.min(o+36e5-1,n),d=0;for(let t of e)for(let e of t.entries)d+=B(e,o,i,s);if(d<=0)continue;let c=`${t}-${l}`;r.set(c,(r.get(c)??0)+d)}o=(0,O.addDays)(o,1)}return F(r)}(e,o,i,a),weekTrend:Q(e,"week",r,a,s),monthTrend:Q(e,"month",r,a,s),monthInReview:function(e,t=new Date,a=Date.now()){let s,r,n,l,o=(0,K.startOfMonth)(t),i=(0,U.endOfMonth)(t),d=(0,P.format)(o,"MMMM yyyy"),c=(r=(s=(0,L.toDate)(o,void 0)).getFullYear(),n=s.getMonth(),(l=(0,z.constructFrom)(s,0)).setFullYear(r,n+1,0),l.setHours(0,0,0,0),l.getDate()),m=W(e,+o,+i,a),u=V(e,+o,+i,a),x=0,f=0,h=0,g=-1;m.forEach((e,t)=>{x+=e.totalMs,e.totalMs>0&&(f+=1),e.totalMs>h&&(h=e.totalMs,g=t)});let p=0,b=0,y=new Map;for(let t of e){let e=0;for(let s of t.entries){let t=B(s,+o,+i,a);!(t<=0)&&(p+=1,e+=t,t>b&&(b=t))}e>0&&y.set(t.name,e)}let M=null,j=0;for(let[e,t]of y)t>j&&(j=t,M=e);let w=null,v=0;for(let e of u)"Untagged"!==e.tag&&e.totalMs>v&&(v=e.totalMs,w=e.tag);let N=function(e,t=new Date,a=Date.now()){let s=(0,I.startOfDay)(t);0>=Y(e,+s,+(0,A.endOfDay)(s),a)&&(s=(0,C.subDays)(s,1));let r=0;for(let t=0;t<3660&&!(0>=Y(e,+(0,I.startOfDay)(s),+(0,A.endOfDay)(s),a));t+=1){;r+=1,s=(0,C.subDays)(s,1)}return r}(e,t,a),_=function(e){let t=0,a=0;for(let s of e)s.totalMs>0?(a+=1,t=Math.max(t,a)):a=0;return t}(m),k=-1===g?null:(0,P.format)(new Date(m[g].dateMs),"EEE, MMM d"),D=f>0?x/f:0;return{monthLabel:d,totalMs:x,trackedDays:f,daysInMonth:c,bestDayMs:h,bestDayLabel:k,longestEntryMs:b,totalEntries:p,topSheetName:M,topSheetMs:j,topTag:w,topTagMs:v,currentStreakDays:N,longestStreakDays:_,averageActiveDayMs:D}}(e,r,a)}}(N,_,j,$)}),[N,_,$,j]),{activeSheets:Z,grandAverageEntryMs:J,grandTotalMs:X,idleSheets:eM,periodTotals:ej,totalEntryCount:ew}=q,ev=Z.length+eM.length,eN=null===_,e_=(0,s.useMemo)(()=>ec(Z,g),[Z,g]),ek=(0,s.useMemo)(()=>ec(eM,g),[eM,g]),eD=null===_?"Last 30 days of activity.":`${H.dailyBuckets.length} days in the selected range.`;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.TrackerTopbar,{breadcrumb:{current:"Reporting"}}),(0,t.jsxs)("main",{className:"mx-auto flex w-full max-w-[1120px] flex-col items-center gap-6 px-5 pb-12 pt-6",children:[(0,t.jsxs)("header",{className:"flex w-full max-w-2xl flex-col gap-3",children:[(0,t.jsx)("h1",{className:"m-0 text-center text-[1.5rem] font-[650] tracking-tight",children:"Reporting"}),(0,t.jsx)("p",{className:"m-0 max-w-md self-center text-center text-[0.9rem] leading-relaxed text-muted",children:null===_?"A snapshot of where your time has been going.":"Metrics filtered to the selected date range."})]}),(0,t.jsx)(T,{active_tab:m,on_change:u}),(0,t.jsx)(f.ReportingDateRangePicker,{range:b,is_invalid:k,on_range_change:y,on_clear:()=>y(ex)}),(0,t.jsxs)("section",{className:"grid w-full max-w-5xl grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4","aria-label":"Summary",children:[(0,t.jsx)(eg,{label:null===_?"Total tracked":"In range",value:(0,r.format_duration)(X,d)}),(0,t.jsx)(eg,{label:"Avg per entry",value:(0,r.format_duration)(J,d)}),(0,t.jsx)(eg,{label:"Sheets",value:String(ev)}),(0,t.jsx)(eg,{label:"Entries",value:String(ew)})]}),eN?(0,t.jsxs)("section",{className:"grid w-full max-w-5xl grid-cols-1 gap-2 sm:grid-cols-3","aria-label":"Period totals",children:[(0,t.jsx)(eg,{label:"Today",value:(0,r.format_duration)(ej.todayMs,d)}),(0,t.jsx)(eg,{label:"This week",value:(0,r.format_duration)(ej.weekMs,d)}),(0,t.jsx)(eg,{label:"This month",value:(0,r.format_duration)(ej.monthMs,d)})]}):null,0===ev?(0,t.jsx)("p",{className:"m-0 w-full max-w-2xl text-center text-[0.9rem] text-muted",children:"No sheets yet. Create a sheet on the tracker to start logging time."}):k?(0,t.jsx)("p",{className:"m-0 w-full max-w-2xl text-center text-[0.9rem] text-muted",children:"Choose both dates to filter metrics, or clear the range to see all time."}):"dashboard"===m?(0,t.jsxs)(ef,{children:[(0,t.jsx)(h,{stats:H.monthInReview,duration_format:d}),(0,t.jsxs)("div",{className:"grid w-full grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,t.jsx)(D,{trend:H.weekTrend,duration_format:d,current_label:"This week",previous_label:"Last week"}),(0,t.jsx)(D,{trend:H.monthTrend,duration_format:d,current_label:"This month",previous_label:"Last month"})]}),(0,t.jsx)(x,{daily_buckets:H.dailyBuckets,duration_format:d,subtitle:eD}),(0,t.jsxs)("div",{className:"grid w-full grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,t.jsx)(v,{tag_breakdown:H.tagBreakdown,duration_format:d}),(0,t.jsx)(S,{weekday_distribution:H.weekdayDistribution,duration_format:d})]}),(0,t.jsx)(i,{heatmap:H.heatmap,duration_format:d,week_starts_on:c})]}):(0,t.jsxs)(eh,{children:[(0,t.jsx)(M,{sort:g,on_sort_change:p}),0===Z.length?(0,t.jsx)("p",{className:"m-0 w-full max-w-2xl text-center text-[0.9rem] text-muted",children:null===_?"No tracked time yet. Check in on a sheet to see stats here.":"No tracked time in this date range."}):(0,t.jsx)(ep,{title:"Tracked sheets",aria_label:"Tracked sheet statistics",children:e_.map(e=>(0,t.jsx)(eb,{sheet:e,grand_total_ms:X,duration_format:d},e.sheetName))}),eM.length>0?(0,t.jsx)(ep,{title:null===_?"Empty sheets":"Sheets in range",aria_label:"Sheets without time in range",muted:!0,children:ek.map(e=>(0,t.jsx)(ey,{sheet:e,in_range:null!==_},e.sheetName))}):null]})]})]})}],68120)}]);
|