create-pmos 0.443.0 → 0.444.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/package.json +13 -13
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/briefing-premium-board-test.js +8 -2
  7. package/workspace/briefing-premium-insights-test.js +40 -38
  8. package/workspace/briefing-premium-test.js +2 -1
  9. package/workspace/changelog.json +12 -0
  10. package/workspace/goals-clear-ui-test.js +34 -20
  11. package/workspace/guide/home.md +5 -0
  12. package/workspace/intel-report-ui-test.js +1 -1
  13. package/workspace/lib/board-premium.js +1 -1
  14. package/workspace/lib/engine/boards.js +9 -2
  15. package/workspace/lib/routes-boards.js +40 -1
  16. package/workspace/live-pill-round-test.js +178 -0
  17. package/workspace/okr-goals-ui-test.js +21 -19
  18. package/workspace/package-lock.json +2 -2
  19. package/workspace/package.json +1 -1
  20. package/workspace/panels-test.js +231 -0
  21. package/workspace/premium-rec-tab-test.js +2 -1
  22. package/workspace/premium-vw-item-test.js +10 -2
  23. package/workspace/premium-vw-jira-test.js +3 -0
  24. package/workspace/public/pm/bd-ini-panel.js +3 -2
  25. package/workspace/public/pm/cozy-adler.js +21 -0
  26. package/workspace/public/pm/cozy-divider.css +32 -0
  27. package/workspace/public/pm/cozy-divider.js +45 -0
  28. package/workspace/public/pm/cozy-insights.css +14 -0
  29. package/workspace/public/pm/cozy-live-pill.css +16 -22
  30. package/workspace/public/pm/cozy-live-pill.js +28 -17
  31. package/workspace/public/pm/cozy-panels.css +59 -0
  32. package/workspace/public/pm/cozy-panels.js +524 -0
  33. package/workspace/public/pm/cozy-viewer.js +146 -70
  34. package/workspace/public/pm/goals-clear.js +9 -2
  35. package/workspace/public/pm/home-app.js +22 -11
  36. package/workspace/public/pm/home-ini.js +9 -3
  37. package/workspace/public/pm/home-today.js +4 -2
  38. package/workspace/public/pm/ini-edit.js +401 -0
  39. package/workspace/public/pm/ini-tasks.js +42 -18
  40. package/workspace/public/pm/ini-versions.js +18 -4
  41. package/workspace/public/pm/ini-view-model.js +8 -4
  42. package/workspace/public/pm/ini-view.css +88 -1
  43. package/workspace/public/pm/ini-view.js +42 -11
  44. package/workspace/public/pm/premium-board.js +8 -6
  45. package/workspace/public/pm/premium-insights.js +205 -43
  46. package/workspace/public/pm/task-card.css +2 -0
  47. package/workspace/public/pm/task-card.js +4 -1
  48. package/workspace/stage-card-tasks-test.js +396 -0
  49. package/workspace/stage-card-test.js +1 -1
  50. package/workspace/task-delete-test.js +9 -1
  51. package/workspace/task-milestones-test.js +3 -3
  52. package/workspace/task-press-test.js +12 -4
  53. package/workspace/task-views-test.js +8 -4
  54. package/workspace/test-lists/batch18-live-pill-round.json +10 -0
  55. package/workspace/test-lists/batch18-panels.json +9 -0
  56. package/workspace/test-lists/stage-card-tasks.json +6 -0
@@ -461,33 +461,85 @@ async function pressMove(b) {
461
461
  await load();
462
462
  }
463
463
 
464
- /* ── the North Star (GsM1–M5; before it Iq8Overview's card with its inputs): the KR metric record with role north-star ── */
464
+ /* ── the North Star and its inputs (Iq8Overview; GcJ2FirstMonday while it has fewer than 3 readings): the KR metric record with role north-star,
465
+ * drawn as its number with the change against the span before it and its readings as a line; the records with role input (and guardrail) as a
466
+ * list beside it, each with its change over the same span. Every number is a reading. One reading is a starting point: the line waits in a dashed
467
+ * box for the 2nd, and the span buttons wait for a line. A read that failed or a held reading (GcR4Failed, GcR5Held) keeps the last good number
468
+ * and says so. The drafts that repair the North Star sit under its card. With no North Star the row is not drawn (zero is silence); a drafted
469
+ * North Star is a row of the drafts table, never a second North Star here. ── */
470
+ let nsSpan = '4';
471
+ const SPANS = [['4', '4 weeks', 28], ['12', '12 weeks', 84], ['q', 'This quarter vs last', null]];
465
472
  const isOwnKr = (g) => !g.program && !g.initiative;
466
473
  const nsGoal = () => (PF ? null : M.goals.find((g) => g.role === 'north-star' && isOwnKr(g)) || null);
467
- /** The North Star as the list's first row (GsM1–M5): its dot, its reading with the change since the quarter's first reading and its age; the
468
- * chart is in the Viewer and its inputs are in the more menu, Metrics, as a tree. A drafted North Star (or a drafted input or guardrail) that is not a
469
- * record yet is a hollow row with its keep press. Nothing to show: the card is not drawn (zero is silence). */
470
- function nsMeta(g) {
471
- const lk = rowLook(g); if (lk.meta) return lk.meta;
472
- if (g.reading && g.reading.txt) return OK.metaOf(g, today());
473
- const S = g.series || [];
474
- if (!S.length) return OK.metaOf(g, today());
475
- const a = S[0], z = S[S.length - 1], d = z.v - a.v, pctU = /^%$/.test(String(g.unit || '').trim());
476
- const ch = S.length > 1 && d !== 0 ? (d > 0 ? 'up ' : 'down ') + (Math.round(Math.abs(d) * 100) / 100) + (pctU ? '' : g.unit ? (/^[A-Za-z]/.test(g.unit) ? ' ' + g.unit : g.unit) : '') + ' since ' + md(day(a.at)) : '';
477
- return [g.nowTxt, ch, OK.ageOf(z.at, today())].filter(Boolean).join(' · ');
474
+ const inputGoals = () => (PF ? [] : M.goals.filter((g) => (g.role === 'input' || g.role === 'guardrail') && isOwnKr(g)));
475
+ /** The reading at or before a day, from a goal's series; null when the series does not reach back that far. */
476
+ const atOrBefore = (g, t) => { const S = (g.series || []).filter((r) => day(r.at) <= t); return S.length ? S[S.length - 1] : null; };
477
+ /** The change of a goal over the span: the latest reading against the one a span before it (a quarter: the same day of the quarter before). */
478
+ function spanChange(g, span = nsSpan) {
479
+ const S = g.series || []; if (S.length < 2) return null;
480
+ const last = S[S.length - 1], tl = day(last.at), back = (SPANS.find((x) => x[0] === span) || SPANS[0])[2];
481
+ const t0 = back ? tl - back * DAY : (() => { const d = new Date(tl); return Date.UTC(d.getUTCFullYear(), d.getUTCMonth() - 3, d.getUTCDate()); })();
482
+ const prev = atOrBefore(g, t0); if (!prev || prev === last) return null;
483
+ const d = last.v - prev.v, pctd = prev.v ? d / Math.abs(prev.v) * 100 : null, better = d === 0 ? null : (g.direction === 'down' ? d < 0 : d > 0);
484
+ return { d, pct: pctd, prev, last, better, t0 };
485
+ }
486
+ const pctSay = (p) => (p === null ? '' : (p > 0 ? '+' : p < 0 ? '−' : '') + (Math.round(Math.abs(p) * 10) / 10) + '%');
487
+ /** The North Star's line: the readings of the span solid, the span before it dashed and laid under it, the latest a dot. Each reading has a
488
+ * title, so a hover says its value and day. */
489
+ function nsSvg(g, ch, W = 520, H = 120) {
490
+ const S = g.series || [], tl = day(S[S.length - 1].at), span = ch ? tl - ch.t0 : 28 * DAY;
491
+ const cur = S.filter((r) => day(r.at) >= tl - span), prev = S.filter((r) => day(r.at) >= tl - 2 * span && day(r.at) <= tl - span);
492
+ const ys = cur.concat(prev).map((r) => r.v), lo = Math.min(...ys), hi = Math.max(...ys), rg = hi - lo || 1, f = (n) => n.toFixed(1);
493
+ const x = (t) => 8 + (span ? (t - (tl - span)) / span : 1) * (W - 16), y = (v) => 10 + (1 - (v - lo) / rg) * (H - 26);
494
+ const path = (L, sh) => L.map((r, i) => (i ? 'L' : 'M') + f(x(day(r.at) + sh)) + ' ' + f(y(r.v))).join('');
495
+ const dots = cur.map((r) => `<circle class="pt" cx="${f(x(day(r.at)))}" cy="${f(y(r.v))}" r="3"><title>${esc(md(day(r.at)) + ' · ' + unitV(g, r.v))}</title></circle>`).join('');
496
+ const z = cur[cur.length - 1];
497
+ return `<svg class="ins-nsch" viewBox="0 0 ${W} ${H}" preserveAspectRatio="none" role="img" aria-label="${esc(g.title + ': ' + cur.length + ' readings in the span' + (prev.length > 1 ? ', the span before it dashed' : ''))}">`
498
+ + (prev.length > 1 ? `<path class="pv" d="${path(prev, span)}"/>` : '') + (cur.length > 1 ? `<path class="ar" d="${path(cur, 0)}L${f(x(tl))} ${H}L${f(x(day(cur[0].at)))} ${H}Z"/><path class="ln" d="${path(cur, 0)}"/>` : '')
499
+ + dots + `<circle class="dt" cx="${f(x(day(z.at)))}" cy="${f(y(z.v))}" r="4.5"/></svg>`;
500
+ }
501
+ const RM = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
502
+ let nsCounted = false;
503
+ /** The North Star's number counts up once, on the first draw (principle 12 as amended for Intelligence: subtle, honest, reduced motion respected). */
504
+ function countUp(el, g) {
505
+ if (nsCounted || RM() || !el || g.now === null) { nsCounted = true; return; }
506
+ nsCounted = true;
507
+ const txt = g.nowTxt, m = /-?\d[\d,]*(\.\d+)?/.exec(txt || ''); if (!m) return;
508
+ const dec = (m[1] || '').length - (m[1] ? 1 : 0), to = Number(m[0].replace(/,/g, '')), t0 = performance.now();
509
+ const step = (t) => { const k = Math.min(1, (t - t0) / 900), e = 1 - Math.pow(1 - k, 3), v = (to * e).toFixed(Math.max(0, dec)); el.textContent = txt.replace(m[0], m[0].includes(',') ? Number(v).toLocaleString('en-US', { minimumFractionDigits: dec, maximumFractionDigits: dec }) : v); if (k < 1) requestAnimationFrame(step); else el.textContent = txt; };
510
+ requestAnimationFrame(step);
511
+ }
512
+ /** What the North Star's number is (said once, beside it): the last good reading after a failed read or a held one; the source and time of
513
+ * the first readings; else the source and how fresh it is. */
514
+ function nsNote(g) {
515
+ const good = GC.lastGoodSay(g); if (good) return good;
516
+ const F = GC.firstOf(g); if (F) return [F.source, GC.atTxt(F.at)].filter(Boolean).join(' · ');
517
+ const src = srcOf(g); return [src === 'Recorded' ? '' : src, freshOf(g)].filter(Boolean).join(' · ');
478
518
  }
479
519
  function drawNs() {
480
520
  const box = $('#nsRow');
481
521
  if (!M || PF) { box.hidden = true; box.innerHTML = ''; return; }
482
- // batch 18 item 11: a drafted North Star is a row of the drafts table, never a second North Star row here
483
522
  const g = nsGoal();
484
523
  if (!g) { box.hidden = true; box.innerHTML = ''; return; }
485
- const rows = OK.rowHtml(g, Object.assign({ meta: nsMeta(g), drafts: draftsFor(g.id), drawDraft: drHtml, noOwner: !OK.whoOf(g), today: today() }, rowLook(g)));
486
- box.innerHTML = `<div class="okr-sec"><h2 class="okr-h">North Star</h2></div><div class="okr-card">${rows}</div>`;
487
- box.hidden = false; box.classList.add('okr-ns');
524
+ const F = GC.firstOf(g), line = !F || F.n >= 2, ch = line ? spanChange(g) : null, I0 = inputGoals(), bad = !!(g.failed || (g.held || []).length);
525
+ const pill = ch && ch.pct !== null && !bad ? `<span class="cz-pill ${ch.better === null ? 'q' : ch.better ? 'ok' : 'late'}">${esc(pctSay(ch.pct))}</span><span class="note">vs ${esc(unitV(g, ch.prev.v))} ${nsSpan === 'q' ? 'last quarter, same day' : 'the previous ' + (SPANS.find((x) => x[0] === nsSpan) || SPANS[0])[1]}</span>` : '';
526
+ const seg = line && (g.series || []).length > 1 ? `<div class="cz-seg ins-seg" role="group" aria-label="Compare">${SPANS.map(([k, l]) => `<button type="button" aria-pressed="${nsSpan === k}" data-span="${k}">${esc(l)}</button>`).join('')}</div>` : '';
527
+ const chart = !line ? GC.firstChart(g) : (g.series || []).length ? nsSvg(g, ch) : `<p class="note">${esc(nextReading(g))}</p>`;
528
+ const drafts = draftsFor(g.id).map(drHtml).join('');
529
+ const card = `<div class="ins-nsc${bad ? ' bad' : ''}" data-goal="${esc(g.id)}"><div class="ins-nsh"><span class="ins-lbl2">${OK.dotOf(g) === 'broken' ? OK.dotHtml('broken') + ' ' : ''}North Star <span>${esc(g.title)}</span></span>${seg}</div>`
530
+ + `<div class="ins-nsv"><button type="button" class="ins-big" data-nsopen aria-label="Open ${esc(g.title)}"><b id="nsNum">${esc(nowOf(g))}</b></button>${pill}<span class="note ins-nsn">${esc(nsNote(g))}</span></div>`
531
+ + chart + (drafts ? `<div class="ins-nsd">${drafts}</div>` : '') + '</div>';
532
+ const row = (x) => { const c = F ? null : spanChange(x), warn = gcSay(x); return `<button type="button" class="ins-inr" data-goal="${esc(x.id)}"><span class="nm">${esc(x.title)}${warn ? `<small class="note">${esc(warn)}</small>` : ''}</span><span class="v"><b>${esc(nowOf(x))}</b>${c && !warn ? `<span class="${c.better === null ? 'q' : c.better ? 'up' : 'dn'}">${esc(sgn(c.d, x.unit))}</span>` : ''}</span></button>`; };
533
+ const ins = I0.filter((x) => x.role === 'input'), grd = I0.filter((x) => x.role === 'guardrail');
534
+ const side = ins.length || grd.length ? `<div class="ins-nsi">${ins.length ? `<span class="ins-lbl2">Inputs <span>what moves the North Star</span></span>${ins.map(row).join('')}` : ''}${grd.length ? `<span class="ins-lbl2">Guardrails <span>must not get worse</span></span>${grd.map(row).join('')}` : ''}</div>` : '';
535
+ box.innerHTML = card + side; box.hidden = false; box.classList.toggle('one', !side);
536
+ countUp($('#nsNum'), g);
488
537
  }
489
538
  $('#nsRow').addEventListener('click', (e) => {
490
- const r = e.target.closest('[data-goal]'); if (r && e.target.closest('.okr-main')) openGoalDetail(r.dataset.goal);
539
+ if (e.target.closest('.okr-dr')) return; // a draft under the North Star has its own presses
540
+ const s = e.target.closest('[data-span]'); if (s) { nsSpan = s.dataset.span; drawNs(); return; }
541
+ if (e.target.closest('[data-nsopen]')) { const g = nsGoal(); if (g) openGoalDetail(g.id); return; }
542
+ const r = e.target.closest('.ins-inr[data-goal]'); if (r) openGoalDetail(r.dataset.goal);
491
543
  });
492
544
 
493
545
  /* ── what Claude drafted (GsM1–M5; before it Iq8Suggest, Iq9Draft): GET /api/metric-drafts for this product. Each draft sits under the row it
@@ -761,42 +813,148 @@ function bandSvg(pts, lim, ceil, tone, label, w = 210, h = 40) {
761
813
  const line = L.length > 1 ? `<polygon points="${L[0].split(',')[0]},${h} ${L.join(' ')} ${last[0]},${h}" class="ar"/><polyline points="${L.join(' ')}" class="ln"/>` : '';
762
814
  return `<svg class="ins-spark" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}" role="img" aria-label="${esc(label)}">${band}${line}<circle cx="${last[0]}" cy="${last[1]}" r="3.6" class="dt" style="fill:${TONE_BAR[tone] || TONE_BAR.q}"/></svg>`;
763
815
  }
764
- /* the goal list (GsM1–M5): Key results, then Health budgets, one row per goal: the dot, the outcome, the reading with its age, and the owner. No
765
- * sparkline and no initiative status on a row: the chart and what moves it are in the Viewer. The same list on a phone and a desktop. */
766
- const okrRow = (g, o = {}) => OK.rowHtml(g, Object.assign({ today: today(), drafts: PF ? [] : draftsFor(g.id), drawDraft: drHtml, mark: markHtml,
767
- selecting, sel: selecting && picked.includes(g.id), meta: PF ? [g.prod, OK.metaOf(g, today())].filter(Boolean).join(' · ') : undefined }, PF ? {} : rowLook(g), o));
768
- const budgetOkr = (b) => OK.rowHtml(Object.assign({}, b, { title: b.outcome || b.title }), { budget: true, today: today(), meta: OK.budgetMeta(b, today()), dot: OK.dotOf(Object.assign({ anchor: b.anchor }, b)), drafts: draftsFor(b.id), drawDraft: drHtml, mark: markHtml });
816
+ /* ── the key results (Iq8Overview, GcJ2FirstMonday): one table, Key results · Now, of target · So far · By its date · Moved by, by objective,
817
+ * then Health budgets. A goal with fewer than 3 readings shows its reading, a grey dot for So far and "Known after 3 readings" for By its date;
818
+ * a read that failed or a held reading keeps the last good reading and says what happened under it (GcR4Failed, GcR5Held). The drafts that
819
+ * repair a goal sit under its row. On a phone each goal is a card (Iq8Phone). ── */
820
+ const COLS = 'ins-cols';
821
+ function barHtml(g, cls = '') {
822
+ return `<div class="ins-bar1${cls}" role="img" aria-label="${g.done === null ? 'No progress to read' : Math.round(g.done * 100) + '% of the way to the target'}${g.timeGone == null ? '' : ', ' + Math.round(g.timeGone * 100) + '% of its time gone'}"><i style="width:${g.done === null ? 0 : Math.round(g.done * 100)}%;background:${TONE_BAR[g.tone] || TONE_BAR.q}"></i>${g.timeGone == null ? '' : `<span class="today" title="today" style="left:${Math.round(g.timeGone * 100)}%"></span>`}</div>`;
823
+ }
824
+ /** The so-far sparkline: the readings at their dates across the goal's span, the target dashed, and the pace carried to the date, dashed. */
825
+ function sparkHtml(g, w = 210, h = 40) {
826
+ const c = g.key ? byKey(g.key) : null;
827
+ if (!c) return g.readings ? `<span class="ins-one"><span class="note">${g.readings === 1 ? '1 reading' : g.readings + ' readings'}</span><span class="cz-pill ins-dash">No trend yet</span></span>` : '<span class="note">No reading yet</span>'; // IsMenus: the one value, never a flat line
828
+ const t0 = day(c.pts[0].at), tl = day(c.pts[c.pts.length - 1].at), t1 = Math.max(tl, day(g.byAt) || tl);
829
+ const ys = c.pts.map((p) => p.v).concat(g.target !== null ? [g.target] : [], g.proj ? [g.proj.atDue] : []), lo = Math.min(...ys), hi = Math.max(...ys), rg = hi - lo || 1;
830
+ const x = (t) => 5 + (t1 > t0 ? (t - t0) / (t1 - t0) : 1) * (w - 10), y = (v) => 4 + (1 - (v - lo) / rg) * (h - 8);
831
+ const pts = c.pts.map((p) => x(day(p.at)).toFixed(1) + ',' + y(p.v).toFixed(1)), last = pts[pts.length - 1].split(',');
832
+ const fill = `${x(t0).toFixed(1)},${h} ${pts.join(' ')} ${last[0]},${h}`;
833
+ const proj = g.proj && day(g.byAt) > tl ? `<polyline points="${last.join(',')} ${x(day(g.byAt)).toFixed(1)},${y(g.proj.atDue).toFixed(1)}" class="pj"/>` : '';
834
+ return `<svg class="ins-spark" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}" role="img" aria-label="${esc(g.title + ': ' + c.pts.length + ' readings' + (g.targetTxt ? ', target ' + g.targetTxt : ''))}"><polygon points="${fill}" class="ar"/>${g.target !== null ? `<line x1="0" x2="${w}" y1="${y(g.target).toFixed(1)}" y2="${y(g.target).toFixed(1)}" class="tg"/>` : ''}${proj}<polyline points="${pts.join(' ')}" class="ln"/><circle cx="${last[0]}" cy="${last[1]}" r="3.6" class="dt" style="fill:${TONE_BAR[g.tone]}"/></svg>`;
835
+ }
836
+ /** A Count goal with a small whole target is drawn as blocks: one per unit of the target, the ones reached filled. */
837
+ const isBlocks = (g) => g.type === 'Count' && Number.isInteger(g.target) && g.target >= 1 && g.target <= 12 && Number.isInteger(g.now) && g.now >= 0;
838
+ const blocksHtml = (g, w, names = true) => `<div class="ins-blocks" style="width:${w}px" role="img" aria-label="${esc(g.now + ' of ' + g.target)}">${Array.from({ length: g.target }, (_, i) => `<i class="${i < g.now ? 'on' : ''}"></i>`).join('')}</div>`
839
+ + (names && g.items && g.items.length ? `<div class="note ins-items">${esc(g.items.slice(0, g.now).join(', '))}</div>` : ''); // the reached items, when the goal records them
840
+ /** The grey dot of So far while a goal has fewer than 3 readings (GcJ2FirstMonday): one reading is a starting point, not a trend. */
841
+ const firstDot = (g) => `<span class="ins-dot1" role="img" aria-label="${esc((GC.firstOf(g) || {}).n === 1 ? '1 reading, no trend yet' : '2 readings, no trend yet')}"></span>`;
842
+ function soFarHtml(g, w = 210) {
843
+ if (g.type === 'Done or not') return g.steps && g.steps.length ? stepsHtml(g) : '<span class="note">No steps recorded</span>';
844
+ if (GC.firstOf(g)) return firstDot(g);
845
+ if (g.type === 'Stay within' && g.target !== null && g.series && g.series.length) {
846
+ return bandSvg(g.series, g.target, g.limit !== 'floor', g.pace && g.pace.tone !== 'q' ? g.pace.tone : g.tone, g.title + ': ' + g.series.length + (g.series.length === 1 ? ' reading' : ' readings') + ', the green band is inside the budget', w);
847
+ }
848
+ if (isBlocks(g)) return blocksHtml(g, w);
849
+ return sparkHtml(g, w);
850
+ }
851
+ const PACE_C = { ok: 'var(--cz-ok)', late: 'var(--cz-late)', risk: 'var(--cz-risk)', q: 'var(--cz-ink3)' };
852
+ const GAP_DAYS = { hourly: 1 / 24, daily: 1, weekly: 7, monthly: 30 };
853
+ /** When the pace of a goal with fewer than 3 readings is known: the day of its 3rd reading, from its next read and its rhythm. */
854
+ function knownAt(g) {
855
+ const F = GC.firstOf(g); if (!F || !F.next) return '';
856
+ const c = (g.rhythm && g.rhythm.cadence) || (g.recipe && g.recipe.cadence), gap = GAP_DAYS[c];
857
+ const t = Date.parse(F.next); if (!Number.isFinite(t)) return '';
858
+ return GC.dayTxt(new Date(t + Math.max(0, 2 - F.n) * (gap || 0) * DAY).toISOString());
859
+ }
860
+ /** The pace column: "≈16.5% by Dec 31" with its words; "Known after 3 readings" and the day it will be while the line is too short. */
861
+ function paceHtml(g) {
862
+ if (GC.firstOf(g)) { const k = knownAt(g); return `<div class="pace" role="cell"><span>Known after 3 readings</span>${k ? `<div class="note">${esc(k)}</div>` : ''}</div>`; }
863
+ return `<div class="pace" role="cell"><b style="color:${PACE_C[g.pace.tone]}">${esc(g.pace.head)}</b><div class="note">${esc(g.pace.sub)}</div></div>`;
864
+ }
865
+ /** What happened to a goal's last reading, said once under its number: "not read Mon 16 Nov", "1 reading held". */
866
+ const gcSay = (g) => (g.failed ? 'not read ' + GC.dayTxt(g.failed.at) : (g.held || []).length ? ((g.held.length === 1 ? '1 reading' : g.held.length + ' readings') + ' held') : '');
867
+ function goalSub(g) {
868
+ const by = day(g.byAt), late = per && by !== null && by > per.to && per.key !== 'y' && per.key !== 'c';
869
+ if (g.type === 'Done or not') return [g.steps && g.steps.length ? g.steps.filter((x) => x.done).length + ' of ' + g.steps.length + ' steps' : '', by !== null ? 'due ' + md(by) : ''].filter(Boolean).join(' · ');
870
+ if (g.type === 'Stay within') return [g.dirTxt + ' ' + (g.targetTxt || ''), g.alwaysOn ? 'always on' : by !== null ? 'until ' + md(by) : ''].filter(Boolean).join(' · ');
871
+ const from = g.baseTxt ? 'from ' + g.baseTxt + (g.fromAt && (g.type === 'Percentage' || g.type === 'Amount') ? ' on ' + md(day(g.fromAt)) : '') : '';
872
+ const cp = late ? (g.checkpoints || []).find((c) => day(c.by) >= per.from && day(c.by) <= per.to) : null;
873
+ return [g.dirTxt, from, late ? 'due ' + md(by) + ' ' + new Date(by).getUTCFullYear() + ' · ' + (cp ? per.short + ' checkpoint ' + unitV(g, cp.target) : 'no ' + per.short + ' checkpoint recorded') : ''].filter(Boolean).join(' · ');
874
+ }
875
+ /** The drafts that repair a goal or a budget, as one full row under it (zero is silence). */
876
+ const draftsRow = (id) => { const D = PF ? [] : draftsFor(id); return D.length ? `<div class="ins-drr" role="row" data-drafts-for="${esc(id)}"><div role="cell">${D.map(drHtml).join('')}</div></div>` : ''; };
877
+ /** The number a row shows: after a failed read or a held reading it is the last good one (GcR4Failed, GcR5Held), never the held value. */
878
+ const nowOf = (g) => ((g.failed || (g.held || []).length) && g.lastRead && g.lastRead.txt ? g.lastRead.txt : g.nowTxt) || '—';
879
+ function goalRow(g) {
880
+ const sel = selecting && picked.includes(g.id), warn = gcSay(g), crit = OK.dotOf(g) === 'broken';
881
+ return `<div class="ins-tr ins-row ${COLS}${sel ? ' sel' : ''}${crit ? ' crit' : ''}" role="row" data-goal="${esc(g.id)}" tabindex="0" aria-label="${esc(g.title)}"${selecting ? ` aria-selected="${sel}"` : ''}>`
882
+ + `<div class="nm" role="cell">${crit ? OK.dotHtml('broken') : ''}<span><b>${markHtml(g.title)}</b><small><span class="cz-pill q ins-type">${esc(g.type)}</span><span class="ins-sub" title="${esc(goalSub(g))}">${esc(PF && g.prod ? [g.prod, goalSub(g)].filter(Boolean).join(' · ') : goalSub(g))}</span></small></span></div>`
883
+ + `<div class="val" role="cell"><b>${esc(nowOf(g))}</b> <span class="note">${esc(g.targetTxt ? 'of ' + g.targetTxt : 'no target')}</span>${warn ? `<div class="note ins-warn">${esc(warn)}</div>` : GC.firstOf(g) ? '' : barHtml(g)}</div>`
884
+ + `<div class="sofar" role="cell">${soFarHtml(g)}</div>`
885
+ + paceHtml(g)
886
+ + `<div class="mv" role="cell">${g.moves.length ? g.moves.slice(0, 3).map((r) => initRow(r)).join('') + (g.moves.length > 3 ? `<span class="note">and ${g.moves.length - 3} more</span>` : '') : `<span class="note">${M.initiativesRead ? 'No initiative anchors to it' : 'The initiatives are not read yet'}</span>`}</div>`
887
+ + '</div>' + draftsRow(g.id);
888
+ }
889
+ /** A health budget (D59): always on. Its reading is its share of the board's open initiatives, against its quarterly cap (planning/okrs/health-budgets.md). */
890
+ const pct = (v) => Math.round(v * 100) + '%';
891
+ function budgetRow(b) {
892
+ const R = b.reading, cap = b.cap;
893
+ const val = R ? `<b>${R.n}</b> <span class="note">of ${R.total} open initiatives</span>` : '<b>—</b> <span class="note">' + (b.declared ? 'the initiatives are not read' : 'not in the budget registry') + '</span>';
894
+ const scale = R && R.share !== null && cap !== null ? Math.max(cap * 1.5, R.share) || 1 : 1;
895
+ const bar = R && R.share !== null && cap !== null ? `<div class="ins-bar1" role="img" aria-label="${esc(pct(R.share) + ' of open initiatives, cap ' + pct(cap))}"><i style="width:${Math.round(R.share / scale * 100)}%;background:${R.over ? TONE_BAR.late : TONE_BAR.ok}"></i><span class="today" title="cap" style="left:${Math.round(cap / scale * 100)}%"></span></div>` : barHtml({ done: null, timeGone: null, tone: 'q' });
896
+ const pace = !R || R.share === null ? ['var(--cz-ink3)', '—', b.declared ? 'no open initiative to share' : 'add it to health-budgets.md to give it a cap']
897
+ : R.over ? ['var(--cz-late)', 'Over its ' + pct(cap) + ' cap', pct(R.share) + ' of open initiatives'] : ['var(--cz-ok)', 'Within its ' + pct(cap) + ' cap', pct(R.share) + ' of open initiatives'];
898
+ return `<div class="ins-tr ins-row ${COLS} ins-budget${R && R.over ? ' crit' : ''}" role="row" data-budget="${esc(b.id)}" tabindex="0" aria-label="${esc(b.title)}">`
899
+ + `<div class="nm" role="cell">${R && R.over ? OK.dotHtml('broken') : ''}<span><b>${markHtml(b.title)}</b><small><span class="cz-pill q ins-type">Stay within</span><span class="ins-sub">always on${cap !== null ? ' · cap ' + pct(cap) + ' of a quarter' : ''}</span></small></span></div>`
900
+ + `<div class="val" role="cell">${val}${bar}</div>`
901
+ + `<div class="sofar" role="cell">${R && R.share !== null && cap !== null ? bandSvg([{ at: M.today || iso(today()), v: R.share * 100 }], cap * 100, true, R.over ? 'late' : 'ok', b.title + ': ' + pct(R.share) + ' of open initiatives, the green band is inside its ' + pct(cap) + ' cap') : ''}<span class="note">${esc(b.covers ? 'Covers ' + b.covers : 'What it covers is not declared')}</span></div>`
902
+ + `<div class="pace" role="cell"><b style="color:${pace[0]}">${esc(pace[1])}</b><div class="note">${esc(pace[2])}</div></div>`
903
+ + `<div class="mv" role="cell">${b.moves.length ? b.moves.slice(0, 3).map((r) => initRow(r)).join('') : '<span class="note">No initiative anchors to it</span>'}</div></div>` + draftsRow(b.id);
904
+ }
905
+ const GRP_PILL = (L) => {
906
+ const scored = L.filter((g) => g.tone !== 'q'), bad = scored.filter((g) => g.tone === 'late' || g.tone === 'red').length;
907
+ return !scored.length ? '' : bad ? `<span class="cz-pill late">${bad} of ${L.length} behind</span>` : '<span class="cz-pill ok">on track</span>';
908
+ };
769
909
  function drawGoals() {
770
910
  const G = goalsShown(), T = $('#goalTbl');
771
911
  document.body.classList.toggle('ins-trv', dash === TRENDS);
772
- T.classList.toggle('okr-list', dash !== TRENDS);
773
- $('#goalCards').innerHTML = '';
774
- if (dash === TRENDS) { T.innerHTML = bmHtml(true); return; }
912
+ if (dash === TRENDS) { T.innerHTML = bmHtml(true); $('#goalCards').innerHTML = ''; return; }
913
+ const head = `<div class="ins-tr ins-th ${COLS}" role="row"><div role="columnheader">Key results <span>${G.length} · ${esc(per ? per.label : '')}</span></div><div role="columnheader">Now, of target <span class="ins-lg"><span><i class="ins-tdk"></i>today</span></span></div><div role="columnheader">So far</div><div role="columnheader">By its date</div><div role="columnheader" class="ins-mvh">Moved by <span class="ins-lg"><span><i class="ins-trk"><i class="k"></i></i>Skipped</span><span><i class="ins-trk"><i class="p m"></i></i>Milestone</span></span></div></div>`;
775
914
  const D = curDash();
776
- const krDrafts = []; // batch 18 item 11: a drafted key result is a row of the drafts table
777
- const sub = per ? per.label : '';
778
- const head = `<div class="okr-sec"><h2 class="okr-h">Key results</h2><span class="note">${esc(sub)}</span></div>`;
779
- if (!M.goals.filter(isKr).length && !krDrafts.length) {
915
+ if (!M.goals.filter(isKr).length) {
780
916
  // the drafts table above says what is drafted: no empty card under it (zero is silence)
781
- T.innerHTML = PF || !tableRows().length ? head + '<div class="okr-card"><p class="okr-none">No key result is recorded for this workspace.</p></div>' + budgetsHtml(D) : budgetsHtml(D);
782
- return;
917
+ const B = budgetsHtml(D);
918
+ T.innerHTML = PF || !tableRows().length ? '<div class="ins-empty"><b>No key result is recorded for this workspace.</b> A key result is a metric with a target and a date. Press + to add one.</div>' + B : B;
919
+ T.hidden = !T.innerHTML; drawCards([]); return;
783
920
  }
784
- /* by objective when there is more than one; Portfolio groups by product */
921
+ T.hidden = false;
922
+ /* by objective; Portfolio groups by product, each product's objectives said in its rows */
785
923
  const keyOf = (g) => (PF ? g.prod : g.pillar || '');
786
924
  const by = new Map(); for (const g of G) { const k = keyOf(g); if (!by.has(k)) by.set(k, []); by.get(k).push(g); }
787
925
  const objs = [...new Set(M.goals.filter(isKr).map((g) => g.pillar || ''))];
788
- const sub1 = by.size > 1 || PF ? (k) => `<p class="okr-obj">${PF ? esc(k || 'A product') : k ? 'Objective ' + (objs.indexOf(k) + 1) + ' · ' + esc(k) : 'No objective'}</p>` : () => '';
789
- const groups = [...by.entries()].map(([k, L]) => sub1(k) + L.map((g) => okrRow(g)).join('')).join('');
790
- const drafted = krDrafts.map((r) => (drEdit === r.id ? `<div class="okr-row">${drEditHtml(r)}</div>` : OK.draftRowHtml(r))).join('');
791
- T.innerHTML = head + (G.length || drafted ? `<div class="okr-card">${groups}${drafted}</div>` : `<div class="okr-card"><p class="okr-none">No goal matches${find ? ' “' + esc(find) + '”' : ''}${noFilter() ? '' : ' this filter'} in ${esc(per.label)}. <button type="button" class="lk" id="goalsAll">Show every goal</button></p></div>`) + budgetsHtml(D);
926
+ const head1 = (k) => (PF ? esc(k || 'A product') : k ? 'Objective ' + (objs.indexOf(k) + 1) + ' · ' + esc(k) : 'No objective');
927
+ const groups = [...by.entries()].map(([k, L]) => `<div class="ins-grp" role="row"><span role="cell">${head1(k)}</span> <span class="q">${esc(per ? per.label : '')}</span>${GRP_PILL(L)}</div>` + L.map(goalRow).join('')).join('');
928
+ T.innerHTML = head + (G.length ? groups : `<div class="ins-empty">No goal matches${find ? ' “' + esc(find) + '”' : ''}${noFilter() ? '' : ' this filter'} in ${esc(per.label)}. <button type="button" class="lk" id="goalsAll">Show every goal</button></div>`) + budgetsHtml(D);
929
+ drawCards(G);
792
930
  }
793
- const pct = (v) => Math.round(v * 100) + '%';
794
931
  function budgetsHtml(D) {
795
932
  if (PF || D.saved || D.id.startsWith('p:') || (!M.initiativesRead && !(M.budgets || []).length) || (filt.kind.length && !filt.kind.includes('budgets'))) return '';
796
933
  const B = (M.budgets || []).filter((b) => hit(b.title, ...b.moves.map((m) => m.title)) && ownerHit(b.moves.map((m) => m.owner).filter(Boolean)) && (!filt.status.length || filt.status.includes(budgetStatus(b))));
797
934
  if (!B.length) return ''; // zero is silence
798
- return `<div class="okr-sec"><h2 class="okr-h">Health budgets</h2></div><div class="okr-card">${B.map(budgetOkr).join('')}</div>`;
935
+ return '<div class="ins-grp" role="row"><span role="cell">Health budgets</span> <span class="q">always on, judged every week</span></div>' + B.map(budgetRow).join('');
799
936
  }
937
+ /* the phone (Iq8Phone): one card per goal, its status at the top right, its value, its so-far, its bar and the first initiative that moves it */
938
+ function cardPill(g) {
939
+ if (g.failed) return ['risk', 'Not read'];
940
+ if ((g.held || []).length) return ['risk', 'Held'];
941
+ if (GC.firstOf(g)) return null;
942
+ const t = g.pace && g.pace.tone !== 'q' ? g.pace.tone : g.tone;
943
+ if (t === 'late' || t === 'red') return ['late', 'Behind'];
944
+ if (t === 'ok') return g.done !== null && g.timeGone != null && g.done > g.timeGone ? ['ok', 'Ahead'] : ['ok', 'On track'];
945
+ return null;
946
+ }
947
+ function drawCards(G) {
948
+ $('#goalCards').innerHTML = G.map((g) => {
949
+ const p = cardPill(g), tg = g.targetTxt ? (g.type === 'Count' ? 'of ' : 'target ') + g.targetTxt + (g.byAt ? ' by ' + md(day(g.byAt)) : '') : 'no target', first = GC.firstOf(g);
950
+ const gr = first ? `<span class="note">${esc(GC.firstMeta(g).split(' · ').slice(1).join(' · '))}</span>` : isBlocks(g) ? blocksHtml(g, 190, false) : g.type === 'Stay within' && g.series.length && g.target !== null ? bandSvg(g.series, g.target, g.limit !== 'floor', g.tone, g.title, 190, 30) : g.key ? sparkHtml(g, 190, 30) : '';
951
+ return `<div class="ins-card" role="listitem" data-goal="${esc(g.id)}" tabindex="0" aria-label="${esc(g.title)}"><div class="ins-ch"><b>${esc(g.title)}</b>${p ? `<span class="cz-pill ${p[0]}">${p[1]}</span>` : ''}</div>`
952
+ + `<div class="ins-cs"><span class="cz-pill q ins-type">${esc(g.type)}</span><span class="note">${esc(tg)}</span></div>`
953
+ + `<div class="ins-cv"><b>${esc(nowOf(g))}</b><span class="ins-cg">${gr}</span></div>${first || gcSay(g) ? '' : barHtml(g, ' ins-wide')}`
954
+ + (g.moves[0] ? `<div class="ins-c1">${initRow(g.moves[0], false)}</div>` : '') + '</div>' + (PF ? '' : draftsFor(g.id).map(drHtml).join(''));
955
+ }).join('') || (M.goals.filter(isKr).length ? '<p class="note">No goal in this period.</p>' : '');
956
+ }
957
+ $('#goalCards').addEventListener('click', (e) => { if (e.target.closest('a, .okr-dr')) return; const c = e.target.closest('[data-goal]'); if (c) pressGoal(c.dataset.goal); });
800
958
  $('#goalTbl').addEventListener('click', (e) => {
801
959
  if (e.target.closest('#goalsAll')) { find = ''; $('#findIn').value = ''; clearFilter(); per = periods()[3]; redraw(); return; }
802
960
  if (e.target.closest('a')) return;
@@ -805,7 +963,7 @@ $('#goalTbl').addEventListener('click', (e) => {
805
963
  const bu = e.target.closest('[data-budget]'); if (bu) { openBudget(bu.dataset.budget); return; }
806
964
  const r = e.target.closest('[data-goal]'); if (r) pressGoal(r.dataset.goal);
807
965
  });
808
- $('#goalTbl').addEventListener('keydown', (e) => { if (e.key !== 'Enter' && e.key !== ' ') return; const r = e.target.closest && e.target.closest('.okr-main, .ins-row, [data-tile]'); if (!r || e.target !== r) return; e.preventDefault(); r.click(); });
966
+ $('#goalTbl').addEventListener('keydown', (e) => { if (e.key !== 'Enter' && e.key !== ' ') return; const r = e.target.closest && e.target.closest('.ins-row, [data-tile]'); if (!r || e.target !== r) return; e.preventDefault(); r.click(); });
809
967
  /** A goal press: picks it while New dashboard is open; opens Edit chart on a saved dashboard (AgInsChart); otherwise the goal's detail (IsGoal). */
810
968
  function pressGoal(id) {
811
969
  if (selecting) { picked = picked.includes(id) ? picked.filter((x) => x !== id) : picked.concat(id); drawGoals(); drawDashSide(); return; }
@@ -832,8 +990,12 @@ function detailSvg(g, c, W = 490, H = 150) {
832
990
  const x = (t) => 12 + (t1 > t0 ? (t - t0) / (t1 - t0) : 1) * (W - 24), y = (v) => 26 + (1 - (v - lo) / rg) * (H - 56), f = (n) => n.toFixed(1);
833
991
  let out = '';
834
992
  if (g.target !== null) { const ty = y(g.target); out += `<path class="tg" d="M0 ${f(ty)}H${W}"/><text class="tgl" x="${W - 2}" y="${f(ty < 18 ? ty + 14 : ty - 6)}" text-anchor="end">Target ${esc(g.targetTxt)}</text>`; }
835
- for (const s of shipsOf(g)) { if (s.t < t0 || s.t > t1) continue; const sx = x(s.t), end = sx > W - 160; out += `<path class="ship" d="M${f(sx)} 20V${H - 10}"/><text class="shipl" x="${f(end ? sx - 4 : sx + 4)}" y="${H - 14}"${end ? ' text-anchor="end"' : ''}>${esc(s.label)}</text>`; }
836
- for (const m of marks) { const mx = x(m.t), end = mx > W - 120; out += `<path class="msr" d="M${f(mx)} 14V${H - 16}"/><path class="msd" d="M${f(mx)} ${H - 14}l5 5-5 5-5-5z"/><text class="msl" x="${f(end ? mx - 9 : mx + 9)}" y="${H - 5}"${end ? ' text-anchor="end"' : ''}>${esc(m.label)}</text>`; }
993
+ // the labels at the foot never overlap: the first milestone label (Deliver, Evaluate) keeps the bottom line, and a milestone or release label
994
+ // that would touch one moves up a line (7.5 units a character is the bold label font, a little over; a line is 17 units)
995
+ const lanes = [], laneOf = (a, b) => { let i = 0; while ((lanes[i] || []).some(([p, q]) => a < q + 6 && b > p - 6)) i++; (lanes[i] = lanes[i] || []).push([a, b]); return i; };
996
+ const span = (px, end, label) => { const w = String(label).length * 7.5; return end ? [px - w, px] : [px, px + w]; };
997
+ for (const m of marks) { const mx = x(m.t), end = mx > W - 120, lx = end ? mx - 9 : mx + 9; const [a, b] = span(lx, end, m.label), ly = H - 5 - 17 * laneOf(Math.min(a, mx - 6), Math.max(b, mx + 6)); out += `<path class="msr" d="M${f(mx)} 14V${H - 16}"/><path class="msd" d="M${f(mx)} ${H - 14}l5 5-5 5-5-5z"/><text class="msl" x="${f(lx)}" y="${ly}"${end ? ' text-anchor="end"' : ''}>${esc(m.label)}</text>`; }
998
+ for (const s of shipsOf(g)) { if (s.t < t0 || s.t > t1) continue; const sx = x(s.t), end = sx > W - 160, lx = end ? sx - 4 : sx + 4, ly = H - 5 - 17 * laneOf(...span(lx, end, s.label)); out += `<path class="ship" d="M${f(sx)} 20V${H - 10}"/><text class="shipl" x="${f(lx)}" y="${ly}"${end ? ' text-anchor="end"' : ''}>${esc(s.label)}</text>`; }
837
999
  const L = pts.map((p) => f(x(day(p.at))) + ' ' + f(y(p.v))), last = L[L.length - 1];
838
1000
  out += `<path class="ln" d="M${L.join('L')}"/>` + (proj ? `<path class="pj" d="M${last}L${f(x(proj.t))} ${f(y(proj.v))}"/>` : '');
839
1001
  out += `<circle class="pt now" cx="${f(x(day(pts[pts.length - 1].at)))}" cy="${f(y(pts[pts.length - 1].v))}" r="3.5"/>`;
@@ -934,8 +1096,8 @@ function goalBodyHtml(g, o) {
934
1096
  o.own && savedDash().length ? { id: 'dash', title: 'On dashboards', count: onDash, render: () => dashSwitches(g) } : null,
935
1097
  ];
936
1098
  const ask = `<form class="ins-askf" data-askf><input name="q" maxlength="300" autocomplete="off" placeholder="Ask about this goal" aria-label="Ask about this goal"><button type="submit" class="cz-ib sm solid" aria-label="Ask in Home" title="Ask in Home">${SV(I.up)}</button></form>`;
937
- const failedOrHeld = !!(g.failed || (g.held || []).length);
938
- return head + form + (failedOrHeld ? kr : '') + `<div class="ins-gbig">${chart}</div>` + (failedOrHeld ? '' : kr) + whyCard + window.czViewer.czSections(rows.filter(Boolean), { key: 'goal' }) + '<p class="note ins-gmsg" data-gmsg role="status"></p>' + ask;
1099
+ // GcR3Goal: the panel leads with the number and how it is counted, never with its chart; the chart follows the words
1100
+ return head + form + kr + `<div class="ins-gbig">${chart}</div>` + whyCard + window.czViewer.czSections(rows.filter(Boolean), { key: 'goal' }) + '<p class="note ins-gmsg" data-gmsg role="status"></p>' + ask;
939
1101
  }
940
1102
  /** The goal as plain text, for Copy as text. */
941
1103
  function goalText(g) {
@@ -98,3 +98,5 @@
98
98
  .tkc .tkc-hu { width: 30px; height: 30px; border-radius: 999px; border: 0; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
99
99
  .tkc .tkc-hu:hover { background: var(--cz-well); color: var(--cz-ink); }
100
100
  .tkc .seg .ivq-del:hover, .tkc .seg .ivq-del:focus-visible { color: var(--cz-red); background: var(--cz-redbg, transparent); }
101
+ /* one date (batch 18 item 16, StA4Milestone): a milestone's picker names its one day, with no Start and Due tabs */
102
+ .tkc .tkc-dp .one { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px; margin-bottom: 8px; font-size: var(--fs-3); color: var(--cz-ink); }
@@ -126,7 +126,10 @@ function picker(t, o, now) {
126
126
  const tom = (() => { const d = todayOf(now); d.setDate(d.getDate() + 1); return isoOf(d); })();
127
127
  const two = ['start', 'due'].map((f) => `<button type="button" data-tkc-field="${f}"${f === field ? ' class="on" aria-pressed="true"' : ' aria-pressed="false"'}><small>${f === 'start' ? 'Start' : 'Due'}</small><b>${esc(short(t[f]) || 'None')}</b></button>`).join('');
128
128
  const prevM = isoOf(new Date(y, m - 1, 1)).slice(0, 7), nextM = isoOf(new Date(y, m + 1, 1)).slice(0, 7);
129
- return `<div class="tkc-pop tkc-dp" role="dialog" aria-label="Start and due"><div class="two">${two}</div>`
129
+ // one date (batch 18 item 16, StA4Milestone): a milestone has its day only, so the Start and Due tabs give way to "◇ Date"; o.head: a
130
+ // sheet's own head (its title and ✕), drawn first
131
+ const top = o.one ? (o.head ? '' : `<div class="one">${ico('<path d="M12 4l8 8-8 8-8-8z"/>', 14)}<b>Date</b></div>`) : `<div class="two">${two}</div>`;
132
+ return `<div class="tkc-pop tkc-dp${o.one ? ' one' : ''}" role="dialog" aria-label="${o.one ? 'Date' : 'Start and due'}">${o.head || ''}${top}`
130
133
  + `<div class="qk"><button type="button" data-tkc-day="${today}">Today</button><button type="button" data-tkc-day="${tom}">Tomorrow</button><button type="button" data-tkc-day="${fri}">Fri</button>`
131
134
  + `<button type="button" data-tkc-day="" aria-label="Clear the ${field === 'start' ? 'start' : 'due'} date" title="Clear">${ico(I.clear, 14)}</button></div>`
132
135
  + `<div class="mh"><button type="button" class="tkc-ib s" data-tkc-month="${prevM}" aria-label="Previous month">${ico(I.prev, 16)}</button><span>${MONTHS[m]} ${y}</span><button type="button" class="tkc-ib s" data-tkc-month="${nextM}" aria-label="Next month">${ico(I.next, 16)}</button></div>`