super-time-tracker-ui 0.1.24 → 0.1.29
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/app-path-routes-manifest.json +1 -0
- package/dist/standalone/next-output/build-manifest.json +3 -3
- package/dist/standalone/next-output/routes-manifest.json +6 -0
- 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.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.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.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.js +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.js +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.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.js +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/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.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.js +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.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.js +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/app-paths-manifest.json +3 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/build-manifest.json +17 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/next-font-manifest.json +11 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/react-loadable-manifest.json +1 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page/server-reference-manifest.json +4 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page.js +16 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page.js.nft.json +1 -0
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +3 -0
- package/dist/standalone/next-output/server/app/settings/page.js +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.js +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/tags/page.js +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.js +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/today/page.js +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/app-paths-manifest.json +1 -0
- package/dist/standalone/next-output/server/chunks/_0y.amf.._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_09d~8qe.js +4 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0-0rjzr._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__01xqr3d._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__06o_2e_._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0_b2z9m._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0_wxrlk._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0dvku3t._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0gi2idc._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0hx9602._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0k~hq1g._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0wtu388._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{[root-of-the-server]__06tjg41._.js → [root-of-the-server]__0x6yv3u._.js} +2 -2
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0yrs18n._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0-hc~ba._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_002dssm._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_00aklen._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_08dnxqq._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0agxxbf._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0c0txs~._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0cm4hy2._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0l6-7m4._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0r_7~d.._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0y3ypyx._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_13crob-._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_13y76jr._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_settings_notifications_page_actions_0p_s-jo.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/components_today-focus-view_tsx_0~eac-w._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js +1 -1
- package/dist/standalone/next-output/server/middleware-build-manifest.js +3 -3
- package/dist/standalone/next-output/server/middleware-manifest.json +1 -1
- package/dist/standalone/next-output/server/next-font-manifest.js +1 -1
- package/dist/standalone/next-output/server/next-font-manifest.json +4 -0
- package/dist/standalone/next-output/server/pages/500.html +1 -1
- package/dist/standalone/next-output/static/chunks/00rjs5ywh4_np.css +3 -0
- package/dist/standalone/next-output/static/chunks/{0r_p~8b~slwz6.js → 03d24rbiv.lx7.js} +1 -1
- package/dist/standalone/next-output/static/chunks/041fttxys-zjw.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0uqa2icli2jfg.js → 055~9w5b9lao5.js} +1 -1
- package/dist/standalone/next-output/static/chunks/09mbpw08eiqwx.js +1 -0
- package/dist/standalone/next-output/static/chunks/0ate7k1rcitu0.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0jmzwpfmnsd3v.js → 0bw3uow4-~3fr.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0nkl588xh~5.i.js → 0d1dhitpe0ieo.js} +5 -5
- package/dist/standalone/next-output/static/chunks/0d2d-s..s8cfz.js +1 -0
- package/dist/standalone/next-output/static/chunks/{01f_tq~9x~8zv.js → 0h72~3~6gq3fn.js} +1 -1
- package/dist/standalone/next-output/static/chunks/{0p-_potvb-of4.js → 0hhu330gm_fnl.js} +1 -1
- package/dist/standalone/next-output/static/chunks/0ls_5qyf15z5_.js +1 -0
- package/dist/standalone/next-output/static/chunks/0n0.21h11yrv2.js +1 -0
- package/dist/standalone/next-output/static/chunks/0sywv5h95uodq.js +1 -0
- package/dist/standalone/next-output/static/chunks/0x5_m1_cuacap.js +1 -0
- package/dist/standalone/next-output/static/chunks/0xccil3r~k_7n.js +1 -0
- package/dist/standalone/next-output/static/chunks/0y8q3nm-aw7vw.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0lik.lmxlumgs.js → 0~z41.7~3tpw3.js} +1 -1
- package/dist/standalone/next-output/static/chunks/14oa3e0hktvxi.js +1 -0
- package/dist/standalone/package.json +1 -1
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__08321hx._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0c.ljsw._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0d6d7oj._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0ddge-d._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0jx47wg._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0px9gk1._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0qfxx_p._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0v7ghh2._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0xenuid._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0~t0puh._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_08iak5j._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_09-_33p._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0a899fn._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ceu~9f._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0i4.n_a._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ks2fqx._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0n4osnj._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0st.s39._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0u8~h8i._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0ybsqe1._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_11d2qve._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_138a8mc._.js +0 -3
- package/dist/standalone/next-output/static/chunks/0.--_5xgw~jq3.js +0 -1
- package/dist/standalone/next-output/static/chunks/00~ilmka-h85i.js +0 -1
- package/dist/standalone/next-output/static/chunks/06u43x9tl391w.js +0 -1
- package/dist/standalone/next-output/static/chunks/0beicab6wjk6i.js +0 -1
- package/dist/standalone/next-output/static/chunks/0d_y_tcdl.atr.js +0 -1
- package/dist/standalone/next-output/static/chunks/0pad.4ycu.c9a.js +0 -1
- package/dist/standalone/next-output/static/chunks/0wwa4vyavaj9y.js +0 -1
- package/dist/standalone/next-output/static/chunks/145wpjuqytc0-.js +0 -1
- package/dist/standalone/next-output/static/chunks/16mdccb8.20ou.css +0 -3
- package/dist/standalone/next-output/static/chunks/16unuw80qbxmx.js +0 -1
- package/dist/standalone/next-output/static/chunks/170g.yxigj5~6.js +0 -1
- package/dist/standalone/next-output/static/chunks/18c9gg_1a7.0p.js +0 -1
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{wZOpAni2OS7_9AC_2kAVd → diBBBwr7OTHBo2aEw-WYC}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},85930,a=>{"use strict";var b=a.i(39752),c=a.i(85393),d=a.i(98790);a.s(["SettingsPageLayout",0,function({breadcrumb:a,title:e,description:f,children:g}){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.TrackerTopbar,{breadcrumb:a}),(0,b.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,b.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,b.jsx)(c.SettingsNav,{})]}),(0,b.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,b.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:e}),void 0!==f?(0,b.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:f}):null]}),g]})]})]})}])},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}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,48174,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d(a){return a.startsWith("@")?a:`@${a}`}a.s(["format_display_tag",0,d],48174);var e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=d(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-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:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.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 ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:d(a)})},a))}):null]})}],30354)},64617,a=>{"use strict";a.s(["POMODORO_DEFAULT_SETTINGS",0,{work_minutes:25,short_break_minutes:5,long_break_minutes:15,rounds_before_long_break:4,auto_start_next_phase:!0,check_in_on_work_start:!0,work_entry_description:"Pomodoro focus"},"POMODORO_DEFAULT_STATE",0,{phase:"work",status:"idle",completed_work_sessions:0,deadline_at_ms:null,paused_remaining_ms:null},"POMODORO_STORAGE_KEY",0,"super-time-tracker-pomodoro"])},98670,a=>{"use strict";var b=a.i(39752),c=a.i(34542),d=a.i(30354),e=a.i(85930),f=a.i(64617);a.s(["PomodoroSettingsView",0,function({known_tags:a}){let[g,h]=(0,c.useState)(f.POMODORO_DEFAULT_SETTINGS),[i,j]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{},[]),(0,c.useEffect)(()=>{},[i,g]),(0,b.jsx)(e.SettingsPageLayout,{breadcrumb:{current:"Pomodoro",parent:{label:"Settings",href:"/settings"}},title:"Pomodoro",description:"Focus and break durations, auto-start behavior, and tracker check-in defaults.",children:(0,b.jsxs)("ul",{className:"m-0 grid w-full list-none grid-cols-1 gap-2 p-0 md:grid-cols-2","aria-label":"Pomodoro settings",children:[(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Work minutes"}),(0,b.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:g.work_minutes,onChange:a=>{h(b=>({...b,work_minutes:Math.max(1,Number.parseInt(a.target.value,10)||1)}))}})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Short break minutes"}),(0,b.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:g.short_break_minutes,onChange:a=>{h(b=>({...b,short_break_minutes:Math.max(1,Number.parseInt(a.target.value,10)||1)}))}})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Long break minutes"}),(0,b.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:g.long_break_minutes,onChange:a=>{h(b=>({...b,long_break_minutes:Math.max(1,Number.parseInt(a.target.value,10)||1)}))}})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,b.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Rounds before long break"}),(0,b.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:g.rounds_before_long_break,onChange:a=>{h(b=>({...b,rounds_before_long_break:Math.max(1,Number.parseInt(a.target.value,10)||1)}))}})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0",checked:g.auto_start_next_phase,onChange:a=>{h(b=>({...b,auto_start_next_phase:a.target.checked}))}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Auto-start next phase"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Continue automatically when a focus or break phase ends."})]})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0",checked:g.check_in_on_work_start,onChange:a=>{h(b=>({...b,check_in_on_work_start:a.target.checked}))}}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Start tracker entry on focus start"}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"When you start a focus phase, create a new entry on your active sheet."})]})]})}),(0,b.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,b.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,b.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Focus entry description (supports @tags)"}),(0,b.jsx)(d.TagAutocompleteInput,{id:"pomodoro-settings-work-entry-description",value:g.work_entry_description,known_tags:a,placeholder:"Pomodoro focus @pomodoro @focus",on_change:a=>{h(b=>({...b,work_entry_description:a}))}}),(0,b.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Used when a focus phase creates a new tracker entry on the active sheet."})]})})]})})}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0st.s39._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[96359,a=>{"use strict";var b=a.i(34542),c=a.i(46299);a.s(["use_escape_to_cancel",0,function(a,d=!0){let e=(0,b.useRef)(a);e.current=a,(0,b.useEffect)(()=>{if(!d)return;let a=a=>{"Escape"!==a.key||(0,c.is_modal_dialog_open)()||(a.preventDefault(),e.current())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[d])}])},34435,a=>{"use strict";var b=a.i(39752);a.s(["HamburgerIcon",0,function(){return(0,b.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,b.jsx)("path",{d:"M4 7h16"}),(0,b.jsx)("path",{d:"M4 12h16"}),(0,b.jsx)("path",{d:"M4 17h16"})]})}])},26846,a=>{"use strict";var b=a.i(82508),c=a.i(34542),d=a.i(9301),e=a.i(63577),f=a.i(7048);a.s(["use_supabase_auth_session",0,function(){let a=(0,b.useRouter)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,e.is_supabase_configured)();return(0,c.useEffect)(()=>{if(!k)return;let a=(0,d.create_browser_supabase_client)();a.auth.getSession().then(({data:{session:a}})=>{h(a?.user.email??null)}).catch(()=>{h(null)});let{data:{subscription:b}}=a.auth.onAuthStateChange((a,b)=>{h(b?.user.email??null)});return()=>{b.unsubscribe()}},[k]),{is_configured:k,email:g,is_pending:i,sign_out:(0,c.useCallback)(async()=>{j(!0);try{await fetch("/api/auth/signout",{method:"POST"});let b=(0,d.create_browser_supabase_client)();await b.auth.signOut().catch(()=>{}),(0,f.notify_settings_saved)("Signed out"),a.refresh()}finally{j(!1)}},[a])}}])},61995,41194,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/",label:"Tracker",match:a=>"/"===a},{href:"/today",label:"Today",match:a=>a.startsWith("/today")},{href:"/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/pomodoro")},{href:"/sheets",label:"Sheets",match:a=>a.startsWith("/sheets")},{href:"/reporting",label:"Reporting",match:a=>a.startsWith("/reporting")}];function f(){return(0,b.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,b.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"})})}a.s(["TrackerNavLinks",0,function(){let a=(0,d.usePathname)()??"/";return(0,b.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:e.map(d=>{let e=d.match(a);return(0,b.jsx)(c.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:d.href,"aria-current":e?"page":void 0,children:d.label},d.href)})})}],61995);var g=a.i(26846);a.s(["TopbarCloudStatus",0,function(){let{email:a,is_configured:c}=(0,g.use_supabase_auth_session)();return c&&null!==a?(0,b.jsxs)("div",{className:"group relative flex items-center",children:[(0,b.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 ${a}`,role:"img",children:(0,b.jsx)(f,{})}),(0,b.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,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,b.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:a,children:a})]})})]}):null}],41194)},41615,a=>{"use strict";a.s(["build_auth_page_href",0,function(a,b){let c="sign_in"===a?"/login":"/register",d=b.trim();return 0===d.length||"/"===d?c:`${c}?next=${encodeURIComponent(d)}`}])},28958,a=>{"use strict";a.s(["write_document_preference_cookies",0,function(a){if("u"<typeof document)return;let b="path=/; max-age=31536000; SameSite=Lax";void 0!==a.theme_mode&&(document.cookie=`stt-theme-mode=${a.theme_mode}; ${b}`),void 0!==a.theme&&(document.cookie=`stt-theme=${a.theme}; ${b}`),void 0!==a.palette&&(document.cookie=`stt-palette=${a.palette}; ${b}`),void 0!==a.compact_lists&&(document.cookie=`stt-compact-lists=${a.compact_lists?"true":"false"}; ${b}`)}],28958)},81764,34569,a=>{"use strict";a.s(["apply_theme",0,function(a){document.documentElement.setAttribute("data-theme",a)}],81764);var b=a.i(72958);a.s(["write_stored_theme",0,function(a){try{window.localStorage.setItem("super-time-tracker-theme",a),(0,b.schedule_ui_preferences_cloud_sync)()}catch{}}],34569)},65020,84089,22592,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:c.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:a=>"true"===a||"false"===a});function e(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}a.s(["cloud_sync_enabled_preference",0,d],65020),a.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return e()}],84089);var f=a.i(81764),g=a.i(7048),h=a.i(29698),i=a.i(44103),j=a.i(28958),k=a.i(34569);a.s(["toggle_theme",0,function(){let a="dark"===e()?"light":"dark";(0,f.apply_theme)(a),(0,k.write_stored_theme)(a),h.theme_mode_preference.write(a),(0,j.write_document_preference_cookies)({theme_mode:a,theme:a}),h.theme_mode_preference.notify(),(0,i.notify_theme_subscribers)(),(0,g.notify_settings_saved)()}],22592)},79334,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508),e=a.i(34542),f=a.i(34435),g=a.i(41615),h=a.i(7048),i=a.i(65020),j=a.i(74365),k=a.i(84089),l=a.i(44103),m=a.i(22592),n=a.i(96359),o=a.i(26846);let p="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";a.s(["TopbarOverflowMenu",0,function(){let a=(0,d.useRouter)(),q=(0,d.usePathname)()??"/",r=(0,e.useSyncExternalStore)(l.subscribe_theme,k.get_theme_snapshot,k.get_theme_server_snapshot),s=(0,e.useSyncExternalStore)(i.cloud_sync_enabled_preference.subscribe,i.cloud_sync_enabled_preference.get_snapshot,i.cloud_sync_enabled_preference.get_server_snapshot),{email:t,is_configured:u,is_pending:v,sign_out:w}=(0,o.use_supabase_auth_session)(),[x,y]=(0,e.useState)(!1),z=(0,e.useRef)(null);(0,e.useEffect)(()=>{if(!x)return;let a=a=>{null===z.current||z.current.contains(a.target)||y(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[x]);let A=()=>{y(!1)};return(0,n.use_escape_to_cancel)(A,x),(0,b.jsxs)("div",{className:"relative shrink-0",ref:z,children:[(0,b.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":x,"aria-haspopup":"menu",onClick:()=>y(a=>!a),children:(0,b.jsx)(f.HamburgerIcon,{})}),x?(0,b.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:[u&&null!==t?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("p",{className:"m-0 truncate px-2.5 py-1 text-[0.72rem] uppercase tracking-[0.04em] text-muted",title:t,children:t})}):null,(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:"/settings/tags",className:p,role:"menuitem",onClick:A,children:"Manage tags"})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:"/pomodoro",className:p,role:"menuitem",onClick:A,children:"Pomodoro"})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)(c.default,{href:"/settings/cloud-sync",className:p,role:"menuitem",onClick:A,children:"Sync settings"})}),u?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:p,role:"menuitemcheckbox","aria-checked":"true"===s,onClick:()=>{let a="true"===s?"false":"true";i.cloud_sync_enabled_preference.write(a),i.cloud_sync_enabled_preference.notify(),(0,h.notify_settings_saved)("true"===a?"Cloud sync enabled":"Cloud sync disabled"),"true"===a&&null!==t&&(0,j.run_tracker_db_cloud_sync)({merge_on_load:!0}).catch(()=>{})},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"true"===s?"Pause cloud sync":"Resume cloud sync"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===s?"On":"Off"})]})})}):null,(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:p,role:"menuitem",onClick:()=>{A(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsxs)("span",{children:["dark"===r?"Dark":"Light"," theme"]}),(0,b.jsx)("span",{"aria-hidden":"true",children:"dark"===r?"☾":"☀"})]})})}),(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:p,role:"menuitem",onClick:()=>{A(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"?",shiftKey:!0,bubbles:!0}))},children:(0,b.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,b.jsx)("span",{children:"Keyboard shortcuts"}),(0,b.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"(?)"})]})})}),u?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===t?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:p,role:"menuitem",onClick:()=>{A(),a.push((0,g.build_auth_page_href)("sign_in",q))},children:"Sign in"})}):(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${p} text-danger`,role:"menuitem",disabled:v,onClick:()=>{A(),w()},children:v?"Signing out…":"Sign out"})})]}):null]}):null]})}])},75654,a=>{"use strict";var b=a.i(39752);a.s(["SettingsIcon",0,function(){return(0,b.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,b.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,b.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},98790,a=>{"use strict";var b=a.i(39752),c=a.i(61995),d=a.i(41194),e=a.i(79334),f=a.i(62988),g=a.i(82508),h=a.i(75654);function i(){let a=((0,g.usePathname)()??"/").startsWith("/settings");return(0,b.jsx)(f.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${a?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":a?"page":void 0,children:(0,b.jsx)(h.SettingsIcon,{})})}function j({current:a,parent:c}){return(0,b.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,b.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,b.jsx)("li",{children:(0,b.jsx)(f.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==c?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{children:void 0!==c.href?(0,b.jsx)(f.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:c.href,children:c.label}):(0,b.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:c.label})})]}):null,(0,b.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,b.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:a})]})})}a.s(["TrackerTopbar",0,function({breadcrumb:a}={}){return(0,b.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,b.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,b.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!==a?(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(j,{current:a.current,parent:a.parent})}):null,(0,b.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,b.jsx)(c.TrackerNavLinks,{}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,b.jsx)(d.TopbarCloudStatus,{}),(0,b.jsx)(i,{}),(0,b.jsx)(e.TopbarOverflowMenu,{})]})]})]})})}],98790)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0u8~h8i._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[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"])},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}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,48174,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d(a){return a.startsWith("@")?a:`@${a}`}a.s(["format_display_tag",0,d],48174);var e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=d(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-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:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.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 ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:d(a)})},a))}):null]})}],30354)},64617,a=>{"use strict";a.s(["POMODORO_DEFAULT_SETTINGS",0,{work_minutes:25,short_break_minutes:5,long_break_minutes:15,rounds_before_long_break:4,auto_start_next_phase:!0,check_in_on_work_start:!0,work_entry_description:"Pomodoro focus"},"POMODORO_DEFAULT_STATE",0,{phase:"work",status:"idle",completed_work_sessions:0,deadline_at_ms:null,paused_remaining_ms:null},"POMODORO_STORAGE_KEY",0,"super-time-tracker-pomodoro"])},18734,a=>{"use strict";a.s(["clear_pomodoro_task_entry_marker",0,function(){},"is_pomodoro_task_entry",0,function(a){return!1},"mark_pomodoro_task_entry",0,function(a){}])},54015,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(34542),e=a.i(75654),f=a.i(30354),g=a.i(98790),h=a.i(89969),i=a.i(18734),j=a.i(19702),k=a.i(64617);a.s(["PomodoroView",0,function({known_tags:a}){let[l,m]=(0,d.useState)(k.POMODORO_DEFAULT_SETTINGS),[n,o]=(0,d.useState)(k.POMODORO_DEFAULT_STATE),[p,q]=(0,d.useState)(()=>Date.now()),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)(null),[v,w]=(0,d.useState)(!1),x=(0,d.useRef)(null),y=(0,d.useCallback)((a,b)=>{},[]);(0,d.useEffect)(()=>{},[]),(0,d.useEffect)(()=>{},[r,l,n]),(0,d.useEffect)(()=>{if("running"!==n.status)return;let a=window.setInterval(()=>{q(Date.now())},1e3);return()=>{window.clearInterval(a)}},[n.status,n.deadline_at_ms]);let z=(0,d.useCallback)(a=>{switch(a){case"work":return 6e4*l.work_minutes;case"short_break":return 6e4*l.short_break_minutes;case"long_break":return 6e4*l.long_break_minutes}},[l.long_break_minutes,l.short_break_minutes,l.work_minutes]),A=async()=>{let a=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error??"Failed to read tracker state");let b=await a.json().catch(()=>null);return b?.runningEntry!==null&&b?.runningEntry!==void 0},B=async()=>{try{w(await A())}catch{}},C=async()=>{let a=l.work_entry_description.trim();if(0===a.length)return;if(await A())return void w(!0);let b=await fetch("/api/in",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,sheetName:function(){try{let a=window.localStorage.getItem(j.ACTIVE_SHEET_STORAGE_KEY)?.trim()??"";return a.length>0?a:null}catch{return null}}()??void 0})});if(b.ok){let a=await b.json().catch(()=>null),c=a?.activeEntry;null!=c&&(0,i.mark_pomodoro_task_entry)({id:c.id,sheetName:c.sheetName}),w(!0);return}throw Error((await b.json().catch(()=>({}))).error??"Failed to start tracker entry for Pomodoro")},D=async()=>{let a=await fetch("/api/out",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){(0,i.clear_pomodoro_task_entry_marker)(),w(!1);return}let b=(await a.json().catch(()=>({}))).error??"Failed to check out active tracker entry";if(!b.includes("No active entry"))throw Error(b)},E=async()=>{u(null);try{let a=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(b.error??"Failed to read tracker state")}let b=await a.json().catch(()=>null),c=b?.runningEntry;if(c?.start===void 0)throw Error("No active task found to start from");let d=Date.parse(c.start);if(!Number.isFinite(d))throw Error("Active task start time is invalid");let e=Math.max(0,Date.now()-d),f=z(n.phase),g=Math.max(0,f-e);o(a=>({...a,status:"running",deadline_at_ms:Date.now()+g,paused_remaining_ms:null}))}catch(a){u(a instanceof Error?a.message:String(a))}},F=(0,d.useCallback)(()=>{let a="work"===n.phase,b=n.completed_work_sessions+1;if(o(a=>{let b="work"===a.phase?a.completed_work_sessions+1:a.completed_work_sessions,c="work"===a.phase?b%l.rounds_before_long_break==0?"long_break":"short_break":"work",d=z(c);return l.auto_start_next_phase?{phase:c,status:"running",completed_work_sessions:b,deadline_at_ms:Date.now()+d,paused_remaining_ms:null}:{phase:c,status:"idle",completed_work_sessions:b,deadline_at_ms:null,paused_remaining_ms:null}}),a&&y("Pomodoro focus session complete",`Completed focus session ${b}.`),l.auto_start_next_phase){let a="work"===n.phase?n.completed_work_sessions%l.rounds_before_long_break==l.rounds_before_long_break-1?"long break":"short break":"focus";y("work"===n.phase?"Pomodoro break started":"Pomodoro focus started",`Auto-started ${a} timer.`)}},[z,y,n.completed_work_sessions,n.phase,l.auto_start_next_phase,l.rounds_before_long_break]);(0,d.useEffect)(()=>{B()},[]),(0,d.useEffect)(()=>{let a=window.setInterval(()=>{B()},5e3);return()=>{window.clearInterval(a)}},[]),(0,d.useEffect)(()=>{if("running"!==n.status||null===n.deadline_at_ms||p<n.deadline_at_ms)return;let a=window.setTimeout(()=>{F()},0);return()=>{window.clearTimeout(a)}},[F,p,n.deadline_at_ms,n.status]);let G=z(n.phase),H="running"===n.status&&null!==n.deadline_at_ms?Math.max(0,n.deadline_at_ms-p):"paused"===n.status?n.paused_remaining_ms??G:G,I=Math.min(100,Math.max(0,(G-H)/G*100)),J=`${Math.floor(H/6e4).toString().padStart(2,"0")}:${Math.floor(H%6e4/1e3).toString().padStart(2,"0")}`,K={work:"Focus",short_break:"Short break",long_break:"Long break"}[n.phase],L="work"===n.phase?n.completed_work_sessions%l.rounds_before_long_break==l.rounds_before_long_break-1?"long_break":"short_break":"work",M="work"===n.phase?`${n.completed_work_sessions+1} / ${l.rounds_before_long_break} focus rounds`:"short_break"===n.phase?"Recover before the next focus block.":"Take the long break before the next round.",N="running"===n.status?"Pause":"paused"===n.status?"Resume":"Start",O=`${J} \xb7 ${K} \xb7 Pomodoro`;return(0,d.useEffect)(()=>{if("u">typeof document)return null===x.current&&(x.current=document.title),()=>{null!==x.current&&(document.title=x.current)}},[]),(0,d.useEffect)(()=>{"u">typeof document&&(document.title=O)},[O]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.TrackerTopbar,{breadcrumb:{current:"Pomodoro"}}),(0,b.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col gap-6 px-5 pb-12 pt-6",children:[(0,b.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Pomodoro"}),(0,b.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:"Keep a simple focus cycle running alongside your time tracker."})]}),(0,b.jsx)(c.default,{href:"/settings/pomodoro",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","aria-label":"Pomodoro settings",title:"Pomodoro settings",children:(0,b.jsx)(e.SettingsIcon,{})})]}),(0,b.jsx)("section",{className:"rounded-md border border-panel-border bg-panel p-5 shadow-sm",children:(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Current phase"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[1.3rem] font-semibold",children:K}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.88rem] leading-relaxed text-muted",children:M})]}),(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Next phase"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.95rem] font-semibold text-accent",children:{work:"Focus",short_break:"Short break",long_break:"Long break"}[L]}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.84rem] text-muted",children:l.auto_start_next_phase?"Auto-start enabled":"Waiting for you"})]})]}),(0,b.jsxs)("div",{className:"rounded-md border border-panel-border bg-background px-4 py-5 text-center",children:[(0,b.jsx)("p",{className:"m-0 font-mono text-[3rem] font-semibold tracking-tight text-accent","aria-live":"polite",children:J}),(0,b.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-surface-strong",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-200",style:{width:`${I}%`}})}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 text-[0.82rem] text-muted",children:[(0,b.jsxs)("span",{children:[n.completed_work_sessions," focus sessions done"]}),(0,b.jsx)("span",{children:"•"}),(0,b.jsx)("span",{children:"running"===n.status?"Running":"paused"===n.status?"Paused":"Idle"})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("primary"),onClick:()=>{let a,b,c;"running"===n.status?(u(null),o(a=>"running"!==a.status||null===a.deadline_at_ms?a:{...a,status:"paused",deadline_at_ms:null,paused_remaining_ms:Math.max(0,a.deadline_at_ms-Date.now())}),D().catch(a=>{u(a instanceof Error?a.message:String(a))})):(u(null),o(a=>{let b="paused"===a.status&&null!==a.paused_remaining_ms?a.paused_remaining_ms:z(a.phase);return{...a,status:"running",deadline_at_ms:Date.now()+b,paused_remaining_ms:null}}),a="paused"===n.status,b="short_break"===n.phase||"long_break"===n.phase,c=a||"running"!==n.status&&"work"===n.phase&&l.check_in_on_work_start,a||"running"===n.status||y(b?"Pomodoro break started":"Pomodoro focus started",b?"Break timer is running.":"Focus timer is running."),c&&C().catch(a=>{u(a instanceof Error?a.message:String(a))}))},children:N}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),onClick:F,children:"Skip phase"}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),onClick:()=>{o(k.POMODORO_DEFAULT_STATE),q(Date.now())},children:"Reset"}),(0,b.jsx)("button",{type:"button",className:(0,h.get_button_class_name)("ghost"),disabled:"running"===n.status,onClick:()=>{E()},children:"Start from active task start time"})]}),null!==t?(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:t}):null,l.check_in_on_work_start&&!v?(0,b.jsx)("div",{className:"grid gap-2 rounded-md border border-panel-border bg-background p-3 md:grid-cols-2",children:(0,b.jsxs)("label",{className:"flex flex-col gap-1.5 md:col-span-2",children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold text-muted",children:"New entry description (supports @tags)"}),(0,b.jsx)(f.TagAutocompleteInput,{id:"pomodoro-work-entry-description",value:l.work_entry_description,known_tags:a,placeholder:"Pomodoro focus @pomodoro @focus",on_change:a=>{m(b=>({...b,work_entry_description:a}))}})]})}):null]})})]})]})}],54015)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0ybsqe1._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[85393,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(82508);let e=[{href:"/settings",label:"General",match:a=>"/settings"===a},{href:"/settings/display",label:"Display & layout",match:a=>a.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:a=>a.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:a=>a.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:a=>a.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:a=>a.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:a=>a.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:a=>a.startsWith("/settings/tags")}];a.s(["SettingsNav",0,function(){let a=(0,d.usePathname)()??"/settings";return(0,b.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,b.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:e.map(d=>{let e=d.match(a);return(0,b.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,b.jsx)(c.default,{href:d.href,"aria-current":e?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${e?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:d.label})},d.href)})})})}])},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)},19325,a=>{"use strict";var b=a.i(39752),c=a.i(82508),d=a.i(34542),e=a.i(59659),f=a.i(53030),g=a.i(89969);a.s(["BackupRestoreSetting",0,function({db_path:a}){let h=(0,c.useRouter)(),{confirm:i}=(0,f.use_confirm_dialog)(),j=(0,d.useRef)(null),[k,l]=(0,d.useState)(null),[m,n]=(0,d.useState)(null),[o,p]=(0,d.useState)(!1),[q,r]=(0,d.useState)(!1),s=async()=>{p(!0),l(null),n(null);try{let a=await fetch("/api/backup");if(!a.ok){let b=await a.json();throw Error(b.error??"Download failed")}let b=await a.blob(),c=URL.createObjectURL(b),d=document.createElement("a");d.href=c,d.download="db.json",d.click(),URL.revokeObjectURL(c),n("Backup downloaded.")}catch(a){l(a instanceof Error?a.message:String(a))}finally{p(!1)}},t=async a=>{let b=a.target.files?.[0];if((a.target.value="",void 0!==b)&&await i({title:"Restore backup?",message:"This will replace your current time tracker data with the uploaded backup file. This cannot be undone.",confirmLabel:"Restore",variant:"danger"})){r(!0),l(null),n(null);try{let a,c=await b.text();try{a=JSON.parse(c)}catch{throw Error("Invalid backup file: file is not valid JSON.")}let d=await fetch("/api/backup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!d.ok){let a=await d.json();throw Error(a.error??"Restore failed")}n("Backup restored. Opening tracker…"),(0,e.push_tracker_db_cloud_after_change)(),h.push("/"),h.refresh()}catch(a){l(a instanceof Error?a.message:String(a))}finally{r(!1)}}},u=o||q;return(0,b.jsxs)("div",{className:"flex w-full flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.95rem] font-semibold",children:"Backup and restore"}),(0,b.jsx)("p",{className:"m-0 text-[0.8rem] leading-snug text-muted",children:"Download a copy of your database or replace it with a previously saved backup file."})]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-mono text-[0.65rem] leading-snug text-muted",title:a,children:a}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("ghost","small"),disabled:u,onClick:()=>void s(),children:o?"Downloading…":"Download backup"}),(0,b.jsx)("button",{type:"button",className:(0,g.get_button_class_name)("danger","small"),disabled:u,onClick:()=>{j.current?.click()},children:q?"Restoring…":"Restore from file"}),(0,b.jsx)("input",{ref:j,type:"file",accept:"application/json,.json",className:"hidden",onChange:a=>void t(a)})]}),null!==m?(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-accent",children:m}):null,null!==k?(0,b.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:k}):null]})}],19325)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_11d2qve._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[57077,a=>{"use strict";var b=a.i(7048);a.s(["persist_ui_preference",0,function(a,c){a.read()!==c&&(a.write(c),a.notify(),(0,b.notify_settings_saved)())}])},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)},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"])},30004,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.DEBUG_LOGGING_STORAGE_KEY,default_value:c.DEBUG_LOGGING_DEFAULT,is_valid:a=>"true"===a||"false"===a});a.s(["debug_logging_preference",0,d])},98831,40420,6962,45273,a=>{"use strict";var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.CLAUDE_API_KEY_STORAGE_KEY,default_value:c.CLAUDE_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["claude_api_key_preference",0,d],98831);let e=(0,b.create_ui_preference_store)({storage_key:c.ENTRY_SUGGESTION_PROVIDER_STORAGE_KEY,default_value:c.ENTRY_SUGGESTION_PROVIDER_DEFAULT,is_valid:a=>"none"===a||"openai"===a||"claude"===a||"google_ai"===a});a.s(["entry_suggestion_provider_preference",0,e],40420);let f=(0,b.create_ui_preference_store)({storage_key:c.GOOGLE_AI_API_KEY_STORAGE_KEY,default_value:c.GOOGLE_AI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["google_ai_api_key_preference",0,f],6962);let g=(0,b.create_ui_preference_store)({storage_key:c.OPENAI_API_KEY_STORAGE_KEY,default_value:c.OPENAI_API_KEY_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["openai_api_key_preference",0,g],45273)},84365,a=>{"use strict";a.s(["get_serialized_entries_total_ms",0,function(a){return a.reduce((a,b)=>a+b.durationMs,0)}])},14945,a=>{"use strict";a.s(["get_entry_list_sort_options",0,function(){return[{value:"newest",label:"Newest"},{value:"oldest",label:"Oldest"},{value:"duration",label:"Duration"},{value:"description",label:"Description"}]}])},50762,39744,13870,16777,18558,80805,9818,62082,a=>{"use strict";a.s(["parse_focus_goals_by_name",0,function(a){if(0===a.length)return{};try{let b=JSON.parse(a);if(null===b||"object"!=typeof b||Array.isArray(b))return{};let c={};for(let[a,d]of Object.entries(b)){if(null===d||"object"!=typeof d)continue;let b={};"string"==typeof d.daily&&d.daily.length>0&&(b.daily=d.daily),"string"==typeof d.weekly&&d.weekly.length>0&&(b.weekly=d.weekly),(void 0!==b.daily||void 0!==b.weekly)&&(c[a]=b)}return c}catch{return{}}}],50762);var b=a.i(52345),c=a.i(70827);let d=(0,b.create_ui_preference_store)({storage_key:c.DAILY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:c.DAILY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=30&&b<=720}});a.s(["daily_focus_target_minutes_preference",0,d],39744);let e=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_SCOPE_STORAGE_KEY,default_value:c.FOCUS_GOAL_SCOPE_DEFAULT,is_valid:a=>"global"===a||"sheet"===a||"tag"===a});a.s(["focus_goal_scope_preference",0,e],13870);let f=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_SHEET_NAME_STORAGE_KEY,default_value:c.FOCUS_GOAL_SHEET_NAME_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["focus_goal_sheet_name_preference",0,f],16777);let g=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOAL_TAG_NAME_STORAGE_KEY,default_value:c.FOCUS_GOAL_TAG_NAME_DEFAULT,is_valid:a=>a.trim().length>0});a.s(["focus_goal_tag_name_preference",0,g],18558);let h=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOALS_PER_SHEET_STORAGE_KEY,default_value:c.FOCUS_GOALS_PER_SHEET_DEFAULT,is_valid:a=>{if(0===a.length)return!1;try{let b=JSON.parse(a);return null!==b&&"object"==typeof b&&!Array.isArray(b)}catch{return!1}}});a.s(["focus_goals_per_sheet_preference",0,h],80805);let i=(0,b.create_ui_preference_store)({storage_key:c.FOCUS_GOALS_PER_TAG_STORAGE_KEY,default_value:c.FOCUS_GOALS_PER_TAG_DEFAULT,is_valid:a=>{if(0===a.length)return!1;try{let b=JSON.parse(a);return null!==b&&"object"==typeof b&&!Array.isArray(b)}catch{return!1}}});a.s(["focus_goals_per_tag_preference",0,i],9818);let j=(0,b.create_ui_preference_store)({storage_key:c.WEEKLY_FOCUS_TARGET_MINUTES_STORAGE_KEY,default_value:c.WEEKLY_FOCUS_TARGET_MINUTES_DEFAULT,is_valid:a=>{if(!/^\d+$/.test(a))return!1;let b=Number.parseInt(a,10);return b>=60&&b<=4200}});a.s(["weekly_focus_target_minutes_preference",0,j],62082)},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}])},56924,a=>{"use strict";a.s(["normalize_stored_tag",0,function(a){let b=a.trim().replace(/^@+/,"");if(0===b.length)throw Error("Tag name must not be empty.");if(!/^\w+$/.test(b))throw Error("Tags may only contain letters, numbers, and underscores.");return`@${b}`}])},30354,48174,a=>{"use strict";var b=a.i(39752),c=a.i(34542);function d(a){return a.startsWith("@")?a:`@${a}`}a.s(["format_display_tag",0,d],48174);var e=a.i(69749),f=a.i(56924);a.s(["TagAutocompleteInput",0,function({id:a,value:g,known_tags:h,placeholder:i,disabled:j=!1,autoFocus:k=!1,on_change:l}){let m=(0,c.useRef)(null),n=(0,c.useRef)(null),o=(0,c.useRef)(null),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(0),t=function(a,b){let c=a.slice(0,b),d=c.lastIndexOf("@");if(-1===d)return null;let e=c.slice(d+1);return/\s/.test(e)?null:{query:e,start_index:d,end_index:b}}(g,p),u=null===t?[]:function(a,b,c=10){let d=b.toLowerCase();return a.filter(a=>{let b=a.replace(/^@/,"").toLowerCase();return 0===d.length||b.startsWith(d)}).slice(0,c)}(h,t.query),v=null!==t&&function(a,b){if(!/^\w+$/.test(a))return!1;let c=a.toLowerCase();return b.some(a=>{try{return(0,f.normalize_stored_tag)(a).slice(1).toLowerCase()===c}catch{return!1}})}(t.query,h),w=null!==t&&u.length>0&&!v&&!j;(0,c.useLayoutEffect)(()=>{null!==o.current&&null!==m.current&&(m.current.setSelectionRange(o.current,o.current),q(o.current),o.current=null)},[g]),(0,c.useEffect)(()=>{s(0)},[g,p,u.length]);let x=()=>{q(m.current?.selectionStart??g.length)},y=()=>{s(0)},z=a=>{let b,c,e;if(null===t)return;let{next_text:f,next_cursor:h}=(b=d(a),c=g.slice(0,t.start_index),e=g.slice(t.end_index),{next_text:`${c}${b}${e}`,next_cursor:c.length+b.length});o.current=h,l(f),y()};return(0,b.jsxs)("div",{className:"relative min-w-0",children:[(0,b.jsx)("input",{ref:m,id:a,type:"text",className:(0,e.get_input_class_name)(),value:g,placeholder:i,disabled:j,autoFocus:k,autoComplete:"off","aria-autocomplete":"list","aria-expanded":w,"aria-controls":w?`${a}-tag-suggestions`:void 0,onChange:a=>{l(a.target.value),q(a.target.selectionStart??a.target.value.length)},onClick:x,onKeyUp:x,onKeyDown:a=>{if(w){if("ArrowDown"===a.key){a.preventDefault(),s(a=>(a+1)%u.length);return}if("ArrowUp"===a.key){a.preventDefault(),s(a=>(a-1+u.length)%u.length);return}if("Enter"===a.key||"Tab"===a.key){a.preventDefault();let b=u[r];void 0!==b&&z(b);return}"Escape"===a.key&&(a.preventDefault(),y())}},onBlur:()=>{window.setTimeout(y,120)}}),w?(0,b.jsx)("ul",{ref:n,id:`${a}-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:u.map((a,c)=>(0,b.jsx)("li",{role:"option","aria-selected":c===r,children:(0,b.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 ${c===r?"bg-surface-hover":""}`,onMouseDown:b=>{b.preventDefault(),z(a)},children:d(a)})},a))}):null]})}],30354)},64617,a=>{"use strict";a.s(["POMODORO_DEFAULT_SETTINGS",0,{work_minutes:25,short_break_minutes:5,long_break_minutes:15,rounds_before_long_break:4,auto_start_next_phase:!0,check_in_on_work_start:!0,work_entry_description:"Pomodoro focus"},"POMODORO_DEFAULT_STATE",0,{phase:"work",status:"idle",completed_work_sessions:0,deadline_at_ms:null,paused_remaining_ms:null},"POMODORO_STORAGE_KEY",0,"super-time-tracker-pomodoro"])},18734,a=>{"use strict";a.s(["clear_pomodoro_task_entry_marker",0,function(){},"is_pomodoro_task_entry",0,function(a){return!1},"mark_pomodoro_task_entry",0,function(a){}])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_138a8mc._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42800,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/settings",label:"General",match:e=>"/settings"===e},{href:"/settings/display",label:"Display & layout",match:e=>e.startsWith("/settings/display")},{href:"/settings/goals",label:"Goals",match:e=>e.startsWith("/settings/goals")},{href:"/settings/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/settings/pomodoro")},{href:"/settings/ai-suggestions",label:"AI suggestions",match:e=>e.startsWith("/settings/ai-suggestions")},{href:"/settings/cloud-sync",label:"Sync",match:e=>e.startsWith("/settings/cloud-sync")},{href:"/settings/data",label:"Data & backup",match:e=>e.startsWith("/settings/data")},{href:"/settings/tags",label:"Tag management",match:e=>e.startsWith("/settings/tags")}];e.s(["SettingsNav",0,function(){let e=(0,n.usePathname)()??"/settings";return(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"w-full",children:(0,t.jsx)("ul",{className:"scrollbar-none m-0 flex w-full list-none gap-1 overflow-x-auto p-0 pb-1 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden max-[860px]:flex-row min-[861px]:flex-col min-[861px]:gap-0.5 min-[861px]:overflow-visible min-[861px]:pb-0",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)("li",{className:"shrink-0 min-[861px]:shrink",children:(0,t.jsx)(r.default,{href:n.href,"aria-current":s?"page":void 0,className:`block whitespace-nowrap rounded-md px-3 py-2 text-[0.9rem] no-underline transition-colors duration-150 min-[861px]:whitespace-normal ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,children:n.label})},n.href)})})})}])},42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return u},urlObjectKeys:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066)._(e.r(78677)),o=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",l=e.hash||"",i=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),i&&"object"==typeof i&&(i=String(a.urlQueryToSearchParams(i)));let c=e.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),s=s.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${s}${c}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return l(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(31047),s=e.r(63334);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return x},useLinkStatus:function(){return _}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(44066),o=e.r(54710),l=a._(e.r(29158)),i=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let h=e.r(38520),p=e.r(19947),f=e.r(59246),b=e.r(99046);function x(t){var r,n;let s,a,x,[_,y]=(0,l.useOptimistic)(p.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:j,as:k,children:w,prefetch:N=null,passHref:S,replace:O,shallow:T,scroll:E,onClick:C,onMouseEnter:P,onTouchStart:L,legacyBehavior:R=!1,onNavigate:D,transitionTypes:M,ref:A,unstable_dynamicOnHover:I,...U}=t;s=w,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let $=l.default.useContext(u.AppRouterContext),F=!1!==N,W=!1!==N?null===(n=N)||"auto"===n?b.FetchStrategy.PPR:b.FetchStrategy.Full:b.FetchStrategy.PPR,K="string"==typeof(r=k||j)?r:(0,i.formatUrl)(r);if(R){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=l.default.Children.only(s)}let B=R?a&&"object"==typeof a&&a.ref:A,G=l.default.useCallback(e=>(null!==$&&(v.current=(0,p.mountLinkInstance)(e,K,$,W,F,y)),()=>{v.current&&((0,p.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,p.unmountPrefetchableInstance)(e)}),[F,K,$,W,y]),z={ref:(0,c.useMergedRef)(G,B),onClick(t){R||"function"!=typeof C||C(t),R&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,a,o,i){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,f.isLocalURL)(r)){s&&(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(91087);l.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,i)})}}(t,K,v,O,E,D,M)},onMouseEnter(e){R||"function"!=typeof P||P(e),R&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),$&&F&&(0,p.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){R||"function"!=typeof L||L(e),R&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),$&&F&&(0,p.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,d.isAbsoluteUrl)(K)?z.href=K:R&&!S&&("a"!==a.type||"href"in a.props)||(z.href=(0,m.addBasePath)(K)),x=R?l.default.cloneElement(a,z):(0,o.jsx)("a",{...U,...z,children:s}),(0,o.jsx)(g.Provider,{value:_,children:x})}e.r(10364);let g=(0,l.createContext)(p.IDLE_LINK_STATUS),_=()=>(0,l.useContext)(g);("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)},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),a=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[o,l]=(0,r.useState)(null),[i,u]=(0,r.useState)(!1),c=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{l(e?.user.email??null)}).catch(()=>{l(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{l(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:o,is_pending:i,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,a.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e},{href:"/today",label:"Today",match:e=>e.startsWith("/today")},{href:"/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/pomodoro")},{href:"/sheets",label:"Sheets",match:e=>e.startsWith("/sheets")},{href:"/reporting",label:"Reporting",match:e=>e.startsWith("/reporting")}];function a(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var o=e.i(77882);e.s(["TopbarCloudStatus",0,function(){let{email:e,is_configured:r}=(0,o.use_supabase_auth_session)();return r&&null!==e?(0,t.jsxs)("div",{className:"group relative flex items-center",children:[(0,t.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-accent","aria-label":`Cloud sync active for ${e}`,role:"img",children:(0,t.jsx)(a,{})}),(0,t.jsx)("div",{role:"tooltip",className:"pointer-events-none absolute right-0 top-full z-50 mt-1.5 w-max max-w-[min(18rem,calc(100vw-2.5rem))] opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100",children:(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-panel px-2.5 py-1.5 shadow-md",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Signed in as"}),(0,t.jsx)("p",{className:"m-0 max-w-[16rem] truncate text-[0.82rem] font-medium",title:e,children:e})]})})]}):null}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},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)}`}])},2268,76003,38240,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:r.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function s(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,n],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return s()}],76003);var a=e.i(17798),o=e.i(46549),l=e.i(10464),i=e.i(35434),u=e.i(61834),c=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===s()?"light":"dark";(0,a.apply_theme)(e),(0,c.write_stored_theme)(e),l.theme_mode_preference.write(e),(0,u.write_document_preference_cookies)({theme_mode:e,theme:e}),l.theme_mode_preference.notify(),(0,i.notify_theme_subscribers)(),(0,o.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),a=e.i(37399),o=e.i(90463),l=e.i(46549),i=e.i(2268),u=e.i(28274),c=e.i(76003),d=e.i(35434),m=e.i(38240),h=e.i(25204),p=e.i(77882);let f="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";e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),b=(0,n.usePathname)()??"/",x=(0,s.useSyncExternalStore)(d.subscribe_theme,c.get_theme_snapshot,c.get_theme_server_snapshot),g=(0,s.useSyncExternalStore)(i.cloud_sync_enabled_preference.subscribe,i.cloud_sync_enabled_preference.get_snapshot,i.cloud_sync_enabled_preference.get_server_snapshot),{email:_,is_configured:y,is_pending:v,sign_out:j}=(0,p.use_supabase_auth_session)(),[k,w]=(0,s.useState)(!1),N=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!k)return;let e=e=>{null===N.current||N.current.contains(e.target)||w(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[k]);let S=()=>{w(!1)};return(0,h.use_escape_to_cancel)(S,k),(0,t.jsxs)("div",{className:"relative shrink-0",ref:N,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:()=>w(e=>!e),children:(0,t.jsx)(a.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:[y&&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,(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/settings/tags",className:f,role:"menuitem",onClick:S,children:"Manage tags"})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/pomodoro",className:f,role:"menuitem",onClick:S,children:"Pomodoro"})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/settings/cloud-sync",className:f,role:"menuitem",onClick:S,children:"Sync settings"})}),y?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:f,role:"menuitemcheckbox","aria-checked":"true"===g,onClick:()=>{let e="true"===g?"false":"true";i.cloud_sync_enabled_preference.write(e),i.cloud_sync_enabled_preference.notify(),(0,l.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==_&&(0,u.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"===g?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===g?"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:f,role:"menuitem",onClick:()=>{S(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===x?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===x?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:f,role:"menuitem",onClick:()=>{S(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"?",shiftKey:!0,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:"(?)"})]})})}),y?(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:f,role:"menuitem",onClick:()=>{S(),e.push((0,o.build_auth_page_href)("sign_in",b))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${f} text-danger`,role:"menuitem",disabled:v,onClick:()=>{S(),j()},children:v?"Signing out…":"Sign out"})})]}):null]}):null]})}])},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),a=e.i(45958),o=e.i(71060),l=e.i(29539);function i(){let e=((0,o.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(a.default,{href:"/settings",className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-panel-border bg-ghost-bg text-muted no-underline hover:bg-surface-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent${e?" border-accent-border text-foreground":""}`,"aria-label":"Settings","aria-current":e?"page":void 0,children:(0,t.jsx)(l.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(a.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(a.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(i,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],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}])},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,18774,e=>{"use strict";var t=e.i(54710),r=e.i(29158);function n(e){return e.startsWith("@")?e:`@${e}`}e.s(["format_display_tag",0,n],18774);var s=e.i(52405),a=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:o,known_tags:l,placeholder:i,disabled:u=!1,autoFocus:c=!1,on_change:d}){let m=(0,r.useRef)(null),h=(0,r.useRef)(null),p=(0,r.useRef)(null),[f,b]=(0,r.useState)(0),[x,g]=(0,r.useState)(0),_=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let s=r.slice(n+1);return/\s/.test(s)?null:{query:s,start_index:n,end_index:t}}(o,f),y=null===_?[]: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)}(l,_.query),v=null!==_&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,a.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(_.query,l),j=null!==_&&y.length>0&&!v&&!u;(0,r.useLayoutEffect)(()=>{null!==p.current&&null!==m.current&&(m.current.setSelectionRange(p.current,p.current),b(p.current),p.current=null)},[o]),(0,r.useEffect)(()=>{g(0)},[o,f,y.length]);let k=()=>{b(m.current?.selectionStart??o.length)},w=()=>{g(0)},N=e=>{let t,r,s;if(null===_)return;let{next_text:a,next_cursor:l}=(t=n(e),r=o.slice(0,_.start_index),s=o.slice(_.end_index),{next_text:`${r}${t}${s}`,next_cursor:r.length+t.length});p.current=l,d(a),w()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",className:(0,s.get_input_class_name)(),value:o,placeholder:i,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":j,"aria-controls":j?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),b(e.target.selectionStart??e.target.value.length)},onClick:k,onKeyUp:k,onKeyDown:e=>{if(j){if("ArrowDown"===e.key){e.preventDefault(),g(e=>(e+1)%y.length);return}if("ArrowUp"===e.key){e.preventDefault(),g(e=>(e-1+y.length)%y.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=y[x];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),w())}},onBlur:()=>{window.setTimeout(w,120)}}),j?(0,t.jsx)("ul",{ref:h,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:y.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===x,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===x?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),N(e)},children:n(e)})},e))}):null]})}],14260)},77352,e=>{"use strict";var t=e.i(54710),r=e.i(42800),n=e.i(75404);e.s(["SettingsPageLayout",0,function({breadcrumb:e,title:s,description:a,children:o}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.TrackerTopbar,{breadcrumb:e}),(0,t.jsxs)("main",{className:"mx-auto grid w-full max-w-[1120px] grid-cols-[minmax(12rem,16rem)_minmax(0,1fr)] gap-4 px-4 pb-10 pt-5 sm:gap-6 sm:px-5 sm:pt-6 max-[860px]:grid-cols-1",children:[(0,t.jsxs)("aside",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Settings"}),(0,t.jsx)(r.SettingsNav,{})]}),(0,t.jsxs)("section",{className:"flex min-w-0 flex-col gap-4",children:[(0,t.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.35rem] font-[650] tracking-tight",children:s}),void 0!==a?(0,t.jsx)("p",{className:"m-0 text-[0.9rem] leading-relaxed text-muted",children:a}):null]}),o]})]})]})}])},99860,e=>{"use strict";var t=e.i(54710),r=e.i(29158),n=e.i(14260),s=e.i(27850),a=e.i(77352),o=e.i(26740);e.s(["PomodoroSettingsView",0,function({known_tags:e}){let[l,i]=(0,r.useState)(o.POMODORO_DEFAULT_SETTINGS),[u,c]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(o.POMODORO_STORAGE_KEY);if(null!==e){let t=JSON.parse(e).settings;void 0!==t&&i({work_minutes:"number"==typeof t.work_minutes&&Number.isFinite(t.work_minutes)&&t.work_minutes>0?Math.round(t.work_minutes):o.POMODORO_DEFAULT_SETTINGS.work_minutes,short_break_minutes:"number"==typeof t.short_break_minutes&&Number.isFinite(t.short_break_minutes)&&t.short_break_minutes>0?Math.round(t.short_break_minutes):o.POMODORO_DEFAULT_SETTINGS.short_break_minutes,long_break_minutes:"number"==typeof t.long_break_minutes&&Number.isFinite(t.long_break_minutes)&&t.long_break_minutes>0?Math.round(t.long_break_minutes):o.POMODORO_DEFAULT_SETTINGS.long_break_minutes,rounds_before_long_break:"number"==typeof t.rounds_before_long_break&&Number.isFinite(t.rounds_before_long_break)&&t.rounds_before_long_break>0?Math.round(t.rounds_before_long_break):o.POMODORO_DEFAULT_SETTINGS.rounds_before_long_break,auto_start_next_phase:"boolean"==typeof t.auto_start_next_phase?t.auto_start_next_phase:o.POMODORO_DEFAULT_SETTINGS.auto_start_next_phase,check_in_on_work_start:"boolean"==typeof t.check_in_on_work_start?t.check_in_on_work_start:o.POMODORO_DEFAULT_SETTINGS.check_in_on_work_start,work_entry_description:"string"==typeof t.work_entry_description?t.work_entry_description:o.POMODORO_DEFAULT_SETTINGS.work_entry_description})}}catch{}c(!0)},[]),(0,r.useEffect)(()=>{if(u)try{let e=window.localStorage.getItem(o.POMODORO_STORAGE_KEY),t=null===e?{}:JSON.parse(e),r={settings:l,state:t.state??o.POMODORO_DEFAULT_STATE};window.localStorage.setItem(o.POMODORO_STORAGE_KEY,JSON.stringify(r)),(0,s.schedule_ui_preferences_cloud_sync)()}catch{}},[u,l]),(0,t.jsx)(a.SettingsPageLayout,{breadcrumb:{current:"Pomodoro",parent:{label:"Settings",href:"/settings"}},title:"Pomodoro",description:"Focus and break durations, auto-start behavior, and tracker check-in defaults.",children:(0,t.jsxs)("ul",{className:"m-0 grid w-full list-none grid-cols-1 gap-2 p-0 md:grid-cols-2","aria-label":"Pomodoro settings",children:[(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,t.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Work minutes"}),(0,t.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:l.work_minutes,onChange:e=>{i(t=>({...t,work_minutes:Math.max(1,Number.parseInt(e.target.value,10)||1)}))}})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,t.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Short break minutes"}),(0,t.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:l.short_break_minutes,onChange:e=>{i(t=>({...t,short_break_minutes:Math.max(1,Number.parseInt(e.target.value,10)||1)}))}})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,t.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Long break minutes"}),(0,t.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:l.long_break_minutes,onChange:e=>{i(t=>({...t,long_break_minutes:Math.max(1,Number.parseInt(e.target.value,10)||1)}))}})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm",children:(0,t.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Rounds before long break"}),(0,t.jsx)("input",{type:"number",min:1,step:1,className:"rounded-md border border-panel-border bg-background px-3 py-2",value:l.rounds_before_long_break,onChange:e=>{i(t=>({...t,rounds_before_long_break:Math.max(1,Number.parseInt(e.target.value,10)||1)}))}})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0",checked:l.auto_start_next_phase,onChange:e=>{i(t=>({...t,auto_start_next_phase:e.target.checked}))}}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Auto-start next phase"}),(0,t.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Continue automatically when a focus or break phase ends."})]})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,t.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("input",{type:"checkbox",className:"mt-0.5 shrink-0",checked:l.check_in_on_work_start,onChange:e=>{i(t=>({...t,check_in_on_work_start:e.target.checked}))}}),(0,t.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Start tracker entry on focus start"}),(0,t.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"When you start a focus phase, create a new entry on your active sheet."})]})]})}),(0,t.jsx)("li",{className:"rounded-md border border-panel-border bg-panel p-3.5 shadow-sm md:col-span-2",children:(0,t.jsxs)("label",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[0.95rem] font-semibold",children:"Focus entry description (supports @tags)"}),(0,t.jsx)(n.TagAutocompleteInput,{id:"pomodoro-settings-work-entry-description",value:l.work_entry_description,known_tags:e,placeholder:"Pomodoro focus @pomodoro @focus",on_change:e=>{i(t=>({...t,work_entry_description:e}))}}),(0,t.jsx)("span",{className:"text-[0.8rem] leading-snug text-muted",children:"Used when a focus phase creates a new tracker entry on the active sheet."})]})})]})})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42552,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let o=e.r(44066)._(e.r(78677)),a=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||a.test(n))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),s=s.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${s}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},37879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(29158);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=o(e,n)),t&&(s.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},59246,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(31047),s=e.r(63334);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},10364,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},45958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return b},useLinkStatus:function(){return x}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let o=e.r(44066),a=e.r(54710),i=o._(e.r(29158)),l=e.r(42552),u=e.r(61717),c=e.r(37879),d=e.r(31047),m=e.r(20321);e.r(90503);let h=e.r(38520),f=e.r(19947),p=e.r(59246),_=e.r(99046);function b(t){var r,n;let s,o,b,[x,w]=(0,i.useOptimistic)(f.IDLE_LINK_STATUS),k=(0,i.useRef)(null),{href:y,as:v,children:j,prefetch:N=null,passHref:S,replace:O,shallow:E,scroll:T,onClick:P,onMouseEnter:C,onTouchStart:D,legacyBehavior:R=!1,onNavigate:M,transitionTypes:L,ref:A,unstable_dynamicOnHover:I,...F}=t;s=j,R&&("string"==typeof s||"number"==typeof s)&&(s=(0,a.jsx)("a",{children:s}));let $=i.default.useContext(u.AppRouterContext),U=!1!==N,K=!1!==N?null===(n=N)||"auto"===n?_.FetchStrategy.PPR:_.FetchStrategy.Full:_.FetchStrategy.PPR,B="string"==typeof(r=v||y)?r:(0,l.formatUrl)(r);if(R){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(s)}let G=R?o&&"object"==typeof o&&o.ref:A,W=i.default.useCallback(e=>(null!==$&&(k.current=(0,f.mountLinkInstance)(e,B,$,K,U,w)),()=>{k.current&&((0,f.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,f.unmountPrefetchableInstance)(e)}),[U,B,$,K,w]),z={ref:(0,c.useMergedRef)(W,G),onClick(t){R||"function"!=typeof P||P(t),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!$||t.defaultPrevented||function(t,r,n,s,o,a,l){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),a){let e=!1;if(a({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(91087);i.default.startTransition(()=>{d(r,s?"replace":"push",!1===o?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,l)})}}(t,B,k,O,T,M,L)},onMouseEnter(e){R||"function"!=typeof C||C(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),$&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===I)},onTouchStart:function(e){R||"function"!=typeof D||D(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),$&&U&&(0,f.onNavigationIntent)(e.currentTarget,!0===I)}};return(0,d.isAbsoluteUrl)(B)?z.href=B:R&&!S&&("a"!==o.type||"href"in o.props)||(z.href=(0,m.addBasePath)(B)),b=R?i.default.cloneElement(o,z):(0,a.jsx)("a",{...F,...z,children:s}),(0,a.jsx)(g.Provider,{value:x,children:b})}e.r(10364);let g=(0,i.createContext)(f.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},29539,e=>{"use strict";var t=e.i(54710);e.s(["SettingsIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),(0,t.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}])},77882,e=>{"use strict";var t=e.i(71060),r=e.i(29158),n=e.i(83105),s=e.i(32417),o=e.i(46549);e.s(["use_supabase_auth_session",0,function(){let e=(0,t.useRouter)(),[a,i]=(0,r.useState)(null),[l,u]=(0,r.useState)(!1),c=(0,s.is_supabase_configured)();return(0,r.useEffect)(()=>{if(!c)return;let e=(0,n.create_browser_supabase_client)();e.auth.getSession().then(({data:{session:e}})=>{i(e?.user.email??null)}).catch(()=>{i(null)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{i(t?.user.email??null)});return()=>{t.unsubscribe()}},[c]),{is_configured:c,email:a,is_pending:l,sign_out:(0,r.useCallback)(async()=>{u(!0);try{await fetch("/api/auth/signout",{method:"POST"});let t=(0,n.create_browser_supabase_client)();await t.auth.signOut().catch(()=>{}),(0,o.notify_settings_saved)("Signed out"),e.refresh()}finally{u(!1)}},[e])}}])},45200,648,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060);let s=[{href:"/",label:"Tracker",match:e=>"/"===e},{href:"/today",label:"Today",match:e=>e.startsWith("/today")},{href:"/pomodoro",label:"Pomodoro",match:e=>e.startsWith("/pomodoro")},{href:"/sheets",label:"Sheets",match:e=>e.startsWith("/sheets")},{href:"/reporting",label:"Reporting",match:e=>e.startsWith("/reporting")}];function o(){return(0,t.jsx)("svg",{className:"block h-4 w-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.5 19a4.5 4.5 0 0 0 0-9 6.5 6.5 0 0 0-12.6 1.5A4 4 0 0 0 6 19h11.5z"})})}e.s(["TrackerNavLinks",0,function(){let e=(0,n.usePathname)()??"/";return(0,t.jsx)("div",{className:"scrollbar-none flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap py-0.5 [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden min-[980px]:overflow-visible",children:s.map(n=>{let s=n.match(e);return(0,t.jsx)(r.default,{className:`rounded-full px-3 py-1.5 text-[0.85rem] font-semibold no-underline transition-colors duration-150 shrink-0 ${s?"bg-accent-soft text-foreground":"text-muted hover:bg-surface-hover hover:text-foreground"}`,href:n.href,"aria-current":s?"page":void 0,children:n.label},n.href)})})}],45200);var a=e.i(77882);e.s(["TopbarCloudStatus",0,function(){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}],648)},37399,e=>{"use strict";var t=e.i(54710);e.s(["HamburgerIcon",0,function(){return(0,t.jsxs)("svg",{className:"block h-4 w-4 text-muted",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M4 7h16"}),(0,t.jsx)("path",{d:"M4 12h16"}),(0,t.jsx)("path",{d:"M4 17h16"})]})}])},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)}`}])},2268,76003,38240,e=>{"use strict";var t=e.i(34869),r=e.i(92629);let n=(0,t.create_ui_preference_store)({storage_key:r.CLOUD_SYNC_ENABLED_STORAGE_KEY,default_value:r.CLOUD_SYNC_ENABLED_DEFAULT,is_valid:e=>"true"===e||"false"===e});function s(){return"u"<typeof document?"dark":"light"===document.documentElement.getAttribute("data-theme")?"light":"dark"}e.s(["cloud_sync_enabled_preference",0,n],2268),e.s(["get_theme_server_snapshot",0,function(){return"dark"},"get_theme_snapshot",0,function(){return s()}],76003);var o=e.i(17798),a=e.i(46549),i=e.i(10464),l=e.i(35434),u=e.i(61834),c=e.i(81553);e.s(["toggle_theme",0,function(){let e="dark"===s()?"light":"dark";(0,o.apply_theme)(e),(0,c.write_stored_theme)(e),i.theme_mode_preference.write(e),(0,u.write_document_preference_cookies)({theme_mode:e,theme:e}),i.theme_mode_preference.notify(),(0,l.notify_theme_subscribers)(),(0,a.notify_settings_saved)()}],38240)},25204,e=>{"use strict";var t=e.i(29158),r=e.i(72074);e.s(["use_escape_to_cancel",0,function(e,n=!0){let s=(0,t.useRef)(e);s.current=e,(0,t.useEffect)(()=>{if(!n)return;let e=e=>{"Escape"!==e.key||(0,r.is_modal_dialog_open)()||(e.preventDefault(),s.current())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n])}])},1976,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(71060),s=e.i(29158),o=e.i(37399),a=e.i(90463),i=e.i(46549),l=e.i(2268),u=e.i(28274),c=e.i(76003),d=e.i(35434),m=e.i(38240),h=e.i(25204),f=e.i(77882);let p="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";e.s(["TopbarOverflowMenu",0,function(){let e=(0,n.useRouter)(),_=(0,n.usePathname)()??"/",b=(0,s.useSyncExternalStore)(d.subscribe_theme,c.get_theme_snapshot,c.get_theme_server_snapshot),g=(0,s.useSyncExternalStore)(l.cloud_sync_enabled_preference.subscribe,l.cloud_sync_enabled_preference.get_snapshot,l.cloud_sync_enabled_preference.get_server_snapshot),{email:x,is_configured:w,is_pending:k,sign_out:y}=(0,f.use_supabase_auth_session)(),[v,j]=(0,s.useState)(!1),N=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!v)return;let e=e=>{null===N.current||N.current.contains(e.target)||j(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[v]);let S=()=>{j(!1)};return(0,h.use_escape_to_cancel)(S,v),(0,t.jsxs)("div",{className:"relative shrink-0",ref:N,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":v,"aria-haspopup":"menu",onClick:()=>j(e=>!e),children:(0,t.jsx)(o.HamburgerIcon,{})}),v?(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:[w&&null!==x?(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:x,children:x})}):null,(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/settings/tags",className:p,role:"menuitem",onClick:S,children:"Manage tags"})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/pomodoro",className:p,role:"menuitem",onClick:S,children:"Pomodoro"})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)(r.default,{href:"/settings/cloud-sync",className:p,role:"menuitem",onClick:S,children:"Sync settings"})}),w?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:p,role:"menuitemcheckbox","aria-checked":"true"===g,onClick:()=>{let e="true"===g?"false":"true";l.cloud_sync_enabled_preference.write(e),l.cloud_sync_enabled_preference.notify(),(0,i.notify_settings_saved)("true"===e?"Cloud sync enabled":"Cloud sync disabled"),"true"===e&&null!==x&&(0,u.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"===g?"Pause cloud sync":"Resume cloud sync"}),(0,t.jsx)("span",{className:"text-muted","aria-hidden":"true",children:"true"===g?"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:p,role:"menuitem",onClick:()=>{S(),(0,m.toggle_theme)()},suppressHydrationWarning:!0,children:(0,t.jsxs)("span",{className:"inline-flex w-full items-center justify-between gap-2",children:[(0,t.jsxs)("span",{children:["dark"===b?"Dark":"Light"," theme"]}),(0,t.jsx)("span",{"aria-hidden":"true",children:"dark"===b?"☾":"☀"})]})})}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:p,role:"menuitem",onClick:()=>{S(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"?",shiftKey:!0,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:"(?)"})]})})}),w?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),null===x?(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:p,role:"menuitem",onClick:()=>{S(),e.push((0,a.build_auth_page_href)("sign_in",_))},children:"Sign in"})}):(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${p} text-danger`,role:"menuitem",disabled:k,onClick:()=>{S(),y()},children:k?"Signing out…":"Sign out"})})]}):null]}):null]})}])},75404,e=>{"use strict";var t=e.i(54710),r=e.i(45200),n=e.i(648),s=e.i(1976),o=e.i(45958),a=e.i(71060),i=e.i(29539);function l(){let e=((0,a.usePathname)()??"/").startsWith("/settings");return(0,t.jsx)(o.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)(i.SettingsIcon,{})})}function u({current:e,parent:r}){return(0,t.jsx)("nav",{"aria-label":"Breadcrumb",className:"min-w-0 text-left",children:(0,t.jsxs)("ol",{className:"m-0 flex min-w-0 list-none flex-wrap items-center gap-1.5 p-0 text-[0.85rem]",children:[(0,t.jsx)("li",{children:(0,t.jsx)(o.default,{className:"text-muted no-underline hover:text-foreground",href:"/",children:"Tracker"})}),void 0!==r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{children:void 0!==r.href?(0,t.jsx)(o.default,{className:"max-w-44 truncate text-muted no-underline hover:text-foreground sm:max-w-none",href:r.href,children:r.label}):(0,t.jsx)("span",{className:"max-w-44 truncate text-muted sm:max-w-none",children:r.label})})]}):null,(0,t.jsx)("li",{className:"text-muted","aria-hidden":"true",children:"/"}),(0,t.jsx)("li",{className:"max-w-44 truncate font-medium text-foreground sm:max-w-none","aria-current":"page",children:e})]})})}e.s(["TrackerTopbar",0,function({breadcrumb:e}={}){return(0,t.jsx)("header",{className:"relative z-1 border-b border-panel-border bg-[color-mix(in_srgb,var(--panel)_92%,var(--background))] shadow-sm backdrop-blur-[10px]",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[1120px] min-h-13 flex-wrap items-center gap-x-4 gap-y-2 px-4 py-2 sm:px-5",children:[(0,t.jsx)("span",{className:"inline-flex min-w-0 shrink items-center font-mono text-[0.72rem] font-semibold uppercase leading-tight tracking-[0.08em] text-accent whitespace-nowrap",children:"super-time-tracker"}),void 0!==e?(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(u,{current:e.current,parent:e.parent})}):null,(0,t.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 min-[980px]:ml-auto min-[980px]:w-auto min-[980px]:justify-end",children:[(0,t.jsx)(r.TrackerNavLinks,{}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2",children:[(0,t.jsx)(n.TopbarCloudStatus,{}),(0,t.jsx)(l,{}),(0,t.jsx)(s.TopbarOverflowMenu,{})]})]})]})})}],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}])},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,18774,e=>{"use strict";var t=e.i(54710),r=e.i(29158);function n(e){return e.startsWith("@")?e:`@${e}`}e.s(["format_display_tag",0,n],18774);var s=e.i(52405),o=e.i(31113);e.s(["TagAutocompleteInput",0,function({id:e,value:a,known_tags:i,placeholder:l,disabled:u=!1,autoFocus:c=!1,on_change:d}){let m=(0,r.useRef)(null),h=(0,r.useRef)(null),f=(0,r.useRef)(null),[p,_]=(0,r.useState)(0),[b,g]=(0,r.useState)(0),x=function(e,t){let r=e.slice(0,t),n=r.lastIndexOf("@");if(-1===n)return null;let s=r.slice(n+1);return/\s/.test(s)?null:{query:s,start_index:n,end_index:t}}(a,p),w=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)}(i,x.query),k=null!==x&&function(e,t){if(!/^\w+$/.test(e))return!1;let r=e.toLowerCase();return t.some(e=>{try{return(0,o.normalize_stored_tag)(e).slice(1).toLowerCase()===r}catch{return!1}})}(x.query,i),y=null!==x&&w.length>0&&!k&&!u;(0,r.useLayoutEffect)(()=>{null!==f.current&&null!==m.current&&(m.current.setSelectionRange(f.current,f.current),_(f.current),f.current=null)},[a]),(0,r.useEffect)(()=>{g(0)},[a,p,w.length]);let v=()=>{_(m.current?.selectionStart??a.length)},j=()=>{g(0)},N=e=>{let t,r,s;if(null===x)return;let{next_text:o,next_cursor:i}=(t=n(e),r=a.slice(0,x.start_index),s=a.slice(x.end_index),{next_text:`${r}${t}${s}`,next_cursor:r.length+t.length});f.current=i,d(o),j()};return(0,t.jsxs)("div",{className:"relative min-w-0",children:[(0,t.jsx)("input",{ref:m,id:e,type:"text",className:(0,s.get_input_class_name)(),value:a,placeholder:l,disabled:u,autoFocus:c,autoComplete:"off","aria-autocomplete":"list","aria-expanded":y,"aria-controls":y?`${e}-tag-suggestions`:void 0,onChange:e=>{d(e.target.value),_(e.target.selectionStart??e.target.value.length)},onClick:v,onKeyUp:v,onKeyDown:e=>{if(y){if("ArrowDown"===e.key){e.preventDefault(),g(e=>(e+1)%w.length);return}if("ArrowUp"===e.key){e.preventDefault(),g(e=>(e-1+w.length)%w.length);return}if("Enter"===e.key||"Tab"===e.key){e.preventDefault();let t=w[b];void 0!==t&&N(t);return}"Escape"===e.key&&(e.preventDefault(),j())}},onBlur:()=>{window.setTimeout(j,120)}}),y?(0,t.jsx)("ul",{ref:h,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:w.map((e,r)=>(0,t.jsx)("li",{role:"option","aria-selected":r===b,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===b?"bg-surface-hover":""}`,onMouseDown:t=>{t.preventDefault(),N(e)},children:n(e)})},e))}):null]})}],14260)},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{}}])},7668,e=>{"use strict";var t=e.i(54710),r=e.i(45958),n=e.i(29158),s=e.i(29539),o=e.i(14260),a=e.i(75404),i=e.i(52663),l=e.i(15526),u=e.i(72550),c=e.i(26740);e.s(["PomodoroView",0,function({known_tags:e}){let[d,m]=(0,n.useState)(c.POMODORO_DEFAULT_SETTINGS),[h,f]=(0,n.useState)(c.POMODORO_DEFAULT_STATE),[p,_]=(0,n.useState)(()=>Date.now()),[b,g]=(0,n.useState)(!1),[x,w]=(0,n.useState)(null),[k,y]=(0,n.useState)(!1),v=(0,n.useRef)(null),j=(0,n.useCallback)((e,t)=>{if("Notification"in window){if("granted"===window.Notification.permission)return void new window.Notification(e,{body:t});"default"===window.Notification.permission&&window.Notification.requestPermission().then(r=>{"granted"===r&&new window.Notification(e,{body:t})})}},[]);(0,n.useEffect)(()=>{let e=window.setTimeout(()=>{try{let e=window.localStorage.getItem(c.POMODORO_STORAGE_KEY);if(null!==e){let t=JSON.parse(e),r=t.settings,n=t.state;if(void 0!==r&&m({work_minutes:"number"==typeof r.work_minutes&&Number.isFinite(r.work_minutes)&&r.work_minutes>0?Math.round(r.work_minutes):c.POMODORO_DEFAULT_SETTINGS.work_minutes,short_break_minutes:"number"==typeof r.short_break_minutes&&Number.isFinite(r.short_break_minutes)&&r.short_break_minutes>0?Math.round(r.short_break_minutes):c.POMODORO_DEFAULT_SETTINGS.short_break_minutes,long_break_minutes:"number"==typeof r.long_break_minutes&&Number.isFinite(r.long_break_minutes)&&r.long_break_minutes>0?Math.round(r.long_break_minutes):c.POMODORO_DEFAULT_SETTINGS.long_break_minutes,rounds_before_long_break:"number"==typeof r.rounds_before_long_break&&Number.isFinite(r.rounds_before_long_break)&&r.rounds_before_long_break>0?Math.round(r.rounds_before_long_break):c.POMODORO_DEFAULT_SETTINGS.rounds_before_long_break,auto_start_next_phase:"boolean"==typeof r.auto_start_next_phase?r.auto_start_next_phase:c.POMODORO_DEFAULT_SETTINGS.auto_start_next_phase,check_in_on_work_start:"boolean"==typeof r.check_in_on_work_start?r.check_in_on_work_start:c.POMODORO_DEFAULT_SETTINGS.check_in_on_work_start,work_entry_description:"string"==typeof r.work_entry_description?r.work_entry_description:c.POMODORO_DEFAULT_SETTINGS.work_entry_description}),void 0!==n){let e=n.phase,t=n.status;f({phase:"short_break"===e||"long_break"===e||"work"===e?e:c.POMODORO_DEFAULT_STATE.phase,status:"idle"===t||"paused"===t||"running"===t?t:c.POMODORO_DEFAULT_STATE.status,completed_work_sessions:"number"==typeof n.completed_work_sessions&&Number.isFinite(n.completed_work_sessions)&&n.completed_work_sessions>=0?Math.round(n.completed_work_sessions):c.POMODORO_DEFAULT_STATE.completed_work_sessions,deadline_at_ms:"number"==typeof n.deadline_at_ms&&Number.isFinite(n.deadline_at_ms)?n.deadline_at_ms:null,paused_remaining_ms:"number"==typeof n.paused_remaining_ms&&Number.isFinite(n.paused_remaining_ms)&&n.paused_remaining_ms>=0?Math.round(n.paused_remaining_ms):null})}}}catch{}g(!0)},0);return()=>{window.clearTimeout(e)}},[]),(0,n.useEffect)(()=>{if(b)try{window.localStorage.setItem(c.POMODORO_STORAGE_KEY,JSON.stringify({settings:d,state:h}))}catch{}},[b,d,h]),(0,n.useEffect)(()=>{if("running"!==h.status)return;let e=window.setInterval(()=>{_(Date.now())},1e3);return()=>{window.clearInterval(e)}},[h.status,h.deadline_at_ms]);let N=(0,n.useCallback)(e=>{switch(e){case"work":return 6e4*d.work_minutes;case"short_break":return 6e4*d.short_break_minutes;case"long_break":return 6e4*d.long_break_minutes}},[d.long_break_minutes,d.short_break_minutes,d.work_minutes]),S=async()=>{let e=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!e.ok)throw Error((await e.json().catch(()=>({}))).error??"Failed to read tracker state");let t=await e.json().catch(()=>null);return t?.runningEntry!==null&&t?.runningEntry!==void 0},O=async()=>{try{y(await S())}catch{}},E=async()=>{let e=d.work_entry_description.trim();if(0===e.length)return;if(await S())return void y(!0);let t=await fetch("/api/in",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:e,sheetName:function(){try{let e=window.localStorage.getItem(u.ACTIVE_SHEET_STORAGE_KEY)?.trim()??"";return e.length>0?e:null}catch{return null}}()??void 0})});if(t.ok){let e=await t.json().catch(()=>null),r=e?.activeEntry;null!=r&&(0,l.mark_pomodoro_task_entry)({id:r.id,sheetName:r.sheetName}),y(!0);return}throw Error((await t.json().catch(()=>({}))).error??"Failed to start tracker entry for Pomodoro")},T=async()=>{let e=await fetch("/api/out",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){(0,l.clear_pomodoro_task_entry_marker)(),y(!1);return}let t=(await e.json().catch(()=>({}))).error??"Failed to check out active tracker entry";if(!t.includes("No active entry"))throw Error(t)},P=async()=>{w(null);try{let e=await fetch("/api/state",{method:"GET",cache:"no-store"});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??"Failed to read tracker state")}let t=await e.json().catch(()=>null),r=t?.runningEntry;if(r?.start===void 0)throw Error("No active task found to start from");let n=Date.parse(r.start);if(!Number.isFinite(n))throw Error("Active task start time is invalid");let s=Math.max(0,Date.now()-n),o=N(h.phase),a=Math.max(0,o-s);f(e=>({...e,status:"running",deadline_at_ms:Date.now()+a,paused_remaining_ms:null}))}catch(e){w(e instanceof Error?e.message:String(e))}},C=(0,n.useCallback)(()=>{let e="work"===h.phase,t=h.completed_work_sessions+1;if(f(e=>{let t="work"===e.phase?e.completed_work_sessions+1:e.completed_work_sessions,r="work"===e.phase?t%d.rounds_before_long_break==0?"long_break":"short_break":"work",n=N(r);return d.auto_start_next_phase?{phase:r,status:"running",completed_work_sessions:t,deadline_at_ms:Date.now()+n,paused_remaining_ms:null}:{phase:r,status:"idle",completed_work_sessions:t,deadline_at_ms:null,paused_remaining_ms:null}}),e&&j("Pomodoro focus session complete",`Completed focus session ${t}.`),d.auto_start_next_phase){let e="work"===h.phase?h.completed_work_sessions%d.rounds_before_long_break==d.rounds_before_long_break-1?"long break":"short break":"focus";j("work"===h.phase?"Pomodoro break started":"Pomodoro focus started",`Auto-started ${e} timer.`)}},[N,j,h.completed_work_sessions,h.phase,d.auto_start_next_phase,d.rounds_before_long_break]);(0,n.useEffect)(()=>{O()},[]),(0,n.useEffect)(()=>{let e=window.setInterval(()=>{O()},5e3);return()=>{window.clearInterval(e)}},[]),(0,n.useEffect)(()=>{if("running"!==h.status||null===h.deadline_at_ms||p<h.deadline_at_ms)return;let e=window.setTimeout(()=>{C()},0);return()=>{window.clearTimeout(e)}},[C,p,h.deadline_at_ms,h.status]);let D=N(h.phase),R="running"===h.status&&null!==h.deadline_at_ms?Math.max(0,h.deadline_at_ms-p):"paused"===h.status?h.paused_remaining_ms??D:D,M=Math.min(100,Math.max(0,(D-R)/D*100)),L=`${Math.floor(R/6e4).toString().padStart(2,"0")}:${Math.floor(R%6e4/1e3).toString().padStart(2,"0")}`,A={work:"Focus",short_break:"Short break",long_break:"Long break"}[h.phase],I="work"===h.phase?h.completed_work_sessions%d.rounds_before_long_break==d.rounds_before_long_break-1?"long_break":"short_break":"work",F="work"===h.phase?`${h.completed_work_sessions+1} / ${d.rounds_before_long_break} focus rounds`:"short_break"===h.phase?"Recover before the next focus block.":"Take the long break before the next round.",$="running"===h.status?"Pause":"paused"===h.status?"Resume":"Start",U=`${L} \xb7 ${A} \xb7 Pomodoro`;return(0,n.useEffect)(()=>{if("u">typeof document)return null===v.current&&(v.current=document.title),()=>{null!==v.current&&(document.title=v.current)}},[]),(0,n.useEffect)(()=>{"u">typeof document&&(document.title=U)},[U]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.TrackerTopbar,{breadcrumb:{current:"Pomodoro"}}),(0,t.jsxs)("main",{className:"mx-auto flex w-full max-w-2xl flex-col gap-6 px-5 pb-12 pt-6",children:[(0,t.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h1",{className:"m-0 text-[1.5rem] font-[650] tracking-tight",children:"Pomodoro"}),(0,t.jsx)("p",{className:"m-0 mt-2 text-[0.9rem] leading-relaxed text-muted",children:"Keep a simple focus cycle running alongside your time tracker."})]}),(0,t.jsx)(r.default,{href:"/settings/pomodoro",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","aria-label":"Pomodoro settings",title:"Pomodoro settings",children:(0,t.jsx)(s.SettingsIcon,{})})]}),(0,t.jsx)("section",{className:"rounded-md border border-panel-border bg-panel p-5 shadow-sm",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Current phase"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[1.3rem] font-semibold",children:A}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.88rem] leading-relaxed text-muted",children:F})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Next phase"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.95rem] font-semibold text-accent",children:{work:"Focus",short_break:"Short break",long_break:"Long break"}[I]}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.84rem] text-muted",children:d.auto_start_next_phase?"Auto-start enabled":"Waiting for you"})]})]}),(0,t.jsxs)("div",{className:"rounded-md border border-panel-border bg-background px-4 py-5 text-center",children:[(0,t.jsx)("p",{className:"m-0 font-mono text-[3rem] font-semibold tracking-tight text-accent","aria-live":"polite",children:L}),(0,t.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-surface-strong",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-200",style:{width:`${M}%`}})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center justify-center gap-2 text-[0.82rem] text-muted",children:[(0,t.jsxs)("span",{children:[h.completed_work_sessions," focus sessions done"]}),(0,t.jsx)("span",{children:"•"}),(0,t.jsx)("span",{children:"running"===h.status?"Running":"paused"===h.status?"Paused":"Idle"})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("primary"),onClick:()=>{let e,t,r;"running"===h.status?(w(null),f(e=>"running"!==e.status||null===e.deadline_at_ms?e:{...e,status:"paused",deadline_at_ms:null,paused_remaining_ms:Math.max(0,e.deadline_at_ms-Date.now())}),T().catch(e=>{w(e instanceof Error?e.message:String(e))})):(w(null),f(e=>{let t="paused"===e.status&&null!==e.paused_remaining_ms?e.paused_remaining_ms:N(e.phase);return{...e,status:"running",deadline_at_ms:Date.now()+t,paused_remaining_ms:null}}),e="paused"===h.status,t="short_break"===h.phase||"long_break"===h.phase,r=e||"running"!==h.status&&"work"===h.phase&&d.check_in_on_work_start,e||"running"===h.status||j(t?"Pomodoro break started":"Pomodoro focus started",t?"Break timer is running.":"Focus timer is running."),r&&E().catch(e=>{w(e instanceof Error?e.message:String(e))}))},children:$}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),onClick:C,children:"Skip phase"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),onClick:()=>{f(c.POMODORO_DEFAULT_STATE),_(Date.now())},children:"Reset"}),(0,t.jsx)("button",{type:"button",className:(0,i.get_button_class_name)("ghost"),disabled:"running"===h.status,onClick:()=>{P()},children:"Start from active task start time"})]}),null!==x?(0,t.jsx)("p",{className:"m-0 text-[0.82rem] text-danger",children:x}):null,d.check_in_on_work_start&&!k?(0,t.jsx)("div",{className:"grid gap-2 rounded-md border border-panel-border bg-background p-3 md:grid-cols-2",children:(0,t.jsxs)("label",{className:"flex flex-col gap-1.5 md:col-span-2",children:[(0,t.jsx)("span",{className:"text-[0.8rem] font-semibold text-muted",children:"New entry description (supports @tags)"}),(0,t.jsx)(o.TagAutocompleteInput,{id:"pomodoro-work-entry-description",value:d.work_entry_description,known_tags:e,placeholder:"Pomodoro focus @pomodoro @focus",on_change:e=>{m(t=>({...t,work_entry_description:e}))}})]})}):null]})})]})]})}],7668)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67999,t=>{"use strict";t.s(["get_serialized_entries_total_ms",0,function(t){return t.reduce((t,e)=>t+e.durationMs,0)}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,22482,e=>{"use strict";var t=e.i(54710),n=e.i(45958),r=e.i(29158),a=e.i(14260),s=e.i(52663),i=e.i(52405),l=e.i(69472),o=e.i(84545),c=e.i(50937),d=e.i(83327),u=e.i(59515);function _({known_tags:e,on_submit:n,is_pending:m}){let[p,h]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[x,b]=(0,r.useState)(null),[y,v]=(0,r.useState)(!1),w=(0,r.useSyncExternalStore)(o.entry_suggestion_provider_preference.subscribe,o.entry_suggestion_provider_preference.get_snapshot,o.entry_suggestion_provider_preference.get_server_snapshot),k=(0,r.useSyncExternalStore)(d.openai_api_key_preference.subscribe,d.openai_api_key_preference.get_snapshot,d.openai_api_key_preference.get_server_snapshot),N=(0,r.useSyncExternalStore)(l.claude_api_key_preference.subscribe,l.claude_api_key_preference.get_snapshot,l.claude_api_key_preference.get_server_snapshot),j=(0,r.useSyncExternalStore)(c.google_ai_api_key_preference.subscribe,c.google_ai_api_key_preference.get_snapshot,c.google_ai_api_key_preference.get_server_snapshot),S="openai"===w?k:"claude"===w?N:"google_ai"===w?j:"",E="none"!==w&&S.trim().length>0,$=async()=>{if(E){v(!0),b(null);try{let e=await (0,u.request_ai_entry_description_suggestion)({provider:w,api_key:S,context:p,notes:""});h(e)}catch(e){b(e instanceof Error?e.message:String(e))}finally{v(!1)}}};return(0,t.jsxs)("form",{className:"flex flex-col gap-2 border border-panel-border bg-panel p-[1.1rem] shadow-sm",onSubmit:e=>{e.preventDefault();let t=p.trim();if(0===t.length)return;let r=g.trim();n({description:t,...r.length>0?{at:r}:{}}),h(""),f("")},children:[(0,t.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-description",children:"What are you working on?"}),(0,t.jsxs)("div",{className:`grid gap-2 max-[860px]:grid-cols-1 ${E?"grid-cols-[minmax(0,1fr)_auto_auto]":"grid-cols-[minmax(0,1fr)_auto]"}`,children:[(0,t.jsx)(a.TagAutocompleteInput,{id:"check-in-description",value:p,known_tags:e,placeholder:"e.g. crafting something @design",disabled:m,autoFocus:!0,on_change:h}),E?(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("ghost"),disabled:m||y,onClick:()=>void $(),title:"Suggest description with AI",children:y?"Suggesting…":"Suggest"}):null,(0,t.jsx)("button",{type:"submit",className:(0,s.get_button_class_name)("primary"),disabled:m||0===p.trim().length,children:"Check in"})]}),null!==x?(0,t.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:x}):null,(0,t.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-at",children:["Start time"," ",(0,t.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,t.jsx)("input",{id:"check-in-at",className:(0,i.get_input_class_name)(),value:g,onChange:e=>f(e.target.value),placeholder:"e.g. 30 minutes ago",disabled:m})]})}var m=e.i(50994);let p=(0,r.forwardRef)(function({known_tags:e,is_pending:n,on_submit:a,trailing:i},l){let o="true"===(0,r.useSyncExternalStore)(m.check_in_form_collapsed_preference.subscribe,m.check_in_form_collapsed_preference.get_snapshot,m.check_in_form_collapsed_preference.get_server_snapshot),[c,d]=(0,r.useState)(!o);return((0,r.useImperativeHandle)(l,()=>({expand_and_focus:()=>{d(!0),window.requestAnimationFrame(()=>{let e=document.getElementById("check-in-description");e instanceof HTMLElement&&e.focus()})}}),[]),o&&!c)?(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("primary"),disabled:n,onClick:()=>d(!0),children:"Check in"}),i]}):(0,t.jsx)(_,{known_tags:e,is_pending:n,on_submit:e=>{a(e),o&&d(!1)}})});var h=e.i(29539),g=e.i(32584),f=e.i(1238),x=e.i(83821),b=e.i(51703),y=e.i(74597),v=e.i(77130),w=e.i(56442),k=e.i(73228),N=e.i(56996),j=e.i(8654),S=e.i(76900),E=e.i(60145),$=e.i(26740),T=e.i(1800);function C({on_check_in_shortcut:e,has_running_timer:n=!1}){let a=(0,T.use_duration_format)(),s=(0,r.useSyncExternalStore)(N.focus_nudges_enabled_preference.subscribe,N.focus_nudges_enabled_preference.get_snapshot,N.focus_nudges_enabled_preference.get_server_snapshot),i=(0,r.useSyncExternalStore)(x.daily_focus_target_minutes_preference.subscribe,x.daily_focus_target_minutes_preference.get_snapshot,x.daily_focus_target_minutes_preference.get_server_snapshot),l=(0,r.useSyncExternalStore)(E.weekly_focus_target_minutes_preference.subscribe,E.weekly_focus_target_minutes_preference.get_snapshot,E.weekly_focus_target_minutes_preference.get_server_snapshot),o=(0,r.useSyncExternalStore)(j.no_log_reminder_minutes_preference.subscribe,j.no_log_reminder_minutes_preference.get_snapshot,j.no_log_reminder_minutes_preference.get_server_snapshot),c=(0,r.useSyncExternalStore)(S.overwork_alert_hours_preference.subscribe,S.overwork_alert_hours_preference.get_snapshot,S.overwork_alert_hours_preference.get_server_snapshot),d=(0,r.useSyncExternalStore)(b.focus_goal_scope_preference.subscribe,b.focus_goal_scope_preference.get_snapshot,b.focus_goal_scope_preference.get_server_snapshot),u=(0,r.useSyncExternalStore)(y.focus_goal_sheet_name_preference.subscribe,y.focus_goal_sheet_name_preference.get_snapshot,y.focus_goal_sheet_name_preference.get_server_snapshot),_=(0,r.useSyncExternalStore)(v.focus_goal_tag_name_preference.subscribe,v.focus_goal_tag_name_preference.get_snapshot,v.focus_goal_tag_name_preference.get_server_snapshot),m=(0,r.useSyncExternalStore)(w.focus_goals_per_sheet_preference.subscribe,w.focus_goals_per_sheet_preference.get_snapshot,w.focus_goals_per_sheet_preference.get_server_snapshot),p=(0,r.useSyncExternalStore)(k.focus_goals_per_tag_preference.subscribe,k.focus_goals_per_tag_preference.get_snapshot,k.focus_goals_per_tag_preference.get_server_snapshot),[h,A]=(0,r.useState)(null),[D,O]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=()=>{try{let e=window.localStorage.getItem($.POMODORO_STORAGE_KEY);if(null===e)return null;let t=JSON.parse(e).state;if(void 0===t||"running"!==t.status||null===t.deadline_at_ms)return null;let n=Math.max(0,t.deadline_at_ms-Date.now()),r=Math.floor(n/6e4),a=Math.floor(n%6e4/1e3);return{phase_label:"work"===t.phase?"Focus":"short_break"===t.phase?"Short break":"Long break",remaining_label:`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`}}catch{return null}};O(e());let t=window.setInterval(()=>{O(e())},1e3);return()=>{window.clearInterval(t)}},[]),(0,r.useEffect)(()=>{if("true"!==s)return;let e=!1,t=async()=>{try{var t,n,r;let a=new URLSearchParams;a.set("scope",(t=d,n=u,r=_,"sheet"===t&&0===n.length||"tag"===t&&0===r.length?"global":t)),"sheet"===d&&u.length>0&&a.set("sheet",u),"tag"===d&&_.length>0&&a.set("tag",_);let s=await fetch(`/api/focus-nudges/status?${a.toString()}`);if(!s.ok)return;let i=await s.json();e||A(i)}catch{}};t();let n=window.setInterval(()=>{t()},6e4);return()=>{e=!0,window.clearInterval(n)}},[s,d,u,_]);let R=(0,r.useMemo)(()=>{if("true"!==s||null===h)return null;let{daily_minutes:e,weekly_minutes:t}=function(e){if("sheet"===e.scope&&e.sheet_name.length>0){let t=(0,f.parse_focus_goals_by_name)(e.per_sheet_json)[e.sheet_name];return void 0===t?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:t.daily??e.global_daily,weekly_minutes:t.weekly??e.global_weekly}}if("tag"===e.scope&&e.tag_name.length>0){let t=(0,f.parse_focus_goals_by_name)(e.per_tag_json)[e.tag_name];return void 0===t?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:t.daily??e.global_daily,weekly_minutes:t.weekly??e.global_weekly}}return{daily_minutes:e.global_daily,weekly_minutes:e.global_weekly}}({scope:d,sheet_name:u,tag_name:_,per_sheet_json:m,per_tag_json:p,global_daily:i,global_weekly:l});if(null===e||null===t)return{kind:"alert",tone:"info",title:I("daily",d,u,_),detail:"No goals configured yet for this scope. Set daily and weekly targets in Goal settings."};let r=6e4*Number.parseInt(e,10),x=6e4*Number.parseInt(t,10),b=36e5*Number.parseInt(c,10),y=Number.parseInt(o,10);return null!==h.activeTimerDurationMs&&h.activeTimerDurationMs>=b?{kind:"alert",tone:"warning",title:"Overwork alert",detail:`Current session is ${(0,g.format_duration)(h.activeTimerDurationMs,a)}. Consider a short break.`}:!n&&null!==h.minutesSinceLastLog&&h.minutesSinceLastLog>=y?{kind:"alert",tone:"warning",title:"Gentle reminder",detail:`No time logged for ${h.minutesSinceLastLog} min. Start a timer when you are back on task.`,show_check_in_shortcut:!0}:h.todayTrackedMs<r?{kind:"progress",scope:"daily",title:I("daily",d,u,_),tracked_ms:h.todayTrackedMs,target_ms:r}:h.weekTrackedMs<x?{kind:"progress",scope:"weekly",title:I("weekly",d,u,_),tracked_ms:h.weekTrackedMs,target_ms:x}:{kind:"alert",tone:"success",title:"Targets met",detail:"Daily and weekly focus goals are on track."}},[i,a,s,c,n,d,u,_,m,p,o,h,l]);if(null===R)return null;if("progress"===R.kind)return(0,t.jsx)(M,{scope:R.scope,title:R.title,tracked_ms:R.tracked_ms,target_ms:R.target_ms,duration_format:a,active_pomodoro:D});let F="warning"===R.tone?"mb-4 rounded-md border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text":"success"===R.tone?"mb-4 rounded-md border border-accent-border bg-accent-soft px-3 py-2.5 text-accent":"mb-4 rounded-md border border-panel-border bg-panel px-3 py-2.5 text-foreground";return(0,t.jsxs)("section",{className:F,"aria-live":"polite","aria-atomic":"true",children:[(0,t.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:R.title}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,t.jsx)("p",{className:"m-0 text-[0.82rem] leading-relaxed",children:R.detail}),R.show_check_in_shortcut&&void 0!==e?(0,t.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-current bg-transparent px-2 py-1 text-[0.75rem] font-semibold",onClick:e,children:"Check in"}):null]})]})}function I(e,t,n,r){let a="daily"===e?"Relevant goal":"Weekly goal";return"sheet"===t&&n.length>0?`${a} \xb7 ${n}`:"tag"===t&&r.length>0?`${a} \xb7 @${r}`:a}function M({scope:e,title:r,tracked_ms:a,target_ms:s,duration_format:i,active_pomodoro:l}){let o=s>0?Math.min(100,a/s*100):0,c=Math.max(0,s-a);return(0,t.jsxs)("section",{className:"mb-4 rounded-md border border-panel-border bg-panel px-4 py-3 shadow-sm","aria-label":r,"aria-live":"polite",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:r}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[null!==l?(0,t.jsxs)("p",{className:"m-0 rounded border border-panel-border bg-surface-raised px-2 py-1 font-mono text-[0.72rem] font-semibold text-accent",children:["Pomodoro ",l.phase_label," · ",l.remaining_label]}):null,"daily"===e?(0,t.jsx)(n.default,{href:"/settings/goals#focus-goals-nudges",className:"inline-flex h-6 w-6 items-center justify-center rounded border border-panel-border text-muted no-underline hover:bg-surface-hover hover:text-foreground","aria-label":"Open daily focus target settings",title:"Daily focus target settings",children:(0,t.jsx)(h.SettingsIcon,{})}):null,(0,t.jsxs)("p",{className:"m-0 font-mono text-[0.78rem] font-semibold text-accent",children:[Math.round(o),"%"]})]})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-baseline justify-between gap-3",children:[(0,t.jsxs)("p",{className:"m-0 font-mono text-[1.35rem] font-semibold leading-none text-foreground",children:[(0,g.format_duration)(a,i),(0,t.jsxs)("span",{className:"ml-1 text-[0.85rem] font-medium text-muted",children:["/ ",(0,g.format_duration)(s,i)]})]}),(0,t.jsxs)("p",{className:"m-0 text-[0.78rem] text-muted",children:[(0,g.format_duration)(c,i)," left ","daily"===e?"today":"this week"]})]}),(0,t.jsx)("div",{className:"mt-3 h-1.5 w-full overflow-hidden rounded-full bg-accent-soft",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(o),children:(0,t.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${o}%`}})})]})}var A=e.i(71060),D=e.i(83391);function O(e,t,n){if(0===e.length)return null;let r=e.findIndex(e=>e.name===t),a=((-1===r?0:r)+("next"===n?1:-1)+e.length)%e.length;return e[a]?.name??null}var R=e.i(34995),F=e.i(53754),P=e.i(99211);function L({sheets:e,active_sheet_name:n,active_entry:a,is_pending:s,check_in_form_ref:i,active_entry_panel_ref:l,on_select_sheet:o,on_check_out:c}){let d=(0,A.useRouter)(),[u,_]=(0,r.useState)(!1),m=(0,F.use_check_out_action)(c),p=(0,r.useMemo)(()=>{let t=null!==a;return[{id:"help",label:"?",description:"Show keyboard shortcuts",key:"?",modifiers:["shift"],action:()=>{_(e=>!e)}},{id:"check-in",label:"C",description:"Check in (focus description)",key:"c",is_available:()=>!s&&!t,action:()=>{i.current?.expand_and_focus()}},{id:"check-out",label:"O",description:"Check out",key:"o",is_available:()=>!s&&t,action:()=>{m()}},{id:"edit-entry",label:"E",description:"Edit active entry",key:"e",is_available:()=>!s&&t,action:()=>{l.current?.start_edit()}},{id:"add-note",label:"N",description:"Add note to active entry",key:"n",is_available:()=>!s&&t,action:()=>{l.current?.start_add_note()}},{id:"pomodoro",label:"P",description:"Open Pomodoro",key:"p",is_available:()=>!s,action:()=>{d.push("/pomodoro")}},{id:"previous-sheet",label:"[",description:"Previous sheet",key:"[",is_available:()=>!s&&e.length>1,action:()=>{let t=O(e,n,"previous");null!==t&&t!==n&&o(t)}},{id:"next-sheet",label:"]",description:"Next sheet",key:"]",is_available:()=>!s&&e.length>1,action:()=>{let t=O(e,n,"next");null!==t&&t!==n&&o(t)}}]},[a,l,n,i,m,s,o,d,e]);return((0,P.use_document_keyboard_shortcuts)(p),u)?(0,t.jsx)(D.KeyboardShortcutsDialog,{sections:[...(0,R.get_app_keyboard_shortcut_sections)(),{title:"Tracker",entries:[{label:"C",description:"Check in (focus description)"},{label:"O",description:"Check out"},{label:"E",description:"Edit active entry description"},{label:"N",description:"Add note to active entry"},{label:"P",description:"Open Pomodoro"},{label:"[",description:"Previous sheet"},{label:"]",description:"Next sheet"}]}],on_close:()=>_(!1)}):null}var z=e.i(18774),G=e.i(31113),H=e.i(72550);function U(){try{let e=window.localStorage.getItem(H.SHEET_TAG_FILTERS_STORAGE_KEY);if(null===e)return{};let t=JSON.parse(e);if(null===t||"object"!=typeof t)return{};return t}catch{return{}}}function K(e){let t=U()[e]??[],n=[],r=new Set;for(let e of t)try{let t=(0,G.normalize_stored_tag)(e);r.has(t)||(r.add(t),n.push(t))}catch{continue}return n}var J=e.i(86580);function Y(e){return(0,J.get_stable_sheet_tag_filter_snapshot)(e,K(e))}function q(){return J.EMPTY_SHEET_TAG_FILTER}var B=e.i(98425),W=e.i(27850);function Q(e,t){let n=U();0===t.length?delete n[e]:n[e]=t;try{window.localStorage.setItem(H.SHEET_TAG_FILTERS_STORAGE_KEY,JSON.stringify(n)),(0,W.schedule_ui_preferences_cloud_sync)()}catch{}(0,B.notify_sheet_tag_filters_subscribers)()}function V(e,t){try{return(0,G.normalize_stored_tag)(e)===(0,G.normalize_stored_tag)(t)}catch{return!1}}var X=e.i(62796);function Z(){return(0,r.useSyncExternalStore)(X.tag_filter_mode_preference.subscribe,X.tag_filter_mode_preference.get_snapshot,X.tag_filter_mode_preference.get_server_snapshot)}function ee({sheet_name:e,sheet_tags:n}){let a=Z(),i=(0,r.useSyncExternalStore)(B.subscribe_sheet_tag_filters,()=>Y(e),q);if((0,r.useEffect)(()=>{!function(e,t){let n=K(e);if(0===n.length)return;let r=n.filter(e=>t.some(t=>V(e,t)));r.length!==n.length&&Q(e,r)}(e,n.map(e=>e.name))},[e,n]),0===n.length)return null;let l=i.length>0;return(0,t.jsxs)("div",{role:"group","aria-label":"Filter by tag",className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,t.jsx)("h2",{className:"m-0 shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:"Filter by tag"}),(0,t.jsx)("p",{className:"m-0 shrink-0 text-[0.8rem] text-muted",children:"any"===a?"Show entries that include any selected tag.":"Show entries that include every selected tag."}),(0,t.jsxs)("div",{className:"ml-auto flex min-w-0 flex-wrap justify-end gap-1",children:[n.map(n=>{let r=i.some(e=>V(e,n.name));return(0,t.jsxs)("button",{type:"button",className:`${(0,s.get_button_class_name)("ghost","small")} ${r?"border-accent-border bg-accent-soft text-foreground":""}`,"aria-pressed":r,onClick:()=>{var t;let r,a;return t=n.name,r=(0,G.normalize_stored_tag)(t),void((a=K(e)).some(e=>V(e,r))?Q(e,a.filter(e=>!V(e,r))):Q(e,[...a,r]))},children:[(0,z.format_display_tag)(n.name),(0,t.jsxs)("span",{className:"ml-1 font-normal text-muted",children:["(",n.entryCount,")"]})]},n.name)}),l?(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("ghost","small"),onClick:()=>Q(e,[]),children:"Clear filter"}):null]})]})}let et="inline-flex shrink-0 cursor-pointer items-center gap-1.5";function en({checked:e,disabled:n=!1,indeterminate:a=!1,nested:s=!1,on_change:i,label:l,aria_label:o,className:c}){let d=(0,r.useRef)(null);(0,r.useEffect)(()=>{null!==d.current&&(d.current.indeterminate=a)},[a]);let u=void 0===c?et:`${et} ${c}`,_=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:d,type:"checkbox",className:"peer absolute m-0 h-px w-px overflow-hidden opacity-0",checked:e,disabled:n,"aria-label":s&&void 0===l?o:void 0,onChange:i}),(0,t.jsx)("span",{className:'relative block h-[0.85rem] w-[0.85rem] shrink-0 rounded-[0.2rem] border border-panel-border bg-input-bg box-border transition-[background-color,border-color] duration-150 peer-checked:border-accent peer-checked:bg-accent peer-indeterminate:border-accent peer-indeterminate:bg-accent peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-input-focus-border peer-focus-visible:outline-offset-1 peer-disabled:cursor-not-allowed peer-disabled:opacity-55 after:absolute after:left-1/2 after:top-[44%] after:hidden after:h-[0.28rem] after:w-[0.45rem] after:-translate-x-1/2 after:-translate-y-[60%] after:rotate-[-45deg] after:border-b-[1.5px] after:border-l-[1.5px] after:border-accent-text-on after:content-[""] peer-checked:after:block peer-indeterminate:after:top-1/2 peer-indeterminate:after:block peer-indeterminate:after:h-[1.5px] peer-indeterminate:after:w-[0.45rem] peer-indeterminate:after:-translate-x-1/2 peer-indeterminate:after:-translate-y-1/2 peer-indeterminate:after:rotate-0 peer-indeterminate:after:border-0 peer-indeterminate:after:bg-accent-text-on',"aria-hidden":"true"})]});return s?(0,t.jsx)("span",{className:u,children:_}):(0,t.jsxs)("label",{className:u,children:[_,void 0!==l?(0,t.jsx)("span",{className:"select-none text-[0.8rem] leading-tight text-muted",children:l}):null]})}var er=e.i(14974),ea=e.i(28098),es=e.i(4903),ei=e.i(7568);function el({selected_count:e,total_count:n,all_selected:a,some_selected:l,selected_entries:o,sheets:c,is_pending:d,on_toggle_all:u,on_move:_,on_delete:m,on_clear:p}){let[h,g]=(0,r.useState)(""),f=o.some(e=>e.isActive),x=c.filter(e=>(!f||!e.hasActiveEntry)&&o.some(t=>t.sheetName!==e.name));return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md border border-accent-border bg-accent-soft px-3 py-2",children:[(0,t.jsx)(en,{className:"shrink-0",checked:a,indeterminate:l,disabled:d,aria_label:a?"Deselect all entries":"Select all entries",on_change:u}),(0,t.jsxs)("p",{className:"m-0 shrink-0 text-[0.85rem] font-semibold",children:[e,(0,t.jsx)("span",{className:"text-muted",children:` of ${n} selected`})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("select",{className:`${(0,i.get_input_class_name)("compact")} min-w-32`,value:h,disabled:d||0===x.length,"aria-label":"Move to sheet",onChange:e=>g(e.target.value),children:[(0,t.jsx)("option",{value:"",children:"Move to…"}),x.map(e=>(0,t.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("ghost","small"),disabled:d||0===h.trim().length||0===x.length,onClick:()=>{let e=h.trim();0!==e.length&&(_(e),g(""))},children:"Move"})]}),(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("danger","small"),disabled:d,onClick:m,children:"Delete"}),(0,t.jsx)("button",{type:"button",className:`${(0,s.get_button_class_name)("ghost","small")} shrink-0`,disabled:d,"aria-label":"Clear selection",title:"Clear selection",onClick:p,children:"✕"})]})]})}var eo=e.i(66770),ec=e.i(4874),ed=e.i(7902);function eu(){return(0,r.useSyncExternalStore)(ec.entry_list_sort_preference.subscribe,ec.entry_list_sort_preference.get_snapshot,ec.entry_list_sort_preference.get_server_snapshot)}let e_=(0,eo.get_entry_list_sort_options)();function em({is_pending:e=!1}){let n=eu();return(0,t.jsxs)("fieldset",{className:"m-0 flex flex-wrap items-center gap-x-2 gap-y-1.5 border-0 p-0",children:[(0,t.jsx)("legend",{className:"sr-only",children:"Order entries by"}),(0,t.jsx)("span",{className:"shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Order by"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Order entries by",children:e_.map(r=>{let a=n===r.value;return(0,t.jsx)("button",{type:"button",className:a?(0,s.get_button_class_name)("primary","small"):(0,s.get_button_class_name)("ghost","small"),disabled:e,"aria-pressed":a,onClick:()=>(0,ed.persist_ui_preference)(ec.entry_list_sort_preference,r.value),children:r.label},r.value)})})]})}var ep=e.i(75899),eh=e.i(27707);function eg(e){return`${e.sheetName}-${e.id}`}var ef=e.i(91966),ex=e.i(25204),eb=e.i(35923);function ey({title:e,entries:n,sheets:a,known_tags:s,total_ms:i,empty_message:_,is_pending:m,show_sheet_name:p=!0,header_extra:h,on_delete:f,on_edit:x,on_move:b,on_move_many:y,on_delete_many:v,on_edit_note:w,on_add_note:k,on_resume:N}){let{confirm:j}=(0,er.use_confirm_dialog)(),S=(0,ef.use_confirm_destructive_actions)(),E=(0,eb.use_time_format)(),$=(0,T.use_duration_format)(),[C,I]=(0,r.useState)(null),[M,A]=(0,r.useState)(()=>new Set),[D,O]=(0,r.useState)(null),[R,F]=(0,r.useState)(null),[P,L]=(0,r.useState)({}),G=(0,r.useSyncExternalStore)(o.entry_suggestion_provider_preference.subscribe,o.entry_suggestion_provider_preference.get_snapshot,o.entry_suggestion_provider_preference.get_server_snapshot),H=(0,r.useSyncExternalStore)(d.openai_api_key_preference.subscribe,d.openai_api_key_preference.get_snapshot,d.openai_api_key_preference.get_server_snapshot),U=(0,r.useSyncExternalStore)(l.claude_api_key_preference.subscribe,l.claude_api_key_preference.get_snapshot,l.claude_api_key_preference.get_server_snapshot),K=(0,r.useSyncExternalStore)(c.google_ai_api_key_preference.subscribe,c.google_ai_api_key_preference.get_snapshot,c.google_ai_api_key_preference.get_server_snapshot),J="openai"===G?H:"claude"===G?U:"google_ai"===G?K:"",Y="none"!==G&&J.trim().length>0,q=n.map(e=>eg(e)),B=n.filter(e=>M.has(eg(e))),W=n.length>0&&B.length===n.length,Q=B.length>0&&B.length<n.length;(0,r.useEffect)(()=>{A(e=>{let t=new Set(q),n=new Set([...e].filter(e=>t.has(e)));return n.size===e.size?e:n})},[q.join("|")]);let V=()=>{W?A(new Set):A(new Set(q))},X=()=>{A(new Set)},Z=async()=>{let e,t,n;0!==B.length&&(!S||await j((e=B.length,t=B.some(e=>e.isActive),n=1===e?"1 entry":`${e} entries`,{title:1===e?"Delete entry?":"Delete entries?",message:`Permanently delete ${n}?${t?" This will stop the active timer.":""}`,confirmLabel:"Delete",variant:"danger"})))&&(v(B),X())},ee=B.length>0,et=async e=>{if(!Y)return;let t=eg(e);O(t),F(null);try{let n=e.notes.map(e=>e.text).join("\n"),r=await (0,u.request_ai_entry_description_suggestion)({provider:G,api_key:J,context:e.description,notes:n});L(e=>({...e,[t]:r})),I(t)}catch(e){F(e instanceof Error?e.message:String(e))}finally{O(null)}};return(0,ex.use_escape_to_cancel)(X,ee&&null===C),(0,t.jsxs)("section",{className:"min-w-0",children:[(0,t.jsx)("header",{className:"mb-3 flex flex-col gap-2 border-b border-panel-border pb-2.5 compact:mb-2 compact:pb-1.5",children:ee?(0,t.jsx)(el,{selected_count:B.length,total_count:n.length,all_selected:W,some_selected:Q,selected_entries:B,sheets:a,is_pending:m,on_toggle_all:V,on_move:e=>{y(B,e),X()},on_delete:()=>void Z(),on_clear:X}):(0,t.jsxs)(t.Fragment,{children:[h,(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[n.length>0?(0,t.jsx)(en,{className:"shrink-0",checked:W,indeterminate:Q,disabled:m,aria_label:"Select all entries",on_change:V}):null,(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:e}),(0,t.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===n.length?null:1===n.length?"1 entry":`${n.length} entries`})]}),(0,t.jsxs)("p",{className:"m-0 font-mono text-[0.85rem] text-muted max-[640px]:w-full",children:[(0,g.format_duration)(i,$)," total"]})]}),(0,t.jsx)(em,{is_pending:m}),null!==R?(0,t.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:R}):null]})}),0===n.length?(0,t.jsx)("p",{className:"m-0 text-muted",children:_}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("ul",{className:"m-0 flex list-none flex-col p-0",children:n.map(e=>{let n=eg(e),r=C===n,i=M.has(n);return r?(0,t.jsx)("li",{className:"block border-b border-panel-border py-2.5 last:border-b-0 compact:py-1.5",children:(0,t.jsx)(ei.EntryEditForm,{entry:e,known_tags:s,is_pending:m,initial_description_override:P[n],on_cancel:()=>{I(null),L(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t})},on_save:t=>{x(e,t),I(null),L(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t})}})},n):(0,t.jsxs)("li",{className:`group relative flex flex-col gap-0 border-b border-panel-border px-2 py-2.5 transition-colors duration-150 last:border-b-0 hover:bg-surface-hover compact:py-1.5 ${i?"bg-accent-soft hover:bg-accent-soft":""}`,children:[(0,t.jsxs)("div",{className:"flex w-full min-w-0 flex-col items-start gap-2.5 min-[700px]:flex-row min-[700px]:items-center compact:gap-1.5",children:[(0,t.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed","aria-label":`Select entry ${e.description||"Untitled entry"}`,children:[(0,t.jsx)(en,{nested:!0,className:`shrink-0 pr-1 transition-opacity duration-150 compact:pr-0.5 ${i||ee?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,checked:i,disabled:m,on_change:()=>{A(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-semibold leading-snug compact:text-[0.9rem] compact:leading-tight",children:e.description||"Untitled entry"}),(0,t.jsxs)("div",{className:"mt-0.5 flex flex-wrap items-center gap-1 text-[0.8rem] text-muted compact:mt-px compact:gap-0.5 compact:text-[0.72rem]",children:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:e.sheetName}),(0,t.jsx)("span",{children:"·"})]}):null,(0,t.jsxs)("span",{children:["#",e.id]}),(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{className:"whitespace-nowrap",children:[(0,ep.format_time)(e.start,E),null===e.end?" → now":` → ${(0,ep.format_time)(e.end,E)}`]}),e.tags.length>0?(0,t.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1 p-0",children:e.tags.map(e=>(0,t.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,z.format_display_tag)(e)},e))}):null]})]})]}),(0,t.jsxs)("div",{className:"flex w-full shrink-0 flex-row items-center justify-between gap-2 min-[700px]:w-auto min-[700px]:justify-end max-[860px]:flex-wrap compact:gap-1.5",children:[(0,t.jsx)("p",{className:`m-0 whitespace-nowrap text-right font-mono text-[0.9rem] text-muted compact:text-[0.8rem] ${e.isActive?"text-accent":""}`,children:(0,g.format_duration)(e.durationMs,$)}),(0,t.jsx)(ea.EntryActionsMenu,{current_sheet_name:e.sheetName,sheets:a,is_pending:m||D===n,on_edit:()=>{I(n),L(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t})},on_revise_description_ai:Y?()=>void et(e):void 0,can_revise_description_ai:Y,on_add_note:t=>k(e,t),on_resume:()=>N(e),entry_is_active:e.isActive,on_move:t=>b(e,t),on_delete:async()=>{(!S||await j((0,eh.get_delete_entry_confirm_dialog)(e)))&&f(e)}})]})]}),e.notes.length>0?(0,t.jsx)("div",{className:"w-full pt-1 pl-[calc(0.85rem+0.5rem+0.35rem)] compact:pt-0.5 compact:pl-[calc(0.85rem+0.35rem+0.2rem)]",children:(0,t.jsx)(es.EntryNotesList,{notes:e.notes,variant:"inline",is_pending:m,on_edit_note:(t,n)=>w(e,t,n)})}):null]},n)})})})]})}var ev=e.i(37399);let ew="block w-full cursor-pointer rounded-[0.45rem] border-0 bg-transparent px-2.5 py-1.5 text-left font-inherit text-[0.85rem] text-inherit hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-55";function ek({sheet_name:e,is_pending:n,can_delete:a,on_rename:s,on_delete:i}){let[l,o]=(0,r.useState)(!1),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!l)return;let e=e=>{null===c.current||c.current.contains(e.target)||o(!1)};return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[l]);let d=()=>{o(!1)};return(0,t.jsxs)("div",{className:"relative shrink-0 self-center",ref:c,children:[(0,t.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":`Actions for sheet ${e}`,"aria-expanded":l,"aria-haspopup":"menu",disabled:n,onClick:()=>o(e=>!e),children:(0,t.jsx)(ev.HamburgerIcon,{})}),l?(0,t.jsxs)("ul",{className:"absolute right-0 top-full z-10 mt-1.5 min-w-56 list-none rounded-md border border-panel-border bg-panel p-1.5 shadow-md",role:"menu",children:[(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:ew,role:"menuitem",disabled:n,onClick:()=>{d(),s()},children:"Rename"})}),(0,t.jsx)("li",{className:"my-1 border-t border-panel-border",role:"separator","aria-hidden":"true"}),(0,t.jsx)("li",{role:"none",children:(0,t.jsx)("button",{type:"button",className:`${ew} text-danger`,role:"menuitem",disabled:n||!a,title:a?void 0:"Cannot delete the last sheet",onClick:()=>{d(),i()},children:"Delete sheet"})})]}):null]})}function eN({sheets:e,db_path:n,on_select:a,on_create:l,on_rename:o,on_delete:c,is_pending:d}){let{confirm:u}=(0,er.use_confirm_dialog)(),_=(0,ef.use_confirm_destructive_actions)(),m=e.length>1,[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),[x,b]=(0,r.useState)(null),[y,v]=(0,r.useState)(""),w=()=>{h(!1),f("")},k=()=>{b(null),v("")};(0,ex.use_escape_to_cancel)(k,null!==x),(0,ex.use_escape_to_cancel)(w,p);let N=e=>{if(e.preventDefault(),null===x)return;let t=y.trim();0===t.length||t===x||o(x,t),k()};return(0,t.jsxs)("aside",{className:"flex min-w-0 flex-col gap-3 max-[860px]:min-w-0",children:[(0,t.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheets"}),(0,t.jsx)("ul",{className:"m-0 flex min-h-0 flex-1 list-none flex-col gap-1.5 p-0",children:e.map(e=>(0,t.jsx)("li",{className:"min-w-0",children:x===e.name?(0,t.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-1.5",onSubmit:N,children:[(0,t.jsx)("input",{className:(0,i.get_input_class_name)("compact"),value:y,onChange:e=>v(e.target.value),disabled:d,autoFocus:!0}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)("button",{type:"submit",className:`${(0,s.get_button_class_name)("ghost")} flex-1`,disabled:d||0===y.trim().length,children:"Save"}),(0,t.jsx)("button",{type:"button",className:`${(0,s.get_button_class_name)("ghost")} flex-1`,disabled:d,onClick:k,children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"flex min-w-0 items-stretch gap-1",children:[(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 cursor-pointer items-center justify-between gap-2 rounded-md border border-transparent bg-transparent px-2.5 py-2 text-left transition-[background-color,color] duration-150 hover:bg-surface-hover",disabled:d&&!e.isActive,onClick:()=>a(e.name),children:[(0,t.jsx)("span",{className:`min-w-0 flex-1 truncate font-semibold ${e.isActive||e.hasActiveEntry?"text-accent":""}`,children:e.name}),(0,t.jsx)("span",{className:`shrink-0 text-xs whitespace-nowrap ${e.hasActiveEntry?"text-accent":"text-muted"}`,children:e.hasActiveEntry?"● active":`${e.entryCount} entries`})]}),(0,t.jsx)(ek,{sheet_name:e.name,is_pending:d,can_delete:m,on_rename:()=>{var t;b(t=e.name),v(t)},on_delete:async()=>{var t,n,r;let a;(!_||await u((t=e.name,n=e.entryCount,r=e.hasActiveEntry,a=0===n?"":` This will delete ${n} ${1===n?"entry":"entries"}.`,{title:"Delete sheet?",message:`Delete "${t}"?${a}${r?" This will stop the active timer.":""}`,confirmLabel:"Delete sheet",variant:"danger"})))&&c(e.name)}})]})},e.name))}),p?(0,t.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-2",onSubmit:e=>{e.preventDefault();let t=g.trim();0!==t.length&&(l(t),w())},children:[(0,t.jsx)("input",{className:(0,i.get_input_class_name)("compact"),value:g,onChange:e=>f(e.target.value),placeholder:"New sheet name",disabled:d,autoFocus:!0}),(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)("button",{type:"submit",className:`${(0,s.get_button_class_name)("ghost")} flex-1`,disabled:d||0===g.trim().length,children:"Add"}),(0,t.jsx)("button",{type:"button",className:`${(0,s.get_button_class_name)("ghost")} flex-1`,disabled:d,onClick:w,children:"Cancel"})]})]}):(0,t.jsx)("button",{type:"button",className:(0,s.get_button_class_name)("ghost"),disabled:d,onClick:()=>h(!0),children:"Add sheet"}),(0,t.jsx)("p",{className:"mt-auto shrink-0 overflow-wrap-anywhere border-t border-panel-border pt-3 font-mono text-[0.65rem] leading-snug text-muted",title:n,children:n})]})}var ej=e.i(2154),eS=e.i(15526);let eE=(0,r.forwardRef)(function({active_entry:e,sheets:n,known_tags:a,is_pending:s,on_check_out:i,on_delete:l,on_edit:o,on_move:c,on_add_note:d,on_edit_note:u,on_delete_note:_},m){let{confirm:p}=(0,er.use_confirm_dialog)(),h=(0,ef.use_confirm_destructive_actions)(),g=(0,r.useRef)(null);return((0,r.useImperativeHandle)(m,()=>({start_edit:()=>{g.current?.start_edit()},start_add_note:()=>{g.current?.start_add_note()}})),null===e)?null:(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted whitespace-nowrap truncate",children:["Sheet ",e.sheetName]}),(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),(0,eS.is_pomodoro_task_entry)(e)?(0,t.jsx)("span",{className:"shrink-0 rounded-full border border-panel-border bg-surface-raised px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-foreground",children:"Pomodoro"}):null,(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(ea.EntryActionsMenu,{current_sheet_name:e.sheetName,sheets:n,is_pending:s,on_edit:()=>g.current?.start_edit(),on_show_add_note_form:()=>g.current?.start_add_note(),on_move:c,on_delete:async()=>{(!h||await p((0,eh.get_delete_entry_confirm_dialog)(e)))&&l()}})})]}),(0,t.jsx)(ej.ActiveEntryPanel,{ref:g,entry:e,sheets:n,known_tags:a,in_bar:!0,is_pending:s,on_check_out:i,on_delete:l,on_edit:o,on_move:c,on_add_note:d,on_edit_note:u,on_delete_note:_},`${e.sheetName}-${e.id}`)]})});var e$=e.i(16967),eT=e.i(92743);let eC="super-time-tracker";function eI({active_entry:e}){let t="true"===(0,r.useSyncExternalStore)(e$.timer_in_title_preference.subscribe,e$.timer_in_title_preference.get_snapshot,e$.timer_in_title_preference.get_server_snapshot),n=(0,T.use_duration_format)(),a=(0,eT.use_timer_show_seconds)(),[s,i]=(0,r.useState)(e?.durationMs??0);return(0,r.useEffect)(()=>{if(null===e)return void i(0);i(e.durationMs);let t=window.setInterval(()=>{i(Date.now()-new Date(e.start).getTime())},1e3);return()=>window.clearInterval(t)},[e]),(0,r.useEffect)(()=>{if(!t||null===e){document.title=eC;return}let r=e.description.trim()||"Tracking",i=(0,g.format_duration)(s,n,a);return document.title=`${i} — ${r}`,()=>{document.title=eC}},[e,n,s,a,t]),null}var eM=e.i(75404),eA=e.i(44356),eD=e.i(68713),eO=e.i(67999),eR=e.i(17857),eF=e.i(3159),eP=e.i(51229),eL=e.i(17003);function ez(e){let t=e.activeSheetName;null!==t&&(0,eL.write_active_sheet_preference)(t)}var eG=e.i(65742);e.s(["TrackerApp",0,function({initial_state:e}){let[a,i]=(0,r.useState)(e),[l,o]=(0,r.useState)(null),[c,d]=(0,r.useState)(!1),[u,_]=(0,r.useState)(!1),m=(0,r.useRef)(e);(0,r.useEffect)(()=>{ez(e)},[e]);let h=async e=>{d(!0),o(null);try{let t=await e(),n=null!==a.activeEntry&&null===t.activeEntry;ez(t),i(t),n&&(0,eD.finish_running_pomodoro_timer)()}catch(e){o(e instanceof Error?e.message:String(e))}finally{d(!1)}},g=a.activeSheetName??a.sheets.find(e=>e.isActive)?.name??"main",f=Z(),x=eu(),b="true"===(0,r.useSyncExternalStore)(eG.clear_tag_filters_on_sheet_change_preference.subscribe,eG.clear_tag_filters_on_sheet_change_preference.get_snapshot,eG.clear_tag_filters_on_sheet_change_preference.get_server_snapshot),y=(0,r.useRef)(null),v=(0,r.useRef)(null),w=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!b||null===y.current||y.current===g){y.current=g;return}Q(g,[]),y.current=g},[g,b]);let k=(0,r.useSyncExternalStore)(B.subscribe_sheet_tag_filters,()=>Y(g),q),N=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let n of e){let e=new Set;for(let r of n.tags)try{let n=(0,G.normalize_stored_tag)(r);if(e.has(n))continue;e.add(n),t.set(n,(t.get(n)??0)+1)}catch{continue}}return[...t.entries()].map(([e,t])=>({name:e,entryCount:t})).sort((e,t)=>e.name.localeCompare(t.name))})(a.activeSheetEntries),[a.activeSheetEntries]),j=(0,r.useMemo)(()=>{if(u)return[];let e=[...function(e,t,n="all"){return 0===t.length?e:e.filter(e=>(function(e,t,n="all"){return 0===t.length||("any"===n?t.some(t=>e.tags.some(e=>V(e,t))):t.every(t=>e.tags.some(e=>V(e,t))))})(e,t,n))}(a.activeSheetEntries,k,f)];switch(x){case"oldest":return e.sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime());case"duration":return e.sort((e,t)=>t.durationMs-e.durationMs);case"description":return e.sort((e,t)=>{let n=e.description.trim()||"Untitled entry",r=t.description.trim()||"Untitled entry";return n.localeCompare(r)});default:return e.sort((e,t)=>new Date(t.start).getTime()-new Date(e.start).getTime())}},[a.activeSheetEntries,k,f,x,u]),S=(0,r.useMemo)(()=>(0,eO.get_serialized_entries_total_ms)(j),[j]),E=u?`Loading entries for "${g}"…`:k.length>0?"any"===f?`No entries on sheet "${g}" match any selected tag.`:`No entries on sheet "${g}" match all selected tags.`:`No entries on sheet "${g}".`,$=e=>{let t;if(e===g&&!u)return;m.current=a;let n=(t=a.runningEntries.find(t=>t.sheetName===e)??null,{...a,activeSheetName:e,sheets:a.sheets.map(t=>({...t,isActive:t.name===e})),activeEntry:t,activeSheetEntries:a.activeSheetEntries,activeSheetTotalMs:a.activeSheetTotalMs});ez(n),i(n),_(!0),o(null),(0,eP.post_tracker_action)("/api/sheet",{name:e}).then(e=>{ez(e),i(e)}).catch(e=>{o(e instanceof Error?e.message:String(e)),i(m.current)}).finally(()=>{_(!1)})},T=(e,t,n)=>(0,eF.patch_tracker_action)("/api/entry",{sheetName:e,entryId:t,...n});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eI,{active_entry:a.activeEntry}),(0,t.jsx)(L,{sheets:a.sheets,active_sheet_name:g,active_entry:a.activeEntry,is_pending:c,check_in_form_ref:v,active_entry_panel_ref:w,on_select_sheet:$,on_check_out:e=>h(()=>(0,eP.post_tracker_action)("/api/out",{sheetName:g,...void 0!==e?{at:e}:{}}))}),(0,t.jsx)("div",{className:"relative z-1",children:(0,t.jsx)(eM.TrackerTopbar,{})}),(0,t.jsxs)("div",{className:"mx-auto max-w-[1120px] px-4 pb-10 pt-4 sm:px-5 sm:pt-5",children:[null!==l?(0,t.jsx)("p",{className:"mb-4 border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text",children:l}):null,(0,t.jsx)(C,{has_running_timer:null!==a.runningEntry,on_check_in_shortcut:()=>{v.current?.expand_and_focus()}}),(0,t.jsxs)("div",{className:"grid grid-cols-[minmax(14rem,18rem)_minmax(0,1fr)] items-stretch border border-panel-border bg-panel shadow-sm max-[960px]:grid-cols-1",children:[(0,t.jsx)("div",{className:"flex min-h-0 min-w-0 flex-col border-r border-panel-border p-4 max-[860px]:border-r-0 max-[860px]:border-b",children:(0,t.jsx)(eN,{sheets:a.sheets,db_path:a.dbPath,is_pending:c,on_select:$,on_create:e=>h(()=>(0,eP.post_tracker_action)("/api/sheet",{name:e})),on_rename:(e,t)=>h(()=>(0,eF.patch_tracker_action)("/api/sheet",{name:e,newName:t})),on_delete:e=>h(()=>(0,eP.post_tracker_action)("/api/sheet",{name:e,delete:!0}))})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,t.jsxs)("section",{className:"flex min-w-0 flex-col gap-4 border-b border-panel-border border-l-4 border-l-accent p-4",children:[null===a.activeEntry?(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-panel-border bg-background px-3 py-2",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Quick action"}),(0,t.jsx)("p",{className:"m-0 mt-1 text-[0.9rem] font-medium",children:"Jump into Pomodoro without leaving the tracker."})]}),(0,t.jsxs)(n.default,{href:"/pomodoro",className:`${(0,s.get_button_class_name)("primary")} inline-flex min-w-40 flex-col items-center justify-center whitespace-nowrap text-center`,"aria-label":"Open Pomodoro timer",children:[(0,t.jsx)("span",{className:"text-white text-[0.9rem] leading-none",children:"Start Pomodoro"}),(0,t.jsx)("span",{className:"text-white mt-1 text-[0.72rem] font-medium leading-none opacity-85",children:"Focus timer"})]})]}):null,(0,t.jsx)(eE,{ref:w,active_entry:a.activeEntry,sheets:a.sheets,known_tags:a.knownTags,is_pending:c,on_check_out:e=>h(()=>(0,eP.post_tracker_action)("/api/out",{sheetName:g,...void 0!==e?{at:e}:{}})),on_delete:()=>h(()=>(0,eP.post_tracker_action)("/api/entry",{sheetName:g,entryId:a.activeEntry?.id})),on_edit:e=>h(()=>T(g,a.activeEntry?.id??0,e)),on_move:e=>h(()=>(0,eP.post_tracker_action)("/api/entry/move",{sheetName:g,entryId:a.activeEntry?.id,targetSheetName:e})),on_add_note:(e,t)=>h(()=>(0,eP.post_tracker_action)("/api/note",{text:e,...void 0!==t?{at:t}:{},sheetName:g,entryId:a.activeEntry?.id})),on_edit_note:(e,t)=>h(()=>(0,eF.patch_tracker_action)("/api/note",{sheetName:g,entryId:a.activeEntry?.id,timestamp:e,text:t})),on_delete_note:e=>h(()=>(0,eR.delete_tracker_action)("/api/note",{sheetName:g,entryId:a.activeEntry?.id,timestamp:e}))}),null===a.activeEntry?(0,t.jsx)(p,{ref:v,known_tags:a.knownTags,is_pending:c,trailing:(0,t.jsx)("p",{className:"m-0 text-[0.85rem] leading-tight text-muted",children:"Not tracking"}),on_submit:e=>h(()=>(0,eP.post_tracker_action)("/api/in",{...e,sheetName:g}))}):null]}),(0,t.jsx)("section",{className:"flex min-w-0 flex-col gap-4 p-4",children:(0,t.jsx)(ey,{title:"Entries",entries:j,sheets:a.sheets,known_tags:a.knownTags,total_ms:S,empty_message:E,is_pending:c,show_sheet_name:!1,header_extra:(0,t.jsx)(ee,{sheet_name:g,sheet_tags:N}),on_delete:e=>h(()=>(0,eP.post_tracker_action)("/api/entry",{sheetName:e.sheetName,entryId:e.id})),on_edit:(e,t)=>h(()=>T(e.sheetName,e.id,t)),on_move:(e,t)=>h(()=>(0,eP.post_tracker_action)("/api/entry/move",{sheetName:e.sheetName,entryId:e.id,targetSheetName:t})),on_move_many:(e,t)=>h(()=>(0,eP.post_tracker_action)("/api/entry/move-bulk",{entries:e.map(e=>({sheetName:e.sheetName,entryId:e.id})),targetSheetName:t})),on_delete_many:e=>h(()=>(0,eP.post_tracker_action)("/api/entry/delete-bulk",{entries:e.map(e=>({sheetName:e.sheetName,entryId:e.id}))})),on_edit_note:(e,t,n)=>h(()=>(0,eF.patch_tracker_action)("/api/note",{sheetName:e.sheetName,entryId:e.id,timestamp:t,text:n})),on_add_note:(e,t)=>h(()=>(0,eP.post_tracker_action)("/api/note",{sheetName:e.sheetName,entryId:e.id,text:t})),on_resume:e=>h(()=>(0,eP.post_tracker_action)("/api/in",{description:(0,eA.build_resume_description)(e.description,e.tags),sheetName:e.sheetName}))})})]})]})]})]})}],22482)}]);
|