@burdenoff/microfe-timecampus 2026.1031.12 → 2026.1031.13
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.
|
@@ -22,7 +22,7 @@ export declare function localDayBounds(key: string): {
|
|
|
22
22
|
export declare function dayHeading(key: string, now?: Date): string;
|
|
23
23
|
/** Long form of the day for the sub-heading ("Wednesday, October 25"). */
|
|
24
24
|
export declare function longDayLabel(key: string): string;
|
|
25
|
-
/** Compact "1h 30m" / "45m" / "0m" from seconds (never shows seconds). */
|
|
25
|
+
/** Compact "1h 30m" / "45m" / "<1m" / "0m" from seconds (never shows seconds). */
|
|
26
26
|
export declare function compactDuration(seconds: number): string;
|
|
27
27
|
/** "MM:SS" countdown; hours roll into the minutes ("90:00"). */
|
|
28
28
|
export declare function formatCountdown(seconds: number): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobileModel.d.ts","sourceRoot":"","sources":["../../../../src/timecampus/pages/mobile/mobileModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAKjD;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAc7E;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAED,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAaxE;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG,MAAM,CAWtE;AAED,0EAA0E;AAC1E,wB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C9B,IAAI,EAAE,SAAS,SAAS,EAAE,GACzB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWnD"}
|
|
@@ -40,7 +40,9 @@ function a(e) {
|
|
|
40
40
|
}) : e;
|
|
41
41
|
}
|
|
42
42
|
function o(e) {
|
|
43
|
-
let t = Math.max(0, Math.round(e))
|
|
43
|
+
let t = Math.max(0, Math.round(e));
|
|
44
|
+
if (t > 0 && t < 60) return "<1m";
|
|
45
|
+
let n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60);
|
|
44
46
|
return n === 0 ? `${r}m` : r === 0 ? `${n}h` : `${n}h ${r}m`;
|
|
45
47
|
}
|
|
46
48
|
function s(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobileModel.js","names":[],"sources":["../../../../src/timecampus/pages/mobile/mobileModel.ts"],"sourcesContent":["/**\n * Pure view-model helpers for the phone-optimised TimeCampus screens\n * (`/mobile/timer`, `/mobile/timeline`, `/mobile/life-balance`).\n *\n * Everything here is derived from data the backend already returns — nothing\n * is invented. When there is not enough data to say something honestly (no\n * targets declared, nothing tracked yet) the helpers return `null` and the\n * screen says so instead of showing a made-up number.\n */\n\n// ---------------------------------------------------------------------------\n// Dates\n// ---------------------------------------------------------------------------\n\n/** `YYYY-MM-DD` for a Date in the viewer's local time zone. */\nexport function toLocalDateKey(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return `${y}-${m}-${d}`;\n}\n\n/** Parses a `YYYY-MM-DD` key as local midnight; `null` when it is not a real date. */\nexport function parseLocalDateKey(key: string | null | undefined): Date | null {\n if (!key) return null;\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(key);\n if (!match) return null;\n const [, y, m, d] = match;\n const date = new Date(Number(y), Number(m) - 1, Number(d));\n if (\n date.getFullYear() !== Number(y) ||\n date.getMonth() !== Number(m) - 1 ||\n date.getDate() !== Number(d)\n ) {\n return null;\n }\n return date;\n}\n\n/** Moves a `YYYY-MM-DD` key by whole days (DST-safe: calendar arithmetic). */\nexport function shiftDateKey(key: string, days: number): string {\n const base = parseLocalDateKey(key) ?? new Date();\n const next = new Date(\n base.getFullYear(),\n base.getMonth(),\n base.getDate() + days,\n );\n return toLocalDateKey(next);\n}\n\n/** ISO bounds of one local calendar day. */\nexport function localDayBounds(key: string): { from: string; to: string } {\n const day = parseLocalDateKey(key) ?? new Date();\n const start = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n const end = new Date(\n day.getFullYear(),\n day.getMonth(),\n day.getDate(),\n 23,\n 59,\n 59,\n 999,\n );\n return { from: start.toISOString(), to: end.toISOString() };\n}\n\n/** \"Today\", \"Yesterday\", or a short weekday + date (\"Wed, Oct 25\"). */\nexport function dayHeading(key: string, now: Date = new Date()): string {\n const today = toLocalDateKey(now);\n if (key === today) return \"Today\";\n if (key === shiftDateKey(today, -1)) return \"Yesterday\";\n const date = parseLocalDateKey(key);\n if (!date) return key;\n return date.toLocaleDateString(\"en-US\", {\n weekday: \"short\",\n month: \"short\",\n day: \"numeric\",\n });\n}\n\n/** Long form of the day for the sub-heading (\"Wednesday, October 25\"). */\nexport function longDayLabel(key: string): string {\n const date = parseLocalDateKey(key);\n if (!date) return key;\n return date.toLocaleDateString(\"en-US\", {\n weekday: \"long\",\n month: \"long\",\n day: \"numeric\",\n });\n}\n\n// ---------------------------------------------------------------------------\n// Durations\n// ---------------------------------------------------------------------------\n\n/** Compact \"1h 30m\" / \"45m\" / \"0m\" from seconds (never shows seconds). */\nexport function compactDuration(seconds: number): string {\n const total = Math.max(0, Math.round(seconds));\n const h = Math.floor(total / 3600);\n const m = Math.floor((total % 3600) / 60);\n if (h === 0) return `${m}m`;\n if (m === 0) return `${h}h`;\n return `${h}h ${m}m`;\n}\n\n/** \"MM:SS\" countdown; hours roll into the minutes (\"90:00\"). */\nexport function formatCountdown(seconds: number): string {\n const total = Math.max(0, Math.floor(seconds));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${String(m).padStart(2, \"0\")}:${String(s).padStart(2, \"0\")}`;\n}\n\n// ---------------------------------------------------------------------------\n// Timer (pomodoro-backed focus session)\n// ---------------------------------------------------------------------------\n\nexport interface SessionClock {\n startTime: string;\n /** Planned length in seconds; falls back to the mode default when absent. */\n duration?: number | null;\n}\n\n/** Seconds left on a running session at `now` (never negative). */\nexport function remainingSeconds(\n session: SessionClock,\n fallbackDurationSeconds: number,\n now: number = Date.now(),\n): number {\n const planned =\n session.duration && session.duration > 0\n ? session.duration\n : fallbackDurationSeconds;\n const started = new Date(session.startTime).getTime();\n if (!Number.isFinite(started)) return planned;\n const elapsed = Math.floor((now - started) / 1000);\n return Math.max(0, planned - Math.max(0, elapsed));\n}\n\n/** Fraction of the ring that is still \"left\" (1 = full, 0 = done). */\nexport function ringFraction(remaining: number, total: number): number {\n if (!Number.isFinite(total) || total <= 0) return 0;\n return Math.min(1, Math.max(0, remaining / total));\n}\n\nexport interface GoalLike {\n type: string;\n target: number;\n current: number;\n startDate: string;\n endDate: string;\n}\n\n/**\n * The daily focus goal that covers `now`, if the user set one. Only DAILY goals\n * qualify — a weekly target is not \"today's goal\".\n */\nexport function todaysGoal<T extends GoalLike>(\n goals: readonly T[],\n now: Date = new Date(),\n): T | null {\n // Compare calendar days, not instants: a goal that ends \"on\" a date covers\n // the whole of that day whatever time-of-day the end was stored with.\n const today = toLocalDateKey(now);\n const dayKey = (iso: string): string | null => {\n const date = new Date(iso);\n return Number.isFinite(date.getTime()) ? toLocalDateKey(date) : null;\n };\n const active = goals.filter((goal) => {\n if (goal.type !== \"DAILY\" || goal.target <= 0) return false;\n const start = dayKey(goal.startDate);\n const end = dayKey(goal.endDate);\n return (start === null || start <= today) && (end === null || today <= end);\n });\n if (active.length === 0) return null;\n return active.reduce((best, goal) =>\n new Date(goal.startDate).getTime() > new Date(best.startDate).getTime()\n ? goal\n : best,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Timeline\n// ---------------------------------------------------------------------------\n\nexport interface CategoryTotal {\n category: string;\n totalSeconds: number;\n}\n\nexport interface TimelineSummaryLike {\n totalTrackedSeconds: number;\n focusRatio?: number | null;\n byCategory: readonly CategoryTotal[];\n}\n\nexport interface FocusSummary {\n /** Whole-number focus share, or null when the backend has no ratio yet. */\n focusPercent: number | null;\n deepWorkSeconds: number;\n meetingSeconds: number;\n trackedSeconds: number;\n}\n\nexport function focusSummary(\n summary: TimelineSummaryLike | null | undefined,\n): FocusSummary {\n const total = (category: string) =>\n summary?.byCategory\n .filter((row) => row.category === category)\n .reduce((sum, row) => sum + row.totalSeconds, 0) ?? 0;\n const ratio = summary?.focusRatio;\n return {\n focusPercent:\n typeof ratio === \"number\" && Number.isFinite(ratio)\n ? Math.round(ratio * 100)\n : null,\n deepWorkSeconds: total(\"DEEP_WORK\"),\n meetingSeconds: total(\"MEETING\"),\n trackedSeconds: summary?.totalTrackedSeconds ?? 0,\n };\n}\n\nexport interface SearchableSegment {\n title?: string | null;\n app?: string | null;\n category: string;\n projectId?: string | null;\n}\n\n/**\n * Case-insensitive match on the segment's title, app, category label or project\n * name. An empty query keeps everything.\n */\nexport function filterSegments<T extends SearchableSegment>(\n segments: readonly T[],\n query: string,\n projectNameById: ReadonlyMap<string, string>,\n categoryLabel: (category: string) => string,\n): T[] {\n const needle = query.trim().toLowerCase();\n if (!needle) return [...segments];\n return segments.filter((segment) => {\n const haystack = [\n segment.title,\n segment.app,\n categoryLabel(segment.category),\n segment.projectId ? projectNameById.get(segment.projectId) : undefined,\n ];\n return haystack.some(\n (value) =>\n typeof value === \"string\" && value.toLowerCase().includes(needle),\n );\n });\n}\n\n/** Segments ordered by start time (planned blocks keep their slot). */\nexport function sortByStart<T extends { startTime: string }>(\n segments: readonly T[],\n): T[] {\n return [...segments].sort(\n (a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime(),\n );\n}\n\n// ---------------------------------------------------------------------------\n// Life balance\n// ---------------------------------------------------------------------------\n\nexport interface DomainBalanceLike {\n domain: string;\n actualSeconds: number;\n actualShare: number;\n desiredShare: number;\n gap: number;\n}\n\n/**\n * How close the tracked split is to the declared one, 0–100: one minus the\n * total-variation distance between the two distributions. 100 means the time\n * split exactly as wanted; 0 means none of it went where it was wanted.\n * `null` when the user has not declared targets or nothing is tracked — there\n * is nothing honest to score.\n */\nexport function balanceScore(\n byDomain: readonly DomainBalanceLike[],\n hasTargets: boolean,\n): number | null {\n if (!hasTargets) return null;\n const tracked = byDomain.reduce((sum, d) => sum + d.actualSeconds, 0);\n if (tracked <= 0) return null;\n const distance =\n byDomain.reduce(\n (sum, d) => sum + Math.abs(d.actualShare - d.desiredShare),\n 0,\n ) / 2;\n return Math.round(Math.min(1, Math.max(0, 1 - distance)) * 100);\n}\n\nexport type BalanceStatus = \"on-track\" | \"drifting\" | \"off-balance\";\n\nexport function balanceStatus(score: number): BalanceStatus {\n if (score >= 75) return \"on-track\";\n if (score >= 50) return \"drifting\";\n return \"off-balance\";\n}\n\nexport interface DomainRow {\n domain: string;\n actualSeconds: number;\n /** Target for the selected range, pro-rated from hours/week; null if none. */\n targetSeconds: number | null;\n /** actual / target as a whole percent, null without a target. */\n percentOfTarget: number | null;\n actualShare: number;\n}\n\n/**\n * Rows for the \"so far\" list: domains with tracked time or a target, most time\n * first. Weekly targets are pro-rated to the range length.\n */\nexport function domainRows(\n byDomain: readonly DomainBalanceLike[],\n targetHoursPerWeek: Readonly<Record<string, number | undefined>>,\n rangeDays: number,\n): DomainRow[] {\n const days = Math.max(1, rangeDays);\n return byDomain\n .map((d) => {\n const weekly = targetHoursPerWeek[d.domain];\n const targetSeconds =\n typeof weekly === \"number\" && weekly > 0\n ? Math.round((weekly * 3600 * days) / 7)\n : null;\n return {\n domain: d.domain,\n actualSeconds: d.actualSeconds,\n targetSeconds,\n percentOfTarget:\n targetSeconds && targetSeconds > 0\n ? Math.round((d.actualSeconds / targetSeconds) * 100)\n : null,\n actualShare: d.actualShare,\n };\n })\n .filter((row) => row.actualSeconds > 0 || row.targetSeconds !== null)\n .sort((a, b) => b.actualSeconds - a.actualSeconds);\n}\n\n/**\n * The domain furthest below its target (largest unmet seconds), for the\n * \"make room for…\" nudge. `null` when every target is met or none are set.\n */\nexport function biggestShortfall(\n rows: readonly DomainRow[],\n): { domain: string; missingSeconds: number } | null {\n let best: { domain: string; missingSeconds: number } | null = null;\n for (const row of rows) {\n if (row.targetSeconds === null) continue;\n const missing = row.targetSeconds - row.actualSeconds;\n if (missing <= 0) continue;\n if (!best || missing > best.missingSeconds) {\n best = { domain: row.domain, missingSeconds: missing };\n }\n }\n return best;\n}\n"],"mappings":";AAeA,SAAgB,EAAe,GAAoB;CAIjD,OAAO,GAHG,EAAK,YAGL,EAAE,GAFF,OAAO,EAAK,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAEnC,EAAE,GADP,OAAO,EAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,GACzB;AACtB;AAGA,SAAgB,EAAkB,GAA6C;CAC7E,IAAI,CAAC,GAAK,OAAO;CACjB,IAAM,IAAQ,4BAA4B,KAAK,CAAG;CAClD,IAAI,CAAC,GAAO,OAAO;CACnB,IAAM,GAAG,GAAG,GAAG,KAAK,GACd,IAAO,IAAI,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;CAQzD,OANE,EAAK,YAAY,MAAM,OAAO,CAAC,KAC/B,EAAK,SAAS,MAAM,OAAO,CAAC,IAAI,KAChC,EAAK,QAAQ,MAAM,OAAO,CAAC,IAEpB,OAEF;AACT;AAGA,SAAgB,EAAa,GAAa,GAAsB;CAC9D,IAAM,IAAO,EAAkB,CAAG,qBAAK,IAAI,KAAK;CAMhD,OAAO,EAAe,IALL,KACf,EAAK,YAAY,GACjB,EAAK,SAAS,GACd,EAAK,QAAQ,IAAI,CAEG,CAAI;AAC5B;AAGA,SAAgB,EAAe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AAgB,EACd,GACA,GACA,GACa;CACb,IAAM,IAAO,KAAK,IAAI,GAAG,CAAS;CAClC,OAAO,EACJ,KAAK,MAAM;EACV,IAAM,IAAS,EAAmB,EAAE,SAC9B,IACJ,OAAO,KAAW,YAAY,IAAS,IACnC,KAAK,MAAO,IAAS,OAAO,IAAQ,CAAC,IACrC;EACN,OAAO;GACL,QAAQ,EAAE;GACV,eAAe,EAAE;GACjB;GACA,iBACE,KAAiB,IAAgB,IAC7B,KAAK,MAAO,EAAE,gBAAgB,IAAiB,GAAG,IAClD;GACN,aAAa,EAAE;EACjB;CACF,CAAC,CAAC,CACD,QAAQ,MAAQ,EAAI,gBAAgB,KAAK,EAAI,kBAAkB,IAAI,CAAC,CACpE,MAAM,GAAG,MAAM,EAAE,gBAAgB,EAAE,aAAa;AACrD;AAMA,SAAgB,EACd,GACmD;CACnD,IAAI,IAA0D;CAC9D,KAAK,IAAM,KAAO,GAAM;EACtB,IAAI,EAAI,kBAAkB,MAAM;EAChC,IAAM,IAAU,EAAI,gBAAgB,EAAI;EACpC,KAAW,MACX,CAAC,KAAQ,IAAU,EAAK,oBAC1B,IAAO;GAAE,QAAQ,EAAI;GAAQ,gBAAgB;EAAQ;CAEzD;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"mobileModel.js","names":[],"sources":["../../../../src/timecampus/pages/mobile/mobileModel.ts"],"sourcesContent":["/**\n * Pure view-model helpers for the phone-optimised TimeCampus screens\n * (`/mobile/timer`, `/mobile/timeline`, `/mobile/life-balance`).\n *\n * Everything here is derived from data the backend already returns — nothing\n * is invented. When there is not enough data to say something honestly (no\n * targets declared, nothing tracked yet) the helpers return `null` and the\n * screen says so instead of showing a made-up number.\n */\n\n// ---------------------------------------------------------------------------\n// Dates\n// ---------------------------------------------------------------------------\n\n/** `YYYY-MM-DD` for a Date in the viewer's local time zone. */\nexport function toLocalDateKey(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return `${y}-${m}-${d}`;\n}\n\n/** Parses a `YYYY-MM-DD` key as local midnight; `null` when it is not a real date. */\nexport function parseLocalDateKey(key: string | null | undefined): Date | null {\n if (!key) return null;\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(key);\n if (!match) return null;\n const [, y, m, d] = match;\n const date = new Date(Number(y), Number(m) - 1, Number(d));\n if (\n date.getFullYear() !== Number(y) ||\n date.getMonth() !== Number(m) - 1 ||\n date.getDate() !== Number(d)\n ) {\n return null;\n }\n return date;\n}\n\n/** Moves a `YYYY-MM-DD` key by whole days (DST-safe: calendar arithmetic). */\nexport function shiftDateKey(key: string, days: number): string {\n const base = parseLocalDateKey(key) ?? new Date();\n const next = new Date(\n base.getFullYear(),\n base.getMonth(),\n base.getDate() + days,\n );\n return toLocalDateKey(next);\n}\n\n/** ISO bounds of one local calendar day. */\nexport function localDayBounds(key: string): { from: string; to: string } {\n const day = parseLocalDateKey(key) ?? new Date();\n const start = new Date(day.getFullYear(), day.getMonth(), day.getDate());\n const end = new Date(\n day.getFullYear(),\n day.getMonth(),\n day.getDate(),\n 23,\n 59,\n 59,\n 999,\n );\n return { from: start.toISOString(), to: end.toISOString() };\n}\n\n/** \"Today\", \"Yesterday\", or a short weekday + date (\"Wed, Oct 25\"). */\nexport function dayHeading(key: string, now: Date = new Date()): string {\n const today = toLocalDateKey(now);\n if (key === today) return \"Today\";\n if (key === shiftDateKey(today, -1)) return \"Yesterday\";\n const date = parseLocalDateKey(key);\n if (!date) return key;\n return date.toLocaleDateString(\"en-US\", {\n weekday: \"short\",\n month: \"short\",\n day: \"numeric\",\n });\n}\n\n/** Long form of the day for the sub-heading (\"Wednesday, October 25\"). */\nexport function longDayLabel(key: string): string {\n const date = parseLocalDateKey(key);\n if (!date) return key;\n return date.toLocaleDateString(\"en-US\", {\n weekday: \"long\",\n month: \"long\",\n day: \"numeric\",\n });\n}\n\n// ---------------------------------------------------------------------------\n// Durations\n// ---------------------------------------------------------------------------\n\n/** Compact \"1h 30m\" / \"45m\" / \"<1m\" / \"0m\" from seconds (never shows seconds). */\nexport function compactDuration(seconds: number): string {\n const total = Math.max(0, Math.round(seconds));\n // Something was tracked, just not a whole minute: \"0m\" would read as nothing.\n if (total > 0 && total < 60) return \"<1m\";\n const h = Math.floor(total / 3600);\n const m = Math.floor((total % 3600) / 60);\n if (h === 0) return `${m}m`;\n if (m === 0) return `${h}h`;\n return `${h}h ${m}m`;\n}\n\n/** \"MM:SS\" countdown; hours roll into the minutes (\"90:00\"). */\nexport function formatCountdown(seconds: number): string {\n const total = Math.max(0, Math.floor(seconds));\n const m = Math.floor(total / 60);\n const s = total % 60;\n return `${String(m).padStart(2, \"0\")}:${String(s).padStart(2, \"0\")}`;\n}\n\n// ---------------------------------------------------------------------------\n// Timer (pomodoro-backed focus session)\n// ---------------------------------------------------------------------------\n\nexport interface SessionClock {\n startTime: string;\n /** Planned length in seconds; falls back to the mode default when absent. */\n duration?: number | null;\n}\n\n/** Seconds left on a running session at `now` (never negative). */\nexport function remainingSeconds(\n session: SessionClock,\n fallbackDurationSeconds: number,\n now: number = Date.now(),\n): number {\n const planned =\n session.duration && session.duration > 0\n ? session.duration\n : fallbackDurationSeconds;\n const started = new Date(session.startTime).getTime();\n if (!Number.isFinite(started)) return planned;\n const elapsed = Math.floor((now - started) / 1000);\n return Math.max(0, planned - Math.max(0, elapsed));\n}\n\n/** Fraction of the ring that is still \"left\" (1 = full, 0 = done). */\nexport function ringFraction(remaining: number, total: number): number {\n if (!Number.isFinite(total) || total <= 0) return 0;\n return Math.min(1, Math.max(0, remaining / total));\n}\n\nexport interface GoalLike {\n type: string;\n target: number;\n current: number;\n startDate: string;\n endDate: string;\n}\n\n/**\n * The daily focus goal that covers `now`, if the user set one. Only DAILY goals\n * qualify — a weekly target is not \"today's goal\".\n */\nexport function todaysGoal<T extends GoalLike>(\n goals: readonly T[],\n now: Date = new Date(),\n): T | null {\n // Compare calendar days, not instants: a goal that ends \"on\" a date covers\n // the whole of that day whatever time-of-day the end was stored with.\n const today = toLocalDateKey(now);\n const dayKey = (iso: string): string | null => {\n const date = new Date(iso);\n return Number.isFinite(date.getTime()) ? toLocalDateKey(date) : null;\n };\n const active = goals.filter((goal) => {\n if (goal.type !== \"DAILY\" || goal.target <= 0) return false;\n const start = dayKey(goal.startDate);\n const end = dayKey(goal.endDate);\n return (start === null || start <= today) && (end === null || today <= end);\n });\n if (active.length === 0) return null;\n return active.reduce((best, goal) =>\n new Date(goal.startDate).getTime() > new Date(best.startDate).getTime()\n ? goal\n : best,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Timeline\n// ---------------------------------------------------------------------------\n\nexport interface CategoryTotal {\n category: string;\n totalSeconds: number;\n}\n\nexport interface TimelineSummaryLike {\n totalTrackedSeconds: number;\n focusRatio?: number | null;\n byCategory: readonly CategoryTotal[];\n}\n\nexport interface FocusSummary {\n /** Whole-number focus share, or null when the backend has no ratio yet. */\n focusPercent: number | null;\n deepWorkSeconds: number;\n meetingSeconds: number;\n trackedSeconds: number;\n}\n\nexport function focusSummary(\n summary: TimelineSummaryLike | null | undefined,\n): FocusSummary {\n const total = (category: string) =>\n summary?.byCategory\n .filter((row) => row.category === category)\n .reduce((sum, row) => sum + row.totalSeconds, 0) ?? 0;\n const ratio = summary?.focusRatio;\n return {\n focusPercent:\n typeof ratio === \"number\" && Number.isFinite(ratio)\n ? Math.round(ratio * 100)\n : null,\n deepWorkSeconds: total(\"DEEP_WORK\"),\n meetingSeconds: total(\"MEETING\"),\n trackedSeconds: summary?.totalTrackedSeconds ?? 0,\n };\n}\n\nexport interface SearchableSegment {\n title?: string | null;\n app?: string | null;\n category: string;\n projectId?: string | null;\n}\n\n/**\n * Case-insensitive match on the segment's title, app, category label or project\n * name. An empty query keeps everything.\n */\nexport function filterSegments<T extends SearchableSegment>(\n segments: readonly T[],\n query: string,\n projectNameById: ReadonlyMap<string, string>,\n categoryLabel: (category: string) => string,\n): T[] {\n const needle = query.trim().toLowerCase();\n if (!needle) return [...segments];\n return segments.filter((segment) => {\n const haystack = [\n segment.title,\n segment.app,\n categoryLabel(segment.category),\n segment.projectId ? projectNameById.get(segment.projectId) : undefined,\n ];\n return haystack.some(\n (value) =>\n typeof value === \"string\" && value.toLowerCase().includes(needle),\n );\n });\n}\n\n/** Segments ordered by start time (planned blocks keep their slot). */\nexport function sortByStart<T extends { startTime: string }>(\n segments: readonly T[],\n): T[] {\n return [...segments].sort(\n (a, b) => new Date(a.startTime).getTime() - new Date(b.startTime).getTime(),\n );\n}\n\n// ---------------------------------------------------------------------------\n// Life balance\n// ---------------------------------------------------------------------------\n\nexport interface DomainBalanceLike {\n domain: string;\n actualSeconds: number;\n actualShare: number;\n desiredShare: number;\n gap: number;\n}\n\n/**\n * How close the tracked split is to the declared one, 0–100: one minus the\n * total-variation distance between the two distributions. 100 means the time\n * split exactly as wanted; 0 means none of it went where it was wanted.\n * `null` when the user has not declared targets or nothing is tracked — there\n * is nothing honest to score.\n */\nexport function balanceScore(\n byDomain: readonly DomainBalanceLike[],\n hasTargets: boolean,\n): number | null {\n if (!hasTargets) return null;\n const tracked = byDomain.reduce((sum, d) => sum + d.actualSeconds, 0);\n if (tracked <= 0) return null;\n const distance =\n byDomain.reduce(\n (sum, d) => sum + Math.abs(d.actualShare - d.desiredShare),\n 0,\n ) / 2;\n return Math.round(Math.min(1, Math.max(0, 1 - distance)) * 100);\n}\n\nexport type BalanceStatus = \"on-track\" | \"drifting\" | \"off-balance\";\n\nexport function balanceStatus(score: number): BalanceStatus {\n if (score >= 75) return \"on-track\";\n if (score >= 50) return \"drifting\";\n return \"off-balance\";\n}\n\nexport interface DomainRow {\n domain: string;\n actualSeconds: number;\n /** Target for the selected range, pro-rated from hours/week; null if none. */\n targetSeconds: number | null;\n /** actual / target as a whole percent, null without a target. */\n percentOfTarget: number | null;\n actualShare: number;\n}\n\n/**\n * Rows for the \"so far\" list: domains with tracked time or a target, most time\n * first. Weekly targets are pro-rated to the range length.\n */\nexport function domainRows(\n byDomain: readonly DomainBalanceLike[],\n targetHoursPerWeek: Readonly<Record<string, number | undefined>>,\n rangeDays: number,\n): DomainRow[] {\n const days = Math.max(1, rangeDays);\n return byDomain\n .map((d) => {\n const weekly = targetHoursPerWeek[d.domain];\n const targetSeconds =\n typeof weekly === \"number\" && weekly > 0\n ? Math.round((weekly * 3600 * days) / 7)\n : null;\n return {\n domain: d.domain,\n actualSeconds: d.actualSeconds,\n targetSeconds,\n percentOfTarget:\n targetSeconds && targetSeconds > 0\n ? Math.round((d.actualSeconds / targetSeconds) * 100)\n : null,\n actualShare: d.actualShare,\n };\n })\n .filter((row) => row.actualSeconds > 0 || row.targetSeconds !== null)\n .sort((a, b) => b.actualSeconds - a.actualSeconds);\n}\n\n/**\n * The domain furthest below its target (largest unmet seconds), for the\n * \"make room for…\" nudge. `null` when every target is met or none are set.\n */\nexport function biggestShortfall(\n rows: readonly DomainRow[],\n): { domain: string; missingSeconds: number } | null {\n let best: { domain: string; missingSeconds: number } | null = null;\n for (const row of rows) {\n if (row.targetSeconds === null) continue;\n const missing = row.targetSeconds - row.actualSeconds;\n if (missing <= 0) continue;\n if (!best || missing > best.missingSeconds) {\n best = { domain: row.domain, missingSeconds: missing };\n }\n }\n return best;\n}\n"],"mappings":";AAeA,SAAgB,EAAe,GAAoB;CAIjD,OAAO,GAHG,EAAK,YAGL,EAAE,GAFF,OAAO,EAAK,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAEnC,EAAE,GADP,OAAO,EAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,GACzB;AACtB;AAGA,SAAgB,EAAkB,GAA6C;CAC7E,IAAI,CAAC,GAAK,OAAO;CACjB,IAAM,IAAQ,4BAA4B,KAAK,CAAG;CAClD,IAAI,CAAC,GAAO,OAAO;CACnB,IAAM,GAAG,GAAG,GAAG,KAAK,GACd,IAAO,IAAI,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,C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