super-time-tracker-ui 0.1.30 → 0.1.32
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.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.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.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.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.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.js.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/notifications/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/page.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.nft.json +1 -1
- package/dist/standalone/next-output/server/app/settings/pomodoro/page_client-reference-manifest.js +1 -1
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/app-paths-manifest.json +3 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/build-manifest.json +17 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/next-font-manifest.json +11 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/react-loadable-manifest.json +1 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page/server-reference-manifest.json +4 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js +16 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page.js.nft.json +1 -0
- package/dist/standalone/next-output/server/app/settings/quick-actions/page_client-reference-manifest.js +3 -0
- 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.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.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/[root-of-the-server]__0.ztg_g._.js +1 -1
- package/dist/standalone/next-output/server/chunks/[root-of-the-server]__0a7wn1j._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/0z~i_next_dist_esm_build_templates_app-page_0r4hd.l.js +4 -0
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0bowsf1._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0k~hq1g._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/[root-of-the-server]__0oqgod_._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_002dssm._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_00ic3j9._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_00x~ete._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_07p~0bg._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/{_10n~~xo._.js → _088~qfj._.js} +3 -3
- package/dist/standalone/next-output/server/chunks/ssr/_08qe8j9._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0agxxbf._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0c0txs~._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0cxg26n._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0l6-7m4._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0m.iebm._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0nnp~ae._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0q~8_bm._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0v9kigy._.js +3 -0
- package/dist/standalone/next-output/server/chunks/ssr/_0y3ypyx._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_13crob-._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_13y76jr._.js +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_next-internal_server_app_settings_quick-actions_page_actions_031bu28.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/0.4obx1-sv46-.js +1 -0
- package/dist/standalone/next-output/static/chunks/029pvmqxn_t4z.js +1 -0
- package/dist/standalone/next-output/static/chunks/04~.lbegcwd41.js +1 -0
- package/dist/standalone/next-output/static/chunks/05tg.ske01w0a.js +1 -0
- package/dist/standalone/next-output/static/chunks/06xf_oh5oqbs2.js +1 -0
- package/dist/standalone/next-output/static/chunks/09acxdggb87~w.js +1 -0
- package/dist/standalone/next-output/static/chunks/09tjbwcc~3p_e.js +1 -0
- package/dist/standalone/next-output/static/chunks/0crn_fc6.6569.js +1 -0
- package/dist/standalone/next-output/static/chunks/0fkr5kz7p1r5l.js +1 -0
- package/dist/standalone/next-output/static/chunks/0lhj2p9.4g20~.js +1 -0
- package/dist/standalone/next-output/static/chunks/0o4zvrm3q.9k3.js +1 -0
- package/dist/standalone/next-output/static/chunks/0pqilbd~jphqs.css +3 -0
- package/dist/standalone/next-output/static/chunks/0q05k1wfzh4_a.js +1 -0
- package/dist/standalone/next-output/static/chunks/0vov8ngx9~8m2.js +1 -0
- package/dist/standalone/next-output/static/chunks/0watkjb-fw0vn.js +1 -0
- package/dist/standalone/next-output/static/chunks/{0znvz4n7decra.js → 0x9s1xcq69ppx.js} +5 -5
- package/dist/standalone/next-output/static/chunks/0xj4dodycy1oc.js +1 -0
- package/dist/standalone/next-output/static/chunks/12eaief5vtso9.js +1 -0
- package/dist/standalone/next-output/static/chunks/13-nw2q_c_9mk.js +1 -0
- package/dist/standalone/next-output/static/chunks/14jtaz5s.4ih1.js +1 -0
- package/dist/standalone/package.json +1 -1
- package/package.json +1 -1
- package/dist/standalone/next-output/server/chunks/ssr/_0-hc~ba._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_00_8gfw._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_059wg4v._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_08dnxqq._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0hs4c5u._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0nz4ym1._.js +0 -3
- package/dist/standalone/next-output/server/chunks/ssr/_0wg9~zr._.js +0 -3
- package/dist/standalone/next-output/static/chunks/00rjs5ywh4_np.css +0 -3
- package/dist/standalone/next-output/static/chunks/03d24rbiv.lx7.js +0 -1
- package/dist/standalone/next-output/static/chunks/03flgrd7bw9r5.js +0 -1
- package/dist/standalone/next-output/static/chunks/041fttxys-zjw.js +0 -1
- package/dist/standalone/next-output/static/chunks/055~9w5b9lao5.js +0 -1
- package/dist/standalone/next-output/static/chunks/09mbpw08eiqwx.js +0 -1
- package/dist/standalone/next-output/static/chunks/0bw3uow4-~3fr.js +0 -1
- package/dist/standalone/next-output/static/chunks/0d2d-s..s8cfz.js +0 -1
- package/dist/standalone/next-output/static/chunks/0h72~3~6gq3fn.js +0 -1
- package/dist/standalone/next-output/static/chunks/0hhu330gm_fnl.js +0 -1
- package/dist/standalone/next-output/static/chunks/0ls_5qyf15z5_.js +0 -1
- package/dist/standalone/next-output/static/chunks/0n0.21h11yrv2.js +0 -1
- package/dist/standalone/next-output/static/chunks/0n2~cs.u7bygu.js +0 -1
- package/dist/standalone/next-output/static/chunks/0sywv5h95uodq.js +0 -1
- package/dist/standalone/next-output/static/chunks/0xccil3r~k_7n.js +0 -1
- package/dist/standalone/next-output/static/chunks/0~z41.7~3tpw3.js +0 -1
- package/dist/standalone/next-output/static/chunks/14oa3e0hktvxi.js +0 -1
- package/dist/standalone/next-output/static/chunks/15ixzo9s2kj_o.js +0 -1
- /package/dist/standalone/next-output/static/{Ohbr2ePvonj7GxdJPkXBY → gS32e4Tv_70ot1IWBJddE}/_buildManifest.js +0 -0
- /package/dist/standalone/next-output/static/{Ohbr2ePvonj7GxdJPkXBY → gS32e4Tv_70ot1IWBJddE}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/next-output/static/{Ohbr2ePvonj7GxdJPkXBY → gS32e4Tv_70ot1IWBJddE}/_ssgManifest.js +0 -0
package/dist/standalone/next-output/server/chunks/ssr/components_tracker-app_tsx_0qs9.7y._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[12584,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(34542),e=a.i(30354),f=a.i(89969),g=a.i(69749),h=a.i(98831),i=a.i(40420),j=a.i(6962),k=a.i(45273),l=a.i(30004);async function m(a){if("none"===a.provider)throw Error("AI suggestion provider is disabled");let b="true"===l.debug_logging_preference.read(),c=Date.now(),d={provider:a.provider,context:a.context,notes:a.notes,debug_logging:b};b&&console.info("[ai-suggestion] client request start",{provider:a.provider,context_length:a.context.length,notes_length:a.notes.length});try{let e=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...d,api_key:a.api_key})});if(!e.ok){let d=await e.json().catch(()=>({}));throw b&&console.warn("[ai-suggestion] client request failed",{provider:a.provider,status:e.status,elapsed_ms:Date.now()-c,error:d.error??"Failed to suggest description"}),Error(d.error??"Failed to suggest description")}let f=await e.json(),g=f.description?.trim()??"";if(0===g.length)throw Error("Suggestion was empty");return b&&console.info("[ai-suggestion] client request success",{provider:a.provider,elapsed_ms:Date.now()-c,description_length:g.length}),g}catch(d){throw b&&console.error("[ai-suggestion] client request error",{provider:a.provider,elapsed_ms:Date.now()-c,error:d instanceof Error?d.message:String(d)}),d}}function n(a){}function o({known_tags:a,on_submit:c,is_pending:l}){let[p,q]=(0,d.useState)([]),[r,s]=(0,d.useState)(""),[t,u]=(0,d.useState)(""),[v,w]=(0,d.useState)(""),[x,y]=(0,d.useState)(null),[z,A]=(0,d.useState)(!1),B=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),C=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),D=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),E=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),F="openai"===B?C:"claude"===B?D:"google_ai"===B?E:"",G="none"!==B&&F.trim().length>0;(0,d.useEffect)(()=>{q([])},[]);let H=(0,d.useMemo)(()=>p.find(a=>a.id===r)??null,[p,r]),I=async()=>{if(G){A(!0),y(null);try{let a=await m({provider:B,api_key:F,context:t,notes:""});u(a)}catch(a){y(a instanceof Error?a.message:String(a))}finally{A(!1)}}};return(0,b.jsxs)("form",{className:"flex flex-col gap-2 border border-panel-border bg-panel p-[1.1rem] shadow-sm",onSubmit:a=>{a.preventDefault();let b=t.trim();if(0===b.length)return;let d=v.trim();c({description:b,...d.length>0?{at:d}:{}}),u(""),w("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-description",children:"What are you working on?"}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[(0,b.jsxs)("select",{className:(0,g.get_input_class_name)(),value:r,disabled:l||0===p.length,onChange:a=>{let b=a.target.value;s(b);let c=p.find(a=>a.id===b)??null;null!==c&&u(c.description)},children:[(0,b.jsx)("option",{value:"",children:0===p.length?"No templates":"Use a template…"}),p.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||0===t.trim().length,onClick:()=>{let a=t.trim();if(0===a.length)return;let b=a.slice(0,40),c=window.prompt("Template name",b.length>0?b:"New template");if(null===c)return;let d=c.trim();if(0===d.length)return;let e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,f=[...p,{id:e,name:d,description:a}];q(f),s(e),n(f)},children:"Save template"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||null===H,onClick:()=>{if(null===H)return;let a=p.filter(a=>a.id!==H.id);q(a),s(""),n(a)},children:"Delete template"})]}),(0,b.jsxs)("div",{className:`grid gap-2 max-[860px]:grid-cols-1 ${G?"grid-cols-[minmax(0,1fr)_auto_auto]":"grid-cols-[minmax(0,1fr)_auto]"}`,children:[(0,b.jsx)(e.TagAutocompleteInput,{id:"check-in-description",value:t,known_tags:a,placeholder:"e.g. crafting something @design",disabled:l,autoFocus:!0,on_change:u}),G?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||z,onClick:()=>void I(),title:"Suggest description with AI",children:z?"Suggesting…":"Suggest"}):null,(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary"),disabled:l||0===t.trim().length,children:"Check in"})]}),null!==x?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:x}):null,(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-at",children:["Start time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"check-in-at",className:(0,g.get_input_class_name)(),value:v,onChange:a=>w(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:l})]})}var p=a.i(14244);let q=(0,d.forwardRef)(function({known_tags:a,is_pending:c,on_submit:e,trailing:g},h){let i="true"===(0,d.useSyncExternalStore)(p.check_in_form_collapsed_preference.subscribe,p.check_in_form_collapsed_preference.get_snapshot,p.check_in_form_collapsed_preference.get_server_snapshot),[j,k]=(0,d.useState)(!i);return((0,d.useImperativeHandle)(h,()=>({expand_and_focus:()=>{k(!0),window.requestAnimationFrame(()=>{let a=document.getElementById("check-in-description");a instanceof HTMLElement&&a.focus()})}}),[]),i&&!j)?(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("primary"),disabled:c,onClick:()=>k(!0),children:"Check in"}),g]}):(0,b.jsx)(o,{known_tags:a,is_pending:c,on_submit:a=>{e(a),i&&k(!1)}})});var r=a.i(75654),s=a.i(85752),t=a.i(50762),u=a.i(39744),v=a.i(13870),w=a.i(16777),x=a.i(18558),y=a.i(80805),z=a.i(9818),A=a.i(72327),B=a.i(40395),C=a.i(76121),D=a.i(62082),E=a.i(64617),F=a.i(65162);function G({on_check_in_shortcut:a,has_running_timer:c=!1}){let e=(0,F.use_duration_format)(),f=(0,d.useSyncExternalStore)(A.focus_nudges_enabled_preference.subscribe,A.focus_nudges_enabled_preference.get_snapshot,A.focus_nudges_enabled_preference.get_server_snapshot),g=(0,d.useSyncExternalStore)(u.daily_focus_target_minutes_preference.subscribe,u.daily_focus_target_minutes_preference.get_snapshot,u.daily_focus_target_minutes_preference.get_server_snapshot),h=(0,d.useSyncExternalStore)(D.weekly_focus_target_minutes_preference.subscribe,D.weekly_focus_target_minutes_preference.get_snapshot,D.weekly_focus_target_minutes_preference.get_server_snapshot),i=(0,d.useSyncExternalStore)(B.no_log_reminder_minutes_preference.subscribe,B.no_log_reminder_minutes_preference.get_snapshot,B.no_log_reminder_minutes_preference.get_server_snapshot),j=(0,d.useSyncExternalStore)(C.overwork_alert_hours_preference.subscribe,C.overwork_alert_hours_preference.get_snapshot,C.overwork_alert_hours_preference.get_server_snapshot),k=(0,d.useSyncExternalStore)(v.focus_goal_scope_preference.subscribe,v.focus_goal_scope_preference.get_snapshot,v.focus_goal_scope_preference.get_server_snapshot),l=(0,d.useSyncExternalStore)(w.focus_goal_sheet_name_preference.subscribe,w.focus_goal_sheet_name_preference.get_snapshot,w.focus_goal_sheet_name_preference.get_server_snapshot),m=(0,d.useSyncExternalStore)(x.focus_goal_tag_name_preference.subscribe,x.focus_goal_tag_name_preference.get_snapshot,x.focus_goal_tag_name_preference.get_server_snapshot),n=(0,d.useSyncExternalStore)(y.focus_goals_per_sheet_preference.subscribe,y.focus_goals_per_sheet_preference.get_snapshot,y.focus_goals_per_sheet_preference.get_server_snapshot),o=(0,d.useSyncExternalStore)(z.focus_goals_per_tag_preference.subscribe,z.focus_goals_per_tag_preference.get_snapshot,z.focus_goals_per_tag_preference.get_server_snapshot),[p,q]=(0,d.useState)(null),[r,J]=(0,d.useState)(null);(0,d.useEffect)(()=>{let a=()=>{try{let a=window.localStorage.getItem(E.POMODORO_STORAGE_KEY);if(null===a)return null;let b=JSON.parse(a).state;if(void 0===b||"running"!==b.status||null===b.deadline_at_ms)return null;let c=Math.max(0,b.deadline_at_ms-Date.now()),d=Math.floor(c/6e4),e=Math.floor(c%6e4/1e3);return{phase_label:"work"===b.phase?"Focus":"short_break"===b.phase?"Short break":"Long break",remaining_label:`${d.toString().padStart(2,"0")}:${e.toString().padStart(2,"0")}`}}catch{return null}},b=window.setTimeout(()=>{J(a())},0),c=window.setInterval(()=>{J(a())},1e3);return()=>{window.clearTimeout(b),window.clearInterval(c)}},[]),(0,d.useEffect)(()=>{if("true"!==f)return;let a=!1,b=async()=>{try{var b,c,d;let e=new URLSearchParams;e.set("scope",(b=k,c=l,d=m,"sheet"===b&&0===c.length||"tag"===b&&0===d.length?"global":b)),"sheet"===k&&l.length>0&&e.set("sheet",l),"tag"===k&&m.length>0&&e.set("tag",m);let f=await fetch(`/api/focus-nudges/status?${e.toString()}`);if(!f.ok)return;let g=await f.json();a||q(g)}catch{}};b();let c=window.setInterval(()=>{b()},6e4);return()=>{a=!0,window.clearInterval(c)}},[f,k,l,m]);let K=(0,d.useMemo)(()=>{if("true"!==f||null===p)return null;let{daily_minutes:a,weekly_minutes:b}=function(a){if("sheet"===a.scope&&a.sheet_name.length>0){let b=(0,t.parse_focus_goals_by_name)(a.per_sheet_json)[a.sheet_name];return void 0===b?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:b.daily??a.global_daily,weekly_minutes:b.weekly??a.global_weekly}}if("tag"===a.scope&&a.tag_name.length>0){let b=(0,t.parse_focus_goals_by_name)(a.per_tag_json)[a.tag_name];return void 0===b?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:b.daily??a.global_daily,weekly_minutes:b.weekly??a.global_weekly}}return{daily_minutes:a.global_daily,weekly_minutes:a.global_weekly}}({scope:k,sheet_name:l,tag_name:m,per_sheet_json:n,per_tag_json:o,global_daily:g,global_weekly:h});if(null===a||null===b)return{kind:"alert",tone:"info",title:H("daily",k,l,m),detail:"No goals configured yet for this scope. Set daily and weekly targets in Goal settings."};let d=6e4*Number.parseInt(a,10),q=6e4*Number.parseInt(b,10),r=36e5*Number.parseInt(j,10),u=Number.parseInt(i,10);return null!==p.activeTimerDurationMs&&p.activeTimerDurationMs>=r?{kind:"alert",tone:"warning",title:"Overwork alert",detail:`Current session is ${(0,s.format_duration)(p.activeTimerDurationMs,e)}. Consider a short break.`}:!c&&null!==p.minutesSinceLastLog&&p.minutesSinceLastLog>=u?{kind:"alert",tone:"warning",title:"Gentle reminder",detail:`No time logged for ${p.minutesSinceLastLog} min. Start a timer when you are back on task.`,show_check_in_shortcut:!0}:p.todayTrackedMs<d?{kind:"progress",scope:"daily",title:H("daily",k,l,m),tracked_ms:p.todayTrackedMs,target_ms:d}:p.weekTrackedMs<q?{kind:"progress",scope:"weekly",title:H("weekly",k,l,m),tracked_ms:p.weekTrackedMs,target_ms:q}:{kind:"alert",tone:"success",title:"Targets met",detail:"Daily and weekly focus goals are on track."}},[g,e,f,j,c,k,l,m,n,o,i,p,h]);if(null===K)return null;if("progress"===K.kind)return(0,b.jsx)(I,{scope:K.scope,title:K.title,tracked_ms:K.tracked_ms,target_ms:K.target_ms,duration_format:e,active_pomodoro:r});let L="warning"===K.tone?"mb-4 rounded-md border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text":"success"===K.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,b.jsxs)("section",{className:L,"aria-live":"polite","aria-atomic":"true",children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:K.title}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.82rem] leading-relaxed",children:K.detail}),K.show_check_in_shortcut&&void 0!==a?(0,b.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-current bg-transparent px-2 py-1 text-[0.75rem] font-semibold",onClick:a,children:"Check in"}):null]})]})}function H(a,b,c,d){let e="daily"===a?"Relevant goal":"Weekly goal";return"sheet"===b&&c.length>0?`${e} \xb7 ${c}`:"tag"===b&&d.length>0?`${e} \xb7 @${d}`:e}function I({scope:a,title:d,tracked_ms:e,target_ms:f,duration_format:g,active_pomodoro:h}){let i=f>0?Math.min(100,e/f*100):0,j=Math.max(0,f-e);return(0,b.jsx)("section",{className:"mb-4 rounded-md border border-panel-border bg-panel px-4 py-3 shadow-sm","aria-label":d,"aria-live":"polite",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-stretch justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:d}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:["daily"===a?(0,b.jsx)(c.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,b.jsx)(r.SettingsIcon,{})}):null,(0,b.jsxs)("p",{className:"m-0 font-mono text-[0.78rem] font-semibold text-accent",children:[Math.round(i),"%"]})]})]}),(0,b.jsxs)("div",{className:"mt-2 flex items-baseline justify-between gap-3",children:[(0,b.jsxs)("p",{className:"m-0 font-mono text-[1.35rem] font-semibold leading-none text-foreground",children:[(0,s.format_duration)(e,g),(0,b.jsxs)("span",{className:"ml-1 text-[0.85rem] font-medium text-muted",children:["/ ",(0,s.format_duration)(f,g)]})]}),(0,b.jsxs)("p",{className:"m-0 text-[0.78rem] text-muted",children:[(0,s.format_duration)(j,g)," left ","daily"===a?"today":"this week"]})]}),(0,b.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(i),children:(0,b.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${i}%`}})})]}),null!==h?(0,b.jsxs)("aside",{className:"min-w-52 rounded-md border border-panel-border bg-surface-raised px-3 py-2.5",children:[(0,b.jsx)("p",{className:"m-0 text-[0.68rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Active Pomodoro"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.82rem] font-semibold text-foreground",children:h.phase_label}),(0,b.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.25rem] font-semibold leading-none text-accent",children:h.remaining_label})]}):null]})})}var J=a.i(82508),K=a.i(7386);function L(a,b,c){if(0===a.length)return null;let d=a.findIndex(a=>a.name===b),e=((-1===d?0:d)+("next"===c?1:-1)+a.length)%a.length;return a[e]?.name??null}var M=a.i(89711),N=a.i(26336),O=a.i(89184);function P({sheets:a,active_sheet_name:c,active_entry:e,is_pending:f,check_in_form_ref:g,active_entry_panel_ref:h,on_select_sheet:i,on_check_out:j}){let k=(0,J.useRouter)(),[l,m]=(0,d.useState)(!1),n=(0,N.use_check_out_action)(j),o=(0,d.useMemo)(()=>{let b=null!==e;return[{id:"help",label:"?",description:"Show keyboard shortcuts",key:"?",modifiers:["shift"],action:()=>{m(a=>!a)}},{id:"check-in",label:"C",description:"Check in (focus description)",key:"c",is_available:()=>!f&&!b,action:()=>{g.current?.expand_and_focus()}},{id:"check-out",label:"O",description:"Check out",key:"o",is_available:()=>!f&&b,action:()=>{n()}},{id:"edit-entry",label:"E",description:"Edit active entry",key:"e",is_available:()=>!f&&b,action:()=>{h.current?.start_edit()}},{id:"add-note",label:"N",description:"Add note to active entry",key:"n",is_available:()=>!f&&b,action:()=>{h.current?.start_add_note()}},{id:"pomodoro",label:"P",description:"Open Pomodoro",key:"p",is_available:()=>!f,action:()=>{k.push("/pomodoro")}},{id:"previous-sheet",label:"[",description:"Previous sheet",key:"[",is_available:()=>!f&&a.length>1,action:()=>{let b=L(a,c,"previous");null!==b&&b!==c&&i(b)}},{id:"next-sheet",label:"]",description:"Next sheet",key:"]",is_available:()=>!f&&a.length>1,action:()=>{let b=L(a,c,"next");null!==b&&b!==c&&i(b)}}]},[e,h,c,g,n,f,i,k,a]);return((0,O.use_document_keyboard_shortcuts)(o),l)?(0,b.jsx)(K.KeyboardShortcutsDialog,{sections:[...(0,M.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:()=>m(!1)}):null}var Q=a.i(48174),R=a.i(56924);function S(a){let b=[],c=new Set;for(let d of({})[a]??[])try{let a=(0,R.normalize_stored_tag)(d);c.has(a)||(c.add(a),b.push(a))}catch{continue}return b}var T=a.i(4845);function U(a){return(0,T.get_stable_sheet_tag_filter_snapshot)(a,S(a))}function V(){return T.EMPTY_SHEET_TAG_FILTER}var W=a.i(5479),X=a.i(72958),Y=a.i(19702);function Z(a,b){let c={};0===b.length?delete c[a]:c[a]=b;try{window.localStorage.setItem(Y.SHEET_TAG_FILTERS_STORAGE_KEY,JSON.stringify(c)),(0,X.schedule_ui_preferences_cloud_sync)()}catch{}(0,W.notify_sheet_tag_filters_subscribers)()}function $(a,b){try{return(0,R.normalize_stored_tag)(a)===(0,R.normalize_stored_tag)(b)}catch{return!1}}var _=a.i(78702);function aa(){return(0,d.useSyncExternalStore)(_.tag_filter_mode_preference.subscribe,_.tag_filter_mode_preference.get_snapshot,_.tag_filter_mode_preference.get_server_snapshot)}function ab({sheet_name:a,sheet_tags:c}){let e=aa(),g=(0,d.useSyncExternalStore)(W.subscribe_sheet_tag_filters,()=>U(a),V);if((0,d.useEffect)(()=>{!function(a,b){let c=S(a);if(0===c.length)return;let d=c.filter(a=>b.some(b=>$(a,b)));d.length!==c.length&&Z(a,d)}(a,c.map(a=>a.name))},[a,c]),0===c.length)return null;let h=g.length>0;return(0,b.jsxs)("div",{role:"group","aria-label":"Filter by tag",className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,b.jsx)("h2",{className:"m-0 shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:"Filter by tag"}),(0,b.jsx)("p",{className:"m-0 shrink-0 text-[0.8rem] text-muted",children:"any"===e?"Show entries that include any selected tag.":"Show entries that include every selected tag."}),(0,b.jsxs)("div",{className:"ml-auto flex min-w-0 flex-wrap justify-end gap-1",children:[c.map(c=>{let d=g.some(a=>$(a,c.name));return(0,b.jsxs)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost","small")} ${d?"border-accent-border bg-accent-soft text-foreground":""}`,"aria-pressed":d,onClick:()=>{var b;let d,e;return b=c.name,d=(0,R.normalize_stored_tag)(b),void((e=S(a)).some(a=>$(a,d))?Z(a,e.filter(a=>!$(a,d))):Z(a,[...e,d]))},children:[(0,Q.format_display_tag)(c.name),(0,b.jsxs)("span",{className:"ml-1 font-normal text-muted",children:["(",c.entryCount,")"]})]},c.name)}),h?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),onClick:()=>Z(a,[]),children:"Clear filter"}):null]})]})}let ac="inline-flex shrink-0 cursor-pointer items-center gap-1.5";function ad({checked:a,disabled:c=!1,indeterminate:e=!1,nested:f=!1,on_change:g,label:h,aria_label:i,className:j}){let k=(0,d.useRef)(null);(0,d.useEffect)(()=>{null!==k.current&&(k.current.indeterminate=e)},[e]);let l=void 0===j?ac:`${ac} ${j}`,m=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("input",{ref:k,type:"checkbox",className:"peer absolute m-0 h-px w-px overflow-hidden opacity-0",checked:a,disabled:c,"aria-label":f&&void 0===h?i:void 0,onChange:g}),(0,b.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 f?(0,b.jsx)("span",{className:l,children:m}):(0,b.jsxs)("label",{className:l,children:[m,void 0!==h?(0,b.jsx)("span",{className:"select-none text-[0.8rem] leading-tight text-muted",children:h}):null]})}var ae=a.i(53030),af=a.i(34435),ag=a.i(96359);let ah="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 ai({current_sheet_name:a,sheets:c,is_pending:e,on_edit:f,on_add_note:g,on_show_add_note_form:h,on_revise_description_ai:i,can_revise_description_ai:j=!1,on_resume:k,entry_is_active:l=!1,on_delete:m,on_move:n}){let o=c.find(b=>b.name===a),p=l||o?.hasActiveEntry===!0&&!l,q=c.filter(b=>b.name!==a),[r,s]=(0,d.useState)(!1),t=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!r)return;let a=a=>{null===t.current||t.current.contains(a.target)||s(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[r]);let u=()=>{s(!1)};return(0,ag.use_escape_to_cancel)(u,r),(0,b.jsxs)("div",{className:"relative shrink-0",ref:t,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Entry actions","aria-expanded":r,"aria-haspopup":"menu",disabled:e,onClick:()=>s(a=>!a),children:(0,b.jsx)(af.HamburgerIcon,{})}),r?(0,b.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,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ah,role:"menuitem",disabled:e,onClick:()=>{u(),f()},children:"Edit times"})}),void 0!==h||void 0!==g?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ah,role:"menuitem",disabled:e,onClick:()=>{if(u(),void 0!==h)return void h();let a=function(){let a=window.prompt("Add note","");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&void 0!==g&&g(a)},children:"Add note"})}):null,void 0!==i?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ah,role:"menuitem",disabled:e||!j,title:j?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{u(),i()},children:"Revise description with AI"})}):null,void 0!==k?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ah,role:"menuitem",disabled:e||p,title:p?l?"This entry is already active":"Another entry is active on this sheet":void 0,onClick:()=>{u(),k()},children:"Resume"})}):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)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),0===q.length?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ah,role:"menuitem",disabled:!0,children:"No other sheets"})}):q.map(a=>(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${ah} pl-4`,role:"menuitem",disabled:e||a.hasActiveEntry,title:a.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{u(),n(a.name)},children:a.name})},a.name)),(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:`${ah} text-danger`,role:"menuitem",disabled:e,onClick:()=>{u(),m()},children:"Delete"})})]}):null]})}function aj({rotated:a=!1,className:c=""}){return(0,b.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${a?"rotate-90":""} ${c}`.trim(),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"m9 18 6-6-6-6"})})}var ak=a.i(76767);function al({initial_text:a,is_pending:c,inline:e=!1,on_save:h,on_cancel:i}){let[j,k]=(0,d.useState)(a);(0,ag.use_escape_to_cancel)(i);let l=Math.min(6,Math.max(2,a.split("\n").length)),m=e?`${(0,g.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,g.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,b.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:a=>{a.preventDefault();let b=j.trim();0!==b.length&&h(b)},onClick:a=>a.stopPropagation(),children:[(0,b.jsx)("textarea",{className:m,value:j,rows:l,disabled:c,onChange:a=>k(a.target.value)}),(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:c,onClick:i,children:"Cancel"}),(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("ghost"),disabled:c||0===j.trim().length,children:"Save"})]})]})}function am(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12 20h9"}),(0,b.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function an(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M3 6h18"}),(0,b.jsx)("path",{d:"M8 6V4h8v2"}),(0,b.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,b.jsx)("path",{d:"M10 11v6"}),(0,b.jsx)("path",{d:"M14 11v6"})]})}var ao=a.i(20537);let ap="inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55";function aq({notes:a,variant:c="panel",in_bar:e=!1,is_pending:f=!1,on_edit_note:g,on_delete_note:h}){let i=(0,ao.use_time_format)(),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)("panel"===c&&!e);if(0===a.length)return null;let n=[...a].sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime()),o="inline"===c,p="panel"===c&&e,q=l||null!==j,r=o?`${a.length} ${1===a.length?"note":"notes"}`:`Notes (${a.length})`,s=[o?"m-0 w-full p-0":"border-t border-accent-border pt-3.5",e&&!o?"border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]":"",p&&q?"flex min-h-0 flex-1 flex-col":p?"flex shrink-0 flex-col":""].filter(Boolean).join(" "),t=q?"mt-1.5":"hidden",u=o?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${t}`:p?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${t}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${t}`,v=o?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":p?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",w=a=>void 0===g&&void 0===h?null:(0,b.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0!==g?(0,b.jsx)("button",{type:"button",className:ap,"aria-label":"Edit note",title:"Edit note",disabled:f,onClick:b=>{var c;b.stopPropagation(),c=a.timestamp,m(!0),k(c)},children:(0,b.jsx)(am,{})}):null,void 0!==h?(0,b.jsx)("button",{type:"button",className:`${ap} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:f,onClick:b=>{var c;b.stopPropagation(),j===(c=a.timestamp)&&k(null),h?.(c)},children:(0,b.jsx)(an,{})}):null]});return(0,b.jsxs)("section",{className:s,"aria-label":"Entry notes",children:[(0,b.jsxs)("button",{type:"button",className:o?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground","aria-expanded":q,onClick:a=>{a.stopPropagation(),null===j&&m(a=>!a)},children:[(0,b.jsx)(aj,{rotated:q}),(0,b.jsx)("span",{children:r})]}),(0,b.jsx)("ul",{className:u,children:n.map((a,c)=>{let d=j===a.timestamp;return(0,b.jsx)("li",{className:v,children:d?(0,b.jsx)(al,{initial_text:a.text,inline:o,is_pending:f,on_cancel:()=>k(null),on_save:b=>{var c;return c=a.timestamp,void(g?.(c,b),k(null))}}):o?(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,b.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:a.timestamp,children:(0,ak.format_time)(a.timestamp,i)}),(0,b.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:a.text})]}),w(a)]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:a.timestamp,children:(0,ak.format_time)(a.timestamp,i)}),w(a)]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:a.text})]})},`${a.timestamp}-${c}`)})})]})}var ar=a.i(93301);function as(a){return(0,ar.format)(new Date(a),"MMM d, h:mm a")}var at=a.i(50803);function au({entry:a,known_tags:c,is_pending:h,initial_description_override:i,in_active_panel:j=!1,times_only:k=!1,start_only:l=!1,on_save:m,on_cancel:n}){let o=(0,d.useMemo)(()=>i??(0,at.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags,i]),[p,q]=(0,d.useState)(o),[r,s]=(0,d.useState)(""),[t,u]=(0,d.useState)("");(0,d.useEffect)(()=>{q(i??(0,at.build_resume_description)(a.description,a.tags)),s(""),u("")},[a.description,a.id,a.sheetName,a.tags,i]),(0,ag.use_escape_to_cancel)(n);let v=a.isActive?"still running":as(a.end??a.start),w=k?r.trim().length>0||!l&&t.trim().length>0:p.trim()!==o.trim()||r.trim().length>0||!l&&t.trim().length>0;return(0,b.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${j?"mt-2":""}`,onSubmit:a=>{a.preventDefault();let b=p.trim(),c=r.trim(),d=t.trim(),e={};k||b===o.trim()||(e.description=b),c.length>0&&(e.start=c),!l&&d.length>0&&(e.end=d),(void 0!==e.description||void 0!==e.start||void 0!==e.end)&&m(e)},children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:k?"Edit times":"Edit entry"}),k?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),(0,b.jsx)(e.TagAutocompleteInput,{id:`entry-description-${a.id}`,value:p,known_tags:c,placeholder:"e.g. crafting something @design",disabled:h,autoFocus:j,on_change:q})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,b.jsxs)("div",{className:`grid gap-2.5 max-[860px]:grid-cols-1 ${l?"grid-cols-1":"grid-cols-2"}`,children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",as(a.start)]}),(0,b.jsx)("input",{id:`entry-start-${a.id}`,className:(0,g.get_input_class_name)("compact"),value:r,onChange:a=>s(a.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:h,autoFocus:k&&j})]}),l?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",v]}),(0,b.jsx)("input",{id:`entry-end-${a.id}`,className:(0,g.get_input_class_name)("compact"),value:t,onChange:a=>u(a.target.value),placeholder:a.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:h})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary","small"),disabled:h||!w,children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:h,onClick:n,children:"Cancel"})]})]})}function av({selected_count:a,total_count:c,all_selected:e,some_selected:h,selected_entries:i,sheets:j,is_pending:k,on_toggle_all:l,on_move:m,on_delete:n,on_clear:o}){let[p,q]=(0,d.useState)(""),r=i.some(a=>a.isActive),s=j.filter(a=>(!r||!a.hasActiveEntry)&&i.some(b=>b.sheetName!==a.name));return(0,b.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,b.jsx)(ad,{className:"shrink-0",checked:e,indeterminate:h,disabled:k,aria_label:e?"Deselect all entries":"Select all entries",on_change:l}),(0,b.jsxs)("p",{className:"m-0 shrink-0 text-[0.85rem] font-semibold",children:[a,(0,b.jsx)("span",{className:"text-muted",children:` of ${c} selected`})]}),(0,b.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("select",{className:`${(0,g.get_input_class_name)("compact")} min-w-32`,value:p,disabled:k||0===s.length,"aria-label":"Move to sheet",onChange:a=>q(a.target.value),children:[(0,b.jsx)("option",{value:"",children:"Move to…"}),s.map(a=>(0,b.jsx)("option",{value:a.name,children:a.name},a.name))]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:k||0===p.trim().length||0===s.length,onClick:()=>{let a=p.trim();0!==a.length&&(m(a),q(""))},children:"Move"})]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("danger","small"),disabled:k,onClick:n,children:"Delete"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost","small")} shrink-0`,disabled:k,"aria-label":"Clear selection",title:"Clear selection",onClick:o,children:"✕"})]})]})}var aw=a.i(14945),ax=a.i(79918),ay=a.i(57077);function az(){return(0,d.useSyncExternalStore)(ax.entry_list_sort_preference.subscribe,ax.entry_list_sort_preference.get_snapshot,ax.entry_list_sort_preference.get_server_snapshot)}let aA=(0,aw.get_entry_list_sort_options)();function aB({is_pending:a=!1}){let c=az();return(0,b.jsxs)("fieldset",{className:"m-0 flex flex-wrap items-center gap-x-2 gap-y-1.5 border-0 p-0",children:[(0,b.jsx)("legend",{className:"sr-only",children:"Order entries by"}),(0,b.jsx)("span",{className:"shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Order by"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Order entries by",children:aA.map(d=>{let e=c===d.value;return(0,b.jsx)("button",{type:"button",className:e?(0,f.get_button_class_name)("primary","small"):(0,f.get_button_class_name)("ghost","small"),disabled:a,"aria-pressed":e,onClick:()=>(0,ay.persist_ui_preference)(ax.entry_list_sort_preference,d.value),children:d.label},d.value)})})]})}function aC(a){let b=a.description.trim()||"Untitled entry",c=a.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${b}" on sheet "${a.sheetName}"?${c}`,confirmLabel:"Delete",variant:"danger"}}function aD(a){return`${a.sheetName}-${a.id}`}var aE=a.i(32297);function aF(){return"true"===(0,d.useSyncExternalStore)(aE.confirm_destructive_actions_preference.subscribe,aE.confirm_destructive_actions_preference.get_snapshot,aE.confirm_destructive_actions_preference.get_server_snapshot)}function aG({title:a,entries:c,sheets:e,known_tags:f,total_ms:g,empty_message:l,is_pending:n,show_sheet_name:o=!0,header_extra:p,on_delete:q,on_edit:r,on_move:t,on_move_many:u,on_delete_many:v,on_edit_note:w,on_add_note:x,on_resume:y}){let{confirm:z}=(0,ae.use_confirm_dialog)(),A=aF(),B=(0,ao.use_time_format)(),C=(0,F.use_duration_format)(),[D,E]=(0,d.useState)(null),[G,H]=(0,d.useState)(()=>new Set),[I,J]=(0,d.useState)(null),[K,L]=(0,d.useState)(null),[M,N]=(0,d.useState)({}),O=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),P=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),R=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),S=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),T="openai"===O?P:"claude"===O?R:"google_ai"===O?S:"",U="none"!==O&&T.trim().length>0,V=c.map(a=>aD(a)),W=c.filter(a=>G.has(aD(a))),X=c.length>0&&W.length===c.length,Y=W.length>0&&W.length<c.length;(0,d.useEffect)(()=>{H(a=>{let b=new Set(V),c=new Set([...a].filter(a=>b.has(a)));return c.size===a.size?a:c})},[V.join("|")]);let Z=()=>{X?H(new Set):H(new Set(V))},$=()=>{H(new Set)},_=async()=>{let a,b,c;0!==W.length&&(!A||await z((a=W.length,b=W.some(a=>a.isActive),c=1===a?"1 entry":`${a} entries`,{title:1===a?"Delete entry?":"Delete entries?",message:`Permanently delete ${c}?${b?" This will stop the active timer.":""}`,confirmLabel:"Delete",variant:"danger"})))&&(v(W),$())},aa=W.length>0,ab=async a=>{if(!U)return;let b=aD(a);J(b),L(null);try{let c=a.notes.map(a=>a.text).join("\n"),d=await m({provider:O,api_key:T,context:a.description,notes:c});N(a=>({...a,[b]:d})),E(b)}catch(a){L(a instanceof Error?a.message:String(a))}finally{J(null)}};return(0,ag.use_escape_to_cancel)($,aa&&null===D),(0,b.jsxs)("section",{className:"min-w-0",children:[(0,b.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:aa?(0,b.jsx)(av,{selected_count:W.length,total_count:c.length,all_selected:X,some_selected:Y,selected_entries:W,sheets:e,is_pending:n,on_toggle_all:Z,on_move:a=>{u(W,a),$()},on_delete:()=>void _(),on_clear:$}):(0,b.jsxs)(b.Fragment,{children:[p,(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[c.length>0?(0,b.jsx)(ad,{className:"shrink-0",checked:X,indeterminate:Y,disabled:n,aria_label:"Select all entries",on_change:Z}):null,(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:a}),(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===c.length?null:1===c.length?"1 entry":`${c.length} entries`})]}),(0,b.jsxs)("p",{className:"m-0 font-mono text-[0.85rem] text-muted max-[640px]:w-full",children:[(0,s.format_duration)(g,C)," total"]})]}),(0,b.jsx)(aB,{is_pending:n}),null!==K?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:K}):null]})}),0===c.length?(0,b.jsx)("p",{className:"m-0 text-muted",children:l}):(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col p-0",children:c.map(a=>{let c=aD(a),d=D===c,g=G.has(c);return d?(0,b.jsx)("li",{className:"block border-b border-panel-border py-2.5 last:border-b-0 compact:py-1.5",children:(0,b.jsx)(au,{entry:a,known_tags:f,is_pending:n,initial_description_override:M[c],on_cancel:()=>{E(null),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})},on_save:b=>{r(a,b),E(null),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})}})},c):(0,b.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 ${g?"bg-accent-soft hover:bg-accent-soft":""}`,children:[(0,b.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,b.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed","aria-label":`Select entry ${a.description||"Untitled entry"}`,children:[(0,b.jsx)(ad,{nested:!0,className:`shrink-0 pr-1 transition-opacity duration-150 compact:pr-0.5 ${g||aa?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,checked:g,disabled:n,on_change:()=>{H(a=>{let b=new Set(a);return b.has(c)?b.delete(c):b.add(c),b})}}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-semibold leading-snug compact:text-[0.9rem] compact:leading-tight",children:a.description||"Untitled entry"}),(0,b.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:[o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:a.sheetName}),(0,b.jsx)("span",{children:"·"})]}):null,(0,b.jsxs)("span",{children:["#",a.id]}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{className:"whitespace-nowrap",children:[(0,ak.format_time)(a.start,B),null===a.end?" → now":` → ${(0,ak.format_time)(a.end,B)}`]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,Q.format_display_tag)(a)},a))}):null]})]})]}),(0,b.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,b.jsx)("p",{className:`m-0 whitespace-nowrap text-right font-mono text-[0.9rem] text-muted compact:text-[0.8rem] ${a.isActive?"text-accent":""}`,children:(0,s.format_duration)(a.durationMs,C)}),(0,b.jsx)(ai,{current_sheet_name:a.sheetName,sheets:e,is_pending:n||I===c,on_edit:()=>{E(c),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})},on_revise_description_ai:U?()=>void ab(a):void 0,can_revise_description_ai:U,on_add_note:b=>x(a,b),on_resume:()=>y(a),entry_is_active:a.isActive,on_move:b=>t(a,b),on_delete:async()=>{(!A||await z(aC(a)))&&q(a)}})]})]}),a.notes.length>0?(0,b.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,b.jsx)(aq,{notes:a.notes,variant:"inline",is_pending:n,on_edit_note:(b,c)=>w(a,b,c)})}):null]},c)})})})]})}let aH="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 aI({sheet_name:a,is_pending:c,can_delete:e,on_rename:f,on_delete:g}){let[h,i]=(0,d.useState)(!1),j=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!h)return;let a=a=>{null===j.current||j.current.contains(a.target)||i(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[h]);let k=()=>{i(!1)};return(0,b.jsxs)("div",{className:"relative shrink-0 self-center",ref:j,children:[(0,b.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 ${a}`,"aria-expanded":h,"aria-haspopup":"menu",disabled:c,onClick:()=>i(a=>!a),children:(0,b.jsx)(af.HamburgerIcon,{})}),h?(0,b.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,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:aH,role:"menuitem",disabled:c,onClick:()=>{k(),f()},children:"Rename"})}),(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:`${aH} text-danger`,role:"menuitem",disabled:c||!e,title:e?void 0:"Cannot delete the last sheet",onClick:()=>{k(),g()},children:"Delete sheet"})})]}):null]})}function aJ({sheets:a,db_path:c,on_select:e,on_create:h,on_rename:i,on_delete:j,is_pending:k}){let{confirm:l}=(0,ae.use_confirm_dialog)(),m=aF(),n=a.length>1,[o,p]=(0,d.useState)(!1),[q,r]=(0,d.useState)(""),[s,t]=(0,d.useState)(null),[u,v]=(0,d.useState)(""),w=()=>{p(!1),r("")},x=()=>{t(null),v("")};(0,ag.use_escape_to_cancel)(x,null!==s),(0,ag.use_escape_to_cancel)(w,o);let y=a=>{if(a.preventDefault(),null===s)return;let b=u.trim();0===b.length||b===s||i(s,b),x()};return(0,b.jsxs)("aside",{className:"flex min-w-0 flex-col gap-3 max-[860px]:min-w-0",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheets"}),(0,b.jsx)("ul",{className:"m-0 flex min-h-0 flex-1 list-none flex-col gap-1.5 p-0",children:a.map(a=>(0,b.jsx)("li",{className:"min-w-0",children:s===a.name?(0,b.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-1.5",onSubmit:y,children:[(0,b.jsx)("input",{className:(0,g.get_input_class_name)("compact"),value:u,onChange:a=>v(a.target.value),disabled:k,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("button",{type:"submit",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k||0===u.trim().length,children:"Save"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k,onClick:x,children:"Cancel"})]})]}):(0,b.jsxs)("div",{className:"flex min-w-0 items-stretch gap-1",children:[(0,b.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:k&&!a.isActive,onClick:()=>e(a.name),children:[(0,b.jsx)("span",{className:`min-w-0 flex-1 truncate font-semibold ${a.isActive||a.hasActiveEntry?"text-accent":""}`,children:a.name}),(0,b.jsx)("span",{className:`shrink-0 text-xs whitespace-nowrap ${a.hasActiveEntry?"text-accent":"text-muted"}`,children:a.hasActiveEntry?"● active":`${a.entryCount} entries`})]}),(0,b.jsx)(aI,{sheet_name:a.name,is_pending:k,can_delete:n,on_rename:()=>{var b;t(b=a.name),v(b)},on_delete:async()=>{var b,c,d;let e;(!m||await l((b=a.name,c=a.entryCount,d=a.hasActiveEntry,e=0===c?"":` This will delete ${c} ${1===c?"entry":"entries"}.`,{title:"Delete sheet?",message:`Delete "${b}"?${e}${d?" This will stop the active timer.":""}`,confirmLabel:"Delete sheet",variant:"danger"})))&&j(a.name)}})]})},a.name))}),o?(0,b.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=q.trim();0!==b.length&&(h(b),w())},children:[(0,b.jsx)("input",{className:(0,g.get_input_class_name)("compact"),value:q,onChange:a=>r(a.target.value),placeholder:"New sheet name",disabled:k,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("button",{type:"submit",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k||0===q.trim().length,children:"Add"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k,onClick:w,children:"Cancel"})]})]}):(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:k,onClick:()=>p(!0),children:"Add sheet"}),(0,b.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:c,children:c})]})}var aK=a.i(99751);function aL(){return"true"===(0,d.useSyncExternalStore)(aK.timer_show_seconds_preference.subscribe,aK.timer_show_seconds_preference.get_snapshot,aK.timer_show_seconds_preference.get_server_snapshot)}function aM({entry:a,in_bar:c,is_pending:e,initial_at:h,on_cancel:i,on_submit:j}){let k=(0,F.use_duration_format)(),l=aL(),[m,n]=(0,d.useState)(()=>Date.now()-new Date(a.start).getTime()),[o,p]=(0,d.useState)(""),[q,r]=(0,d.useState)(h??""),t=(0,d.useRef)(null);(0,ag.use_escape_to_cancel)(i),(0,d.useEffect)(()=>{t.current?.focus()},[]),(0,d.useEffect)(()=>{n(Date.now()-new Date(a.start).getTime());let b=window.setInterval(()=>{n(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.start]);let u=(0,s.format_duration)(m,k,l),v=a.description||"Untitled entry";return(0,b.jsxs)("form",{className:"flex min-w-0 flex-col gap-4","aria-label":"Check out form",onSubmit:a=>{a.preventDefault();let b=o.trim(),c=q.trim(),d=b.length>0,e=c.length>0;d||e?j({...e?{at:c}:{},...d?{note:b}:{}}):j(void 0)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.68rem] font-bold uppercase leading-none tracking-wider text-danger",children:"Checking out"}),(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.05rem] font-[650] leading-tight tracking-tight min-[560px]:text-[1.15rem]",children:v})]}),(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.4rem] font-medium leading-none tracking-tight text-accent min-[560px]:text-[1.6rem]",children:u})]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-[0.72rem] text-tag-text",children:(0,Q.format_display_tag)(a)},a))}):null,(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-3 min-[640px]:grid-cols-[minmax(0,1fr)_minmax(10rem,14rem)]",children:[(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-note",children:[(0,b.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["Note ",(0,b.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,b.jsx)("input",{ref:t,id:"checkout-note",className:(0,g.get_input_class_name)("compact"),value:o,onChange:a=>p(a.target.value),placeholder:"Wrap-up, blockers, next steps…",disabled:e})]}),(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-at",children:[(0,b.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["End time ",(0,b.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,b.jsx)("input",{id:"checkout-at",className:(0,g.get_input_class_name)("compact"),value:q,onChange:a=>r(a.target.value),placeholder:"e.g. now, 30 minutes ago, 5:30pm",disabled:e})]})]}),(0,b.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${c?"":"pt-1"}`,children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("danger-solid"),disabled:e,children:"Confirm check out"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:e,onClick:i,children:"Cancel"})]})]})}function aN(){return(0,b.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",role:"presentation","aria-hidden":"true",focusable:"false",children:(0,b.jsx)("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7L12 3zM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14zM5 15l.9 2.1L8 18l-2.1.9L5 21l-.9-2.1L2 18l2.1-.9L5 15z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function aO({entry:a,known_tags:c,is_pending:g,on_save:l,on_cancel:n}){let o=(0,d.useMemo)(()=>(0,at.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags]),[p,q]=(0,d.useState)(o),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)(null),v=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),w=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),x=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),y=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),z="openai"===v?w:"claude"===v?x:"google_ai"===v?y:"",A="none"!==v&&z.trim().length>0;(0,d.useEffect)(()=>{q((0,at.build_resume_description)(a.description,a.tags))},[a.description,a.id,a.sheetName,a.tags]),(0,ag.use_escape_to_cancel)(n);let B=async()=>{if(A){s(!0),u(null);try{let b=a.notes.map(a=>a.text).join("\n"),c=await m({provider:v,api_key:z,context:p,notes:b});q(c)}catch(a){u(a instanceof Error?a.message:String(a))}finally{s(!1)}}};return(0,b.jsxs)("form",{className:"flex min-w-0 flex-1 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=p.trim();b===o.trim()?n():l(b)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-start gap-2 max-[700px]:flex-col",children:[(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(e.TagAutocompleteInput,{id:`active-entry-description-${a.id}`,value:p,known_tags:c,placeholder:"e.g. crafting something @design",disabled:g,autoFocus:!0,on_change:q})}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2 max-[700px]:w-full",children:[A?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:g||r,title:"Revise description with AI","aria-label":"Revise description with AI",onClick:()=>void B(),children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(aN,{}),r?"Revising…":"Revise with AI"]})}):null,(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary","small"),disabled:g||p.trim()===o.trim(),children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:g,onClick:n,children:"Cancel"})]})]}),null!==t?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:t}):null]})}var aP=a.i(61566);let aQ=`${(0,f.get_button_class_name)("danger-solid")} rounded-none first:rounded-l-[0.65rem] last:rounded-r-[0.65rem] not-first:-ml-px not-first:min-w-12 not-first:border-l not-first:border-l-[color-mix(in_srgb,#ffffff_30%,var(--danger-solid))] min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1 max-[560px]:basis-1/2`;function aR({in_bar:a=!1,is_pending:c,on_start_checkout:d}){return(0,b.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${a?"max-[560px]:w-full":"min-w-30 max-[560px]:w-full"}`,children:[(0,b.jsx)("button",{type:"button",className:aQ,disabled:c,onClick:()=>d(),children:"Check out"}),(0,b.jsx)("button",{type:"button",className:aQ,disabled:c,title:"Check out at a specific time",onClick:()=>{let a=(0,aP.prompt_check_out_at)();null!==a&&d(a)},children:"@"})]})}function aS({on_submit:a,on_cancel:c,is_pending:e,in_active_panel:h=!1,in_bar:i=!1,allow_at:j=!1}){let[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)("");return(0,ag.use_escape_to_cancel)(()=>c?.(),void 0!==c),(0,b.jsxs)("form",{className:`flex flex-col gap-2 ${h&&!i?"border-t border-accent-border pt-4":i?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:b=>{b.preventDefault();let c=k.trim();if(0===c.length)return;let d=m.trim();a(c,d.length>0?d:void 0),l(""),n("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-text",children:"Add note"}),(0,b.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2 max-[860px]:grid-cols-1",children:[(0,b.jsx)("input",{id:"note-text",className:(0,g.get_input_class_name)(),value:k,onChange:a=>l(a.target.value),placeholder:"Pair with alice on the widget",disabled:e,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-[860px]:w-full",children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("ghost"),disabled:e||0===k.trim().length,children:"Save note"}),void 0!==c?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:e,onClick:c,children:"Cancel"}):null]})]}),j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-at",children:["Note time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"note-at",className:(0,g.get_input_class_name)(),value:m,onChange:a=>n(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:e})]}):null]})}var aT=a.i(38842),aU=a.i(77328);let aV=(0,d.forwardRef)(function({entry:a,sheets:c,known_tags:e,in_bar:g=!1,on_check_out:h,on_delete:i,on_edit:j,on_move:k,on_add_note:l,on_edit_note:m,on_delete_note:n,is_pending:o},p){var q;let r,{confirm:t}=(0,ae.use_confirm_dialog)(),u=aF(),v=(0,aT.use_confirm_before_checkout)(),w=(0,F.use_duration_format)(),x=aL(),[y,z]=(0,d.useState)(a.durationMs),[A,B]=(0,d.useState)(!1),[C,D]=(0,d.useState)(!1),[E,G]=(0,d.useState)(!1),[H,I]=(0,d.useState)(!1),[J,K]=(0,d.useState)(void 0);(0,d.useImperativeHandle)(p,()=>({start_edit:()=>{A||C||H||B(!0)},start_add_note:()=>{A||C||E||H||G(!0)}}),[E,A,C,H]),(0,d.useEffect)(()=>{G(!1),B(!1),D(!1),I(!1),K(void 0)},[a.id,a.sheetName]),(0,d.useEffect)(()=>{z(a.durationMs);let b=window.setInterval(()=>{z(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.durationMs,a.start]);let L=()=>{I(!1),K(void 0)},M=async a=>{(!v||await t((0,aU.get_check_out_confirm_dialog)(a)))&&(h(a),L())},N=(q=A||C||H,r="flex flex-col gap-4 rounded-lg border border-accent-border p-[1.1rem] shadow-sm",g?q?`${r} rounded-md border border-accent-border bg-[color-mix(in_srgb,var(--panel)_70%,var(--background))] p-3.5`:"flex flex-col gap-3 border-0 bg-transparent p-0 shadow-none":`${r} bg-[image:var(--active-panel-bg)]`),O=async b=>{let c,d,e=a.notes.find(a=>a.timestamp===b);(!u||await t({title:"Delete note?",message:(d=(c=(e?.text??"").trim()).length>80?`${c.slice(0,80)}…`:c).length>0?`Remove this note? "${d}"`:"Remove this note?",confirmLabel:"Delete",variant:"danger"}))&&n(b)},P=(0,b.jsx)(ai,{current_sheet_name:a.sheetName,sheets:c,is_pending:o,on_edit:()=>D(!0),on_show_add_note_form:()=>G(!0),on_move:k,on_delete:async()=>{(!u||await t(aC(a)))&&i()}});return H?(0,b.jsx)("section",{className:N,"aria-label":"Check out active entry",children:(0,b.jsx)(aM,{entry:a,in_bar:g,is_pending:o,initial_at:J,on_cancel:L,on_submit:a=>{M(a)}})}):C?(0,b.jsx)("section",{className:N,children:(0,b.jsx)(au,{entry:a,known_tags:e,is_pending:o,in_active_panel:!0,times_only:!0,start_only:!0,on_cancel:()=>D(!1),on_save:a=>{j(a),D(!1)}})}):(0,b.jsxs)("section",{className:N,children:[(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[g?null:(0,b.jsx)("span",{className:"self-start rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),A?(0,b.jsx)(aO,{entry:a,known_tags:e,is_pending:o,on_cancel:()=>B(!1),on_save:a=>{j({description:a}),B(!1)}}):(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.12rem] font-[650] leading-tight tracking-tight min-[560px]:text-xl",children:a.description||"Untitled entry"}),(0,b.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Edit description",title:"Edit description",disabled:o||E,onClick:()=>B(!0),children:(0,b.jsx)(am,{})})]})]}),g?null:(0,b.jsx)("div",{className:"max-[560px]:self-end",children:P})]}),(0,b.jsxs)("div",{className:`flex shrink-0 items-end justify-between gap-4 max-[860px]:flex-col max-[860px]:items-stretch ${g?"px-3":""}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.65rem] font-medium leading-none tracking-tight text-accent min-[440px]:text-[1.85rem] min-[560px]:text-[2rem]",children:(0,s.format_duration)(y,w,x)}),!A&&a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,Q.format_display_tag)(a)},a))}):null]}),(0,b.jsxs)("div",{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2 max-[560px]:flex-col max-[560px]:items-stretch ${g?"w-full":"min-w-30 max-[860px]:w-full max-[860px]:justify-stretch"}`,children:[E?null:(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} min-w-0 min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1`,disabled:o||A,onClick:()=>G(!0),children:"Add note"}),(0,b.jsx)(aR,{in_bar:g,is_pending:o,on_start_checkout:a=>{o||(B(!1),D(!1),G(!1),K(a),I(!0))}})]})]}),(0,b.jsx)(aq,{notes:a.notes,variant:"panel",in_bar:g,is_pending:o,on_edit_note:m,on_delete_note:O}),E?(0,b.jsx)("div",{className:"shrink-0",children:(0,b.jsx)(aS,{in_active_panel:!0,in_bar:g,allow_at:!0,is_pending:o,on_cancel:()=>G(!1),on_submit:(a,b)=>{l(a,b),G(!1)}})}):null]})});var aW=a.i(18734);let aX=(0,d.forwardRef)(function({active_entry:a,sheets:c,known_tags:e,is_pending:f,on_check_out:g,on_delete:h,on_edit:i,on_move:j,on_add_note:k,on_edit_note:l,on_delete_note:m},n){let{confirm:o}=(0,ae.use_confirm_dialog)(),p=aF(),q=(0,d.useRef)(null);return((0,d.useImperativeHandle)(n,()=>({start_edit:()=>{q.current?.start_edit()},start_add_note:()=>{q.current?.start_add_note()}})),null===a)?null:(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted whitespace-nowrap truncate",children:["Sheet ",a.sheetName]}),(0,b.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,aW.is_pomodoro_task_entry)(a)?(0,b.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,b.jsx)("div",{className:"ml-auto",children:(0,b.jsx)(ai,{current_sheet_name:a.sheetName,sheets:c,is_pending:f,on_edit:()=>q.current?.start_edit(),on_show_add_note_form:()=>q.current?.start_add_note(),on_move:j,on_delete:async()=>{(!p||await o(aC(a)))&&h()}})})]}),(0,b.jsx)(aV,{ref:q,entry:a,sheets:c,known_tags:e,in_bar:!0,is_pending:f,on_check_out:g,on_delete:h,on_edit:i,on_move:j,on_add_note:k,on_edit_note:l,on_delete_note:m},`${a.sheetName}-${a.id}`)]})});var aY=a.i(6128);let aZ="super-time-tracker";function a$({active_entry:a}){let b="true"===(0,d.useSyncExternalStore)(aY.timer_in_title_preference.subscribe,aY.timer_in_title_preference.get_snapshot,aY.timer_in_title_preference.get_server_snapshot),c=(0,F.use_duration_format)(),e=aL(),[f,g]=(0,d.useState)(a?.durationMs??0);return(0,d.useEffect)(()=>{if(null===a)return void g(0);g(a.durationMs);let b=window.setInterval(()=>{g(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a]),(0,d.useEffect)(()=>{if(!b||null===a){document.title=aZ;return}let d=a.description.trim()||"Tracking",g=(0,s.format_duration)(f,c,e);return document.title=`${g} — ${d}`,()=>{document.title=aZ}},[a,c,f,e,b]),null}var a_=a.i(98790),a0=a.i(68070),a1=a.i(68225);function a2(a){return`${a.sheetName}:${a.id}`}var a3=a.i(84365),a4=a.i(78537),a5=a.i(97063);async function a6(a,b){let c=await fetch(a,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error??"Request failed");return await c.json()}var a7=a.i(57377),a8=a.i(115);function a9(a){}var ba=a.i(35822),bb=a.i(77963);a.s(["TrackerApp",0,function({initial_state:a}){let[e,g]=(0,d.useState)(a),[h,i]=(0,d.useState)(null),[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(a);(0,d.useEffect)(()=>{a9(a)},[a]);let o=async a=>{k(!0),i(null);try{let b=await a(),c=null!==e.activeEntry&&null===b.activeEntry,d=e.runningEntry,f=b.runningEntry;if(a9(b),g(b),c&&(0,a1.finish_running_pomodoro_timer)(),!t)return;if(null===d&&null!==f)return void(0,a4.notify_desktop)({title:"Tracking started",body:`${f.description||"Untitled entry"} (${f.sheetName})`,tag:"tracker-running-entry"});if(null!==d&&null===f)return void(0,a4.notify_desktop)({title:"Tracking stopped",body:`${d.description||"Untitled entry"} (${d.sheetName})`,tag:"tracker-running-entry"});null!==d&&null!==f&&a2(d)!==a2(f)&&(0,a4.notify_desktop)({title:"Tracking switched",body:`${f.description||"Untitled entry"} (${f.sheetName})`,tag:"tracker-running-entry"})}catch(a){i(a instanceof Error?a.message:String(a))}finally{k(!1)}},p=e.activeSheetName??e.sheets.find(a=>a.isActive)?.name??"main",r=aa(),s=az(),t="true"===(0,d.useSyncExternalStore)(bb.desktop_notifications_preference.subscribe,bb.desktop_notifications_preference.get_snapshot,bb.desktop_notifications_preference.get_server_snapshot),u="true"===(0,d.useSyncExternalStore)(ba.clear_tag_filters_on_sheet_change_preference.subscribe,ba.clear_tag_filters_on_sheet_change_preference.get_snapshot,ba.clear_tag_filters_on_sheet_change_preference.get_server_snapshot),v=(0,d.useRef)(null),w=(0,d.useRef)(null),x=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!u||null===v.current||v.current===p){v.current=p;return}Z(p,[]),v.current=p},[p,u]);let y=(0,d.useSyncExternalStore)(W.subscribe_sheet_tag_filters,()=>U(p),V),z=(0,d.useMemo)(()=>(function(a){let b=new Map;for(let c of a){let a=new Set;for(let d of c.tags)try{let c=(0,R.normalize_stored_tag)(d);if(a.has(c))continue;a.add(c),b.set(c,(b.get(c)??0)+1)}catch{continue}}return[...b.entries()].map(([a,b])=>({name:a,entryCount:b})).sort((a,b)=>a.name.localeCompare(b.name))})(e.activeSheetEntries),[e.activeSheetEntries]),A=(0,d.useMemo)(()=>{if(l)return[];let a=[...function(a,b,c="all"){return 0===b.length?a:a.filter(a=>(function(a,b,c="all"){return 0===b.length||("any"===c?b.some(b=>a.tags.some(a=>$(a,b))):b.every(b=>a.tags.some(a=>$(a,b))))})(a,b,c))}(e.activeSheetEntries,y,r)];switch(s){case"oldest":return a.sort((a,b)=>new Date(a.start).getTime()-new Date(b.start).getTime());case"duration":return a.sort((a,b)=>b.durationMs-a.durationMs);case"description":return a.sort((a,b)=>{let c=a.description.trim()||"Untitled entry",d=b.description.trim()||"Untitled entry";return c.localeCompare(d)});default:return a.sort((a,b)=>new Date(b.start).getTime()-new Date(a.start).getTime())}},[e.activeSheetEntries,y,r,s,l]),B=(0,d.useMemo)(()=>(0,a3.get_serialized_entries_total_ms)(A),[A]);(0,d.useEffect)(()=>(0,a5.subscribe_tracker_state_sync)(()=>{j||l||fetch("/api/state").then(async a=>{if(!a.ok)throw Error("Failed to refresh tracker state");return await a.json()}).then(a=>{a9(a),g(b=>(null===b.activeEntry?null:`${b.activeEntry.sheetName}:${b.activeEntry.id}`)===(null===a.activeEntry?null:`${a.activeEntry.sheetName}:${a.activeEntry.id}`)?b:a)}).catch(()=>{})}),[j,l]);let C=l?`Loading entries for "${p}"…`:y.length>0?"any"===r?`No entries on sheet "${p}" match any selected tag.`:`No entries on sheet "${p}" match all selected tags.`:`No entries on sheet "${p}".`,D=a=>{let b;if(a===p&&!l)return;n.current=e;let c=(b=e.runningEntries.find(b=>b.sheetName===a)??null,{...e,activeSheetName:a,sheets:e.sheets.map(b=>({...b,isActive:b.name===a})),activeEntry:b,activeSheetEntries:e.activeSheetEntries,activeSheetTotalMs:e.activeSheetTotalMs});a9(c),g(c),m(!0),i(null),(0,a8.post_tracker_action)("/api/sheet",{name:a}).then(a=>{a9(a),g(a)}).catch(a=>{i(a instanceof Error?a.message:String(a)),g(n.current)}).finally(()=>{m(!1)})},E=(a,b,c)=>(0,a7.patch_tracker_action)("/api/entry",{sheetName:a,entryId:b,...c});return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a$,{active_entry:e.activeEntry}),(0,b.jsx)(P,{sheets:e.sheets,active_sheet_name:p,active_entry:e.activeEntry,is_pending:j,check_in_form_ref:w,active_entry_panel_ref:x,on_select_sheet:D,on_check_out:a=>o(()=>(0,a8.post_tracker_action)("/api/out",(0,a0.build_check_out_request_payload)(p,a)))}),(0,b.jsx)("div",{className:"relative z-1",children:(0,b.jsx)(a_.TrackerTopbar,{})}),(0,b.jsxs)("div",{className:"mx-auto max-w-[1120px] px-4 pb-10 pt-4 sm:px-5 sm:pt-5",children:[null!==h?(0,b.jsx)("p",{className:"mb-4 border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text",children:h}):null,(0,b.jsx)(G,{has_running_timer:null!==e.runningEntry,on_check_in_shortcut:()=>{w.current?.expand_and_focus()}}),(0,b.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,b.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,b.jsx)(aJ,{sheets:e.sheets,db_path:e.dbPath,is_pending:j,on_select:D,on_create:a=>o(()=>(0,a8.post_tracker_action)("/api/sheet",{name:a})),on_rename:(a,b)=>o(()=>(0,a7.patch_tracker_action)("/api/sheet",{name:a,newName:b})),on_delete:a=>o(()=>(0,a8.post_tracker_action)("/api/sheet",{name:a,delete:!0}))})}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,b.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===e.activeEntry?(0,b.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,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Quick action"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.9rem] font-medium",children:"Jump into Pomodoro without leaving the tracker."})]}),(0,b.jsxs)(c.default,{href:"/pomodoro",className:`${(0,f.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,b.jsx)("span",{className:"text-white text-[0.9rem] leading-none",children:"Start Pomodoro"}),(0,b.jsx)("span",{className:"text-white mt-1 text-[0.72rem] font-medium leading-none opacity-85",children:"Focus timer"})]})]}):null,(0,b.jsx)(aX,{ref:x,active_entry:e.activeEntry,sheets:e.sheets,known_tags:e.knownTags,is_pending:j,on_check_out:a=>o(()=>(0,a8.post_tracker_action)("/api/out",(0,a0.build_check_out_request_payload)(p,a))),on_delete:()=>o(()=>(0,a8.post_tracker_action)("/api/entry",{sheetName:p,entryId:e.activeEntry?.id})),on_edit:a=>o(()=>E(p,e.activeEntry?.id??0,a)),on_move:a=>o(()=>(0,a8.post_tracker_action)("/api/entry/move",{sheetName:p,entryId:e.activeEntry?.id,targetSheetName:a})),on_add_note:(a,b)=>o(()=>(0,a8.post_tracker_action)("/api/note",{text:a,...void 0!==b?{at:b}:{},sheetName:p,entryId:e.activeEntry?.id})),on_edit_note:(a,b)=>o(()=>(0,a7.patch_tracker_action)("/api/note",{sheetName:p,entryId:e.activeEntry?.id,timestamp:a,text:b})),on_delete_note:a=>o(()=>a6("/api/note",{sheetName:p,entryId:e.activeEntry?.id,timestamp:a}))}),null===e.activeEntry?(0,b.jsx)(q,{ref:w,known_tags:e.knownTags,is_pending:j,trailing:(0,b.jsx)("p",{className:"m-0 text-[0.85rem] leading-tight text-muted",children:"Not tracking"}),on_submit:a=>o(()=>(0,a8.post_tracker_action)("/api/in",{...a,sheetName:p}))}):null]}),(0,b.jsx)("section",{className:"flex min-w-0 flex-col gap-4 p-4",children:(0,b.jsx)(aG,{title:"Entries",entries:A,sheets:e.sheets,known_tags:e.knownTags,total_ms:B,empty_message:C,is_pending:j,show_sheet_name:!1,header_extra:(0,b.jsx)(ab,{sheet_name:p,sheet_tags:z}),on_delete:a=>o(()=>(0,a8.post_tracker_action)("/api/entry",{sheetName:a.sheetName,entryId:a.id})),on_edit:(a,b)=>o(()=>E(a.sheetName,a.id,b)),on_move:(a,b)=>o(()=>(0,a8.post_tracker_action)("/api/entry/move",{sheetName:a.sheetName,entryId:a.id,targetSheetName:b})),on_move_many:(a,b)=>o(()=>(0,a8.post_tracker_action)("/api/entry/move-bulk",{entries:a.map(a=>({sheetName:a.sheetName,entryId:a.id})),targetSheetName:b})),on_delete_many:a=>o(()=>(0,a8.post_tracker_action)("/api/entry/delete-bulk",{entries:a.map(a=>({sheetName:a.sheetName,entryId:a.id}))})),on_edit_note:(a,b,c)=>o(()=>(0,a7.patch_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,timestamp:b,text:c})),on_add_note:(a,b)=>o(()=>(0,a8.post_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,text:b})),on_resume:a=>o(()=>(0,a8.post_tracker_action)("/api/in",{description:(0,at.build_resume_description)(a.description,a.tags),sheetName:a.sheetName}))})})]})]})]})]})}],12584)}];
|
|
1
|
+
module.exports=[12584,a=>{"use strict";var b=a.i(39752),c=a.i(62988),d=a.i(34542),e=a.i(30354),f=a.i(89969),g=a.i(69749),h=a.i(98831),i=a.i(40420),j=a.i(6962),k=a.i(45273),l=a.i(30004);async function m(a){if("none"===a.provider)throw Error("AI suggestion provider is disabled");let b="true"===l.debug_logging_preference.read(),c=Date.now(),d={provider:a.provider,context:a.context,notes:a.notes,debug_logging:b};b&&console.info("[ai-suggestion] client request start",{provider:a.provider,context_length:a.context.length,notes_length:a.notes.length});try{let e=await fetch("/api/entry/suggest-description",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...d,api_key:a.api_key})});if(!e.ok){let d=await e.json().catch(()=>({}));throw b&&console.warn("[ai-suggestion] client request failed",{provider:a.provider,status:e.status,elapsed_ms:Date.now()-c,error:d.error??"Failed to suggest description"}),Error(d.error??"Failed to suggest description")}let f=await e.json(),g=f.description?.trim()??"";if(0===g.length)throw Error("Suggestion was empty");return b&&console.info("[ai-suggestion] client request success",{provider:a.provider,elapsed_ms:Date.now()-c,description_length:g.length}),g}catch(d){throw b&&console.error("[ai-suggestion] client request error",{provider:a.provider,elapsed_ms:Date.now()-c,error:d instanceof Error?d.message:String(d)}),d}}function n(a){}function o({known_tags:a,on_submit:c,is_pending:l}){let[p,q]=(0,d.useState)([]),[r,s]=(0,d.useState)(""),[t,u]=(0,d.useState)(""),[v,w]=(0,d.useState)(""),[x,y]=(0,d.useState)(null),[z,A]=(0,d.useState)(!1),B=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),C=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),D=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),E=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),F="openai"===B?C:"claude"===B?D:"google_ai"===B?E:"",G="none"!==B&&F.trim().length>0;(0,d.useEffect)(()=>{q([])},[]);let H=(0,d.useMemo)(()=>p.find(a=>a.id===r)??null,[p,r]),I=async()=>{if(G){A(!0),y(null);try{let a=await m({provider:B,api_key:F,context:t,notes:""});u(a)}catch(a){y(a instanceof Error?a.message:String(a))}finally{A(!1)}}};return(0,b.jsxs)("form",{className:"flex flex-col gap-2 border border-panel-border bg-panel p-[1.1rem] shadow-sm",onSubmit:a=>{a.preventDefault();let b=t.trim();if(0===b.length)return;let d=v.trim();c({description:b,...d.length>0?{at:d}:{}}),u(""),w("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-description",children:"What are you working on?"}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[(0,b.jsxs)("select",{className:(0,g.get_input_class_name)(),value:r,disabled:l||0===p.length,onChange:a=>{let b=a.target.value;s(b);let c=p.find(a=>a.id===b)??null;null!==c&&u(c.description)},children:[(0,b.jsx)("option",{value:"",children:0===p.length?"No templates":"Use a template…"}),p.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||0===t.trim().length,onClick:()=>{let a=t.trim();if(0===a.length)return;let b=a.slice(0,40),c=window.prompt("Template name",b.length>0?b:"New template");if(null===c)return;let d=c.trim();if(0===d.length)return;let e="u">typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,f=[...p,{id:e,name:d,description:a}];q(f),s(e),n(f)},children:"Save template"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||null===H,onClick:()=>{if(null===H)return;let a=p.filter(a=>a.id!==H.id);q(a),s(""),n(a)},children:"Delete template"})]}),(0,b.jsxs)("div",{className:`grid gap-2 max-[860px]:grid-cols-1 ${G?"grid-cols-[minmax(0,1fr)_auto_auto]":"grid-cols-[minmax(0,1fr)_auto]"}`,children:[(0,b.jsx)(e.TagAutocompleteInput,{id:"check-in-description",value:t,known_tags:a,placeholder:"e.g. crafting something @design",disabled:l,autoFocus:!0,on_change:u}),G?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:l||z,onClick:()=>void I(),title:"Suggest description with AI",children:z?"Suggesting…":"Suggest"}):null,(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary"),disabled:l||0===t.trim().length,children:"Check in"})]}),null!==x?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:x}):null,(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"check-in-at",children:["Start time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"check-in-at",className:(0,g.get_input_class_name)(),value:v,onChange:a=>w(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:l})]})}var p=a.i(14244);let q=(0,d.forwardRef)(function({known_tags:a,is_pending:c,on_submit:e,trailing:g},h){let i="true"===(0,d.useSyncExternalStore)(p.check_in_form_collapsed_preference.subscribe,p.check_in_form_collapsed_preference.get_snapshot,p.check_in_form_collapsed_preference.get_server_snapshot),[j,k]=(0,d.useState)(!i);return((0,d.useImperativeHandle)(h,()=>({expand_and_focus:()=>{k(!0),window.requestAnimationFrame(()=>{let a=document.getElementById("check-in-description");a instanceof HTMLElement&&a.focus()})}}),[]),i&&!j)?(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("primary"),disabled:c,onClick:()=>k(!0),children:"Check in"}),g]}):(0,b.jsx)(o,{known_tags:a,is_pending:c,on_submit:a=>{e(a),i&&k(!1)}})});var r=a.i(75654),s=a.i(85752),t=a.i(50762),u=a.i(39744),v=a.i(13870),w=a.i(16777),x=a.i(18558),y=a.i(80805),z=a.i(9818),A=a.i(72327),B=a.i(40395),C=a.i(76121),D=a.i(62082),E=a.i(64617),F=a.i(65162);function G({on_check_in_shortcut:a,has_running_timer:c=!1}){let e=(0,F.use_duration_format)(),f=(0,d.useSyncExternalStore)(A.focus_nudges_enabled_preference.subscribe,A.focus_nudges_enabled_preference.get_snapshot,A.focus_nudges_enabled_preference.get_server_snapshot),g=(0,d.useSyncExternalStore)(u.daily_focus_target_minutes_preference.subscribe,u.daily_focus_target_minutes_preference.get_snapshot,u.daily_focus_target_minutes_preference.get_server_snapshot),h=(0,d.useSyncExternalStore)(D.weekly_focus_target_minutes_preference.subscribe,D.weekly_focus_target_minutes_preference.get_snapshot,D.weekly_focus_target_minutes_preference.get_server_snapshot),i=(0,d.useSyncExternalStore)(B.no_log_reminder_minutes_preference.subscribe,B.no_log_reminder_minutes_preference.get_snapshot,B.no_log_reminder_minutes_preference.get_server_snapshot),j=(0,d.useSyncExternalStore)(C.overwork_alert_hours_preference.subscribe,C.overwork_alert_hours_preference.get_snapshot,C.overwork_alert_hours_preference.get_server_snapshot),k=(0,d.useSyncExternalStore)(v.focus_goal_scope_preference.subscribe,v.focus_goal_scope_preference.get_snapshot,v.focus_goal_scope_preference.get_server_snapshot),l=(0,d.useSyncExternalStore)(w.focus_goal_sheet_name_preference.subscribe,w.focus_goal_sheet_name_preference.get_snapshot,w.focus_goal_sheet_name_preference.get_server_snapshot),m=(0,d.useSyncExternalStore)(x.focus_goal_tag_name_preference.subscribe,x.focus_goal_tag_name_preference.get_snapshot,x.focus_goal_tag_name_preference.get_server_snapshot),n=(0,d.useSyncExternalStore)(y.focus_goals_per_sheet_preference.subscribe,y.focus_goals_per_sheet_preference.get_snapshot,y.focus_goals_per_sheet_preference.get_server_snapshot),o=(0,d.useSyncExternalStore)(z.focus_goals_per_tag_preference.subscribe,z.focus_goals_per_tag_preference.get_snapshot,z.focus_goals_per_tag_preference.get_server_snapshot),[p,q]=(0,d.useState)(null),[r,J]=(0,d.useState)(null);(0,d.useEffect)(()=>{let a=()=>{try{let a=window.localStorage.getItem(E.POMODORO_STORAGE_KEY);if(null===a)return null;let b=JSON.parse(a).state;if(void 0===b||"running"!==b.status||null===b.deadline_at_ms)return null;let c=Math.max(0,b.deadline_at_ms-Date.now()),d=Math.floor(c/6e4),e=Math.floor(c%6e4/1e3);return{phase_label:"work"===b.phase?"Focus":"short_break"===b.phase?"Short break":"Long break",remaining_label:`${d.toString().padStart(2,"0")}:${e.toString().padStart(2,"0")}`}}catch{return null}},b=window.setTimeout(()=>{J(a())},0),c=window.setInterval(()=>{J(a())},1e3);return()=>{window.clearTimeout(b),window.clearInterval(c)}},[]),(0,d.useEffect)(()=>{if("true"!==f)return;let a=!1,b=async()=>{try{var b,c,d;let e=new URLSearchParams;e.set("scope",(b=k,c=l,d=m,"sheet"===b&&0===c.length||"tag"===b&&0===d.length?"global":b)),"sheet"===k&&l.length>0&&e.set("sheet",l),"tag"===k&&m.length>0&&e.set("tag",m);let f=await fetch(`/api/focus-nudges/status?${e.toString()}`);if(!f.ok)return;let g=await f.json();a||q(g)}catch{}};b();let c=window.setInterval(()=>{b()},6e4);return()=>{a=!0,window.clearInterval(c)}},[f,k,l,m]);let K=(0,d.useMemo)(()=>{if("true"!==f||null===p)return null;let{daily_minutes:a,weekly_minutes:b}=function(a){if("sheet"===a.scope&&a.sheet_name.length>0){let b=(0,t.parse_focus_goals_by_name)(a.per_sheet_json)[a.sheet_name];return void 0===b?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:b.daily??a.global_daily,weekly_minutes:b.weekly??a.global_weekly}}if("tag"===a.scope&&a.tag_name.length>0){let b=(0,t.parse_focus_goals_by_name)(a.per_tag_json)[a.tag_name];return void 0===b?{daily_minutes:null,weekly_minutes:null}:{daily_minutes:b.daily??a.global_daily,weekly_minutes:b.weekly??a.global_weekly}}return{daily_minutes:a.global_daily,weekly_minutes:a.global_weekly}}({scope:k,sheet_name:l,tag_name:m,per_sheet_json:n,per_tag_json:o,global_daily:g,global_weekly:h});if(null===a||null===b)return{kind:"alert",tone:"info",title:H("daily",k,l,m),detail:"No goals configured yet for this scope. Set daily and weekly targets in Goal settings."};let d=6e4*Number.parseInt(a,10),q=6e4*Number.parseInt(b,10),r=36e5*Number.parseInt(j,10),u=Number.parseInt(i,10);return null!==p.activeTimerDurationMs&&p.activeTimerDurationMs>=r?{kind:"alert",tone:"warning",title:"Overwork alert",detail:`Current session is ${(0,s.format_duration)(p.activeTimerDurationMs,e)}. Consider a short break.`}:!c&&null!==p.minutesSinceLastLog&&p.minutesSinceLastLog>=u?{kind:"alert",tone:"warning",title:"Gentle reminder",detail:`No time logged for ${p.minutesSinceLastLog} min. Start a timer when you are back on task.`,show_check_in_shortcut:!0}:p.todayTrackedMs<d?{kind:"progress",scope:"daily",title:H("daily",k,l,m),tracked_ms:p.todayTrackedMs,target_ms:d}:p.weekTrackedMs<q?{kind:"progress",scope:"weekly",title:H("weekly",k,l,m),tracked_ms:p.weekTrackedMs,target_ms:q}:{kind:"alert",tone:"success",title:"Targets met",detail:"Daily and weekly focus goals are on track."}},[g,e,f,j,c,k,l,m,n,o,i,p,h]);if(null===K)return null;if("progress"===K.kind)return(0,b.jsx)(I,{scope:K.scope,title:K.title,tracked_ms:K.tracked_ms,target_ms:K.target_ms,duration_format:e,active_pomodoro:r});let L="warning"===K.tone?"mb-4 rounded-md border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text":"success"===K.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,b.jsxs)("section",{className:L,"aria-live":"polite","aria-atomic":"true",children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:K.title}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.82rem] leading-relaxed",children:K.detail}),K.show_check_in_shortcut&&void 0!==a?(0,b.jsx)("button",{type:"button",className:"cursor-pointer rounded border border-current bg-transparent px-2 py-1 text-[0.75rem] font-semibold",onClick:a,children:"Check in"}):null]})]})}function H(a,b,c,d){let e="daily"===a?"Relevant goal":"Weekly goal";return"sheet"===b&&c.length>0?`${e} \xb7 ${c}`:"tag"===b&&d.length>0?`${e} \xb7 @${d}`:e}function I({scope:a,title:d,tracked_ms:e,target_ms:f,duration_format:g,active_pomodoro:h}){let i=f>0?Math.min(100,e/f*100):0,j=Math.max(0,f-e);return(0,b.jsx)("section",{className:"mb-4 rounded-md border border-panel-border bg-panel px-4 py-3 shadow-sm","aria-label":d,"aria-live":"polite",children:(0,b.jsxs)("div",{className:"flex flex-wrap items-stretch justify-between gap-3",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-baseline justify-between gap-3",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:d}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:["daily"===a?(0,b.jsx)(c.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,b.jsx)(r.SettingsIcon,{})}):null,(0,b.jsxs)("p",{className:"m-0 font-mono text-[0.78rem] font-semibold text-accent",children:[Math.round(i),"%"]})]})]}),(0,b.jsxs)("div",{className:"mt-2 flex items-baseline justify-between gap-3",children:[(0,b.jsxs)("p",{className:"m-0 font-mono text-[1.35rem] font-semibold leading-none text-foreground",children:[(0,s.format_duration)(e,g),(0,b.jsxs)("span",{className:"ml-1 text-[0.85rem] font-medium text-muted",children:["/ ",(0,s.format_duration)(f,g)]})]}),(0,b.jsxs)("p",{className:"m-0 text-[0.78rem] text-muted",children:[(0,s.format_duration)(j,g)," left ","daily"===a?"today":"this week"]})]}),(0,b.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(i),children:(0,b.jsx)("div",{className:"h-full rounded-full bg-accent transition-[width] duration-300",style:{width:`${i}%`}})})]}),null!==h?(0,b.jsxs)("aside",{className:"min-w-52 rounded-md border border-panel-border bg-surface-raised px-3 py-2.5",children:[(0,b.jsx)("p",{className:"m-0 text-[0.68rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Active Pomodoro"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.82rem] font-semibold text-foreground",children:h.phase_label}),(0,b.jsx)("p",{className:"m-0 mt-1 font-mono text-[1.25rem] font-semibold leading-none text-accent",children:h.remaining_label})]}):null]})})}var J=a.i(82508),K=a.i(7386);function L(a,b,c){if(0===a.length)return null;let d=a.findIndex(a=>a.name===b),e=((-1===d?0:d)+("next"===c?1:-1)+a.length)%a.length;return a[e]?.name??null}var M=a.i(85928),N=a.i(11937),O=a.i(54212),P=a.i(26336),Q=a.i(89184);function R({sheets:a,active_sheet_name:c,active_entry:e,is_pending:f,check_in_form_ref:g,active_entry_panel_ref:h,on_select_sheet:i,on_check_out:j}){let k=(0,J.useRouter)(),[l,m]=(0,d.useState)(!1),n=(0,P.use_check_out_action)(j),o=(0,d.useSyncExternalStore)(O.tracker_shortcut_map_preference.subscribe,O.tracker_shortcut_map_preference.get_snapshot,O.tracker_shortcut_map_preference.get_server_snapshot),p=(0,d.useMemo)(()=>(0,N.parse_tracker_shortcut_map)(o),[o]),q=p.help,r="?"===q?"?":q.toUpperCase(),s="?"===q?["shift"]:[],t=(0,d.useMemo)(()=>{let b=null!==e;return[{id:"help",label:r,description:"Show keyboard shortcuts",key:q,modifiers:s,action:()=>{m(a=>!a)}},{id:"check-in",label:p["check-in"].toUpperCase(),description:"Check in (focus description)",key:p["check-in"],is_available:()=>!f&&!b,action:()=>{g.current?.expand_and_focus()}},{id:"check-out",label:p["check-out"].toUpperCase(),description:"Check out",key:p["check-out"],is_available:()=>!f&&b,action:()=>{n()}},{id:"edit-entry",label:p["edit-entry"].toUpperCase(),description:"Edit active entry",key:p["edit-entry"],is_available:()=>!f&&b,action:()=>{h.current?.start_edit()}},{id:"add-note",label:p["add-note"].toUpperCase(),description:"Add note to active entry",key:p["add-note"],is_available:()=>!f&&b,action:()=>{h.current?.start_add_note()}},{id:"pomodoro",label:p.pomodoro.toUpperCase(),description:"Open Pomodoro",key:p.pomodoro,is_available:()=>!f,action:()=>{k.push("/pomodoro")}},{id:"previous-sheet",label:p["previous-sheet"],description:"Previous sheet",key:p["previous-sheet"],is_available:()=>!f&&a.length>1,action:()=>{let b=L(a,c,"previous");null!==b&&b!==c&&i(b)}},{id:"next-sheet",label:p["next-sheet"],description:"Next sheet",key:p["next-sheet"],is_available:()=>!f&&a.length>1,action:()=>{let b=L(a,c,"next");null!==b&&b!==c&&i(b)}}]},[e,h,c,g,n,f,i,k,q,r,s,p,a]);return((0,Q.use_document_keyboard_shortcuts)(t),l)?(0,b.jsx)(K.KeyboardShortcutsDialog,{sections:(0,M.get_tracker_keyboard_shortcut_sections)(p),on_close:()=>m(!1)}):null}var S=a.i(48174),T=a.i(56924);function U(a){let b=[],c=new Set;for(let d of({})[a]??[])try{let a=(0,T.normalize_stored_tag)(d);c.has(a)||(c.add(a),b.push(a))}catch{continue}return b}var V=a.i(4845);function W(a){return(0,V.get_stable_sheet_tag_filter_snapshot)(a,U(a))}function X(){return V.EMPTY_SHEET_TAG_FILTER}var Y=a.i(5479),Z=a.i(72958),$=a.i(19702);function _(a,b){let c={};0===b.length?delete c[a]:c[a]=b;try{window.localStorage.setItem($.SHEET_TAG_FILTERS_STORAGE_KEY,JSON.stringify(c)),(0,Z.schedule_ui_preferences_cloud_sync)()}catch{}(0,Y.notify_sheet_tag_filters_subscribers)()}function aa(a,b){try{return(0,T.normalize_stored_tag)(a)===(0,T.normalize_stored_tag)(b)}catch{return!1}}var ab=a.i(78702);function ac(){return(0,d.useSyncExternalStore)(ab.tag_filter_mode_preference.subscribe,ab.tag_filter_mode_preference.get_snapshot,ab.tag_filter_mode_preference.get_server_snapshot)}function ad({sheet_name:a,sheet_tags:c}){let e=ac(),g=(0,d.useSyncExternalStore)(Y.subscribe_sheet_tag_filters,()=>W(a),X);if((0,d.useEffect)(()=>{!function(a,b){let c=U(a);if(0===c.length)return;let d=c.filter(a=>b.some(b=>aa(a,b)));d.length!==c.length&&_(a,d)}(a,c.map(a=>a.name))},[a,c]),0===c.length)return null;let h=g.length>0;return(0,b.jsxs)("div",{role:"group","aria-label":"Filter by tag",className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,b.jsx)("h2",{className:"m-0 shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:"Filter by tag"}),(0,b.jsx)("p",{className:"m-0 shrink-0 text-[0.8rem] text-muted",children:"any"===e?"Show entries that include any selected tag.":"Show entries that include every selected tag."}),(0,b.jsxs)("div",{className:"ml-auto flex min-w-0 flex-wrap justify-end gap-1",children:[c.map(c=>{let d=g.some(a=>aa(a,c.name));return(0,b.jsxs)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost","small")} ${d?"border-accent-border bg-accent-soft text-foreground":""}`,"aria-pressed":d,onClick:()=>{var b;let d,e;return b=c.name,d=(0,T.normalize_stored_tag)(b),void((e=U(a)).some(a=>aa(a,d))?_(a,e.filter(a=>!aa(a,d))):_(a,[...e,d]))},children:[(0,S.format_display_tag)(c.name),(0,b.jsxs)("span",{className:"ml-1 font-normal text-muted",children:["(",c.entryCount,")"]})]},c.name)}),h?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),onClick:()=>_(a,[]),children:"Clear filter"}):null]})]})}var ae=a.i(64723),af=a.i(53030),ag=a.i(34435),ah=a.i(96359);let ai="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 aj({current_sheet_name:a,sheets:c,is_pending:e,on_edit:f,on_add_note:g,on_show_add_note_form:h,on_revise_description_ai:i,can_revise_description_ai:j=!1,on_resume:k,entry_is_active:l=!1,on_delete:m,on_move:n}){let o=c.find(b=>b.name===a),p=l||o?.hasActiveEntry===!0&&!l,q=c.filter(b=>b.name!==a),[r,s]=(0,d.useState)(!1),t=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!r)return;let a=a=>{null===t.current||t.current.contains(a.target)||s(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[r]);let u=()=>{s(!1)};return(0,ah.use_escape_to_cancel)(u,r),(0,b.jsxs)("div",{className:"relative shrink-0",ref:t,children:[(0,b.jsx)("button",{type:"button",className:"inline-flex cursor-pointer appearance-none items-center justify-center rounded-none border-0 bg-transparent p-0.5 text-muted shadow-none hover:opacity-75 focus-visible:outline-2 focus-visible:outline-input-focus-border focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Entry actions","aria-expanded":r,"aria-haspopup":"menu",disabled:e,onClick:()=>s(a=>!a),children:(0,b.jsx)(ag.HamburgerIcon,{})}),r?(0,b.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,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ai,role:"menuitem",disabled:e,onClick:()=>{u(),f()},children:"Edit times"})}),void 0!==h||void 0!==g?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ai,role:"menuitem",disabled:e,onClick:()=>{if(u(),void 0!==h)return void h();let a=function(){let a=window.prompt("Add note","");if(null===a)return null;let b=a.trim();return 0===b.length?null:b}();null!==a&&void 0!==g&&g(a)},children:"Add note"})}):null,void 0!==i?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ai,role:"menuitem",disabled:e||!j,title:j?"Revise with AI":"Configure provider and key in Settings → AI suggestions",onClick:()=>{u(),i()},children:"Revise description with AI"})}):null,void 0!==k?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ai,role:"menuitem",disabled:e||p,title:p?l?"This entry is already active":"Another entry is active on this sheet":void 0,onClick:()=>{u(),k()},children:"Resume"})}):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)("p",{className:"m-0 px-2.5 py-0.5 text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted",children:"Move to sheet"})}),0===q.length?(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:ai,role:"menuitem",disabled:!0,children:"No other sheets"})}):q.map(a=>(0,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:`${ai} pl-4`,role:"menuitem",disabled:e||a.hasActiveEntry,title:a.hasActiveEntry?"That sheet already has an active entry":void 0,onClick:()=>{u(),n(a.name)},children:a.name})},a.name)),(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:`${ai} text-danger`,role:"menuitem",disabled:e,onClick:()=>{u(),m()},children:"Delete"})})]}):null]})}function ak({rotated:a=!1,className:c=""}){return(0,b.jsx)("svg",{className:`h-3 w-3 shrink-0 transition-transform duration-150 ${a?"rotate-90":""} ${c}`.trim(),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,b.jsx)("path",{d:"m9 18 6-6-6-6"})})}var al=a.i(76767);function am({initial_text:a,is_pending:c,inline:e=!1,on_save:h,on_cancel:i}){let[j,k]=(0,d.useState)(a);(0,ah.use_escape_to_cancel)(i);let l=Math.min(6,Math.max(2,a.split("\n").length)),m=e?`${(0,g.get_input_class_name)()} min-h-10 w-full resize-y text-xs leading-snug`:`${(0,g.get_input_class_name)()} min-h-10 w-full resize-y text-[0.85rem] leading-snug`;return(0,b.jsxs)("form",{className:"flex w-full flex-col gap-1.5",onSubmit:a=>{a.preventDefault();let b=j.trim();0!==b.length&&h(b)},onClick:a=>a.stopPropagation(),children:[(0,b.jsx)("textarea",{className:m,value:j,rows:l,disabled:c,onChange:a=>k(a.target.value)}),(0,b.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:c,onClick:i,children:"Cancel"}),(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("ghost"),disabled:c||0===j.trim().length,children:"Save"})]})]})}function an(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M12 20h9"}),(0,b.jsx)("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function ao(){return(0,b.jsxs)("svg",{className:"h-[0.85rem] w-[0.85rem]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,b.jsx)("path",{d:"M3 6h18"}),(0,b.jsx)("path",{d:"M8 6V4h8v2"}),(0,b.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),(0,b.jsx)("path",{d:"M10 11v6"}),(0,b.jsx)("path",{d:"M14 11v6"})]})}var ap=a.i(20537);let aq="inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55";function ar({notes:a,variant:c="panel",in_bar:e=!1,is_pending:f=!1,on_edit_note:g,on_delete_note:h}){let i=(0,ap.use_time_format)(),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)("panel"===c&&!e);if(0===a.length)return null;let n=[...a].sort((a,b)=>new Date(a.timestamp).getTime()-new Date(b.timestamp).getTime()),o="inline"===c,p="panel"===c&&e,q=l||null!==j,r=o?`${a.length} ${1===a.length?"note":"notes"}`:`Notes (${a.length})`,s=[o?"m-0 w-full p-0":"border-t border-accent-border pt-3.5",e&&!o?"border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))]":"",p&&q?"flex min-h-0 flex-1 flex-col":p?"flex shrink-0 flex-col":""].filter(Boolean).join(" "),t=q?"mt-1.5":"hidden",u=o?`m-0 flex list-none flex-col gap-1.5 overflow-visible p-0 compact:gap-0.5 ${t}`:p?`m-0 grid min-h-0 flex-1 list-none auto-rows-fr grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${t}`:`m-0 grid list-none grid-cols-2 gap-2 p-0 max-[860px]:grid-cols-1 ${t}`,v=o?"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-ghost-bg px-2 py-1.5 compact:rounded-none compact:px-1.5 compact:py-1":p?"flex min-h-0 flex-col justify-center gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2":"flex flex-col gap-0.5 rounded-sm border border-panel-border bg-[color-mix(in_srgb,var(--panel)_55%,var(--background))] px-2.5 py-2",w=a=>void 0===g&&void 0===h?null:(0,b.jsxs)("div",{className:"flex shrink-0 gap-0.5",children:[void 0!==g?(0,b.jsx)("button",{type:"button",className:aq,"aria-label":"Edit note",title:"Edit note",disabled:f,onClick:b=>{var c;b.stopPropagation(),c=a.timestamp,m(!0),k(c)},children:(0,b.jsx)(an,{})}):null,void 0!==h?(0,b.jsx)("button",{type:"button",className:`${aq} hover:text-danger`,"aria-label":"Delete note",title:"Delete note",disabled:f,onClick:b=>{var c;b.stopPropagation(),j===(c=a.timestamp)&&k(null),h?.(c)},children:(0,b.jsx)(ao,{})}):null]});return(0,b.jsxs)("section",{className:s,"aria-label":"Entry notes",children:[(0,b.jsxs)("button",{type:"button",className:o?"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent p-0 font-inherit text-xs font-medium normal-case tracking-normal text-muted hover:text-foreground":"inline-flex cursor-pointer items-center gap-1.5 border-0 bg-transparent px-0 py-0.5 font-inherit text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted hover:text-foreground","aria-expanded":q,onClick:a=>{a.stopPropagation(),null===j&&m(a=>!a)},children:[(0,b.jsx)(ak,{rotated:q}),(0,b.jsx)("span",{children:r})]}),(0,b.jsx)("ul",{className:u,children:n.map((a,c)=>{let d=j===a.timestamp;return(0,b.jsx)("li",{className:v,children:d?(0,b.jsx)(am,{initial_text:a.text,inline:o,is_pending:f,on_cancel:()=>k(null),on_save:b=>{var c;return c=a.timestamp,void(g?.(c,b),k(null))}}):o?(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsxs)("p",{className:"m-0 flex min-w-0 flex-1 items-baseline gap-1.5 text-xs leading-snug text-foreground compact:text-[0.72rem]",children:[(0,b.jsx)("time",{className:"shrink-0 font-mono text-[0.68rem] text-muted",dateTime:a.timestamp,children:(0,al.format_time)(a.timestamp,i)}),(0,b.jsx)("span",{className:"min-w-0 overflow-wrap-anywhere whitespace-pre-wrap",children:a.text})]}),w(a)]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex w-full items-start justify-between gap-1.5",children:[(0,b.jsx)("time",{className:"font-mono text-[0.72rem] text-muted",dateTime:a.timestamp,children:(0,al.format_time)(a.timestamp,i)}),w(a)]}),(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere text-[0.9rem] leading-snug whitespace-pre-wrap",children:a.text})]})},`${a.timestamp}-${c}`)})})]})}var as=a.i(93301);function at(a){return(0,as.format)(new Date(a),"MMM d, h:mm a")}var au=a.i(50803);function av({entry:a,known_tags:c,is_pending:h,initial_description_override:i,in_active_panel:j=!1,times_only:k=!1,start_only:l=!1,on_save:m,on_cancel:n}){let o=(0,d.useMemo)(()=>i??(0,au.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags,i]),[p,q]=(0,d.useState)(o),[r,s]=(0,d.useState)(""),[t,u]=(0,d.useState)("");(0,d.useEffect)(()=>{q(i??(0,au.build_resume_description)(a.description,a.tags)),s(""),u("")},[a.description,a.id,a.sheetName,a.tags,i]),(0,ah.use_escape_to_cancel)(n);let v=a.isActive?"still running":at(a.end??a.start),w=k?r.trim().length>0||!l&&t.trim().length>0:p.trim()!==o.trim()||r.trim().length>0||!l&&t.trim().length>0;return(0,b.jsxs)("form",{className:`flex flex-col gap-3 rounded-[0.65rem] border border-panel-border bg-input-bg p-3 ${j?"mt-2":""}`,onSubmit:a=>{a.preventDefault();let b=p.trim(),c=r.trim(),d=t.trim(),e={};k||b===o.trim()||(e.description=b),c.length>0&&(e.start=c),!l&&d.length>0&&(e.end=d),(void 0!==e.description||void 0!==e.start||void 0!==e.end)&&m(e)},children:[(0,b.jsx)("p",{className:"m-0 text-[0.85rem] font-semibold",children:k?"Edit times":"Edit entry"}),k?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-description-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Description"}),(0,b.jsx)(e.TagAutocompleteInput,{id:`entry-description-${a.id}`,value:p,known_tags:c,placeholder:"e.g. crafting something @design",disabled:h,autoFocus:j,on_change:q})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 text-[0.8rem] font-semibold text-muted",children:"Times (optional)"}),(0,b.jsxs)("div",{className:`grid gap-2.5 max-[860px]:grid-cols-1 ${l?"grid-cols-1":"grid-cols-2"}`,children:[(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-start-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"Start"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",at(a.start)]}),(0,b.jsx)("input",{id:`entry-start-${a.id}`,className:(0,g.get_input_class_name)("compact"),value:r,onChange:a=>s(a.target.value),placeholder:"e.g. 10am, 30 minutes ago",disabled:h,autoFocus:k&&j})]}),l?null:(0,b.jsxs)("label",{className:"flex flex-col gap-1",htmlFor:`entry-end-${a.id}`,children:[(0,b.jsx)("span",{className:"text-[0.8rem] font-semibold",children:"End"}),(0,b.jsxs)("span",{className:"text-[0.72rem] text-muted",children:["Current: ",v]}),(0,b.jsx)("input",{id:`entry-end-${a.id}`,className:(0,g.get_input_class_name)("compact"),value:t,onChange:a=>u(a.target.value),placeholder:a.isActive?"e.g. now, 5 minutes ago":"e.g. 11:30am",disabled:h})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary","small"),disabled:h||!w,children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:h,onClick:n,children:"Cancel"})]})]})}function aw({selected_count:a,total_count:c,all_selected:e,some_selected:h,selected_entries:i,sheets:j,is_pending:k,on_toggle_all:l,on_move:m,on_delete:n,on_clear:o}){let[p,q]=(0,d.useState)(""),r=i.some(a=>a.isActive),s=j.filter(a=>(!r||!a.hasActiveEntry)&&i.some(b=>b.sheetName!==a.name));return(0,b.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,b.jsx)(ae.Checkbox,{className:"shrink-0",checked:e,indeterminate:h,disabled:k,aria_label:e?"Deselect all entries":"Select all entries",on_change:l}),(0,b.jsxs)("p",{className:"m-0 shrink-0 text-[0.85rem] font-semibold",children:[a,(0,b.jsx)("span",{className:"text-muted",children:` of ${c} selected`})]}),(0,b.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("select",{className:`${(0,g.get_input_class_name)("compact")} min-w-32`,value:p,disabled:k||0===s.length,"aria-label":"Move to sheet",onChange:a=>q(a.target.value),children:[(0,b.jsx)("option",{value:"",children:"Move to…"}),s.map(a=>(0,b.jsx)("option",{value:a.name,children:a.name},a.name))]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:k||0===p.trim().length||0===s.length,onClick:()=>{let a=p.trim();0!==a.length&&(m(a),q(""))},children:"Move"})]}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("danger","small"),disabled:k,onClick:n,children:"Delete"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost","small")} shrink-0`,disabled:k,"aria-label":"Clear selection",title:"Clear selection",onClick:o,children:"✕"})]})]})}var ax=a.i(14945),ay=a.i(79918),az=a.i(57077);function aA(){return(0,d.useSyncExternalStore)(ay.entry_list_sort_preference.subscribe,ay.entry_list_sort_preference.get_snapshot,ay.entry_list_sort_preference.get_server_snapshot)}let aB=(0,ax.get_entry_list_sort_options)();function aC({is_pending:a=!1}){let c=aA();return(0,b.jsxs)("fieldset",{className:"m-0 flex flex-wrap items-center gap-x-2 gap-y-1.5 border-0 p-0",children:[(0,b.jsx)("legend",{className:"sr-only",children:"Order entries by"}),(0,b.jsx)("span",{className:"shrink-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Order by"}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1",role:"group","aria-label":"Order entries by",children:aB.map(d=>{let e=c===d.value;return(0,b.jsx)("button",{type:"button",className:e?(0,f.get_button_class_name)("primary","small"):(0,f.get_button_class_name)("ghost","small"),disabled:a,"aria-pressed":e,onClick:()=>(0,az.persist_ui_preference)(ay.entry_list_sort_preference,d.value),children:d.label},d.value)})})]})}function aD(a){let b=a.description.trim()||"Untitled entry",c=a.isActive?" This will stop the active timer.":"";return{title:"Delete entry?",message:`Delete "${b}" on sheet "${a.sheetName}"?${c}`,confirmLabel:"Delete",variant:"danger"}}function aE(a){return`${a.sheetName}-${a.id}`}var aF=a.i(32297);function aG(){return"true"===(0,d.useSyncExternalStore)(aF.confirm_destructive_actions_preference.subscribe,aF.confirm_destructive_actions_preference.get_snapshot,aF.confirm_destructive_actions_preference.get_server_snapshot)}function aH({title:a,entries:c,sheets:e,known_tags:f,total_ms:g,empty_message:l,is_pending:n,show_sheet_name:o=!0,header_extra:p,on_delete:q,on_edit:r,on_move:t,on_move_many:u,on_delete_many:v,on_edit_note:w,on_add_note:x,on_resume:y}){let{confirm:z}=(0,af.use_confirm_dialog)(),A=aG(),B=(0,ap.use_time_format)(),C=(0,F.use_duration_format)(),[D,E]=(0,d.useState)(null),[G,H]=(0,d.useState)(()=>new Set),[I,J]=(0,d.useState)(null),[K,L]=(0,d.useState)(null),[M,N]=(0,d.useState)({}),O=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),P=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),Q=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),R=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),T="openai"===O?P:"claude"===O?Q:"google_ai"===O?R:"",U="none"!==O&&T.trim().length>0,V=c.map(a=>aE(a)),W=c.filter(a=>G.has(aE(a))),X=c.length>0&&W.length===c.length,Y=W.length>0&&W.length<c.length;(0,d.useEffect)(()=>{H(a=>{let b=new Set(V),c=new Set([...a].filter(a=>b.has(a)));return c.size===a.size?a:c})},[V.join("|")]);let Z=()=>{X?H(new Set):H(new Set(V))},$=()=>{H(new Set)},_=async()=>{let a,b,c;0!==W.length&&(!A||await z((a=W.length,b=W.some(a=>a.isActive),c=1===a?"1 entry":`${a} entries`,{title:1===a?"Delete entry?":"Delete entries?",message:`Permanently delete ${c}?${b?" This will stop the active timer.":""}`,confirmLabel:"Delete",variant:"danger"})))&&(v(W),$())},aa=W.length>0,ab=async a=>{if(!U)return;let b=aE(a);J(b),L(null);try{let c=a.notes.map(a=>a.text).join("\n"),d=await m({provider:O,api_key:T,context:a.description,notes:c});N(a=>({...a,[b]:d})),E(b)}catch(a){L(a instanceof Error?a.message:String(a))}finally{J(null)}};return(0,ah.use_escape_to_cancel)($,aa&&null===D),(0,b.jsxs)("section",{className:"min-w-0",children:[(0,b.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:aa?(0,b.jsx)(aw,{selected_count:W.length,total_count:c.length,all_selected:X,some_selected:Y,selected_entries:W,sheets:e,is_pending:n,on_toggle_all:Z,on_move:a=>{u(W,a),$()},on_delete:()=>void _(),on_clear:$}):(0,b.jsxs)(b.Fragment,{children:[p,(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2.5",children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[c.length>0?(0,b.jsx)(ae.Checkbox,{className:"shrink-0",checked:X,indeterminate:Y,disabled:n,aria_label:"Select all entries",on_change:Z}):null,(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em]",children:a}),(0,b.jsx)("span",{className:"text-[0.8rem] text-muted",children:0===c.length?null:1===c.length?"1 entry":`${c.length} entries`})]}),(0,b.jsxs)("p",{className:"m-0 font-mono text-[0.85rem] text-muted max-[640px]:w-full",children:[(0,s.format_duration)(g,C)," total"]})]}),(0,b.jsx)(aC,{is_pending:n}),null!==K?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:K}):null]})}),0===c.length?(0,b.jsx)("p",{className:"m-0 text-muted",children:l}):(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("ul",{className:"m-0 flex list-none flex-col p-0",children:c.map(a=>{let c=aE(a),d=D===c,g=G.has(c);return d?(0,b.jsx)("li",{className:"block border-b border-panel-border py-2.5 last:border-b-0 compact:py-1.5",children:(0,b.jsx)(av,{entry:a,known_tags:f,is_pending:n,initial_description_override:M[c],on_cancel:()=>{E(null),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})},on_save:b=>{r(a,b),E(null),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})}})},c):(0,b.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 ${g?"bg-accent-soft hover:bg-accent-soft":""}`,children:[(0,b.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,b.jsxs)("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 has-disabled:cursor-not-allowed","aria-label":`Select entry ${a.description||"Untitled entry"}`,children:[(0,b.jsx)(ae.Checkbox,{nested:!0,className:`shrink-0 pr-1 transition-opacity duration-150 compact:pr-0.5 ${g||aa?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,checked:g,disabled:n,on_change:()=>{H(a=>{let b=new Set(a);return b.has(c)?b.delete(c):b.add(c),b})}}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"m-0 overflow-wrap-anywhere font-semibold leading-snug compact:text-[0.9rem] compact:leading-tight",children:a.description||"Untitled entry"}),(0,b.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:[o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:a.sheetName}),(0,b.jsx)("span",{children:"·"})]}):null,(0,b.jsxs)("span",{children:["#",a.id]}),(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{className:"whitespace-nowrap",children:[(0,al.format_time)(a.start,B),null===a.end?" → now":` → ${(0,al.format_time)(a.end,B)}`]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,S.format_display_tag)(a)},a))}):null]})]})]}),(0,b.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,b.jsx)("p",{className:`m-0 whitespace-nowrap text-right font-mono text-[0.9rem] text-muted compact:text-[0.8rem] ${a.isActive?"text-accent":""}`,children:(0,s.format_duration)(a.durationMs,C)}),(0,b.jsx)(aj,{current_sheet_name:a.sheetName,sheets:e,is_pending:n||I===c,on_edit:()=>{E(c),N(a=>{if(!(c in a))return a;let b={...a};return delete b[c],b})},on_revise_description_ai:U?()=>void ab(a):void 0,can_revise_description_ai:U,on_add_note:b=>x(a,b),on_resume:()=>y(a),entry_is_active:a.isActive,on_move:b=>t(a,b),on_delete:async()=>{(!A||await z(aD(a)))&&q(a)}})]})]}),a.notes.length>0?(0,b.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,b.jsx)(ar,{notes:a.notes,variant:"inline",is_pending:n,on_edit_note:(b,c)=>w(a,b,c)})}):null]},c)})})})]})}let aI="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 aJ({sheet_name:a,is_pending:c,can_delete:e,on_rename:f,on_delete:g}){let[h,i]=(0,d.useState)(!1),j=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!h)return;let a=a=>{null===j.current||j.current.contains(a.target)||i(!1)};return document.addEventListener("pointerdown",a),()=>{document.removeEventListener("pointerdown",a)}},[h]);let k=()=>{i(!1)};return(0,b.jsxs)("div",{className:"relative shrink-0 self-center",ref:j,children:[(0,b.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 ${a}`,"aria-expanded":h,"aria-haspopup":"menu",disabled:c,onClick:()=>i(a=>!a),children:(0,b.jsx)(ag.HamburgerIcon,{})}),h?(0,b.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,b.jsx)("li",{role:"none",children:(0,b.jsx)("button",{type:"button",className:aI,role:"menuitem",disabled:c,onClick:()=>{k(),f()},children:"Rename"})}),(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:`${aI} text-danger`,role:"menuitem",disabled:c||!e,title:e?void 0:"Cannot delete the last sheet",onClick:()=>{k(),g()},children:"Delete sheet"})})]}):null]})}function aK({sheets:a,db_path:c,on_select:e,on_create:h,on_rename:i,on_delete:j,is_pending:k}){let{confirm:l}=(0,af.use_confirm_dialog)(),m=aG(),n=a.length>1,[o,p]=(0,d.useState)(!1),[q,r]=(0,d.useState)(""),[s,t]=(0,d.useState)(null),[u,v]=(0,d.useState)(""),w=()=>{p(!1),r("")},x=()=>{t(null),v("")};(0,ah.use_escape_to_cancel)(x,null!==s),(0,ah.use_escape_to_cancel)(w,o);let y=a=>{if(a.preventDefault(),null===s)return;let b=u.trim();0===b.length||b===s||i(s,b),x()};return(0,b.jsxs)("aside",{className:"flex min-w-0 flex-col gap-3 max-[860px]:min-w-0",children:[(0,b.jsx)("h2",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Sheets"}),(0,b.jsx)("ul",{className:"m-0 flex min-h-0 flex-1 list-none flex-col gap-1.5 p-0",children:a.map(a=>(0,b.jsx)("li",{className:"min-w-0",children:s===a.name?(0,b.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-1.5",onSubmit:y,children:[(0,b.jsx)("input",{className:(0,g.get_input_class_name)("compact"),value:u,onChange:a=>v(a.target.value),disabled:k,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("button",{type:"submit",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k||0===u.trim().length,children:"Save"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k,onClick:x,children:"Cancel"})]})]}):(0,b.jsxs)("div",{className:"flex min-w-0 items-stretch gap-1",children:[(0,b.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:k&&!a.isActive,onClick:()=>e(a.name),children:[(0,b.jsx)("span",{className:`min-w-0 flex-1 truncate font-semibold ${a.isActive||a.hasActiveEntry?"text-accent":""}`,children:a.name}),(0,b.jsx)("span",{className:`shrink-0 text-xs whitespace-nowrap ${a.hasActiveEntry?"text-accent":"text-muted"}`,children:a.hasActiveEntry?"● active":`${a.entryCount} entries`})]}),(0,b.jsx)(aJ,{sheet_name:a.name,is_pending:k,can_delete:n,on_rename:()=>{var b;t(b=a.name),v(b)},on_delete:async()=>{var b,c,d;let e;(!m||await l((b=a.name,c=a.entryCount,d=a.hasActiveEntry,e=0===c?"":` This will delete ${c} ${1===c?"entry":"entries"}.`,{title:"Delete sheet?",message:`Delete "${b}"?${e}${d?" This will stop the active timer.":""}`,confirmLabel:"Delete sheet",variant:"danger"})))&&j(a.name)}})]})},a.name))}),o?(0,b.jsxs)("form",{className:"flex w-full min-w-0 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=q.trim();0!==b.length&&(h(b),w())},children:[(0,b.jsx)("input",{className:(0,g.get_input_class_name)("compact"),value:q,onChange:a=>r(a.target.value),placeholder:"New sheet name",disabled:k,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)("button",{type:"submit",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k||0===q.trim().length,children:"Add"}),(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} flex-1`,disabled:k,onClick:w,children:"Cancel"})]})]}):(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:k,onClick:()=>p(!0),children:"Add sheet"}),(0,b.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:c,children:c})]})}var aL=a.i(99751);function aM(){return"true"===(0,d.useSyncExternalStore)(aL.timer_show_seconds_preference.subscribe,aL.timer_show_seconds_preference.get_snapshot,aL.timer_show_seconds_preference.get_server_snapshot)}function aN({entry:a,in_bar:c,is_pending:e,initial_at:h,on_cancel:i,on_submit:j}){let k=(0,F.use_duration_format)(),l=aM(),[m,n]=(0,d.useState)(()=>Date.now()-new Date(a.start).getTime()),[o,p]=(0,d.useState)(""),[q,r]=(0,d.useState)(h??""),t=(0,d.useRef)(null);(0,ah.use_escape_to_cancel)(i),(0,d.useEffect)(()=>{t.current?.focus()},[]),(0,d.useEffect)(()=>{n(Date.now()-new Date(a.start).getTime());let b=window.setInterval(()=>{n(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.start]);let u=(0,s.format_duration)(m,k,l),v=a.description||"Untitled entry";return(0,b.jsxs)("form",{className:"flex min-w-0 flex-col gap-4","aria-label":"Check out form",onSubmit:a=>{a.preventDefault();let b=o.trim(),c=q.trim(),d=b.length>0,e=c.length>0;d||e?j({...e?{at:c}:{},...d?{note:b}:{}}):j(void 0)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[0.68rem] font-bold uppercase leading-none tracking-wider text-danger",children:"Checking out"}),(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.05rem] font-[650] leading-tight tracking-tight min-[560px]:text-[1.15rem]",children:v})]}),(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.4rem] font-medium leading-none tracking-tight text-accent min-[560px]:text-[1.6rem]",children:u})]}),a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-[0.72rem] text-tag-text",children:(0,S.format_display_tag)(a)},a))}):null,(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-3 min-[640px]:grid-cols-[minmax(0,1fr)_minmax(10rem,14rem)]",children:[(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-note",children:[(0,b.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["Note ",(0,b.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,b.jsx)("input",{ref:t,id:"checkout-note",className:(0,g.get_input_class_name)("compact"),value:o,onChange:a=>p(a.target.value),placeholder:"Wrap-up, blockers, next steps…",disabled:e})]}),(0,b.jsxs)("label",{className:"flex min-w-0 flex-col gap-1",htmlFor:"checkout-at",children:[(0,b.jsxs)("span",{className:"text-[0.8rem] font-semibold",children:["End time ",(0,b.jsx)("span",{className:"font-normal text-muted",children:"(optional)"})]}),(0,b.jsx)("input",{id:"checkout-at",className:(0,g.get_input_class_name)("compact"),value:q,onChange:a=>r(a.target.value),placeholder:"e.g. now, 30 minutes ago, 5:30pm",disabled:e})]})]}),(0,b.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${c?"":"pt-1"}`,children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("danger-solid"),disabled:e,children:"Confirm check out"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:e,onClick:i,children:"Cancel"})]})]})}function aO(){return(0,b.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",role:"presentation","aria-hidden":"true",focusable:"false",children:(0,b.jsx)("path",{d:"M12 3l1.7 4.3L18 9l-4.3 1.7L12 15l-1.7-4.3L6 9l4.3-1.7L12 3zM19 14l.9 2.1L22 17l-2.1.9L19 20l-.9-2.1L16 17l2.1-.9L19 14zM5 15l.9 2.1L8 18l-2.1.9L5 21l-.9-2.1L2 18l2.1-.9L5 15z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function aP({entry:a,known_tags:c,is_pending:g,on_save:l,on_cancel:n}){let o=(0,d.useMemo)(()=>(0,au.build_resume_description)(a.description,a.tags),[a.description,a.id,a.tags]),[p,q]=(0,d.useState)(o),[r,s]=(0,d.useState)(!1),[t,u]=(0,d.useState)(null),v=(0,d.useSyncExternalStore)(i.entry_suggestion_provider_preference.subscribe,i.entry_suggestion_provider_preference.get_snapshot,i.entry_suggestion_provider_preference.get_server_snapshot),w=(0,d.useSyncExternalStore)(k.openai_api_key_preference.subscribe,k.openai_api_key_preference.get_snapshot,k.openai_api_key_preference.get_server_snapshot),x=(0,d.useSyncExternalStore)(h.claude_api_key_preference.subscribe,h.claude_api_key_preference.get_snapshot,h.claude_api_key_preference.get_server_snapshot),y=(0,d.useSyncExternalStore)(j.google_ai_api_key_preference.subscribe,j.google_ai_api_key_preference.get_snapshot,j.google_ai_api_key_preference.get_server_snapshot),z="openai"===v?w:"claude"===v?x:"google_ai"===v?y:"",A="none"!==v&&z.trim().length>0;(0,d.useEffect)(()=>{q((0,au.build_resume_description)(a.description,a.tags))},[a.description,a.id,a.sheetName,a.tags]),(0,ah.use_escape_to_cancel)(n);let B=async()=>{if(A){s(!0),u(null);try{let b=a.notes.map(a=>a.text).join("\n"),c=await m({provider:v,api_key:z,context:p,notes:b});q(c)}catch(a){u(a instanceof Error?a.message:String(a))}finally{s(!1)}}};return(0,b.jsxs)("form",{className:"flex min-w-0 flex-1 flex-col gap-2",onSubmit:a=>{a.preventDefault();let b=p.trim();b===o.trim()?n():l(b)},children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-start gap-2 max-[700px]:flex-col",children:[(0,b.jsx)("div",{className:"min-w-0 flex-1",children:(0,b.jsx)(e.TagAutocompleteInput,{id:`active-entry-description-${a.id}`,value:p,known_tags:c,placeholder:"e.g. crafting something @design",disabled:g,autoFocus:!0,on_change:q})}),(0,b.jsxs)("div",{className:"flex shrink-0 flex-wrap gap-2 max-[700px]:w-full",children:[A?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:g||r,title:"Revise description with AI","aria-label":"Revise description with AI",onClick:()=>void B(),children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,b.jsx)(aO,{}),r?"Revising…":"Revise with AI"]})}):null,(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("primary","small"),disabled:g||p.trim()===o.trim(),children:"Save"}),(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost","small"),disabled:g,onClick:n,children:"Cancel"})]})]}),null!==t?(0,b.jsx)("p",{className:"m-0 text-[0.8rem] text-danger",children:t}):null]})}var aQ=a.i(61566);let aR=`${(0,f.get_button_class_name)("danger-solid")} rounded-none first:rounded-l-[0.65rem] last:rounded-r-[0.65rem] not-first:-ml-px not-first:min-w-12 not-first:border-l not-first:border-l-[color-mix(in_srgb,#ffffff_30%,var(--danger-solid))] min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1 max-[560px]:basis-1/2`;function aS({in_bar:a=!1,is_pending:c,on_start_checkout:d}){return(0,b.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${a?"max-[560px]:w-full":"min-w-30 max-[560px]:w-full"}`,children:[(0,b.jsx)("button",{type:"button",className:aR,disabled:c,onClick:()=>d(),children:"Check out"}),(0,b.jsx)("button",{type:"button",className:aR,disabled:c,title:"Check out at a specific time",onClick:()=>{let a=(0,aQ.prompt_check_out_at)();null!==a&&d(a)},children:"@"})]})}function aT({on_submit:a,on_cancel:c,is_pending:e,in_active_panel:h=!1,in_bar:i=!1,allow_at:j=!1}){let[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)("");return(0,ah.use_escape_to_cancel)(()=>c?.(),void 0!==c),(0,b.jsxs)("form",{className:`flex flex-col gap-2 ${h&&!i?"border-t border-accent-border pt-4":i?"border-t border-[color-mix(in_srgb,var(--accent-border)_65%,var(--panel-border))] pt-3.5":""}`,onSubmit:b=>{b.preventDefault();let c=k.trim();if(0===c.length)return;let d=m.trim();a(c,d.length>0?d:void 0),l(""),n("")},children:[(0,b.jsx)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-text",children:"Add note"}),(0,b.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2 max-[860px]:grid-cols-1",children:[(0,b.jsx)("input",{id:"note-text",className:(0,g.get_input_class_name)(),value:k,onChange:a=>l(a.target.value),placeholder:"Pair with alice on the widget",disabled:e,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 max-[860px]:w-full",children:[(0,b.jsx)("button",{type:"submit",className:(0,f.get_button_class_name)("ghost"),disabled:e||0===k.trim().length,children:"Save note"}),void 0!==c?(0,b.jsx)("button",{type:"button",className:(0,f.get_button_class_name)("ghost"),disabled:e,onClick:c,children:"Cancel"}):null]})]}),j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"text-[0.85rem] text-muted",htmlFor:"note-at",children:["Note time"," ",(0,b.jsx)("span",{className:"font-normal opacity-85",children:"(optional, natural language)"})]}),(0,b.jsx)("input",{id:"note-at",className:(0,g.get_input_class_name)(),value:m,onChange:a=>n(a.target.value),placeholder:"e.g. 30 minutes ago",disabled:e})]}):null]})}var aU=a.i(38842),aV=a.i(77328);let aW=(0,d.forwardRef)(function({entry:a,sheets:c,known_tags:e,in_bar:g=!1,on_check_out:h,on_delete:i,on_edit:j,on_move:k,on_add_note:l,on_edit_note:m,on_delete_note:n,is_pending:o},p){var q;let r,{confirm:t}=(0,af.use_confirm_dialog)(),u=aG(),v=(0,aU.use_confirm_before_checkout)(),w=(0,F.use_duration_format)(),x=aM(),[y,z]=(0,d.useState)(a.durationMs),[A,B]=(0,d.useState)(!1),[C,D]=(0,d.useState)(!1),[E,G]=(0,d.useState)(!1),[H,I]=(0,d.useState)(!1),[J,K]=(0,d.useState)(void 0);(0,d.useImperativeHandle)(p,()=>({start_edit:()=>{A||C||H||B(!0)},start_add_note:()=>{A||C||E||H||G(!0)}}),[E,A,C,H]),(0,d.useEffect)(()=>{G(!1),B(!1),D(!1),I(!1),K(void 0)},[a.id,a.sheetName]),(0,d.useEffect)(()=>{z(a.durationMs);let b=window.setInterval(()=>{z(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a.durationMs,a.start]);let L=()=>{I(!1),K(void 0)},M=async a=>{(!v||await t((0,aV.get_check_out_confirm_dialog)(a)))&&(h(a),L())},N=(q=A||C||H,r="flex flex-col gap-4 rounded-lg border border-accent-border p-[1.1rem] shadow-sm",g?q?`${r} rounded-md border border-accent-border bg-[color-mix(in_srgb,var(--panel)_70%,var(--background))] p-3.5`:"flex flex-col gap-3 border-0 bg-transparent p-0 shadow-none":`${r} bg-[image:var(--active-panel-bg)]`),O=async b=>{let c,d,e=a.notes.find(a=>a.timestamp===b);(!u||await t({title:"Delete note?",message:(d=(c=(e?.text??"").trim()).length>80?`${c.slice(0,80)}…`:c).length>0?`Remove this note? "${d}"`:"Remove this note?",confirmLabel:"Delete",variant:"danger"}))&&n(b)},P=(0,b.jsx)(aj,{current_sheet_name:a.sheetName,sheets:c,is_pending:o,on_edit:()=>D(!0),on_show_add_note_form:()=>G(!0),on_move:k,on_delete:async()=>{(!u||await t(aD(a)))&&i()}});return H?(0,b.jsx)("section",{className:N,"aria-label":"Check out active entry",children:(0,b.jsx)(aN,{entry:a,in_bar:g,is_pending:o,initial_at:J,on_cancel:L,on_submit:a=>{M(a)}})}):C?(0,b.jsx)("section",{className:N,children:(0,b.jsx)(av,{entry:a,known_tags:e,is_pending:o,in_active_panel:!0,times_only:!0,start_only:!0,on_cancel:()=>D(!1),on_save:a=>{j(a),D(!1)}})}):(0,b.jsxs)("section",{className:N,children:[(0,b.jsxs)("div",{className:"flex min-w-0 shrink-0 items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[g?null:(0,b.jsx)("span",{className:"self-start rounded-full bg-accent px-2 py-0.5 text-[0.68rem] font-bold uppercase leading-none tracking-wider text-accent-text-on",children:"Tracking"}),A?(0,b.jsx)(aP,{entry:a,known_tags:e,is_pending:o,on_cancel:()=>B(!1),on_save:a=>{j({description:a}),B(!1)}}):(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,b.jsx)("h2",{className:"m-0 min-w-0 truncate text-[1.12rem] font-[650] leading-tight tracking-tight min-[560px]:text-xl",children:a.description||"Untitled entry"}),(0,b.jsx)("button",{type:"button",className:"inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[0.35rem] border-0 bg-transparent p-0 text-muted hover:bg-surface-hover hover:text-foreground disabled:cursor-not-allowed disabled:opacity-55","aria-label":"Edit description",title:"Edit description",disabled:o||E,onClick:()=>B(!0),children:(0,b.jsx)(an,{})})]})]}),g?null:(0,b.jsx)("div",{className:"max-[560px]:self-end",children:P})]}),(0,b.jsxs)("div",{className:`flex shrink-0 items-end justify-between gap-4 max-[860px]:flex-col max-[860px]:items-stretch ${g?"px-3":""}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsx)("p",{className:"m-0 whitespace-nowrap font-mono text-[1.65rem] font-medium leading-none tracking-tight text-accent min-[440px]:text-[1.85rem] min-[560px]:text-[2rem]",children:(0,s.format_duration)(y,w,x)}),!A&&a.tags.length>0?(0,b.jsx)("ul",{className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:a.tags.map(a=>(0,b.jsx)("li",{className:"rounded-full bg-tag-bg px-2 py-0.5 text-xs text-tag-text",children:(0,S.format_display_tag)(a)},a))}):null]}),(0,b.jsxs)("div",{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2 max-[560px]:flex-col max-[560px]:items-stretch ${g?"w-full":"min-w-30 max-[860px]:w-full max-[860px]:justify-stretch"}`,children:[E?null:(0,b.jsx)("button",{type:"button",className:`${(0,f.get_button_class_name)("ghost")} min-w-0 min-[561px]:px-2.5 min-[561px]:py-2 min-[561px]:text-[0.9rem] max-[560px]:flex-1`,disabled:o||A,onClick:()=>G(!0),children:"Add note"}),(0,b.jsx)(aS,{in_bar:g,is_pending:o,on_start_checkout:a=>{o||(B(!1),D(!1),G(!1),K(a),I(!0))}})]})]}),(0,b.jsx)(ar,{notes:a.notes,variant:"panel",in_bar:g,is_pending:o,on_edit_note:m,on_delete_note:O}),E?(0,b.jsx)("div",{className:"shrink-0",children:(0,b.jsx)(aT,{in_active_panel:!0,in_bar:g,allow_at:!0,is_pending:o,on_cancel:()=>G(!1),on_submit:(a,b)=>{l(a,b),G(!1)}})}):null]})});var aX=a.i(18734);let aY=(0,d.forwardRef)(function({active_entry:a,sheets:c,known_tags:e,is_pending:f,on_check_out:g,on_delete:h,on_edit:i,on_move:j,on_add_note:k,on_edit_note:l,on_delete_note:m},n){let{confirm:o}=(0,af.use_confirm_dialog)(),p=aG(),q=(0,d.useRef)(null);return((0,d.useImperativeHandle)(n,()=>({start_edit:()=>{q.current?.start_edit()},start_add_note:()=>{q.current?.start_add_note()}})),null===a)?null:(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-[0.72rem] font-semibold uppercase tracking-[0.04em] text-muted whitespace-nowrap truncate",children:["Sheet ",a.sheetName]}),(0,b.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,aX.is_pomodoro_task_entry)(a)?(0,b.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,b.jsx)("div",{className:"ml-auto",children:(0,b.jsx)(aj,{current_sheet_name:a.sheetName,sheets:c,is_pending:f,on_edit:()=>q.current?.start_edit(),on_show_add_note_form:()=>q.current?.start_add_note(),on_move:j,on_delete:async()=>{(!p||await o(aD(a)))&&h()}})})]}),(0,b.jsx)(aW,{ref:q,entry:a,sheets:c,known_tags:e,in_bar:!0,is_pending:f,on_check_out:g,on_delete:h,on_edit:i,on_move:j,on_add_note:k,on_edit_note:l,on_delete_note:m},`${a.sheetName}-${a.id}`)]})});var aZ=a.i(6128);let a$="super-time-tracker";function a_({active_entry:a}){let b="true"===(0,d.useSyncExternalStore)(aZ.timer_in_title_preference.subscribe,aZ.timer_in_title_preference.get_snapshot,aZ.timer_in_title_preference.get_server_snapshot),c=(0,F.use_duration_format)(),e=aM(),[f,g]=(0,d.useState)(a?.durationMs??0);return(0,d.useEffect)(()=>{if(null===a)return void g(0);g(a.durationMs);let b=window.setInterval(()=>{g(Date.now()-new Date(a.start).getTime())},1e3);return()=>window.clearInterval(b)},[a]),(0,d.useEffect)(()=>{if(!b||null===a){document.title=a$;return}let d=a.description.trim()||"Tracking",g=(0,s.format_duration)(f,c,e);return document.title=`${g} — ${d}`,()=>{document.title=a$}},[a,c,f,e,b]),null}var a0=a.i(98790),a1=a.i(68070),a2=a.i(68225);function a3(a){return`${a.sheetName}:${a.id}`}var a4=a.i(84365),a5=a.i(78537),a6=a.i(97063);async function a7(a,b){let c=await fetch(a,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)});if(!c.ok)throw Error((await c.json()).error??"Request failed");return await c.json()}var a8=a.i(57377),a9=a.i(115);function ba(a){}var bb=a.i(35822),bc=a.i(77963);a.s(["TrackerApp",0,function({initial_state:a}){let[e,g]=(0,d.useState)(a),[h,i]=(0,d.useState)(null),[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(a);(0,d.useEffect)(()=>{ba(a)},[a]);let o=async a=>{k(!0),i(null);try{let b=await a(),c=null!==e.activeEntry&&null===b.activeEntry,d=e.runningEntry,f=b.runningEntry;if(ba(b),g(b),c&&(0,a2.finish_running_pomodoro_timer)(),!t)return;if(null===d&&null!==f)return void(0,a5.notify_desktop)({title:"Tracking started",body:`${f.description||"Untitled entry"} (${f.sheetName})`,tag:"tracker-running-entry"});if(null!==d&&null===f)return void(0,a5.notify_desktop)({title:"Tracking stopped",body:`${d.description||"Untitled entry"} (${d.sheetName})`,tag:"tracker-running-entry"});null!==d&&null!==f&&a3(d)!==a3(f)&&(0,a5.notify_desktop)({title:"Tracking switched",body:`${f.description||"Untitled entry"} (${f.sheetName})`,tag:"tracker-running-entry"})}catch(a){i(a instanceof Error?a.message:String(a))}finally{k(!1)}},p=e.activeSheetName??e.sheets.find(a=>a.isActive)?.name??"main",r=ac(),s=aA(),t="true"===(0,d.useSyncExternalStore)(bc.desktop_notifications_preference.subscribe,bc.desktop_notifications_preference.get_snapshot,bc.desktop_notifications_preference.get_server_snapshot),u="true"===(0,d.useSyncExternalStore)(bb.clear_tag_filters_on_sheet_change_preference.subscribe,bb.clear_tag_filters_on_sheet_change_preference.get_snapshot,bb.clear_tag_filters_on_sheet_change_preference.get_server_snapshot),v=(0,d.useRef)(null),w=(0,d.useRef)(null),x=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!u||null===v.current||v.current===p){v.current=p;return}_(p,[]),v.current=p},[p,u]);let y=(0,d.useSyncExternalStore)(Y.subscribe_sheet_tag_filters,()=>W(p),X),z=(0,d.useMemo)(()=>(function(a){let b=new Map;for(let c of a){let a=new Set;for(let d of c.tags)try{let c=(0,T.normalize_stored_tag)(d);if(a.has(c))continue;a.add(c),b.set(c,(b.get(c)??0)+1)}catch{continue}}return[...b.entries()].map(([a,b])=>({name:a,entryCount:b})).sort((a,b)=>a.name.localeCompare(b.name))})(e.activeSheetEntries),[e.activeSheetEntries]),A=(0,d.useMemo)(()=>{if(l)return[];let a=[...function(a,b,c="all"){return 0===b.length?a:a.filter(a=>(function(a,b,c="all"){return 0===b.length||("any"===c?b.some(b=>a.tags.some(a=>aa(a,b))):b.every(b=>a.tags.some(a=>aa(a,b))))})(a,b,c))}(e.activeSheetEntries,y,r)];switch(s){case"oldest":return a.sort((a,b)=>new Date(a.start).getTime()-new Date(b.start).getTime());case"duration":return a.sort((a,b)=>b.durationMs-a.durationMs);case"description":return a.sort((a,b)=>{let c=a.description.trim()||"Untitled entry",d=b.description.trim()||"Untitled entry";return c.localeCompare(d)});default:return a.sort((a,b)=>new Date(b.start).getTime()-new Date(a.start).getTime())}},[e.activeSheetEntries,y,r,s,l]),B=(0,d.useMemo)(()=>(0,a4.get_serialized_entries_total_ms)(A),[A]);(0,d.useEffect)(()=>(0,a6.subscribe_tracker_state_sync)(()=>{j||l||fetch("/api/state").then(async a=>{if(!a.ok)throw Error("Failed to refresh tracker state");return await a.json()}).then(a=>{ba(a),g(b=>(null===b.activeEntry?null:`${b.activeEntry.sheetName}:${b.activeEntry.id}`)===(null===a.activeEntry?null:`${a.activeEntry.sheetName}:${a.activeEntry.id}`)?b:a)}).catch(()=>{})}),[j,l]);let C=l?`Loading entries for "${p}"…`:y.length>0?"any"===r?`No entries on sheet "${p}" match any selected tag.`:`No entries on sheet "${p}" match all selected tags.`:`No entries on sheet "${p}".`,D=a=>{let b;if(a===p&&!l)return;n.current=e;let c=(b=e.runningEntries.find(b=>b.sheetName===a)??null,{...e,activeSheetName:a,sheets:e.sheets.map(b=>({...b,isActive:b.name===a})),activeEntry:b,activeSheetEntries:e.activeSheetEntries,activeSheetTotalMs:e.activeSheetTotalMs});ba(c),g(c),m(!0),i(null),(0,a9.post_tracker_action)("/api/sheet",{name:a}).then(a=>{ba(a),g(a)}).catch(a=>{i(a instanceof Error?a.message:String(a)),g(n.current)}).finally(()=>{m(!1)})},E=(a,b,c)=>(0,a8.patch_tracker_action)("/api/entry",{sheetName:a,entryId:b,...c});return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a_,{active_entry:e.activeEntry}),(0,b.jsx)(R,{sheets:e.sheets,active_sheet_name:p,active_entry:e.activeEntry,is_pending:j,check_in_form_ref:w,active_entry_panel_ref:x,on_select_sheet:D,on_check_out:a=>o(()=>(0,a9.post_tracker_action)("/api/out",(0,a1.build_check_out_request_payload)(p,a)))}),(0,b.jsx)("div",{className:"relative z-1",children:(0,b.jsx)(a0.TrackerTopbar,{})}),(0,b.jsxs)("div",{className:"mx-auto max-w-[1120px] px-4 pb-10 pt-4 sm:px-5 sm:pt-5",children:[null!==h?(0,b.jsx)("p",{className:"mb-4 border border-danger-border bg-danger-soft px-3 py-2.5 text-danger-text",children:h}):null,(0,b.jsx)(G,{has_running_timer:null!==e.runningEntry,on_check_in_shortcut:()=>{w.current?.expand_and_focus()}}),(0,b.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,b.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,b.jsx)(aK,{sheets:e.sheets,db_path:e.dbPath,is_pending:j,on_select:D,on_create:a=>o(()=>(0,a9.post_tracker_action)("/api/sheet",{name:a})),on_rename:(a,b)=>o(()=>(0,a8.patch_tracker_action)("/api/sheet",{name:a,newName:b})),on_delete:a=>o(()=>(0,a9.post_tracker_action)("/api/sheet",{name:a,delete:!0}))})}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,b.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===e.activeEntry?(0,b.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,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("p",{className:"m-0 text-[0.72rem] font-semibold uppercase tracking-[0.06em] text-muted",children:"Quick action"}),(0,b.jsx)("p",{className:"m-0 mt-1 text-[0.9rem] font-medium",children:"Jump into Pomodoro without leaving the tracker."})]}),(0,b.jsxs)(c.default,{href:"/pomodoro",className:`${(0,f.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,b.jsx)("span",{className:"text-white text-[0.9rem] leading-none",children:"Start Pomodoro"}),(0,b.jsx)("span",{className:"text-white mt-1 text-[0.72rem] font-medium leading-none opacity-85",children:"Focus timer"})]})]}):null,(0,b.jsx)(aY,{ref:x,active_entry:e.activeEntry,sheets:e.sheets,known_tags:e.knownTags,is_pending:j,on_check_out:a=>o(()=>(0,a9.post_tracker_action)("/api/out",(0,a1.build_check_out_request_payload)(p,a))),on_delete:()=>o(()=>(0,a9.post_tracker_action)("/api/entry",{sheetName:p,entryId:e.activeEntry?.id})),on_edit:a=>o(()=>E(p,e.activeEntry?.id??0,a)),on_move:a=>o(()=>(0,a9.post_tracker_action)("/api/entry/move",{sheetName:p,entryId:e.activeEntry?.id,targetSheetName:a})),on_add_note:(a,b)=>o(()=>(0,a9.post_tracker_action)("/api/note",{text:a,...void 0!==b?{at:b}:{},sheetName:p,entryId:e.activeEntry?.id})),on_edit_note:(a,b)=>o(()=>(0,a8.patch_tracker_action)("/api/note",{sheetName:p,entryId:e.activeEntry?.id,timestamp:a,text:b})),on_delete_note:a=>o(()=>a7("/api/note",{sheetName:p,entryId:e.activeEntry?.id,timestamp:a}))}),null===e.activeEntry?(0,b.jsx)(q,{ref:w,known_tags:e.knownTags,is_pending:j,trailing:(0,b.jsx)("p",{className:"m-0 text-[0.85rem] leading-tight text-muted",children:"Not tracking"}),on_submit:a=>o(()=>(0,a9.post_tracker_action)("/api/in",{...a,sheetName:p}))}):null]}),(0,b.jsx)("section",{className:"flex min-w-0 flex-col gap-4 p-4",children:(0,b.jsx)(aH,{title:"Entries",entries:A,sheets:e.sheets,known_tags:e.knownTags,total_ms:B,empty_message:C,is_pending:j,show_sheet_name:!1,header_extra:(0,b.jsx)(ad,{sheet_name:p,sheet_tags:z}),on_delete:a=>o(()=>(0,a9.post_tracker_action)("/api/entry",{sheetName:a.sheetName,entryId:a.id})),on_edit:(a,b)=>o(()=>E(a.sheetName,a.id,b)),on_move:(a,b)=>o(()=>(0,a9.post_tracker_action)("/api/entry/move",{sheetName:a.sheetName,entryId:a.id,targetSheetName:b})),on_move_many:(a,b)=>o(()=>(0,a9.post_tracker_action)("/api/entry/move-bulk",{entries:a.map(a=>({sheetName:a.sheetName,entryId:a.id})),targetSheetName:b})),on_delete_many:a=>o(()=>(0,a9.post_tracker_action)("/api/entry/delete-bulk",{entries:a.map(a=>({sheetName:a.sheetName,entryId:a.id}))})),on_edit_note:(a,b,c)=>o(()=>(0,a8.patch_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,timestamp:b,text:c})),on_add_note:(a,b)=>o(()=>(0,a9.post_tracker_action)("/api/note",{sheetName:a.sheetName,entryId:a.id,text:b})),on_resume:a=>o(()=>(0,a9.post_tracker_action)("/api/in",{description:(0,au.build_resume_description)(a.description,a.tags),sheetName:a.sheetName}))})})]})]})]})]})}],12584)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=components_tracker-app_tsx_0qs9.7y._.js.map
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/03~yq9q893hmn.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/gS32e4Tv_70ot1IWBJddE/_buildManifest.js",
|
|
11
|
+
"static/gS32e4Tv_70ot1IWBJddE/_ssgManifest.js",
|
|
12
|
+
"static/gS32e4Tv_70ot1IWBJddE/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/0zx~44x9cv897.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"wasm": [],
|
|
20
20
|
"assets": [],
|
|
21
21
|
"env": {
|
|
22
|
-
"__NEXT_BUILD_ID": "
|
|
22
|
+
"__NEXT_BUILD_ID": "gS32e4Tv_70ot1IWBJddE",
|
|
23
23
|
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "ZCfjWQ1j+/I4J6mmJUTCdkubaVm/wt/fMfxL0iW8R8U=",
|
|
24
24
|
"__NEXT_PREVIEW_MODE_ID": "29d30992fa321255a736fc76b01cc746",
|
|
25
25
|
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "ef32282c22c87bee7352728993998d51dd159b60ec937b820c18a87ac9647a97",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__NEXT_FONT_MANIFEST="{\n \"app\": {\n \"[project]/app/_not-found/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/login/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/offline/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/pomodoro/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/register/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/reporting/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/ai-suggestions/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/cloud-sync/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/data/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/display/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/goals/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/notifications/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/pomodoro/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/tags/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/sheets/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/today/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ]\n },\n \"appUsingSizeAdjust\": true,\n \"pages\": {},\n \"pagesUsingSizeAdjust\": false\n}"
|
|
1
|
+
self.__NEXT_FONT_MANIFEST="{\n \"app\": {\n \"[project]/app/_not-found/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/login/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/offline/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/pomodoro/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/register/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/reporting/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/ai-suggestions/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/cloud-sync/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/data/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/display/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/goals/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/notifications/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/pomodoro/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/quick-actions/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/settings/tags/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/sheets/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ],\n \"[project]/app/today/page\": [\n \"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2\",\n \"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2\"\n ]\n },\n \"appUsingSizeAdjust\": true,\n \"pages\": {},\n \"pagesUsingSizeAdjust\": false\n}"
|
|
@@ -60,6 +60,10 @@
|
|
|
60
60
|
"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2",
|
|
61
61
|
"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2"
|
|
62
62
|
],
|
|
63
|
+
"[project]/app/settings/quick-actions/page": [
|
|
64
|
+
"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2",
|
|
65
|
+
"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2"
|
|
66
|
+
],
|
|
63
67
|
"[project]/app/settings/tags/page": [
|
|
64
68
|
"static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2",
|
|
65
69
|
"static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0zx~44x9cv897.js"/><script src="/_next/static/chunks/0ztw.xdr4egi9.js" async=""></script><script src="/_next/static/chunks/0l~uil8w-ewlm.js" async=""></script><script src="/_next/static/chunks/04_2jzw-uhhu0.js" async=""></script><script src="/_next/static/chunks/turbopack-09e2mm19twlrw.js" async=""></script><script src="/_next/static/chunks/1513ibnpmlx36.js" async=""></script><script src="/_next/static/chunks/0lgo02csmvyps.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0zx~44x9cv897.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[5233,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\"]\n3:I[73632,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\"]\n4:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"ViewportBoundary\"]\na:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"MetadataBoundary\"]\nc:I[51709,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/0zx~44x9cv897.js"/><script src="/_next/static/chunks/0ztw.xdr4egi9.js" async=""></script><script src="/_next/static/chunks/0l~uil8w-ewlm.js" async=""></script><script src="/_next/static/chunks/04_2jzw-uhhu0.js" async=""></script><script src="/_next/static/chunks/turbopack-09e2mm19twlrw.js" async=""></script><script src="/_next/static/chunks/1513ibnpmlx36.js" async=""></script><script src="/_next/static/chunks/0lgo02csmvyps.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="icon" href="/favicon.ico?favicon.0x3dzn~oxb6tn.ico" sizes="256x256" type="image/x-icon"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/03~yq9q893hmn.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/0zx~44x9cv897.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[5233,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\"]\n3:I[73632,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\"]\n4:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"ViewportBoundary\"]\na:I[83775,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"MetadataBoundary\"]\nc:I[51709,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"gS32e4Tv_70ot1IWBJddE\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[31415,[\"/_next/static/chunks/1513ibnpmlx36.js\",\"/_next/static/chunks/0lgo02csmvyps.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.0x3dzn~oxb6tn.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"1\",{}]]\n"])</script></body></html>
|