@adminide-stack/clock-tik-browser 12.0.30 → 12.0.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.
Files changed (76) hide show
  1. package/lib/pages/Home/HomePage.d.ts.map +1 -1
  2. package/lib/pages/Home/HomePage.js +1091 -325
  3. package/lib/pages/Home/HomePage.js.map +1 -1
  4. package/lib/pages/Home/__tests__/device.test.d.ts +2 -0
  5. package/lib/pages/Home/__tests__/device.test.d.ts.map +1 -0
  6. package/lib/pages/Home/__tests__/failure.test.d.ts +2 -0
  7. package/lib/pages/Home/__tests__/failure.test.d.ts.map +1 -0
  8. package/lib/pages/Home/__tests__/qr.test.d.ts +2 -0
  9. package/lib/pages/Home/__tests__/qr.test.d.ts.map +1 -0
  10. package/lib/pages/Home/__tests__/textLink.test.d.ts +2 -0
  11. package/lib/pages/Home/__tests__/textLink.test.d.ts.map +1 -0
  12. package/lib/pages/Home/__tests__/timeBack.test.d.ts +2 -0
  13. package/lib/pages/Home/__tests__/timeBack.test.d.ts.map +1 -0
  14. package/lib/pages/Home/assets.js +0 -2
  15. package/lib/pages/Home/assets.js.map +1 -1
  16. package/lib/pages/Home/chat/ChoresChat.d.ts +3 -1
  17. package/lib/pages/Home/chat/ChoresChat.d.ts.map +1 -1
  18. package/lib/pages/Home/chat/ChoresChat.js +212 -31
  19. package/lib/pages/Home/chat/ChoresChat.js.map +1 -1
  20. package/lib/pages/Home/chat/chatTheme.d.ts +2 -1
  21. package/lib/pages/Home/chat/chatTheme.d.ts.map +1 -1
  22. package/lib/pages/Home/chat/chatTheme.js +298 -15
  23. package/lib/pages/Home/chat/chatTheme.js.map +1 -1
  24. package/lib/pages/Home/chat/failure.d.ts +8 -0
  25. package/lib/pages/Home/chat/failure.d.ts.map +1 -0
  26. package/lib/pages/Home/chat/failure.js +24 -0
  27. package/lib/pages/Home/chat/failure.js.map +1 -0
  28. package/lib/pages/Home/chat/thread.d.ts +5 -0
  29. package/lib/pages/Home/chat/thread.d.ts.map +1 -1
  30. package/lib/pages/Home/chat/thread.js +24 -1
  31. package/lib/pages/Home/chat/thread.js.map +1 -1
  32. package/lib/pages/Home/content.d.ts +38 -16
  33. package/lib/pages/Home/content.d.ts.map +1 -1
  34. package/lib/pages/Home/content.js +79 -30
  35. package/lib/pages/Home/content.js.map +1 -1
  36. package/lib/pages/Home/homeStyles.d.ts +2 -0
  37. package/lib/pages/Home/homeStyles.d.ts.map +1 -1
  38. package/lib/pages/Home/homeStyles.js +1902 -491
  39. package/lib/pages/Home/homeStyles.js.map +1 -1
  40. package/lib/pages/Home/imessage/ImessageDialog.d.ts +14 -0
  41. package/lib/pages/Home/imessage/ImessageDialog.d.ts.map +1 -0
  42. package/lib/pages/Home/imessage/ImessageDialog.js +277 -0
  43. package/lib/pages/Home/imessage/ImessageDialog.js.map +1 -0
  44. package/lib/pages/Home/imessage/ImessageIcon.d.ts +5 -0
  45. package/lib/pages/Home/imessage/ImessageIcon.d.ts.map +1 -0
  46. package/lib/pages/Home/imessage/ImessageIcon.js +42 -0
  47. package/lib/pages/Home/imessage/ImessageIcon.js.map +1 -0
  48. package/lib/pages/Home/imessage/QrCode.d.ts +6 -0
  49. package/lib/pages/Home/imessage/QrCode.d.ts.map +1 -0
  50. package/lib/pages/Home/imessage/QrCode.js +86 -0
  51. package/lib/pages/Home/imessage/QrCode.js.map +1 -0
  52. package/lib/pages/Home/imessage/device.d.ts +31 -0
  53. package/lib/pages/Home/imessage/device.d.ts.map +1 -0
  54. package/lib/pages/Home/imessage/device.js +31 -0
  55. package/lib/pages/Home/imessage/device.js.map +1 -0
  56. package/lib/pages/Home/imessage/qr.d.ts +42 -0
  57. package/lib/pages/Home/imessage/qr.d.ts.map +1 -0
  58. package/lib/pages/Home/imessage/qr.js +469 -0
  59. package/lib/pages/Home/imessage/qr.js.map +1 -0
  60. package/lib/pages/Home/imessage/textLink.d.ts +70 -0
  61. package/lib/pages/Home/imessage/textLink.d.ts.map +1 -0
  62. package/lib/pages/Home/imessage/textLink.js +224 -0
  63. package/lib/pages/Home/imessage/textLink.js.map +1 -0
  64. package/lib/pages/Home/index.d.ts +15 -0
  65. package/lib/pages/Home/index.d.ts.map +1 -1
  66. package/lib/pages/Home/index.js +23 -28
  67. package/lib/pages/Home/index.js.map +1 -1
  68. package/lib/pages/Home/platform.d.ts +5 -0
  69. package/lib/pages/Home/platform.d.ts.map +1 -1
  70. package/lib/pages/Home/platform.js +8 -1
  71. package/lib/pages/Home/platform.js.map +1 -1
  72. package/lib/pages/Home/timeBack.d.ts +10 -0
  73. package/lib/pages/Home/timeBack.d.ts.map +1 -0
  74. package/lib/pages/Home/timeBack.js +12 -0
  75. package/lib/pages/Home/timeBack.js.map +1 -0
  76. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Suspense,lazy}from'react';import {createPortal}from'react-dom';import {Briefcase,PhoneCall,Plane,Wrench,Users,ShoppingCart,RefreshCcw,Receipt,ArrowRight,Workflow,BookOpen,Timer,ArrowUp,PackageOpen,Landmark,Smile,UtensilsCrossed,CalendarClock,Play}from'lucide-react';import {canLogin,beginLogin,captureLoginCallback,reconcileStoredToken,clearCdecliToken,hasCdecliToken,tokenExpiringSoon}from'@yantra/surface-kit/auth';import {businessHref}from'./business.js';import {ensurePlatformAnchor,appChatLink}from'./platform.js';import {HOME_ASSETS}from'./assets.js';import {HomeStyles}from'./homeStyles.js';import {savePendingChore,takePendingChore}from'./chat/thread.js';import {MINUTES,HERO_CHORES,VIDEO_NOTE,HOUSEWORK_MIN,AREAS,STEPS,BUSINESS_PRODUCTS,FOOTNOTE,BUSINESS_LINKS}from'./content.js';import {Mark,AnimatedMark}from'./Logo.js';import {emitAnalyticsEvent}from'../../utils/analytics.js';const AREA_ICONS = {
1
+ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useRef,useState,useCallback,useEffect,Suspense,lazy}from'react';import {createPortal}from'react-dom';import {ArrowUpRight,ShieldCheck,PhoneCall,Plane,Wrench,Users,ShoppingCart,RefreshCcw,Receipt,Plus,Briefcase,ArrowUp,PackageOpen,Landmark,Smile,UtensilsCrossed,CalendarClock,ArrowRight,Check,Play,X}from'lucide-react';import {canLogin,beginLogin,captureLoginCallback,reconcileStoredToken,clearCdecliToken,getCdecliToken,hasCdecliToken,tokenExpiringSoon}from'@yantra/surface-kit/auth';import {businessHref}from'./business.js';import {ensurePlatformAnchor,appChatLink,appTextingLink,yantraAppUrl}from'./platform.js';import {HOME_ASSETS}from'./assets.js';import {HomeStyles}from'./homeStyles.js';import {savePendingImessage,savePendingChore,takePendingChore,takePendingImessage,accountKeyFromToken}from'./chat/thread.js';import {MINUTES,TYPED_CHORES,HERO_CHORES,STRIP_CHORES,STEPS,VIDEO_NOTE,TEXT_STEPS,AREAS,HOUSEWORK_MIN,FAQS,FOOTNOTE,CALL_STEPS,TEXT_THREAD,SITE_LINKS}from'./content.js';import {ImessageIcon}from'./imessage/ImessageIcon.js';import {clearTextLinkCodes}from'./imessage/textLink.js';import {Mark,AnimatedMark}from'./Logo.js';import {timeBack}from'./timeBack.js';import {emitAnalyticsEvent}from'../../utils/analytics.js';const AREA_ICONS = {
2
2
  bills: Receipt,
3
3
  subscriptions: RefreshCcw,
4
4
  groceries: ShoppingCart,
@@ -16,12 +16,6 @@ const CHORE_ICONS = {
16
16
  bank: Landmark,
17
17
  return: PackageOpen
18
18
  };
19
- const BUSINESS_ICONS = {
20
- time: Timer,
21
- hr: Users,
22
- books: BookOpen,
23
- workflows: Workflow
24
- };
25
19
  const REELS = [{
26
20
  src: HOME_ASSETS.reelInternet,
27
21
  poster: HOME_ASSETS.reelInternetPoster,
@@ -35,11 +29,48 @@ const REELS = [{
35
29
  result: 'Cancelled by phone, $600 a year back',
36
30
  label: 'Lucy calls the gym, declines three offers and cancels'
37
31
  }];
32
+ const STATS = [{
33
+ to: 38,
34
+ unit: 'min',
35
+ label: 'every day'
36
+ }, {
37
+ to: 4.4,
38
+ decimals: 1,
39
+ unit: 'hrs',
40
+ label: 'every week'
41
+ }, {
42
+ to: 229,
43
+ unit: 'hrs',
44
+ label: 'every year'
45
+ }];
46
+ /**
47
+ * Specks that drift up through the hero's glow. Fixed rather than random, so the server and the
48
+ * browser draw the same markup; a negative delay starts each one part-way through its rise. The
49
+ * first six, all a phone shows, still spread across the width.
50
+ */
51
+ const MOTES = [['7%', '58%', 3, '#ff8a3d', 15, -3, 14], ['49%', '38%', 2, '#ffb36b', 17, -14, -16], ['89%', '58%', 3, '#ff5a00', 23, -15, 12], ['23%', '74%', 4, '#ffc45c', 21, -1, 18], ['65%', '50%', 2, '#ff8fa3', 20, -10, -12], ['40%', '66%', 3, '#ffb36b', 22, -6, 12], ['15%', '32%', 2, '#ff5a00', 18, -9, -10], ['57%', '72%', 3, '#ff8fa3', 19, -4, 10], ['81%', '36%', 2, '#ffc45c', 16, -8, -6], ['31%', '46%', 2, '#ff8a3d', 16, -12, -8], ['73%', '64%', 4, '#ffb36b', 18, -2, 16], ['94%', '80%', 2, '#ff8fa3', 20, -5, -14]];
38
52
  /** The longest chore the composer takes. */
39
53
  const PROMPT_MAX = 2000;
54
+ const PLACEHOLDER = 'What should Lucy take off your plate?';
55
+ const NO_PHRASES = [];
56
+ /** The composer's typewriter: a chore typed out, held, taken back, and the next one. */
57
+ const TYPE_START_MS = 700;
58
+ const TYPE_MS = 34;
59
+ const TYPE_JITTER_MS = 36;
60
+ const TYPE_HOLD_MS = 1800;
61
+ const TYPE_DELETE_MS = 16;
62
+ const TYPE_GAP_MS = 420;
63
+ /** How long a revealed element rises (with its stagger) before its own transitions take over. */
64
+ const RISE_MS = 1400;
65
+ const COUNT_MS = 1400;
66
+ const CALL_STEP_MS = 1500;
67
+ const CALL_HOLD_MS = 3400;
40
68
  /** The page's chat, fetched the first time it is needed (or when the composer is focused). */
41
69
  const loadChat = () => import('./chat/ChoresChat.js');
42
70
  const ChoresChat = lazy(loadChat);
71
+ /** The iMessage dialog and its QR encoder, fetched when someone reaches for it. */
72
+ const loadImessage = () => import('./imessage/ImessageDialog.js');
73
+ const ImessageDialog = lazy(loadImessage);
43
74
  /** Signed in, with a token that is not about to lapse. */
44
75
  function hasLiveToken() {
45
76
  return hasCdecliToken() && !tokenExpiringSoon(30);
@@ -58,6 +89,137 @@ function usePrefersReducedMotion() {
58
89
  }, []);
59
90
  return reduced;
60
91
  }
92
+ /** Motion is on: after hydration (the server draws the still page), unless reduced motion was asked for. */
93
+ function useMotion() {
94
+ const [on, setOn] = useState(false);
95
+ useEffect(() => {
96
+ const query = window.matchMedia?.('(prefers-reduced-motion: reduce)');
97
+ setOn(!query?.matches);
98
+ if (!query) return;
99
+ const onChange = e => setOn(!e.matches);
100
+ query.addEventListener('change', onChange);
101
+ return () => query.removeEventListener('change', onChange);
102
+ }, []);
103
+ return on;
104
+ }
105
+ function useInView(ref) {
106
+ const [inView, setInView] = useState(false);
107
+ useEffect(() => {
108
+ const el = ref.current;
109
+ if (!el) return undefined;
110
+ if (typeof IntersectionObserver === 'undefined') {
111
+ setInView(true);
112
+ return undefined;
113
+ }
114
+ const io = new IntersectionObserver(([entry]) => setInView(Boolean(entry?.isIntersecting)));
115
+ io.observe(el);
116
+ return () => io.disconnect();
117
+ }, [ref]);
118
+ return inView;
119
+ }
120
+ /**
121
+ * `.cbh-reveal` elements still below the fold wait ([data-wait]) and rise into view ([data-in]).
122
+ * What is already on screen is left as the server drew it, so nothing on screen ever flashes.
123
+ */
124
+ function useReveal(rootRef, motion) {
125
+ useEffect(() => {
126
+ const root = rootRef.current;
127
+ if (!root || !motion || typeof IntersectionObserver === 'undefined') return undefined;
128
+ const timers = [];
129
+ const io = new IntersectionObserver(entries => {
130
+ for (const entry of entries) {
131
+ if (!entry.isIntersecting) continue;
132
+ const el = entry.target;
133
+ io.unobserve(el);
134
+ el.setAttribute('data-in', '');
135
+ // Once it has risen, the element's own transitions (a card's hover) take over.
136
+ timers.push(window.setTimeout(() => el.removeAttribute('data-wait'), RISE_MS));
137
+ }
138
+ }, {
139
+ rootMargin: '0px 0px -8% 0px',
140
+ threshold: 0.06
141
+ });
142
+ for (const el of Array.from(root.querySelectorAll('.cbh-reveal'))) {
143
+ if (el.hasAttribute('data-in') || el.getBoundingClientRect().top < window.innerHeight * 0.92) continue;
144
+ el.setAttribute('data-wait', '');
145
+ io.observe(el);
146
+ }
147
+ return () => {
148
+ io.disconnect();
149
+ timers.forEach(t => window.clearTimeout(t));
150
+ // Whatever stopped the effect, nothing is left hidden behind it.
151
+ root.querySelectorAll('.cbh-reveal[data-wait]').forEach(el => {
152
+ el.setAttribute('data-in', '');
153
+ el.removeAttribute('data-wait');
154
+ });
155
+ };
156
+ }, [rootRef, motion]);
157
+ }
158
+ /** A chore typed out in the empty composer, held, taken back, then the next. Null when idle. */
159
+ function useTypewriter(phrases, active) {
160
+ const [text, setText] = useState(null);
161
+ const phraseRef = useRef(0);
162
+ useEffect(() => {
163
+ if (!active || !phrases.length) {
164
+ setText(null);
165
+ return undefined;
166
+ }
167
+ let shown = 0;
168
+ let deleting = false;
169
+ let timer = 0;
170
+ const step = () => {
171
+ const full = phrases[phraseRef.current % phrases.length];
172
+ if (!deleting) {
173
+ shown += 1;
174
+ setText(full.slice(0, shown));
175
+ if (shown >= full.length) {
176
+ deleting = true;
177
+ timer = window.setTimeout(step, TYPE_HOLD_MS);
178
+ } else {
179
+ timer = window.setTimeout(step, TYPE_MS + Math.random() * TYPE_JITTER_MS);
180
+ }
181
+ return;
182
+ }
183
+ shown = Math.max(0, shown - 2);
184
+ setText(full.slice(0, shown));
185
+ if (shown > 0) {
186
+ timer = window.setTimeout(step, TYPE_DELETE_MS);
187
+ return;
188
+ }
189
+ deleting = false;
190
+ phraseRef.current += 1;
191
+ timer = window.setTimeout(step, TYPE_GAP_MS);
192
+ };
193
+ setText('');
194
+ timer = window.setTimeout(step, TYPE_START_MS);
195
+ return () => window.clearTimeout(timer);
196
+ }, [phrases, active]);
197
+ return text;
198
+ }
199
+ /**
200
+ * How many of `length` steps are done, looping while `active`: one every `stepMs`, a pause of
201
+ * `holdMs` on the finished state, then again. All done on the server and under reduced motion.
202
+ */
203
+ function useSequence(length, motion, active, stepMs, holdMs) {
204
+ const [done, setDone] = useState(length);
205
+ useEffect(() => {
206
+ setDone(motion ? 0 : length);
207
+ }, [motion, length]);
208
+ useEffect(() => {
209
+ if (!motion || !active) return undefined;
210
+ let n = 0;
211
+ let timer = 0;
212
+ const next = () => {
213
+ n = n >= length ? 0 : n + 1;
214
+ setDone(n);
215
+ timer = window.setTimeout(next, n >= length ? holdMs : stepMs);
216
+ };
217
+ setDone(0);
218
+ timer = window.setTimeout(next, stepMs);
219
+ return () => window.clearTimeout(timer);
220
+ }, [motion, active, length, stepMs, holdMs]);
221
+ return done;
222
+ }
61
223
  /** A silent animation that loops; a still poster when the visitor prefers reduced motion. */
62
224
  function Loop({
63
225
  src,
@@ -121,7 +283,7 @@ function Reel({
121
283
  className: "cbh-reel-play",
122
284
  "aria-hidden": true,
123
285
  children: jsx(Play, {
124
- size: 26,
286
+ size: 24,
125
287
  fill: "currentColor"
126
288
  })
127
289
  })]
@@ -138,7 +300,8 @@ function Reel({
138
300
  /** One chore: a button that hands it over. Hero chores wear their icon in front. */
139
301
  function ChoreChip({
140
302
  chore,
141
- onChore
303
+ onChore,
304
+ tabIndex
142
305
  }) {
143
306
  const Icon = chore.icon ? CHORE_ICONS[chore.icon] : null;
144
307
  return jsxs("button", {
@@ -147,30 +310,68 @@ function ChoreChip({
147
310
  "data-track": "chore_chip",
148
311
  "data-track-item": chore.label,
149
312
  onClick: () => onChore(chore),
313
+ tabIndex: tabIndex,
150
314
  children: [Icon ? jsx(Icon, {
151
315
  size: 16,
152
316
  "aria-hidden": true
153
317
  }) : null, chore.label, Icon ? null : jsx(ArrowRight, {
154
- size: 16,
318
+ size: 14,
319
+ className: "cbh-chip-go",
155
320
  "aria-hidden": true
156
321
  })]
157
322
  });
158
323
  }
324
+ /** A row of chores that drifts by; it pauses under the pointer and for the keyboard. */
325
+ function Marquee({
326
+ chores,
327
+ onChore,
328
+ reverse
329
+ }) {
330
+ return jsx("div", {
331
+ className: "cbh-marquee",
332
+ "data-reverse": reverse || undefined,
333
+ children: jsxs("div", {
334
+ className: "cbh-marquee-track",
335
+ children: [jsx("div", {
336
+ className: "cbh-marquee-group",
337
+ children: chores.map(c => jsx(ChoreChip, {
338
+ chore: c,
339
+ onChore: onChore
340
+ }, c.label))
341
+ }), jsx("div", {
342
+ className: "cbh-marquee-group cbh-marquee-dup",
343
+ "aria-hidden": true,
344
+ children: chores.map(c => jsx(ChoreChip, {
345
+ chore: c,
346
+ onChore: onChore,
347
+ tabIndex: -1
348
+ }, c.label))
349
+ })]
350
+ })
351
+ });
352
+ }
159
353
  /**
160
354
  * The chore composer, shaped like the Yantra app's home box: a few lines to say it the way you
161
- * would text it, Enter to hand it over (Shift+Enter for a new line).
355
+ * would text it, Enter to hand it over (Shift+Enter for a new line). Empty and on screen, it types
356
+ * out chores people hand over, so it is plain what to write.
162
357
  */
163
358
  function Composer({
164
359
  id,
165
360
  large,
361
+ typed,
166
362
  onSubmit,
167
363
  onWarm,
168
364
  inputRef
169
365
  }) {
170
366
  const [text, setText] = useState('');
367
+ const [focused, setFocused] = useState(false);
171
368
  const fieldRef = useRef(null);
369
+ const formRef = useRef(null);
370
+ const motion = useMotion();
371
+ const inView = useInView(formRef);
372
+ const ghost = useTypewriter(typed ?? NO_PHRASES, Boolean(typed) && motion && inView && !focused && !text);
172
373
  const ready = text.trim().length > 0;
173
- // Grow with the chore, up to the cap in home.css, then scroll.
374
+ // Grow with the chore, up to the cap in the stylesheet, then scroll.
174
375
  useEffect(() => {
175
376
  const el = fieldRef.current;
176
377
  if (!el) return;
@@ -190,52 +391,446 @@ function Composer({
190
391
  fieldRef.current = el;
191
392
  if (typeof inputRef === 'function') inputRef(el);else if (inputRef) inputRef.current = el;
192
393
  };
193
- return jsxs("form", {
194
- className: `cbh-composer${large ? ' cbh-composer-large' : ''}`,
195
- onSubmit: submit,
196
- onClick: () => fieldRef.current?.focus(),
197
- children: [jsx("label", {
198
- htmlFor: id,
394
+ return jsx("div", {
395
+ className: `cbh-cwrap${large ? ' cbh-cwrap-large' : ''}`,
396
+ children: jsxs("form", {
397
+ ref: formRef,
398
+ className: "cbh-composer",
399
+ onSubmit: submit,
400
+ onClick: () => fieldRef.current?.focus(),
401
+ children: [jsx("label", {
402
+ htmlFor: id,
403
+ className: "cbh-visually-hidden",
404
+ children: "A chore to hand over"
405
+ }), jsxs("div", {
406
+ className: "cbh-field",
407
+ children: [ghost !== null ? jsxs("span", {
408
+ className: "cbh-ghost",
409
+ "aria-hidden": true,
410
+ children: [ghost, jsx("i", {
411
+ className: "cbh-caret"
412
+ })]
413
+ }) : null, jsx("textarea", {
414
+ id: id,
415
+ ref: setRefs,
416
+ rows: 2,
417
+ value: text,
418
+ maxLength: PROMPT_MAX,
419
+ onChange: e => setText(e.target.value),
420
+ onKeyDown: onKeyDown,
421
+ onFocus: () => {
422
+ setFocused(true);
423
+ onWarm?.();
424
+ },
425
+ onBlur: () => setFocused(false),
426
+ placeholder: ghost !== null ? '' : PLACEHOLDER,
427
+ autoComplete: "off"
428
+ })]
429
+ }), jsxs("div", {
430
+ className: "cbh-composer-row",
431
+ children: [jsxs("span", {
432
+ className: "cbh-composer-hint",
433
+ children: [jsx(PhoneCall, {
434
+ size: 15,
435
+ "aria-hidden": true
436
+ }), "Lucy calls, books and keeps track"]
437
+ }), jsx("button", {
438
+ type: "submit",
439
+ className: "cbh-send",
440
+ "data-track": "chore_send",
441
+ "data-ready": ready || undefined,
442
+ disabled: !ready,
443
+ "aria-label": "Hand it over",
444
+ children: jsx(ArrowUp, {
445
+ size: 20,
446
+ strokeWidth: 2.4,
447
+ "aria-hidden": true
448
+ })
449
+ })]
450
+ })]
451
+ })
452
+ });
453
+ }
454
+ /**
455
+ * The hero's moving backdrop: a slow aurora in the mark's warm tones, a faint dot grid, a few
456
+ * drifting specks and, under a mouse, a soft light that follows the pointer while the aurora leans
457
+ * the other way. Decorative only: hidden from assistive tech, never takes a click.
458
+ */
459
+ function Ambient() {
460
+ const rootRef = useRef(null);
461
+ const driftRef = useRef(null);
462
+ const lightRef = useRef(null);
463
+ useEffect(() => {
464
+ const root = rootRef.current;
465
+ const host = root?.parentElement;
466
+ if (!root || !host) return undefined;
467
+ // A mouse only: on touch the light would jump to every tap and stay there.
468
+ if (!window.matchMedia?.('(hover: hover) and (pointer: fine)').matches) return undefined;
469
+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return undefined;
470
+ let frame = 0;
471
+ let clientX = 0;
472
+ let clientY = 0;
473
+ // One write per frame however fast the pointer reports; the CSS transitions smooth the rest.
474
+ const paint = () => {
475
+ frame = 0;
476
+ const box = root.getBoundingClientRect();
477
+ const x = clientX - box.left;
478
+ const y = clientY - box.top;
479
+ lightRef.current?.style.setProperty('transform', `translate3d(${x}px, ${y}px, 0)`);
480
+ const dx = (x / Math.max(box.width, 1) - 0.5) * -28;
481
+ const dy = (y / Math.max(box.height, 1) - 0.5) * -18;
482
+ driftRef.current?.style.setProperty('transform', `translate3d(${dx.toFixed(1)}px, ${dy.toFixed(1)}px, 0)`);
483
+ };
484
+ const onMove = event => {
485
+ if (event.pointerType !== 'mouse') return;
486
+ clientX = event.clientX;
487
+ clientY = event.clientY;
488
+ if (!root.hasAttribute('data-pointer')) root.setAttribute('data-pointer', '');
489
+ if (!frame) frame = window.requestAnimationFrame(paint);
490
+ };
491
+ const onLeave = () => root.removeAttribute('data-pointer');
492
+ host.addEventListener('pointermove', onMove, {
493
+ passive: true
494
+ });
495
+ host.addEventListener('pointerleave', onLeave);
496
+ return () => {
497
+ host.removeEventListener('pointermove', onMove);
498
+ host.removeEventListener('pointerleave', onLeave);
499
+ if (frame) window.cancelAnimationFrame(frame);
500
+ };
501
+ }, []);
502
+ return jsxs("div", {
503
+ ref: rootRef,
504
+ className: "cbh-amb",
505
+ "aria-hidden": true,
506
+ children: [jsxs("div", {
507
+ ref: driftRef,
508
+ className: "cbh-amb-drift",
509
+ children: [jsx("span", {
510
+ className: "cbh-amb-blob cbh-amb-b1"
511
+ }), jsx("span", {
512
+ className: "cbh-amb-blob cbh-amb-b2"
513
+ }), jsx("span", {
514
+ className: "cbh-amb-blob cbh-amb-b3"
515
+ }), jsx("span", {
516
+ className: "cbh-amb-blob cbh-amb-b4"
517
+ })]
518
+ }), jsx("div", {
519
+ className: "cbh-amb-grid"
520
+ }), jsx("div", {
521
+ children: MOTES.map(([left, top, size, color, seconds, delay, wander]) => jsx("span", {
522
+ className: "cbh-amb-mote",
523
+ style: {
524
+ left,
525
+ top,
526
+ '--mz': `${size}px`,
527
+ '--mc': color,
528
+ '--md': `${seconds}s`,
529
+ '--mdl': `${delay}s`,
530
+ '--mdx': `${wander}px`
531
+ }
532
+ }, `${left}-${top}`))
533
+ }), jsx("div", {
534
+ ref: lightRef,
535
+ className: "cbh-amb-light"
536
+ })]
537
+ });
538
+ }
539
+ /**
540
+ * A number that counts up as it comes into view. The server draws the real number; it only starts
541
+ * from zero when it was still below the fold, and screen readers hear the real number throughout.
542
+ */
543
+ function CountUp({
544
+ to,
545
+ decimals = 0
546
+ }) {
547
+ const ref = useRef(null);
548
+ const [value, setValue] = useState(to);
549
+ useEffect(() => {
550
+ const el = ref.current;
551
+ if (!el || typeof IntersectionObserver === 'undefined') return undefined;
552
+ if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return undefined;
553
+ if (el.getBoundingClientRect().top < window.innerHeight) return undefined;
554
+ setValue(0);
555
+ let frame = 0;
556
+ const io = new IntersectionObserver(([entry]) => {
557
+ if (!entry?.isIntersecting) return;
558
+ io.disconnect();
559
+ const start = performance.now();
560
+ const tick = now => {
561
+ const p = Math.min(1, (now - start) / COUNT_MS);
562
+ setValue(to * (1 - (1 - p) ** 3));
563
+ if (p < 1) frame = window.requestAnimationFrame(tick);
564
+ };
565
+ frame = window.requestAnimationFrame(tick);
566
+ }, {
567
+ threshold: 0.6
568
+ });
569
+ io.observe(el);
570
+ return () => {
571
+ io.disconnect();
572
+ if (frame) window.cancelAnimationFrame(frame);
573
+ };
574
+ }, [to]);
575
+ return jsxs(Fragment, {
576
+ children: [jsx("span", {
577
+ ref: ref,
578
+ "aria-hidden": true,
579
+ children: value.toFixed(decimals)
580
+ }), jsx("span", {
199
581
  className: "cbh-visually-hidden",
200
- children: "A chore to hand over"
201
- }), jsx("textarea", {
202
- id: id,
203
- ref: setRefs,
204
- rows: 2,
205
- value: text,
206
- maxLength: PROMPT_MAX,
207
- onChange: e => setText(e.target.value),
208
- onKeyDown: onKeyDown,
209
- onFocus: onWarm,
210
- placeholder: "What should Lucy take off your plate?",
211
- autoComplete: "off"
212
- }), jsxs("div", {
213
- className: "cbh-composer-row",
214
- children: [jsxs("span", {
215
- className: "cbh-composer-hint",
216
- children: [jsx(PhoneCall, {
217
- size: 15,
218
- "aria-hidden": true
219
- }), "Lucy calls, books and keeps track"]
220
- }), jsx("button", {
221
- type: "submit",
222
- className: "cbh-send",
223
- "data-track": "chore_send",
224
- disabled: !ready,
225
- "aria-label": "Hand it over",
226
- children: jsx(ArrowUp, {
227
- size: 20,
228
- strokeWidth: 2.4,
229
- "aria-hidden": true
582
+ children: to.toFixed(decimals)
583
+ })]
584
+ });
585
+ }
586
+ /** Lucy on the phone, step by step - the reels' own internet-bill call, as it happens. */
587
+ function CallCard() {
588
+ const ref = useRef(null);
589
+ const motion = useMotion();
590
+ const inView = useInView(ref);
591
+ const done = useSequence(CALL_STEPS.length, motion, inView, CALL_STEP_MS, CALL_HOLD_MS);
592
+ const finished = done >= CALL_STEPS.length;
593
+ return jsxs("div", {
594
+ ref: ref,
595
+ className: "cbh-call",
596
+ role: "img",
597
+ "aria-label": "Illustration: Lucy calls an internet provider, gets through the phone menu, waits on hold, and comes back with a lower rate.",
598
+ children: [jsxs("p", {
599
+ className: "cbh-call-head",
600
+ "aria-hidden": true,
601
+ children: [jsx("span", {
602
+ className: "cbh-live"
603
+ }), finished ? 'Call finished' : 'Live call', jsx("em", {
604
+ children: "Lucy"
605
+ })]
606
+ }), jsx("ol", {
607
+ className: "cbh-call-steps",
608
+ "aria-hidden": true,
609
+ children: CALL_STEPS.map((s, i) => jsxs("li", {
610
+ className: "cbh-call-step",
611
+ "data-state": i < done ? 'done' : i === done ? 'now' : 'next',
612
+ children: [jsx("span", {
613
+ className: "cbh-call-dot",
614
+ children: i < done ? jsx(Check, {
615
+ size: 12,
616
+ strokeWidth: 3.2
617
+ }) : null
618
+ }), jsxs("span", {
619
+ children: [jsx("b", {
620
+ children: s.label
621
+ }), jsx("small", {
622
+ children: s.detail
623
+ })]
624
+ })]
625
+ }, s.label))
626
+ })]
627
+ });
628
+ }
629
+ /** An iMessage thread with Lucy that plays while it is on screen: drawn, not a transcript. */
630
+ function PhoneThread() {
631
+ const ref = useRef(null);
632
+ const motion = useMotion();
633
+ const inView = useInView(ref);
634
+ const [shown, setShown] = useState(TEXT_THREAD.length);
635
+ const [typing, setTyping] = useState(false);
636
+ const [round, setRound] = useState(0);
637
+ useEffect(() => {
638
+ setShown(motion ? 0 : TEXT_THREAD.length);
639
+ setTyping(false);
640
+ }, [motion]);
641
+ useEffect(() => {
642
+ if (!motion || !inView) return undefined;
643
+ const timers = [];
644
+ const at = (ms, run) => {
645
+ timers.push(window.setTimeout(run, ms));
646
+ };
647
+ let t = 0;
648
+ setShown(0);
649
+ setTyping(false);
650
+ TEXT_THREAD.forEach((line, i) => {
651
+ if (line.from === 'lucy') {
652
+ t += 600;
653
+ at(t, () => setTyping(true));
654
+ t += 1500;
655
+ at(t, () => {
656
+ setTyping(false);
657
+ setShown(i + 1);
658
+ });
659
+ } else {
660
+ t += i === 0 ? 400 : 1400;
661
+ at(t, () => setShown(i + 1));
662
+ }
663
+ });
664
+ at(t + 5000, () => setRound(r => r + 1));
665
+ return () => timers.forEach(id => window.clearTimeout(id));
666
+ }, [motion, inView, round]);
667
+ return jsx("div", {
668
+ ref: ref,
669
+ className: "cbh-phone",
670
+ role: "img",
671
+ "aria-label": `An illustrative iMessage thread with Lucy. ${TEXT_THREAD.map(m => m.text).join(' ')}`,
672
+ children: jsxs("div", {
673
+ className: "cbh-phone-screen",
674
+ "aria-hidden": true,
675
+ children: [jsx("span", {
676
+ className: "cbh-phone-island"
677
+ }), jsxs("div", {
678
+ className: "cbh-phone-head",
679
+ children: [jsx("span", {
680
+ className: "cbh-phone-avatar",
681
+ children: jsx(Mark, {
682
+ size: 26
683
+ })
684
+ }), jsx("span", {
685
+ className: "cbh-phone-name",
686
+ children: "Lucy"
687
+ })]
688
+ }), jsxs("div", {
689
+ className: "cbh-thread",
690
+ children: [jsx("span", {
691
+ className: "cbh-thread-day",
692
+ children: "iMessage \u00B7 Today"
693
+ }), TEXT_THREAD.slice(0, shown).map(m => jsx("p", {
694
+ className: "cbh-bubble",
695
+ "data-from": m.from,
696
+ children: m.text
697
+ }, m.text)), typing ? jsxs("span", {
698
+ className: "cbh-typing",
699
+ children: [jsx("i", {}), jsx("i", {}), jsx("i", {})]
700
+ }) : null]
701
+ }), jsxs("div", {
702
+ className: "cbh-phone-input",
703
+ children: ["iMessage", jsx("span", {
704
+ children: jsx(ArrowUp, {
705
+ size: 16,
706
+ strokeWidth: 2.6
707
+ })
708
+ })]
709
+ })]
710
+ })
711
+ });
712
+ }
713
+ const MINUTES_MAX = Math.max(...MINUTES.map(m => m.min));
714
+ const MINUTES_ALL = MINUTES.map(m => m.label);
715
+ /**
716
+ * Where the minutes come from, as chores to pick: all of them are handed over to start with (the
717
+ * page the server draws), and taking one back shows what the rest still give back. Housework is
718
+ * not a pick: Clockbook can't do it.
719
+ */
720
+ function MinutesPicker() {
721
+ const [picked, setPicked] = useState(() => new Set(MINUTES_ALL));
722
+ const total = MINUTES.reduce((sum, m) => picked.has(m.label) ? sum + m.min : sum, 0);
723
+ const {
724
+ year
725
+ } = timeBack(total);
726
+ const toggle = label => setPicked(prev => {
727
+ const next = new Set(prev);
728
+ if (!next.delete(label)) next.add(label);
729
+ return next;
730
+ });
731
+ return jsxs(Fragment, {
732
+ children: [jsx("p", {
733
+ className: "cbh-minutes-hint",
734
+ children: "Tap to pick what you\u2019d hand over."
735
+ }), jsxs("ul", {
736
+ className: "cbh-minutes",
737
+ children: [MINUTES.map((m, i) => jsx("li", {
738
+ children: jsxs("button", {
739
+ type: "button",
740
+ className: "cbh-minutes-row",
741
+ "aria-pressed": picked.has(m.label),
742
+ "data-track": "minutes_pick",
743
+ "data-track-item": m.label,
744
+ onClick: () => toggle(m.label),
745
+ children: [jsx("span", {
746
+ className: "cbh-sw",
747
+ style: {
748
+ background: m.color
749
+ },
750
+ "aria-hidden": true
751
+ }), jsx("span", {
752
+ className: "cbh-minutes-label",
753
+ children: m.label
754
+ }), jsx("span", {
755
+ className: "cbh-minutes-bar",
756
+ "aria-hidden": true,
757
+ children: jsx("i", {
758
+ style: {
759
+ width: `${m.min / MINUTES_MAX * 100}%`,
760
+ '--cbh-i': i
761
+ }
762
+ })
763
+ }), jsxs("b", {
764
+ children: [m.min, " min"]
765
+ }), jsx("span", {
766
+ className: "cbh-minutes-check",
767
+ "aria-hidden": true,
768
+ children: jsx(Check, {
769
+ size: 12,
770
+ strokeWidth: 3.2
771
+ })
772
+ })]
773
+ })
774
+ }, m.label)), jsx("li", {
775
+ className: "cbh-minutes-none",
776
+ children: jsxs("span", {
777
+ className: "cbh-minutes-row",
778
+ children: [jsx("span", {
779
+ className: "cbh-sw",
780
+ "aria-hidden": true
781
+ }), jsx("span", {
782
+ className: "cbh-minutes-label",
783
+ children: "Housework"
784
+ }), jsx("span", {
785
+ className: "cbh-minutes-bar",
786
+ "aria-hidden": true
787
+ }), jsx("b", {
788
+ children: "0 min"
789
+ })]
230
790
  })
231
791
  })]
792
+ }), jsx("p", {
793
+ className: "cbh-minutes-total",
794
+ "aria-live": "polite",
795
+ children: total ? jsxs(Fragment, {
796
+ children: [picked.size === MINUTES.length ? 'All of it' : 'Your pick', ": ", jsxs("b", {
797
+ children: [total, " min"]
798
+ }), " a day, about", ' ', jsxs("b", {
799
+ children: [year, " hours"]
800
+ }), " a year.", jsx("sup", {
801
+ children: "1"
802
+ })]
803
+ }) : 'Pick a chore to see the time it gives back.'
232
804
  })]
233
805
  });
234
806
  }
235
- /** Sign in before the chore runs. The chore waits in this tab and goes out when they are back. */
807
+ /** "Text Lucy on iMessage", where the composer is: the other way to hand a chore over. */
808
+ function ImessagePill({
809
+ onText,
810
+ onWarm
811
+ }) {
812
+ return jsxs("button", {
813
+ type: "button",
814
+ className: "cbh-imsg-pill",
815
+ "data-track": "text_on_imessage",
816
+ onClick: onText,
817
+ onPointerEnter: onWarm,
818
+ onFocus: onWarm,
819
+ "aria-haspopup": "dialog",
820
+ children: [jsx(ImessageIcon, {
821
+ size: 24
822
+ }), "Text Lucy on iMessage", jsx(ArrowRight, {
823
+ size: 15,
824
+ className: "cbh-arrow",
825
+ "aria-hidden": true
826
+ })]
827
+ });
828
+ }
829
+ /** Sign in before the chore runs (or the text goes). It waits in this tab and goes out when they are back. */
236
830
  function SignInDialog({
237
831
  chore,
238
832
  expired,
833
+ purpose = 'chore',
239
834
  onContinue,
240
835
  onCancel
241
836
  }) {
@@ -248,7 +843,9 @@ function SignInDialog({
248
843
  document.addEventListener('keydown', onKey);
249
844
  return () => document.removeEventListener('keydown', onKey);
250
845
  }, [onCancel]);
251
- const title = expired ? 'Sign in again to carry on' : chore ? 'Sign in to hand it over' : 'Sign in to Clockbook';
846
+ const texting = purpose === 'imessage';
847
+ const title = expired ? 'Sign in again to carry on' : texting ? 'Sign in to text Lucy' : chore ? 'Sign in to hand it over' : 'Sign in to Clockbook';
848
+ const body = expired ? texting ? 'Your sign-in ran out. Sign in again, and Messages opens with your text to Lucy.' : 'Your sign-in ran out. Sign in and Lucy picks this up again.' : texting ? 'Sign in or create an account, and Messages opens with a text to Lucy ready to send.' : chore ? 'Sign in or create an account, and Lucy starts on this as soon as you are back.' : 'Sign in or create an account to hand your chores to Lucy.';
252
849
  return jsx("div", {
253
850
  className: "cbh-dialog-backdrop",
254
851
  onClick: e => e.target === e.currentTarget && onCancel(),
@@ -257,11 +854,23 @@ function SignInDialog({
257
854
  role: "dialog",
258
855
  "aria-modal": "true",
259
856
  "aria-labelledby": "cbh-dialog-title",
260
- children: [jsx("span", {
857
+ children: [jsx("button", {
858
+ type: "button",
859
+ className: "cbh-dialog-x",
860
+ "data-track": "sign_in_cancel",
861
+ onClick: onCancel,
862
+ "aria-label": "Close",
863
+ children: jsx(X, {
864
+ size: 18,
865
+ "aria-hidden": true
866
+ })
867
+ }), jsx("span", {
261
868
  className: "cbh-dialog-mark",
262
869
  "aria-hidden": true,
263
- children: jsx(Mark, {
264
- size: 44
870
+ children: texting ? jsx(ImessageIcon, {
871
+ size: 48
872
+ }) : jsx(Mark, {
873
+ size: 46
265
874
  })
266
875
  }), jsx("h2", {
267
876
  id: "cbh-dialog-title",
@@ -272,7 +881,7 @@ function SignInDialog({
272
881
  children: ["\u201C", chore, "\u201D"]
273
882
  }) : null, jsx("p", {
274
883
  className: "cbh-dialog-body",
275
- children: expired ? 'Your sign-in ran out. Sign in and Lucy picks this up again.' : chore ? 'Sign in or create an account, and Lucy starts on this as soon as you are back.' : 'Sign in or create an account to hand your chores to Lucy.'
884
+ children: body
276
885
  }), jsxs("button", {
277
886
  ref: continueRef,
278
887
  type: "button",
@@ -303,13 +912,21 @@ const CHAT_CLOSED = {
303
912
  };
304
913
  function HomePage() {
305
914
  const totalMin = MINUTES.reduce((sum, m) => sum + m.min, 0);
915
+ const rootRef = useRef(null);
916
+ const motion = useMotion();
917
+ useReveal(rootRef, motion);
306
918
  const [signedIn, setSignedIn] = useState(false);
919
+ const [scrolled, setScrolled] = useState(false);
307
920
  const [chat, setChat] = useState(CHAT_CLOSED);
308
921
  const [signIn, setSignIn] = useState(null);
922
+ const [texting, setTexting] = useState(null);
309
923
  const heroFieldRef = useRef(null);
310
924
  const warmChat = useCallback(() => {
311
925
  void loadChat();
312
926
  }, []);
927
+ const warmImessage = useCallback(() => {
928
+ void loadImessage();
929
+ }, []);
313
930
  const openChat = useCallback(chore => {
314
931
  const text = chore.trim();
315
932
  setChat(c => ({
@@ -361,16 +978,29 @@ function HomePage() {
361
978
  method: 'typed',
362
979
  placement
363
980
  });
981
+ /** Every "Text Lucy on iMessage" lands here: the dialog, sign-in first, or the app's own onboarding. */
982
+ const textLucy = useCallback(message => {
983
+ ensurePlatformAnchor();
984
+ void loadImessage();
985
+ if (hasLiveToken()) setTexting({
986
+ message
987
+ });else if (canLogin()) setSignIn({
988
+ chore: '',
989
+ purpose: 'imessage'
990
+ });else window.location.assign(appTextingLink());
991
+ }, []);
992
+ const textFromChat = useCallback(() => textLucy(), [textLucy]);
364
993
  const continueSignIn = useCallback(() => {
365
994
  ensurePlatformAnchor();
366
995
  emitAnalyticsEvent('sign_in_start', {
367
996
  with_chore: !!signIn?.chore,
368
- expired: !!signIn?.expired
997
+ expired: !!signIn?.expired,
998
+ for_imessage: signIn?.purpose === 'imessage'
369
999
  });
370
- savePendingChore(signIn?.chore ?? '');
1000
+ if (signIn?.purpose === 'imessage') savePendingImessage();else savePendingChore(signIn?.chore ?? '');
371
1001
  beginLogin('clockbook-home');
372
1002
  }, [signIn]);
373
- // Back from sign-in: keep the token it brought, and send the chore that waited for it.
1003
+ // Back from sign-in: keep the token it brought, and send what waited for it.
374
1004
  useEffect(() => {
375
1005
  ensurePlatformAnchor();
376
1006
  if (captureLoginCallback()) emitAnalyticsEvent('login', {
@@ -379,7 +1009,9 @@ function HomePage() {
379
1009
  const live = hasLiveToken();
380
1010
  setSignedIn(live);
381
1011
  const pending = takePendingChore();
1012
+ const pendingText = takePendingImessage();
382
1013
  if (live && pending) openChat(pending);else if (live && window.location.hash === CHAT_HASH) openChat('');else if (window.location.hash === CHAT_HASH) window.history.replaceState(null, '', window.location.pathname + window.location.search);
1014
+ if (live && pendingText) setTexting({});
383
1015
  // Where the page shares the app's session cookie (a cdebase.dev host next to the dev app),
384
1016
  // a token left by another account is dropped here. On clockbook.com there is no session to
385
1017
  // compare with, and the token stays until it is refused or the visitor signs out.
@@ -387,6 +1019,7 @@ function HomePage() {
387
1019
  void reconcileStoredToken().then(verdict => {
388
1020
  if (!live2 || verdict !== 'dropped') return;
389
1021
  setSignedIn(false);
1022
+ setTexting(null);
390
1023
  endChat();
391
1024
  });
392
1025
  return () => {
@@ -406,6 +1039,15 @@ function HomePage() {
406
1039
  window.addEventListener('popstate', onPop);
407
1040
  return () => window.removeEventListener('popstate', onPop);
408
1041
  }, []);
1042
+ // The nav turns to frosted glass once the page moves under it.
1043
+ useEffect(() => {
1044
+ const onScroll = () => setScrolled(window.scrollY > 8);
1045
+ onScroll();
1046
+ window.addEventListener('scroll', onScroll, {
1047
+ passive: true
1048
+ });
1049
+ return () => window.removeEventListener('scroll', onScroll);
1050
+ }, []);
409
1051
  // The landing does not scroll behind the open chat.
410
1052
  useEffect(() => {
411
1053
  if (!chat.open) return;
@@ -417,7 +1059,9 @@ function HomePage() {
417
1059
  };
418
1060
  }, [chat.open]);
419
1061
  const onSignedOut = useCallback(() => {
1062
+ clearTextLinkCodes();
420
1063
  setSignedIn(false);
1064
+ setTexting(null);
421
1065
  endChat();
422
1066
  }, [endChat]);
423
1067
  const onSessionExpired = useCallback(chore => {
@@ -429,6 +1073,24 @@ function HomePage() {
429
1073
  expired: true
430
1074
  });
431
1075
  }, [endChat]);
1076
+ const closeTexting = useCallback(() => setTexting(null), []);
1077
+ const textingChatHere = useCallback(() => {
1078
+ setTexting(null);
1079
+ openChat('');
1080
+ }, [openChat]);
1081
+ // The platform refused the sign-in while the dialog asked for the link: sign in again, then back to it.
1082
+ const textingSignedOut = useCallback(() => {
1083
+ clearCdecliToken();
1084
+ clearTextLinkCodes();
1085
+ setTexting(null);
1086
+ setSignedIn(false);
1087
+ endChat();
1088
+ setSignIn({
1089
+ chore: '',
1090
+ expired: true,
1091
+ purpose: 'imessage'
1092
+ });
1093
+ }, [endChat]);
432
1094
  const tryIt = () => {
433
1095
  if (signedIn) {
434
1096
  openChat('');
@@ -444,9 +1106,11 @@ function HomePage() {
444
1106
  };
445
1107
  return jsxs("div", {
446
1108
  className: "cbh",
1109
+ ref: rootRef,
447
1110
  children: [jsx(HomeStyles, {}), jsx("header", {
448
1111
  className: "cbh-nav",
449
1112
  "data-track-section": "nav",
1113
+ "data-scrolled": scrolled || undefined,
450
1114
  children: jsxs("div", {
451
1115
  className: "cbh-wrap cbh-nav-row",
452
1116
  children: [jsxs("a", {
@@ -463,21 +1127,25 @@ function HomePage() {
463
1127
  className: "cbh-links",
464
1128
  "aria-label": "Sections",
465
1129
  children: [jsx("a", {
1130
+ href: "#how",
1131
+ children: "How it works"
1132
+ }), jsx("a", {
466
1133
  href: "#calls",
467
1134
  children: "Lucy calls"
1135
+ }), jsx("a", {
1136
+ href: "#imessage",
1137
+ children: "iMessage"
468
1138
  }), jsx("a", {
469
1139
  href: "#areas",
470
1140
  children: "What it handles"
471
- }), jsx("a", {
472
- href: "#how",
473
- children: "How it works"
474
1141
  }), jsxs("a", {
475
- href: "#business",
1142
+ href: yantraAppUrl(),
476
1143
  className: "cbh-link-biz",
477
- children: [jsx(Briefcase, {
1144
+ "data-track": "business_yantra",
1145
+ children: ["For business ", jsx(ArrowUpRight, {
478
1146
  size: 15,
479
1147
  "aria-hidden": true
480
- }), " For business"]
1148
+ })]
481
1149
  })]
482
1150
  }), jsxs("div", {
483
1151
  className: "cbh-nav-cta",
@@ -499,182 +1167,254 @@ function HomePage() {
499
1167
  })]
500
1168
  })
501
1169
  }), jsxs("main", {
502
- children: [jsx("section", {
1170
+ children: [jsxs("section", {
503
1171
  className: "cbh-hero",
504
1172
  id: "top",
505
1173
  "data-track-section": "hero",
506
- children: jsxs("div", {
507
- className: "cbh-wrap cbh-hero-grid",
508
- children: [jsxs("div", {
509
- className: "cbh-hero-copy",
510
- children: [jsx("p", {
511
- className: "cbh-eyebrow",
512
- children: "For busy households"
513
- }), jsxs("h1", {
514
- children: ["Get your evenings ", jsx("em", {
515
- children: "back."
516
- })]
517
- }), jsxs("p", {
518
- className: "cbh-lead",
519
- children: ["Clockbook takes the life admin off your plate: the calls, the bills, the cancellations, the groceries and the appointments. About 38 minutes back, every day.", jsx("sup", {
520
- children: "1"
521
- })]
522
- }), jsx(Composer, {
1174
+ children: [jsx(Ambient, {}), jsxs("div", {
1175
+ className: "cbh-wrap cbh-hero-inner",
1176
+ children: [jsx("div", {
1177
+ className: "cbh-halo-mark cbh-rise",
1178
+ "aria-hidden": true,
1179
+ children: jsx("span", {
1180
+ className: "cbh-halo-tile",
1181
+ children: jsx(AnimatedMark, {})
1182
+ })
1183
+ }), jsx("p", {
1184
+ className: "cbh-eyebrow cbh-rise cbh-d1",
1185
+ children: "For everyone with a to-do list"
1186
+ }), jsxs("h1", {
1187
+ className: "cbh-rise cbh-d2",
1188
+ children: ["Get your evenings ", jsx("em", {
1189
+ children: "back."
1190
+ })]
1191
+ }), jsxs("p", {
1192
+ className: "cbh-lead cbh-rise cbh-d3",
1193
+ children: ["Clockbook takes the life admin off your plate: the calls, the bills, the cancellations, the groceries and the appointments. About 38 minutes back, every day.", jsx("sup", {
1194
+ children: "1"
1195
+ })]
1196
+ }), jsx("div", {
1197
+ className: "cbh-rise cbh-d4",
1198
+ children: jsx(Composer, {
523
1199
  id: "cbh-chore-hero",
1200
+ typed: TYPED_CHORES,
524
1201
  onSubmit: handOverTyped('hero'),
525
1202
  onWarm: warmChat,
526
1203
  inputRef: heroFieldRef
527
- }), jsxs("div", {
528
- className: "cbh-try",
529
- children: [jsx("span", {
530
- className: "cbh-try-label",
531
- children: "Or try one"
532
- }), jsx("div", {
533
- className: "cbh-chips",
534
- children: HERO_CHORES.map(c => jsx(ChoreChip, {
535
- chore: c,
536
- onChore: handOverChip('hero')
537
- }, c.label))
538
- })]
539
- })]
540
- }), jsx("div", {
541
- className: "cbh-hero-media",
542
- children: jsx(Loop, {
543
- src: HOME_ASSETS.loopTimeBack,
544
- poster: HOME_ASSETS.loopTimeBackPoster,
545
- label: "The Clockbook clock rewinds: 38 minutes a day, 4.4 hours a week, 229 hours a year"
546
1204
  })
1205
+ }), jsxs("div", {
1206
+ className: "cbh-try cbh-rise cbh-d5",
1207
+ role: "group",
1208
+ "aria-label": "Try a chore",
1209
+ children: [jsx("span", {
1210
+ className: "cbh-try-label",
1211
+ children: "Try"
1212
+ }), HERO_CHORES.slice(0, 5).map(c => jsx(ChoreChip, {
1213
+ chore: c,
1214
+ onChore: handOverChip('hero')
1215
+ }, c.label))]
1216
+ }), jsxs("div", {
1217
+ className: "cbh-channels cbh-rise cbh-d6",
1218
+ children: [jsx(ImessagePill, {
1219
+ onText: () => textLucy(),
1220
+ onWarm: warmImessage
1221
+ }), jsxs("span", {
1222
+ className: "cbh-trust",
1223
+ children: [jsx(ShieldCheck, {
1224
+ size: 16,
1225
+ "aria-hidden": true
1226
+ }), "Nothing is paid or changed without your yes"]
1227
+ })]
547
1228
  })]
548
- })
1229
+ })]
1230
+ }), jsxs("section", {
1231
+ className: "cbh-strip",
1232
+ "aria-label": "More chores to hand over",
1233
+ "data-track-section": "strip",
1234
+ children: [jsx(Marquee, {
1235
+ chores: STRIP_CHORES.slice(0, 11),
1236
+ onChore: handOverChip('strip')
1237
+ }), jsx(Marquee, {
1238
+ chores: STRIP_CHORES.slice(11),
1239
+ onChore: handOverChip('strip'),
1240
+ reverse: true
1241
+ })]
549
1242
  }), jsx("section", {
550
- className: "cbh-band",
551
- "aria-label": "Time back",
1243
+ className: "cbh-section cbh-how-section",
1244
+ id: "how",
552
1245
  children: jsxs("div", {
553
- className: "cbh-wrap cbh-stats",
1246
+ className: "cbh-wrap",
554
1247
  children: [jsxs("div", {
555
- children: [jsx("b", {
556
- children: "38 min"
557
- }), jsx("span", {
558
- children: "back, every day"
559
- })]
560
- }), jsxs("div", {
561
- children: [jsx("b", {
562
- children: "4.4 hrs"
563
- }), jsx("span", {
564
- children: "every week"
565
- })]
566
- }), jsxs("div", {
567
- children: [jsx("b", {
568
- children: "229 hrs"
569
- }), jsx("span", {
570
- children: "every year"
1248
+ className: "cbh-head cbh-head-center cbh-reveal",
1249
+ children: [jsx("p", {
1250
+ className: "cbh-eyebrow",
1251
+ children: "How it works"
1252
+ }), jsxs("h2", {
1253
+ children: ["Text it. It gets ", jsx("em", {
1254
+ children: "done."
1255
+ })]
571
1256
  })]
1257
+ }), jsx("ol", {
1258
+ className: "cbh-steps cbh-reveal",
1259
+ children: STEPS.map((s, i) => jsxs("li", {
1260
+ className: "cbh-step",
1261
+ children: [jsx("span", {
1262
+ className: "cbh-step-n",
1263
+ "aria-hidden": true,
1264
+ children: i + 1
1265
+ }), jsxs("div", {
1266
+ children: [jsx("h3", {
1267
+ children: s.title
1268
+ }), jsx("p", {
1269
+ children: s.body
1270
+ })]
1271
+ })]
1272
+ }, s.title))
572
1273
  })]
573
1274
  })
1275
+ }), jsx("section", {
1276
+ className: "cbh-section cbh-time-section",
1277
+ "aria-labelledby": "cbh-time-title",
1278
+ children: jsx("div", {
1279
+ className: "cbh-wrap",
1280
+ children: jsxs("div", {
1281
+ className: "cbh-time-card cbh-reveal",
1282
+ children: [jsx("div", {
1283
+ className: "cbh-time-media",
1284
+ children: jsx(Loop, {
1285
+ src: HOME_ASSETS.loopTimeBack,
1286
+ poster: HOME_ASSETS.loopTimeBackPoster,
1287
+ label: "The Clockbook clock rewinds: 38 minutes a day, 4.4 hours a week, 229 hours a year"
1288
+ })
1289
+ }), jsxs("div", {
1290
+ className: "cbh-time-copy",
1291
+ children: [jsx("p", {
1292
+ className: "cbh-eyebrow",
1293
+ children: "Time back"
1294
+ }), jsxs("h2", {
1295
+ id: "cbh-time-title",
1296
+ children: ["After work, sleep and chores, the evening is ", jsx("em", {
1297
+ children: "short."
1298
+ })]
1299
+ }), jsx("ul", {
1300
+ className: "cbh-stats",
1301
+ children: STATS.map(s => jsxs("li", {
1302
+ className: "cbh-stat",
1303
+ children: [jsxs("b", {
1304
+ children: [jsx(CountUp, {
1305
+ to: s.to,
1306
+ decimals: s.decimals
1307
+ }), jsxs("small", {
1308
+ children: [" ", s.unit]
1309
+ })]
1310
+ }), jsx("span", {
1311
+ children: s.label
1312
+ })]
1313
+ }, s.label))
1314
+ }), jsxs("p", {
1315
+ className: "cbh-time-note",
1316
+ children: ["A working adult spends about 2.8 hours a day on life admin. Clockbook gives you 38 minutes of it back, every day: about 229 hours a year, or 28 workdays.", jsx("sup", {
1317
+ children: "1"
1318
+ })]
1319
+ })]
1320
+ })]
1321
+ })
1322
+ })
574
1323
  }), jsx("section", {
575
1324
  className: "cbh-section",
576
1325
  id: "calls",
577
1326
  children: jsxs("div", {
578
1327
  className: "cbh-wrap cbh-split",
579
1328
  children: [jsxs("div", {
1329
+ className: "cbh-reveal",
580
1330
  children: [jsxs("p", {
581
1331
  className: "cbh-eyebrow",
582
1332
  children: [jsx(PhoneCall, {
583
- size: 16,
1333
+ size: 15,
584
1334
  "aria-hidden": true
585
1335
  }), " Lucy makes the call"]
586
- }), jsx("h2", {
587
- children: "Never sit on hold again."
1336
+ }), jsxs("h2", {
1337
+ children: ["Never sit on ", jsx("em", {
1338
+ children: "hold"
1339
+ }), " again."]
588
1340
  }), jsx("p", {
589
1341
  className: "cbh-body",
590
1342
  children: "Text Lucy what you need. She calls, works the phone menu, waits through the hold music and talks to a real person. When they need to hear from you, she rings you in."
591
- }), jsxs("ul", {
592
- className: "cbh-ticks",
593
- children: [jsx("li", {
594
- children: "Works the phone menu"
595
- }), jsx("li", {
596
- children: "Waits on hold for you"
597
- }), jsx("li", {
598
- children: "Says no to the retention offers"
599
- }), jsx("li", {
600
- children: "Rings you in to confirm"
601
- })]
602
- }), jsx("p", {
1343
+ }), jsx(CallCard, {}), jsx("p", {
603
1344
  className: "cbh-note",
604
1345
  children: VIDEO_NOTE
605
1346
  })]
606
1347
  }), jsx("div", {
607
- className: "cbh-reels",
608
- children: REELS.map(r => jsx(Reel, {
609
- ...r
610
- }, r.title))
1348
+ className: "cbh-reels-wrap cbh-reveal",
1349
+ style: {
1350
+ '--cbh-i': 1
1351
+ },
1352
+ children: jsx("div", {
1353
+ className: "cbh-reels",
1354
+ children: REELS.map(r => jsx(Reel, {
1355
+ ...r
1356
+ }, r.title))
1357
+ })
611
1358
  })]
612
1359
  })
613
1360
  }), jsx("section", {
614
1361
  className: "cbh-section cbh-soft",
615
- id: "minutes",
1362
+ id: "imessage",
616
1363
  children: jsxs("div", {
617
- className: "cbh-wrap cbh-split cbh-split-media-first",
618
- children: [jsx("div", {
619
- className: "cbh-media-card",
620
- children: jsx(Loop, {
621
- src: HOME_ASSETS.loopWhere,
622
- poster: HOME_ASSETS.loopWherePoster,
623
- label: "The clock face fills slice by slice: shopping, meals, bills, calls and family logistics"
624
- })
625
- }), jsxs("div", {
626
- children: [jsx("p", {
1364
+ className: "cbh-wrap cbh-split cbh-split-flip",
1365
+ children: [jsxs("div", {
1366
+ className: "cbh-reveal",
1367
+ children: [jsxs("p", {
627
1368
  className: "cbh-eyebrow",
628
- children: "Where it comes from"
1369
+ children: [jsx(ImessageIcon, {
1370
+ size: 18
1371
+ }), " Now on iMessage"]
629
1372
  }), jsxs("h2", {
630
- children: [jsxs("span", {
631
- className: "cbh-nowrap",
632
- children: [totalMin, " minutes,"]
633
- }), " chore by chore."]
634
- }), jsxs("ul", {
635
- className: "cbh-minutes",
636
- children: [MINUTES.map(m => jsxs("li", {
1373
+ children: ["Text Lucy like you\u2019d text a ", jsx("em", {
1374
+ children: "friend."
1375
+ })]
1376
+ }), jsx("p", {
1377
+ className: "cbh-body",
1378
+ children: "Lucy is in Messages too. Send her a chore from your iPhone, iPad or Mac, and she texts back as it gets done. Same Lucy, same account, nothing to install."
1379
+ }), jsx("ol", {
1380
+ className: "cbh-text-steps",
1381
+ children: TEXT_STEPS.map((s, i) => jsxs("li", {
637
1382
  children: [jsx("span", {
638
- className: "cbh-sw",
639
- style: {
640
- background: m.color
641
- },
642
- "aria-hidden": true
643
- }), jsx("span", {
644
- className: "cbh-minutes-label",
645
- children: m.label
646
- }), jsx("span", {
647
- className: "cbh-minutes-bar",
1383
+ className: "cbh-text-n",
648
1384
  "aria-hidden": true,
649
- children: jsx("i", {
650
- style: {
651
- width: `${m.min / 17 * 100}%`
652
- }
653
- })
654
- }), jsxs("b", {
655
- children: [m.min, " min"]
656
- })]
657
- }, m.label)), jsxs("li", {
658
- className: "cbh-minutes-none",
659
- children: [jsx("span", {
660
- className: "cbh-sw",
661
- "aria-hidden": true
662
- }), jsx("span", {
663
- className: "cbh-minutes-label",
664
- children: "Housework"
665
- }), jsx("span", {
666
- className: "cbh-minutes-bar",
667
- "aria-hidden": true
668
- }), jsx("b", {
669
- children: "0 min"
1385
+ children: i + 1
1386
+ }), jsxs("div", {
1387
+ children: [jsx("b", {
1388
+ children: s.title
1389
+ }), jsx("span", {
1390
+ children: s.body
1391
+ })]
670
1392
  })]
671
- })]
672
- }), jsxs("p", {
673
- className: "cbh-body cbh-small",
674
- children: ["Clockbook can't fold the laundry. The ", HOUSEWORK_MIN, " minutes a day of cleaning and washing stay yours; the rest you can hand over.", jsx("sup", {
675
- children: "1"
1393
+ }, s.title))
1394
+ }), jsxs("div", {
1395
+ className: "cbh-ctas",
1396
+ children: [jsxs("button", {
1397
+ type: "button",
1398
+ className: "cbh-btn",
1399
+ "data-track": "text_on_imessage",
1400
+ onClick: () => textLucy(),
1401
+ onPointerEnter: warmImessage,
1402
+ onFocus: warmImessage,
1403
+ "aria-haspopup": "dialog",
1404
+ children: [jsx(ImessageIcon, {
1405
+ size: 22
1406
+ }), "Text Lucy on iMessage"]
1407
+ }), jsx("span", {
1408
+ className: "cbh-fine",
1409
+ children: "Message and data rates may apply."
676
1410
  })]
677
1411
  })]
1412
+ }), jsx("div", {
1413
+ className: "cbh-phone-wrap cbh-reveal",
1414
+ style: {
1415
+ '--cbh-i': 1
1416
+ },
1417
+ children: jsx(PhoneThread, {})
678
1418
  })]
679
1419
  })
680
1420
  }), jsx("section", {
@@ -682,17 +1422,25 @@ function HomePage() {
682
1422
  id: "areas",
683
1423
  children: jsxs("div", {
684
1424
  className: "cbh-wrap",
685
- children: [jsx("p", {
686
- className: "cbh-eyebrow",
687
- children: "What it handles"
688
- }), jsx("h2", {
689
- children: "Hand over every corner of home life."
1425
+ children: [jsxs("div", {
1426
+ className: "cbh-head cbh-reveal",
1427
+ children: [jsx("p", {
1428
+ className: "cbh-eyebrow",
1429
+ children: "What it handles"
1430
+ }), jsxs("h2", {
1431
+ children: ["Hand over every corner of ", jsx("em", {
1432
+ children: "home life."
1433
+ })]
1434
+ })]
690
1435
  }), jsx("div", {
691
1436
  className: "cbh-areas",
692
- children: AREAS.map(a => {
1437
+ children: AREAS.map((a, i) => {
693
1438
  const Icon = AREA_ICONS[a.key];
694
1439
  return jsxs("article", {
695
- className: "cbh-area",
1440
+ className: "cbh-area cbh-reveal",
1441
+ style: {
1442
+ '--cbh-i': i % 3
1443
+ },
696
1444
  children: [jsx("span", {
697
1445
  className: "cbh-area-icon",
698
1446
  "aria-hidden": true,
@@ -716,145 +1464,143 @@ function HomePage() {
716
1464
  })
717
1465
  }), jsx("section", {
718
1466
  className: "cbh-section cbh-soft",
719
- id: "how",
1467
+ id: "minutes",
720
1468
  children: jsxs("div", {
721
- className: "cbh-wrap",
722
- children: [jsx("p", {
723
- className: "cbh-eyebrow",
724
- children: "How it works"
725
- }), jsx("h2", {
726
- children: "Text it. It gets done."
727
- }), jsx("ol", {
728
- className: "cbh-steps",
729
- children: STEPS.map((s, i) => jsxs("li", {
730
- children: [jsx("span", {
731
- className: "cbh-step-n",
732
- children: i + 1
733
- }), jsx("h3", {
734
- children: s.title
735
- }), jsx("p", {
736
- children: s.body
1469
+ className: "cbh-wrap cbh-split",
1470
+ children: [jsx("div", {
1471
+ className: "cbh-media-card cbh-reveal",
1472
+ children: jsx(Loop, {
1473
+ src: HOME_ASSETS.loopWhere,
1474
+ poster: HOME_ASSETS.loopWherePoster,
1475
+ label: "The clock face fills slice by slice: shopping, meals, bills, calls and family logistics"
1476
+ })
1477
+ }), jsxs("div", {
1478
+ className: "cbh-reveal",
1479
+ style: {
1480
+ '--cbh-i': 1
1481
+ },
1482
+ children: [jsx("p", {
1483
+ className: "cbh-eyebrow",
1484
+ children: "Where it comes from"
1485
+ }), jsxs("h2", {
1486
+ children: [jsxs("span", {
1487
+ className: "cbh-nowrap",
1488
+ children: [totalMin, " minutes,"]
1489
+ }), " chore by ", jsx("em", {
1490
+ children: "chore."
737
1491
  })]
738
- }, s.title))
1492
+ }), jsx(MinutesPicker, {}), jsxs("p", {
1493
+ className: "cbh-body cbh-small",
1494
+ children: ["Clockbook can't fold the laundry. The ", HOUSEWORK_MIN, " minutes a day of cleaning and washing stay yours; the rest you can hand over.", jsx("sup", {
1495
+ children: "1"
1496
+ })]
1497
+ })]
739
1498
  })]
740
1499
  })
741
1500
  }), jsx("section", {
742
1501
  className: "cbh-section",
743
- id: "day",
1502
+ id: "faq",
744
1503
  children: jsxs("div", {
745
- className: "cbh-wrap cbh-split",
1504
+ className: "cbh-wrap",
746
1505
  children: [jsxs("div", {
1506
+ className: "cbh-head cbh-head-center cbh-reveal",
747
1507
  children: [jsx("p", {
748
1508
  className: "cbh-eyebrow",
749
- children: "A working day"
750
- }), jsx("h2", {
751
- children: "After work, sleep and chores, the evening is short."
752
- }), jsxs("p", {
753
- className: "cbh-body",
754
- children: ["A working adult spends about 2.8 hours a day on life admin. Clockbook gives you 38 minutes of it back, every day. That is about 229 hours a year, or 28 workdays.", jsx("sup", {
755
- children: "1"
1509
+ children: "Questions"
1510
+ }), jsxs("h2", {
1511
+ children: ["Good to ", jsx("em", {
1512
+ children: "know."
756
1513
  })]
757
1514
  })]
758
1515
  }), jsx("div", {
759
- className: "cbh-media-card",
760
- children: jsx(Loop, {
761
- src: HOME_ASSETS.loopDay,
762
- poster: HOME_ASSETS.loopDayPoster,
763
- label: "A working day as bars: the Clockbook clock takes 38 minutes off life admin"
764
- })
1516
+ className: "cbh-faq cbh-reveal",
1517
+ children: FAQS.map(f => jsxs("details", {
1518
+ children: [jsxs("summary", {
1519
+ children: [f.q, jsx("span", {
1520
+ className: "cbh-faq-icon",
1521
+ "aria-hidden": true,
1522
+ children: jsx(Plus, {
1523
+ size: 16
1524
+ })
1525
+ })]
1526
+ }), jsx("p", {
1527
+ children: f.a
1528
+ })]
1529
+ }, f.q))
765
1530
  })]
766
1531
  })
767
1532
  }), jsx("section", {
768
- className: "cbh-section cbh-business",
769
- id: "business",
770
- children: jsxs("div", {
1533
+ className: "cbh-final",
1534
+ "data-track-section": "final",
1535
+ children: jsx("div", {
771
1536
  className: "cbh-wrap",
772
- children: [jsxs("div", {
773
- className: "cbh-business-head",
774
- children: [jsxs("div", {
775
- children: [jsxs("p", {
776
- className: "cbh-eyebrow",
777
- children: [jsx(Briefcase, {
778
- size: 16,
779
- "aria-hidden": true
780
- }), " Clockbook for business"]
781
- }), jsx("h2", {
782
- children: "The same Clockbook runs the back office."
783
- }), jsx("p", {
784
- className: "cbh-body",
785
- children: "Clockbook started as the time tracker teams run their day on. For a business it is the whole back office: time, people, money and the workflows between them, with the paperwork handled and you always in control."
786
- })]
787
- }), jsxs("div", {
788
- className: "cbh-business-ctas",
789
- children: [jsxs("a", {
790
- className: "cbh-btn",
791
- href: businessHref(BUSINESS_LINKS.home),
792
- children: ["See Clockbook for business", jsx(ArrowRight, {
793
- size: 18,
794
- "aria-hidden": true
1537
+ children: jsx("div", {
1538
+ className: "cbh-final-card cbh-reveal",
1539
+ children: jsxs("div", {
1540
+ className: "cbh-final-inner",
1541
+ children: [jsx(AnimatedMark, {
1542
+ className: "cbh-final-mark"
1543
+ }), jsxs("h2", {
1544
+ children: ["What\u2019s the first chore you\u2019d ", jsx("em", {
1545
+ children: "hand over?"
795
1546
  })]
1547
+ }), jsx(Composer, {
1548
+ id: "cbh-chore-final",
1549
+ large: true,
1550
+ typed: TYPED_CHORES,
1551
+ onSubmit: handOverTyped('final'),
1552
+ onWarm: warmChat
796
1553
  }), jsxs("div", {
797
- className: "cbh-business-links",
798
- children: [jsx("a", {
799
- href: businessHref(BUSINESS_LINKS.pricing),
800
- children: "Pricing"
801
- }), jsx("a", {
802
- href: businessHref(BUSINESS_LINKS.demo),
803
- children: "Book a demo"
804
- }), jsx("a", {
805
- href: businessHref(BUSINESS_LINKS.freelancers),
806
- children: "For freelancers"
807
- })]
808
- })]
809
- })]
810
- }), jsx("div", {
811
- className: "cbh-business-grid",
812
- children: BUSINESS_PRODUCTS.map(p => {
813
- const Icon = BUSINESS_ICONS[p.key];
814
- return jsxs("a", {
815
- className: "cbh-business-card",
816
- href: businessHref(p.path),
817
- "data-track": "business_product",
818
- "data-track-item": p.key,
819
- children: [jsx("span", {
820
- className: "cbh-area-icon",
821
- "aria-hidden": true,
822
- children: jsx(Icon, {
823
- size: 22
824
- })
825
- }), jsx("h3", {
826
- children: p.title
827
- }), jsx("p", {
828
- children: p.blurb
1554
+ className: "cbh-channels",
1555
+ children: [jsx(ImessagePill, {
1556
+ onText: () => textLucy(),
1557
+ onWarm: warmImessage
829
1558
  }), jsxs("span", {
830
- className: "cbh-business-more",
831
- children: ["Learn more ", jsx(ArrowRight, {
1559
+ className: "cbh-trust",
1560
+ children: [jsx(ShieldCheck, {
832
1561
  size: 16,
833
1562
  "aria-hidden": true
834
- })]
1563
+ }), "Lucy asks before she pays for anything or changes an account"]
835
1564
  })]
836
- }, p.key);
1565
+ })]
837
1566
  })
838
- })]
1567
+ })
839
1568
  })
840
1569
  }), jsx("section", {
841
- className: "cbh-final",
842
- "data-track-section": "final",
843
- children: jsxs("div", {
1570
+ className: "cbh-yantra",
1571
+ id: "business",
1572
+ "aria-labelledby": "cbh-yantra-title",
1573
+ children: jsx("div", {
844
1574
  className: "cbh-wrap",
845
- children: [jsx(AnimatedMark, {
846
- className: "cbh-final-mark"
847
- }), jsx("h2", {
848
- children: "What's the first chore you'd hand over?"
849
- }), jsx(Composer, {
850
- id: "cbh-chore-final",
851
- large: true,
852
- onSubmit: handOverTyped('final'),
853
- onWarm: warmChat
854
- }), jsx("p", {
855
- className: "cbh-note",
856
- children: "Lucy asks before she pays for anything or changes an account."
857
- })]
1575
+ children: jsxs("div", {
1576
+ className: "cbh-yantra-card cbh-reveal",
1577
+ children: [jsx("span", {
1578
+ className: "cbh-yantra-icon",
1579
+ "aria-hidden": true,
1580
+ children: jsx(Briefcase, {
1581
+ size: 22
1582
+ })
1583
+ }), jsxs("div", {
1584
+ children: [jsxs("h2", {
1585
+ id: "cbh-yantra-title",
1586
+ className: "cbh-yantra-title",
1587
+ children: ["Running a business? That\u2019s ", jsx("em", {
1588
+ children: "Yantra."
1589
+ })]
1590
+ }), jsx("p", {
1591
+ className: "cbh-yantra-body",
1592
+ children: "Clockbook keeps life admin easy for everyone. For your team\u2019s work, from timesheets and invoices to the workflows between them, there\u2019s Yantra, the AI workspace Clockbook runs on."
1593
+ })]
1594
+ }), jsxs("a", {
1595
+ className: "cbh-btn",
1596
+ href: yantraAppUrl(),
1597
+ "data-track": "business_yantra",
1598
+ children: ["Go to yantra.app", jsx(ArrowUpRight, {
1599
+ size: 18,
1600
+ "aria-hidden": true
1601
+ })]
1602
+ })]
1603
+ })
858
1604
  })
859
1605
  })]
860
1606
  }), jsx("footer", {
@@ -874,19 +1620,26 @@ function HomePage() {
874
1620
  })]
875
1621
  }), jsxs("nav", {
876
1622
  className: "cbh-footer-links",
877
- "aria-label": "Clockbook for business",
878
- children: [jsxs("a", {
879
- href: businessHref(BUSINESS_LINKS.home),
880
- children: [jsx(Briefcase, {
881
- size: 15,
882
- "aria-hidden": true
883
- }), " Clockbook for business"]
1623
+ "aria-label": "Clockbook",
1624
+ children: [jsx("a", {
1625
+ href: "#how",
1626
+ children: "How it works"
1627
+ }), jsx("a", {
1628
+ href: "#faq",
1629
+ children: "Questions"
884
1630
  }), jsx("a", {
885
- href: businessHref(BUSINESS_LINKS.pricing),
886
- children: "Pricing"
1631
+ href: businessHref(SITE_LINKS.privacy),
1632
+ children: "Privacy"
887
1633
  }), jsx("a", {
888
- href: businessHref(BUSINESS_LINKS.helpCenter),
889
- children: "Help center"
1634
+ href: businessHref(SITE_LINKS.contact),
1635
+ children: "Contact"
1636
+ }), jsxs("a", {
1637
+ href: yantraAppUrl(),
1638
+ "data-track": "business_yantra",
1639
+ children: ["Yantra for business ", jsx(ArrowUpRight, {
1640
+ size: 14,
1641
+ "aria-hidden": true
1642
+ })]
890
1643
  })]
891
1644
  })]
892
1645
  }), jsxs("p", {
@@ -899,8 +1652,20 @@ function HomePage() {
899
1652
  }), signIn ? jsx(SignInDialog, {
900
1653
  chore: signIn.chore,
901
1654
  expired: signIn.expired,
1655
+ purpose: signIn.purpose,
902
1656
  onContinue: continueSignIn,
903
1657
  onCancel: () => setSignIn(null)
1658
+ }) : null, texting ? jsx(Suspense, {
1659
+ fallback: jsx("div", {
1660
+ className: "cbh-dialog-backdrop"
1661
+ }),
1662
+ children: jsx(ImessageDialog, {
1663
+ account: accountKeyFromToken(getCdecliToken()),
1664
+ message: texting.message,
1665
+ onClose: closeTexting,
1666
+ onChatHere: textingChatHere,
1667
+ onSignedOut: textingSignedOut
1668
+ })
904
1669
  }) : null, chat.mounted ? createPortal(jsx(Suspense, {
905
1670
  fallback: chat.open ? jsx("div", {
906
1671
  className: "cbh-chat-loading",
@@ -912,7 +1677,8 @@ function HomePage() {
912
1677
  hidden: !chat.open,
913
1678
  onClose: closeChat,
914
1679
  onSignedOut: onSignedOut,
915
- onSessionExpired: onSessionExpired
1680
+ onSessionExpired: onSessionExpired,
1681
+ onImessage: textFromChat
916
1682
  })
917
1683
  }), document.body) : null]
918
1684
  });