@adminide-stack/clock-tik-mobile 0.0.0-stage → 12.0.37-alpha.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 (376) hide show
  1. package/.claude-flow/data/pending-insights.jsonl +43 -0
  2. package/.claude-flow/sessions/session-1794323376548.json +14 -0
  3. package/CHANGELOG.md +31 -0
  4. package/jest.config.cjs +22 -0
  5. package/lib/assets/home/loop-day.jpg +0 -0
  6. package/lib/assets/home/loop-day.mp4 +0 -0
  7. package/lib/assets/home/loop-time-back.jpg +0 -0
  8. package/lib/assets/home/loop-time-back.mp4 +0 -0
  9. package/lib/assets/home/loop-where.jpg +0 -0
  10. package/lib/assets/home/loop-where.mp4 +0 -0
  11. package/lib/assets/home/reel-gym.jpg +0 -0
  12. package/lib/assets/home/reel-gym.mp4 +0 -0
  13. package/lib/assets/home/reel-internet.jpg +0 -0
  14. package/lib/assets/home/reel-internet.mp4 +0 -0
  15. package/lib/assets/icon.png +0 -0
  16. package/lib/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  17. package/lib/assets/lottie/lucy-mark-calendar.json +1827 -0
  18. package/lib/assets/lottie/lucy-mark-call.json +1470 -0
  19. package/lib/assets/lottie/lucy-mark-connect.json +2552 -0
  20. package/lib/assets/lottie/lucy-mark-details.json +1735 -0
  21. package/lib/assets/lottie/lucy-mark-email.json +1363 -0
  22. package/lib/assets/lottie/lucy-mark-message.json +1154 -0
  23. package/lib/assets/lottie/lucy-mark-search.json +1067 -0
  24. package/lib/assets/lottie/lucy-mark-think.json +1253 -0
  25. package/lib/assets/lottie/lucy-mark-write.json +1532 -0
  26. package/lib/assets/lottie/time-back.json +16458 -0
  27. package/lib/assets/lottie/where-lucy-works-chat.json +6170 -0
  28. package/lib/assets/lottie/where-lucy-works-cloud.json +10066 -0
  29. package/lib/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  30. package/lib/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  31. package/lib/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  32. package/lib/assets/sounds/hours-back.m4a +0 -0
  33. package/lib/assets/sounds/meet-lucy.m4a +0 -0
  34. package/lib/assets/sounds/power-on.m4a +0 -0
  35. package/lib/assets/sounds/wind-back.m4a +0 -0
  36. package/lib/assets/sounds/youre-in.m4a +0 -0
  37. package/lib/chat/agent.js +358 -0
  38. package/lib/chat/agent.js.map +1 -0
  39. package/lib/chat/appFront.js +32 -0
  40. package/lib/chat/appFront.js.map +1 -0
  41. package/lib/chat/auth.js +370 -0
  42. package/lib/chat/auth.js.map +1 -0
  43. package/lib/chat/chores.js +360 -0
  44. package/lib/chat/chores.js.map +1 -0
  45. package/lib/chat/connectors.js +42 -0
  46. package/lib/chat/connectors.js.map +1 -0
  47. package/lib/chat/jobs.js +223 -0
  48. package/lib/chat/jobs.js.map +1 -0
  49. package/lib/chat/lucyMotion.js +6 -0
  50. package/lib/chat/lucyMotion.js.map +1 -0
  51. package/lib/chat/protocol.js +111 -0
  52. package/lib/chat/protocol.js.map +1 -0
  53. package/lib/chat/results.js +133 -0
  54. package/lib/chat/results.js.map +1 -0
  55. package/lib/chat/store.js +81 -0
  56. package/lib/chat/store.js.map +1 -0
  57. package/lib/chat/useDictation.js +168 -0
  58. package/lib/chat/useDictation.js.map +1 -0
  59. package/lib/chat/useLucyChat.js +451 -0
  60. package/lib/chat/useLucyChat.js.map +1 -0
  61. package/lib/chat/useMyComputer.js +32 -0
  62. package/lib/chat/useMyComputer.js.map +1 -0
  63. package/lib/chat/whereLucyWorks.js +52 -0
  64. package/lib/chat/whereLucyWorks.js.map +1 -0
  65. package/lib/chat/workspace.js +124 -0
  66. package/lib/chat/workspace.js.map +1 -0
  67. package/lib/components/AreaShot.js +289 -0
  68. package/lib/components/AreaShot.js.map +1 -0
  69. package/lib/components/Backdrops.js +262 -0
  70. package/lib/components/Backdrops.js.map +1 -0
  71. package/lib/components/BottomSheet.js +61 -0
  72. package/lib/components/BottomSheet.js.map +1 -0
  73. package/lib/components/ChatSheets.js +429 -0
  74. package/lib/components/ChatSheets.js.map +1 -0
  75. package/lib/components/ConnectorLogo.js +91 -0
  76. package/lib/components/ConnectorLogo.js.map +1 -0
  77. package/lib/components/CustomDrawer.js +534 -0
  78. package/lib/components/CustomDrawer.js.map +1 -0
  79. package/lib/components/IdeasPane.js +394 -0
  80. package/lib/components/IdeasPane.js.map +1 -0
  81. package/lib/components/ImessageSheet.js +261 -0
  82. package/lib/components/ImessageSheet.js.map +1 -0
  83. package/lib/components/KeyboardAvoider.js +29 -0
  84. package/lib/components/KeyboardAvoider.js.map +1 -0
  85. package/lib/components/Logo.js +81 -0
  86. package/lib/components/Logo.js.map +1 -0
  87. package/lib/components/LucyWorking.js +67 -0
  88. package/lib/components/LucyWorking.js.map +1 -0
  89. package/lib/components/Markdown.js +260 -0
  90. package/lib/components/Markdown.js.map +1 -0
  91. package/lib/components/Media.js +93 -0
  92. package/lib/components/Media.js.map +1 -0
  93. package/lib/components/MessagesAppIcon.js +23 -0
  94. package/lib/components/MessagesAppIcon.js.map +1 -0
  95. package/lib/components/MicButton.js +71 -0
  96. package/lib/components/MicButton.js.map +1 -0
  97. package/lib/components/ResultCards.js +974 -0
  98. package/lib/components/ResultCards.js.map +1 -0
  99. package/lib/components/SignInPrompt.js +148 -0
  100. package/lib/components/SignInPrompt.js.map +1 -0
  101. package/lib/components/SignedOut.js +38 -0
  102. package/lib/components/SignedOut.js.map +1 -0
  103. package/lib/components/TalkToLucyHero.js +487 -0
  104. package/lib/components/TalkToLucyHero.js.map +1 -0
  105. package/lib/components/TalkToLucySheet.js +182 -0
  106. package/lib/components/TalkToLucySheet.js.map +1 -0
  107. package/lib/components/WhereLucyWorks.js +277 -0
  108. package/lib/components/WhereLucyWorks.js.map +1 -0
  109. package/lib/components/WorkspaceSection.js +271 -0
  110. package/lib/components/WorkspaceSection.js.map +1 -0
  111. package/lib/components/YantraMark.js +13 -0
  112. package/lib/components/YantraMark.js.map +1 -0
  113. package/lib/components/drawerHeader.js +38 -0
  114. package/lib/components/drawerHeader.js.map +1 -0
  115. package/lib/components/lottieInstalled.js +6 -0
  116. package/lib/components/lottieInstalled.js.map +1 -0
  117. package/lib/components/ui.js +550 -0
  118. package/lib/components/ui.js.map +1 -0
  119. package/lib/components/useSignOut.js +7 -0
  120. package/lib/components/useSignOut.js.map +1 -0
  121. package/lib/components/viewport.js +121 -0
  122. package/lib/components/viewport.js.map +1 -0
  123. package/lib/components/voiceDial.js +10 -0
  124. package/lib/components/voiceDial.js.map +1 -0
  125. package/lib/compute.js +157 -0
  126. package/lib/compute.js.map +1 -0
  127. package/lib/config/env-config.js +21 -0
  128. package/lib/config/env-config.js.map +1 -0
  129. package/lib/config/routes.js +15 -0
  130. package/lib/config/routes.js.map +1 -0
  131. package/lib/content.js +25 -0
  132. package/lib/content.js.map +1 -0
  133. package/lib/hooks/keyboardCover.js +39 -0
  134. package/lib/hooks/keyboardCover.js.map +1 -0
  135. package/lib/hooks/useKeyboard.js +121 -0
  136. package/lib/hooks/useKeyboard.js.map +1 -0
  137. package/lib/hooks/useReducedMotion.js +13 -0
  138. package/lib/hooks/useReducedMotion.js.map +1 -0
  139. package/lib/imessage/openMessages.js +25 -0
  140. package/lib/imessage/openMessages.js.map +1 -0
  141. package/lib/imessage/platform.js +12 -0
  142. package/lib/imessage/platform.js.map +1 -0
  143. package/lib/imessage/textLink.js +262 -0
  144. package/lib/imessage/textLink.js.map +1 -0
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -0
  147. package/lib/live/card.js +28 -0
  148. package/lib/live/card.js.map +1 -0
  149. package/lib/live/liveActivity.js +144 -0
  150. package/lib/live/liveActivity.js.map +1 -0
  151. package/lib/module.js +3 -0
  152. package/lib/module.js.map +1 -0
  153. package/lib/offer/BlackFridayOffer.js +378 -0
  154. package/lib/offer/BlackFridayOffer.js.map +1 -0
  155. package/lib/offer/blackFriday.js +78 -0
  156. package/lib/offer/blackFriday.js.map +1 -0
  157. package/lib/offer/parts.js +624 -0
  158. package/lib/offer/parts.js.map +1 -0
  159. package/lib/offer/state.js +63 -0
  160. package/lib/offer/state.js.map +1 -0
  161. package/lib/push/push.js +142 -0
  162. package/lib/push/push.js.map +1 -0
  163. package/lib/push/usePushNotifications.js +39 -0
  164. package/lib/push/usePushNotifications.js.map +1 -0
  165. package/lib/routes.json +175 -0
  166. package/lib/screens/Account/index.js +209 -0
  167. package/lib/screens/Account/index.js.map +1 -0
  168. package/lib/screens/Chat/index.js +710 -0
  169. package/lib/screens/Chat/index.js.map +1 -0
  170. package/lib/screens/Chores/index.js +18 -0
  171. package/lib/screens/Chores/index.js.map +1 -0
  172. package/lib/screens/Connectors/index.js +17 -0
  173. package/lib/screens/Connectors/index.js.map +1 -0
  174. package/lib/screens/History/index.js +380 -0
  175. package/lib/screens/History/index.js.map +1 -0
  176. package/lib/screens/Home/index.js +2711 -0
  177. package/lib/screens/Home/index.js.map +1 -0
  178. package/lib/screens/Home/media.js +25 -0
  179. package/lib/screens/Home/media.js.map +1 -0
  180. package/lib/screens/Welcome/index.js +1066 -0
  181. package/lib/screens/Welcome/index.js.map +1 -0
  182. package/lib/talk/talkToLucy.js +139 -0
  183. package/lib/talk/talkToLucy.js.map +1 -0
  184. package/lib/theme/colors.js +29 -0
  185. package/lib/theme/colors.js.map +1 -0
  186. package/lib/theme/fonts.js +17 -0
  187. package/lib/theme/fonts.js.map +1 -0
  188. package/lib/theme/muse.js +134 -0
  189. package/lib/theme/muse.js.map +1 -0
  190. package/lib/utils/links.js +54 -0
  191. package/lib/utils/links.js.map +1 -0
  192. package/lib/utils/yantraLinks.js +68 -0
  193. package/lib/utils/yantraLinks.js.map +1 -0
  194. package/lib/welcome/flow.js +375 -0
  195. package/lib/welcome/flow.js.map +1 -0
  196. package/lib/welcome/haptics.js +125 -0
  197. package/lib/welcome/haptics.js.map +1 -0
  198. package/lib/welcome/parts.js +1996 -0
  199. package/lib/welcome/parts.js.map +1 -0
  200. package/lib/welcome/powerOn.js +29 -0
  201. package/lib/welcome/powerOn.js.map +1 -0
  202. package/lib/welcome/seen.js +41 -0
  203. package/lib/welcome/seen.js.map +1 -0
  204. package/lib/welcome/sound.js +110 -0
  205. package/lib/welcome/sound.js.map +1 -0
  206. package/package.json +66 -5
  207. package/rollup.config.mjs +42 -0
  208. package/src/.claude-flow/data/pending-insights.jsonl +19 -0
  209. package/src/.claude-flow/sessions/session-1795013028422.json +14 -0
  210. package/src/__tests__/auth.test.ts +94 -0
  211. package/src/__tests__/blackFriday.test.ts +75 -0
  212. package/src/__tests__/cardTokens.test.ts +77 -0
  213. package/src/__tests__/chores.test.ts +179 -0
  214. package/src/__tests__/choresList.test.ts +100 -0
  215. package/src/__tests__/content.test.ts +54 -0
  216. package/src/__tests__/dictation.test.ts +186 -0
  217. package/src/__tests__/haptics.test.ts +202 -0
  218. package/src/__tests__/jobs.test.ts +130 -0
  219. package/src/__tests__/keyboardCover.test.ts +84 -0
  220. package/src/__tests__/liveCard.test.ts +39 -0
  221. package/src/__tests__/lockedPhone.test.ts +355 -0
  222. package/src/__tests__/lucyMotion.test.ts +34 -0
  223. package/src/__tests__/platform.test.ts +32 -0
  224. package/src/__tests__/powerOn.test.ts +62 -0
  225. package/src/__tests__/protocol.test.ts +125 -0
  226. package/src/__tests__/push.test.ts +111 -0
  227. package/src/__tests__/results.test.ts +256 -0
  228. package/src/__tests__/sound.test.ts +248 -0
  229. package/src/__tests__/talkToLucy.test.ts +205 -0
  230. package/src/__tests__/textLink.test.ts +91 -0
  231. package/src/__tests__/voiceDial.test.ts +53 -0
  232. package/src/__tests__/welcomeFlow.test.ts +157 -0
  233. package/src/__tests__/whereLucyWorks.test.ts +81 -0
  234. package/src/__tests__/yantraLinks.test.ts +96 -0
  235. package/src/assets/home/loop-day.jpg +0 -0
  236. package/src/assets/home/loop-day.mp4 +0 -0
  237. package/src/assets/home/loop-time-back.jpg +0 -0
  238. package/src/assets/home/loop-time-back.mp4 +0 -0
  239. package/src/assets/home/loop-where.jpg +0 -0
  240. package/src/assets/home/loop-where.mp4 +0 -0
  241. package/src/assets/home/reel-gym.jpg +0 -0
  242. package/src/assets/home/reel-gym.mp4 +0 -0
  243. package/src/assets/home/reel-internet.jpg +0 -0
  244. package/src/assets/home/reel-internet.mp4 +0 -0
  245. package/src/assets/icon.png +0 -0
  246. package/src/assets/lottie/.claude-flow/data/pending-insights.jsonl +1 -0
  247. package/src/assets/lottie/lucy-mark-calendar.json +1827 -0
  248. package/src/assets/lottie/lucy-mark-call.json +1470 -0
  249. package/src/assets/lottie/lucy-mark-connect.json +2552 -0
  250. package/src/assets/lottie/lucy-mark-details.json +1735 -0
  251. package/src/assets/lottie/lucy-mark-email.json +1363 -0
  252. package/src/assets/lottie/lucy-mark-message.json +1154 -0
  253. package/src/assets/lottie/lucy-mark-search.json +1067 -0
  254. package/src/assets/lottie/lucy-mark-think.json +1253 -0
  255. package/src/assets/lottie/lucy-mark-write.json +1532 -0
  256. package/src/assets/lottie/time-back.json +16458 -0
  257. package/src/assets/lottie/where-lucy-works-chat.json +6170 -0
  258. package/src/assets/lottie/where-lucy-works-cloud.json +10066 -0
  259. package/src/assets/lottie/where-lucy-works-mine-none.json +2478 -0
  260. package/src/assets/lottie/where-lucy-works-mine-offline.json +2373 -0
  261. package/src/assets/lottie/where-lucy-works-mine-online.json +7881 -0
  262. package/src/assets/sounds/hours-back.m4a +0 -0
  263. package/src/assets/sounds/meet-lucy.m4a +0 -0
  264. package/src/assets/sounds/power-on.m4a +0 -0
  265. package/src/assets/sounds/wind-back.m4a +0 -0
  266. package/src/assets/sounds/youre-in.m4a +0 -0
  267. package/src/chat/.claude-flow/data/pending-insights.jsonl +1 -0
  268. package/src/chat/agent.ts +376 -0
  269. package/src/chat/appFront.ts +39 -0
  270. package/src/chat/auth.ts +433 -0
  271. package/src/chat/chores.ts +394 -0
  272. package/src/chat/connectors.ts +65 -0
  273. package/src/chat/jobs.ts +228 -0
  274. package/src/chat/lucyMotion.ts +33 -0
  275. package/src/chat/protocol.ts +192 -0
  276. package/src/chat/results.ts +224 -0
  277. package/src/chat/store.ts +87 -0
  278. package/src/chat/useDictation.ts +201 -0
  279. package/src/chat/useLucyChat.ts +458 -0
  280. package/src/chat/useMyComputer.ts +41 -0
  281. package/src/chat/whereLucyWorks.ts +97 -0
  282. package/src/chat/workspace.ts +127 -0
  283. package/src/components/.claude-flow/data/pending-insights.jsonl +3 -0
  284. package/src/components/AreaShot.tsx +239 -0
  285. package/src/components/Backdrops.tsx +323 -0
  286. package/src/components/BottomSheet.tsx +96 -0
  287. package/src/components/ChatSheets.tsx +565 -0
  288. package/src/components/ConnectorLogo.tsx +116 -0
  289. package/src/components/CustomDrawer.tsx +526 -0
  290. package/src/components/IdeasPane.tsx +318 -0
  291. package/src/components/ImessageSheet.tsx +280 -0
  292. package/src/components/KeyboardAvoider.tsx +45 -0
  293. package/src/components/Logo.tsx +97 -0
  294. package/src/components/LucyWorking.tsx +122 -0
  295. package/src/components/Markdown.tsx +219 -0
  296. package/src/components/Media.tsx +173 -0
  297. package/src/components/MessagesAppIcon.tsx +51 -0
  298. package/src/components/MicButton.tsx +92 -0
  299. package/src/components/ResultCards.tsx +1067 -0
  300. package/src/components/SignInPrompt.tsx +182 -0
  301. package/src/components/SignedOut.tsx +47 -0
  302. package/src/components/TalkToLucyHero.tsx +540 -0
  303. package/src/components/TalkToLucySheet.tsx +208 -0
  304. package/src/components/VoiceOrb.tsx +364 -0
  305. package/src/components/WhereLucyWorks.tsx +261 -0
  306. package/src/components/WorkspaceSection.tsx +307 -0
  307. package/src/components/YantraMark.tsx +30 -0
  308. package/src/components/drawerHeader.tsx +46 -0
  309. package/src/components/kit.tsx +309 -0
  310. package/src/components/lottieInstalled.ts +7 -0
  311. package/src/components/ui.tsx +700 -0
  312. package/src/components/useSignOut.ts +21 -0
  313. package/src/components/viewport.tsx +166 -0
  314. package/src/components/voiceDial.ts +45 -0
  315. package/src/compute.ts +168 -0
  316. package/src/config/env-config.ts +37 -0
  317. package/src/config/routes.ts +28 -0
  318. package/src/content.ts +217 -0
  319. package/src/hooks/keyboardCover.ts +70 -0
  320. package/src/hooks/useKeyboard.ts +135 -0
  321. package/src/hooks/useReducedMotion.ts +19 -0
  322. package/src/imessage/openMessages.ts +53 -0
  323. package/src/imessage/platform.ts +32 -0
  324. package/src/imessage/textLink.ts +307 -0
  325. package/src/index.ts +24 -0
  326. package/src/live/card.ts +62 -0
  327. package/src/live/liveActivity.ts +192 -0
  328. package/src/module.ts +8 -0
  329. package/src/offer/BlackFridayOffer.tsx +394 -0
  330. package/src/offer/blackFriday.ts +109 -0
  331. package/src/offer/parts.tsx +650 -0
  332. package/src/offer/state.ts +78 -0
  333. package/src/push/push.ts +171 -0
  334. package/src/push/usePushNotifications.ts +47 -0
  335. package/src/screens/Account/index.tsx +310 -0
  336. package/src/screens/Chat/.claude-flow/data/pending-insights.jsonl +4 -0
  337. package/src/screens/Chat/index.tsx +891 -0
  338. package/src/screens/Chores/index.tsx +35 -0
  339. package/src/screens/Connectors/index.tsx +35 -0
  340. package/src/screens/History/index.tsx +346 -0
  341. package/src/screens/Home/index.tsx +2773 -0
  342. package/src/screens/Home/media.ts +31 -0
  343. package/src/screens/Welcome/index.tsx +1182 -0
  344. package/src/talk/talkToLucy.ts +187 -0
  345. package/src/theme/colors.ts +38 -0
  346. package/src/theme/fonts.ts +30 -0
  347. package/src/theme/muse.ts +86 -0
  348. package/src/utils/links.ts +84 -0
  349. package/src/utils/yantraLinks.ts +94 -0
  350. package/src/welcome/flow.ts +418 -0
  351. package/src/welcome/haptics.ts +179 -0
  352. package/src/welcome/parts.tsx +2160 -0
  353. package/src/welcome/powerOn.ts +84 -0
  354. package/src/welcome/seen.ts +68 -0
  355. package/src/welcome/sound.ts +173 -0
  356. package/tools/lottie/chat.motion +0 -0
  357. package/tools/lottie/cloud.motion +0 -0
  358. package/tools/lottie/generate.mjs +1209 -0
  359. package/tools/lottie/inter-glyphs.json +4416 -0
  360. package/tools/lottie/lucy-mark-calendar.motion +0 -0
  361. package/tools/lottie/lucy-mark-call.motion +0 -0
  362. package/tools/lottie/lucy-mark-connect.motion +0 -0
  363. package/tools/lottie/lucy-mark-details.motion +0 -0
  364. package/tools/lottie/lucy-mark-email.motion +0 -0
  365. package/tools/lottie/lucy-mark-message.motion +0 -0
  366. package/tools/lottie/lucy-mark-search.motion +0 -0
  367. package/tools/lottie/lucy-mark-think.motion +0 -0
  368. package/tools/lottie/lucy-mark-write.motion +0 -0
  369. package/tools/lottie/mark.json +1 -0
  370. package/tools/lottie/mine-none.motion +0 -0
  371. package/tools/lottie/mine-offline.motion +0 -0
  372. package/tools/lottie/mine-online.motion +0 -0
  373. package/tools/lottie/time-back.mjs +604 -0
  374. package/tools/sounds/render.mjs +730 -0
  375. package/tsconfig.json +17 -0
  376. package/README.md +0 -3
@@ -0,0 +1,418 @@
1
+ /**
2
+ * The welcome flow (screens/Welcome): every step in order, what Lucy says at each one, which steps move on by
3
+ * themselves and when, and the life-admin numbers. Plain TypeScript with no React Native, so it runs under jest as is.
4
+ *
5
+ * The numbers are the web home's (clock-tik-browser pages/Home/content.ts and timeBack.ts): about 169 minutes a day of
6
+ * life admin, about 38 of them handed to Lucy, from the U.S. BLS American Time Use Survey 2025. Wherever a number
7
+ * shows, its footnote shows too.
8
+ */
9
+
10
+ export type StepId =
11
+ | 'i1'
12
+ | 'i2'
13
+ | 'i3'
14
+ | 'i4'
15
+ | 'name'
16
+ | 'hello'
17
+ | 'signin'
18
+ | 'pain'
19
+ | 'pain2'
20
+ | 'home'
21
+ | 'home2'
22
+ | 'time'
23
+ | 'time2'
24
+ | 'review'
25
+ | 'help'
26
+ | 'news'
27
+ | 'bad'
28
+ | 'good'
29
+ | 'cal'
30
+ | 'notif'
31
+ | 'plan'
32
+ | 'yay'
33
+ | 'pay'
34
+ | 'remind'
35
+ | 'done';
36
+
37
+ export type PainKey = 'calls' | 'bills' | 'appts' | 'food' | 'family' | 'travel';
38
+ export type TimeKey = 'h01' | 'h12' | 'h23' | 'h3p';
39
+
40
+ export interface Answers {
41
+ name: string;
42
+ pain: PainKey;
43
+ /** People they run a home for; 6 means six or more. */
44
+ home: number;
45
+ time: TimeKey;
46
+ }
47
+
48
+ /** What the flow assumes before each question is answered (only shown once it is). */
49
+ export const DEFAULT_ANSWERS: Answers = { name: '', pain: 'calls', home: 4, time: 'h23' };
50
+
51
+ /** `icon` is an Ionicons name. `title` and `body` are this choice's row on the plan. */
52
+ export const PAIN: Record<PainKey, { label: string; icon: string; reply: string; title: string; body: string }> = {
53
+ calls: {
54
+ label: 'Calls and hold music',
55
+ icon: 'call-outline',
56
+ reply: 'Phone menus, hold music, “your call is important to us.” I’ll take those.',
57
+ title: 'No more hold music',
58
+ body: 'Lucy makes the calls, works the phone menus and waits on hold for you.',
59
+ },
60
+ bills: {
61
+ label: 'Bills and subscriptions',
62
+ icon: 'receipt-outline',
63
+ reply: 'Rates creep up and fees sneak in. I’ll make the calls that bring them down.',
64
+ title: 'Bills that go down, not up',
65
+ body: 'Better rates asked for and fees disputed, always with your yes.',
66
+ },
67
+ appts: {
68
+ label: 'Booking appointments',
69
+ icon: 'calendar-outline',
70
+ reply: 'All that back-and-forth. I’ll book around your calendar.',
71
+ title: 'Appointments, booked',
72
+ body: 'Dentists, doctors and calls, fitted around your calendar.',
73
+ },
74
+ food: {
75
+ label: 'Groceries and meals',
76
+ icon: 'cart-outline',
77
+ reply: 'Meals planned, lists made, prices compared. Consider it handled.',
78
+ title: 'Dinner, sorted',
79
+ body: 'Easy dinners planned and the grocery list made, every week.',
80
+ },
81
+ family: {
82
+ label: 'Family logistics',
83
+ icon: 'people-outline',
84
+ reply: 'Forms, pickups and reminders for everyone at home. I’ve got them.',
85
+ title: 'Everyone, covered',
86
+ body: 'Forms, pickups and reminders for the whole house.',
87
+ },
88
+ travel: {
89
+ label: 'Travel and refunds',
90
+ icon: 'airplane-outline',
91
+ reply: 'Refunds instead of vouchers, rebookings without the wait.',
92
+ title: 'Refunds, not vouchers',
93
+ body: 'Cancelled flights refunded and trips rebooked, minus the hold music.',
94
+ },
95
+ };
96
+ export const PAIN_KEYS: PainKey[] = ['calls', 'bills', 'appts', 'food', 'family', 'travel'];
97
+
98
+ export const HOME: Record<number, { label: string; reply: string }> = {
99
+ 1: { label: 'Just me', reply: 'Just you. Still plenty to keep track of.' },
100
+ 2: { label: 'Two of us', reply: 'Two people, two calendars, one fridge.' },
101
+ 3: { label: 'Three of us', reply: 'Three people, three dentists, one of you.' },
102
+ 4: { label: 'Four of us', reply: 'Four people and one of you. That’s a lot of calendars.' },
103
+ 5: { label: 'Five of us', reply: 'Five people. You’re basically running a small company.' },
104
+ 6: { label: 'Six or more', reply: 'A full house. Let me take some of it off you.' },
105
+ };
106
+ export const HOME_SIZES = [1, 2, 3, 4, 5, 6];
107
+
108
+ /** `min` is the minutes a day each answer stands for; 2 to 3 hours is the survey's own 169. */
109
+ export const TIME: Record<TimeKey, { label: string; min: number; reply: string }> = {
110
+ h01: { label: 'Under an hour', min: 45, reply: 'Less than most. Let’s make it even less.' },
111
+ h12: { label: '1 to 2 hours', min: 90, reply: 'That’s a long lunch break, every single day.' },
112
+ h23: { label: '2 to 3 hours', min: 169, reply: 'That’s a part-time job nobody pays you for.' },
113
+ h3p: { label: 'More than 3 hours', min: 210, reply: 'That’s a second job. Let’s fix that.' },
114
+ };
115
+ export const TIME_KEYS: TimeKey[] = ['h01', 'h12', 'h23', 'h3p'];
116
+
117
+ /** The chores offered at the end, by their label in content.ts HERO_CHORES. */
118
+ export const FIRST_CHORES = ['Cancel my gym', 'Lower my internet bill', 'Book the dentist', 'Get my flight refund'];
119
+
120
+ /* ---------------------------------------------------------------------------------------------------- steps */
121
+
122
+ const ORDER: StepId[] = [
123
+ 'i1',
124
+ 'i2',
125
+ 'i3',
126
+ 'i4',
127
+ 'name',
128
+ 'hello',
129
+ 'signin',
130
+ 'pain',
131
+ 'pain2',
132
+ 'home',
133
+ 'home2',
134
+ 'time',
135
+ 'time2',
136
+ 'review',
137
+ 'help',
138
+ 'news',
139
+ 'bad',
140
+ 'good',
141
+ 'cal',
142
+ 'notif',
143
+ 'plan',
144
+ 'yay',
145
+ 'pay',
146
+ 'remind',
147
+ 'done',
148
+ ];
149
+
150
+ export interface FlowOptions {
151
+ /** The free-week paywall and its reminder. Off until Clockbook sells a subscription. */
152
+ trial: boolean;
153
+ }
154
+
155
+ export function nextStep(step: StepId, { trial }: FlowOptions): StepId {
156
+ if (step === 'yay' && !trial) return 'done';
157
+ const at = ORDER.indexOf(step);
158
+ return ORDER[Math.min(ORDER.length - 1, at + 1)];
159
+ }
160
+
161
+ /** The intro's beats move on when tapped. */
162
+ export const TAP_NEXT: Partial<Record<StepId, StepId>> = { i1: 'i2', i2: 'i3', i3: 'i4' };
163
+
164
+ export function isIntro(step: StepId): boolean {
165
+ return step === 'i1' || step === 'i2' || step === 'i3' || step === 'i4';
166
+ }
167
+
168
+ /**
169
+ * The intro's third beat ("Now, wind them back."): the clock's ring lights anticlockwise over `lit` ms, felt as
170
+ * `count` ticks `every` ms apart from `start` (haptics.ts) and heard winding back (sound.ts, which was rendered to it).
171
+ */
172
+ export const WIND_BACK = { count: 14, every: 75, start: 60, lit: 1100 } as const;
173
+
174
+ /** First name only, without the markup the chat uses for emphasis, capitalised, at most 24 letters. */
175
+ export function cleanName(raw: string): string {
176
+ const first = raw.replace(/\*/g, '').trim().split(/\s+/)[0] ?? '';
177
+ return first ? first.charAt(0).toUpperCase() + first.slice(1, 24) : '';
178
+ }
179
+
180
+ /* ---------------------------------------------------------------------------------------------------- chat */
181
+
182
+ /** A word as it is drawn: `a` in orange (a name, a number), then `b` in the line's own colour. */
183
+ export interface Word {
184
+ a: string;
185
+ b: string;
186
+ }
187
+
188
+ export interface ChatLine {
189
+ key: string;
190
+ who: 'lucy' | 'you';
191
+ /** The line as a screen reader says it. */
192
+ plain: string;
193
+ words: Word[];
194
+ /** 0 is new at this step; 1 and 2 are the lines before it, fading upward. */
195
+ age: 0 | 1 | 2;
196
+ /** When it starts to appear, in ms from the step's start. */
197
+ start: number;
198
+ }
199
+
200
+ /** Lucy writes a word every WORD_MS; each takes WORD_FADE_MS to settle. */
201
+ export const WORD_MS = 62;
202
+ export const WORD_FADE_MS = 520;
203
+ const START_MS = 260;
204
+ const YOU_MS = 420;
205
+ const LINE_GAP_MS = 300;
206
+ /** The "Adding it up" bar. */
207
+ export const FILL_MS = 2600;
208
+
209
+ /** Each chat step's new lines, as indexes into transcript(). */
210
+ const CHAT_RANGE: Partial<Record<StepId, [number, number]>> = {
211
+ name: [0, 1],
212
+ hello: [2, 3],
213
+ signin: [4, 4],
214
+ pain: [5, 5],
215
+ pain2: [6, 7],
216
+ home: [8, 8],
217
+ home2: [9, 10],
218
+ time: [11, 11],
219
+ time2: [12, 13],
220
+ review: [14, 14],
221
+ help: [15, 16],
222
+ };
223
+
224
+ export function isChat(step: StepId): boolean {
225
+ return step in CHAT_RANGE;
226
+ }
227
+
228
+ /** The whole conversation, in order. `*text*` is drawn in orange. */
229
+ export function transcript(a: Answers): { text: string; you?: boolean }[] {
230
+ const pain = PAIN[a.pain];
231
+ const home = HOME[a.home] ?? HOME[4];
232
+ const time = TIME[a.time];
233
+ return [
234
+ { text: 'Hi, I’m Lucy. I take the life admin off your plate.' },
235
+ { text: 'First, what should I call you?' },
236
+ { text: `Nice to meet you, *${a.name}*.` },
237
+ { text: 'A few quick questions, then I’ll build your plan. No wrong answers.' },
238
+ { text: 'Before we go on, have we met?' },
239
+ { text: 'What eats most of your week?' },
240
+ { text: pain.label, you: true },
241
+ { text: pain.reply },
242
+ { text: 'How many people are you running a home for?' },
243
+ { text: home.label, you: true },
244
+ { text: home.reply },
245
+ { text: 'Roughly how much of your day goes to life admin? A best guess is fine.' },
246
+ { text: time.label, you: true },
247
+ { text: time.reply },
248
+ { text: 'Adding it up…' },
249
+ { text: `I can help with that, *${a.name}*.` },
250
+ { text: 'But first, some honest numbers.' },
251
+ ];
252
+ }
253
+
254
+ /** Splits a line into words, keeping `*emphasis*` (which may span words and end before punctuation). */
255
+ export function words(text: string): Word[] {
256
+ const out: Word[] = [];
257
+ let inAccent = false;
258
+ for (const raw of text.split(' ')) {
259
+ let w = raw;
260
+ if (!w) continue;
261
+ if (w.startsWith('*')) {
262
+ inAccent = true;
263
+ w = w.slice(1);
264
+ }
265
+ if (!inAccent) {
266
+ out.push({ a: '', b: w });
267
+ continue;
268
+ }
269
+ const close = w.indexOf('*');
270
+ if (close >= 0) {
271
+ out.push({ a: w.slice(0, close), b: w.slice(close + 1) });
272
+ inAccent = false;
273
+ } else {
274
+ out.push({ a: w, b: '' });
275
+ }
276
+ }
277
+ return out;
278
+ }
279
+
280
+ /** A chat step's lines (up to two before it, then its new ones) and when its last word has settled. */
281
+ export function buildChat(step: StepId, a: Answers): { lines: ChatLine[]; end: number } {
282
+ const range = CHAT_RANGE[step];
283
+ if (!range) return { lines: [], end: 0 };
284
+ const all = transcript(a);
285
+ const lines: ChatLine[] = [];
286
+ for (let i = Math.max(0, range[0] - 2); i < range[0]; i++) {
287
+ lines.push({
288
+ key: `p${i}`,
289
+ who: all[i].you ? 'you' : 'lucy',
290
+ plain: all[i].text.replace(/\*/g, ''),
291
+ words: words(all[i].text),
292
+ age: range[0] - i === 1 ? 1 : 2,
293
+ start: 0,
294
+ });
295
+ }
296
+ let t = START_MS;
297
+ let end = START_MS + WORD_FADE_MS;
298
+ for (let i = range[0]; i <= range[1]; i++) {
299
+ const line = all[i];
300
+ const ws = words(line.text);
301
+ lines.push({
302
+ key: `n${i}`,
303
+ who: line.you ? 'you' : 'lucy',
304
+ plain: line.text.replace(/\*/g, ''),
305
+ words: ws,
306
+ age: 0,
307
+ start: t,
308
+ });
309
+ if (line.you) {
310
+ t += YOU_MS;
311
+ end = t + 200;
312
+ } else {
313
+ const last = t + (ws.length - 1) * WORD_MS;
314
+ end = last + WORD_FADE_MS;
315
+ t = last + WORD_MS + LINE_GAP_MS;
316
+ }
317
+ }
318
+ return { lines, end };
319
+ }
320
+
321
+ /** When a step's own controls (field, choices, button) come up: once Lucy has finished writing. */
322
+ export function controlsDelay(step: StepId, a: Answers): number {
323
+ return isChat(step) ? buildChat(step, a).end + 80 : 0;
324
+ }
325
+
326
+ /** Steps that move on by themselves: where to, and after how long. */
327
+ export function autoAdvance(step: StepId, a: Answers, opts: FlowOptions): { to: StepId; after: number } | null {
328
+ switch (step) {
329
+ case 'i4':
330
+ return { to: 'name', after: 2200 };
331
+ case 'news':
332
+ return { to: 'bad', after: 2800 };
333
+ case 'yay':
334
+ return { to: nextStep('yay', opts), after: 3000 };
335
+ case 'hello':
336
+ return { to: 'signin', after: buildChat(step, a).end + 1100 };
337
+ case 'pain2':
338
+ case 'home2':
339
+ case 'time2':
340
+ return { to: nextStep(step, opts), after: buildChat(step, a).end + 1300 };
341
+ case 'review':
342
+ return { to: 'help', after: controlsDelay(step, a) + FILL_MS + 450 };
343
+ default:
344
+ return null;
345
+ }
346
+ }
347
+
348
+ /* ---------------------------------------------------------------------------------------------------- numbers */
349
+
350
+ export interface LifeAdmin {
351
+ /** Minutes a day of life admin. */
352
+ min: number;
353
+ /** Of those, the minutes a day handed to Lucy. */
354
+ backMin: number;
355
+ /** Hours a week back, to a tenth (timeBack.ts). */
356
+ week: string;
357
+ yearHours: number;
358
+ /** This year's life admin, in 16-hour waking days. */
359
+ wakingDays: number;
360
+ /** The next 50 years of it, in waking years. */
361
+ lifetimeYears: number;
362
+ }
363
+
364
+ export function lifeAdmin(min: number): LifeAdmin {
365
+ const back = (min * 38) / 169;
366
+ const week = Math.round((back * 7) / 6) / 10;
367
+ return {
368
+ min,
369
+ backMin: Math.round(back),
370
+ week: week.toFixed(1),
371
+ yearHours: Math.round(week * 52),
372
+ wakingDays: Math.round((min * 365) / 60 / 16),
373
+ lifetimeYears: Math.max(1, Math.round((min * 365 * 50) / 60 / (16 * 365))),
374
+ };
375
+ }
376
+
377
+ export function yearsLabel(n: number): string {
378
+ return n === 1 ? '1 year' : `${n} years`;
379
+ }
380
+
381
+ /** The rolling years: a short run up to the answer and one past it, and where the answer sits in the run. */
382
+ export function rollRows(years: number): { rows: number[]; target: number } {
383
+ const from = Math.max(1, years - 6);
384
+ const rows: number[] = [];
385
+ for (let n = from; n <= years + 1; n++) rows.push(n);
386
+ return { rows, target: years - from };
387
+ }
388
+
389
+ /** The odometer: per digit, the strip it spins through (more turns further right) and where it stops. */
390
+ export function odometerColumns(n: number): { digits: number[]; stop: number }[] {
391
+ return String(Math.max(0, Math.round(n)))
392
+ .split('')
393
+ .map((ch, col) => {
394
+ const stop = (1 + col) * 10 + Number(ch);
395
+ const digits: number[] = [];
396
+ for (let k = 0; k <= stop; k++) digits.push(k % 10);
397
+ return { digits, stop };
398
+ });
399
+ }
400
+
401
+ /* ---------------------------------------------------------------------------------------------------- trial */
402
+
403
+ /** A free week from `today`, and the two reminder days offered before it ends. */
404
+ export function reminderDates(today: Date): { ends: Date; options: { daysBefore: 2 | 3; date: Date }[] } {
405
+ const ends = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 7);
406
+ const before = (n: number) => new Date(ends.getFullYear(), ends.getMonth(), ends.getDate() - n);
407
+ return {
408
+ ends,
409
+ options: [
410
+ { daysBefore: 2, date: before(2) },
411
+ { daysBefore: 3, date: before(3) },
412
+ ],
413
+ };
414
+ }
415
+
416
+ export function longDate(d: Date): string {
417
+ return d.toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric' });
418
+ }
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Clockbook's touch: one small language for the whole app, the welcome, Home and the offer.
3
+ *
4
+ * - `tick`: a detent, the lightest there is: Lucy's writing, the dial's run, the years' reel passing a row.
5
+ * - `tap`: something pressed or chosen.
6
+ * - `click` and `release`: a switch going on and off, crisp then soft (the mic).
7
+ * - `thud`: something arriving: a number landing, Lucy's orb lighting, the offer's clock striking.
8
+ * - `success`: done: claimed, you're in.
9
+ * - `powerOn`: the welcome's first moment, a composed run of these timed to its picture (powerOn.ts).
10
+ *
11
+ * Two rules keep it a touch rather than a buzz. Nothing plays within GAP_MS of the last one unless it is stronger,
12
+ * so a tap and a tick never smear together. And ticks are the iPhone's alone: there they are the Taptic Engine's
13
+ * selection click, but on Android expo-haptics (14.1) drives the vibration motor, where a tick is a 50 ms buzz and a
14
+ * run of them one long buzz (its own feedback call, performAndroidHapticsAsync, did nothing before 58.0). So Android
15
+ * feels the presses, the switches and the landings, not the texture.
16
+ *
17
+ * expo-haptics is loaded only when this binary has its native module (as push.ts does with expo-notifications), so
18
+ * a build without it stays silent instead of failing. The phone's own haptics setting still applies.
19
+ */
20
+ import { Platform, Vibration } from 'react-native';
21
+ import { requireOptionalNativeModule } from 'expo-modules-core';
22
+ import { POWER_ON_ANDROID, POWER_ON_TRACK, vibrationPattern, type Buzz } from './powerOn';
23
+
24
+ type ExpoHaptics = typeof import('expo-haptics');
25
+
26
+ let loaded: ExpoHaptics | null | undefined;
27
+ function haptics(): ExpoHaptics | null {
28
+ if (loaded !== undefined) return loaded;
29
+ try {
30
+ loaded = requireOptionalNativeModule('ExpoHaptics')
31
+ ? // eslint-disable-next-line global-require, @typescript-eslint/no-require-imports
32
+ (require('expo-haptics') as ExpoHaptics)
33
+ : null;
34
+ } catch {
35
+ loaded = null;
36
+ }
37
+ return loaded;
38
+ }
39
+
40
+ const quiet = () => undefined;
41
+ const none = () => undefined;
42
+
43
+ /** Ticks are the Taptic Engine's alone (see above). */
44
+ function fine(): boolean {
45
+ return Platform.OS === 'ios';
46
+ }
47
+
48
+ /** Nothing within this many ms of the last haptic, unless it is stronger. */
49
+ export const GAP_MS = 40;
50
+ const STRENGTH = { tick: 0, tap: 1, thud: 2, success: 3 } as const;
51
+ let lastAt = -Infinity;
52
+ let lastStrength = -1;
53
+
54
+ /** Whether one of this strength may play now; if it may, it becomes the last. */
55
+ function room(strength: number): boolean {
56
+ const now = Date.now();
57
+ if (now - lastAt < GAP_MS && strength <= lastStrength) return false;
58
+ lastAt = now;
59
+ lastStrength = strength;
60
+ return true;
61
+ }
62
+
63
+ function impact(strength: number, style: 'Light' | 'Medium' | 'Soft' | 'Rigid'): void {
64
+ if (!room(strength)) return;
65
+ const h = haptics();
66
+ h?.impactAsync(h.ImpactFeedbackStyle[style]).catch(quiet);
67
+ }
68
+
69
+ /** A detent: a word landing, the dial stepping, the reel passing a row. iPhone only. */
70
+ export function tick(): void {
71
+ if (!fine() || !room(STRENGTH.tick)) return;
72
+ haptics()?.selectionAsync().catch(quiet);
73
+ }
74
+
75
+ /** Something tapped or chosen. */
76
+ export function tap(): void {
77
+ impact(STRENGTH.tap, 'Light');
78
+ }
79
+
80
+ /** A switch going on, crisp: the mic starting to listen. */
81
+ export function click(): void {
82
+ impact(STRENGTH.tap, 'Rigid');
83
+ }
84
+
85
+ /** A switch going off, soft: the mic letting go. */
86
+ export function release(): void {
87
+ impact(STRENGTH.tap, 'Soft');
88
+ }
89
+
90
+ /** Something arriving: a number landing, the orb lighting up, the offer's clock striking. */
91
+ export function thud(): void {
92
+ impact(STRENGTH.thud, 'Medium');
93
+ }
94
+
95
+ /** You're in. */
96
+ export function success(): void {
97
+ if (!room(STRENGTH.success)) return;
98
+ const h = haptics();
99
+ h?.notificationAsync(h.NotificationFeedbackType.Success).catch(quiet);
100
+ }
101
+
102
+ /** `feel` at each of `times` (ms from now); returns what cancels the ones still to come. */
103
+ export function at(times: number[], feel: () => void = tick): () => void {
104
+ const ids = times.map((t) => setTimeout(feel, t));
105
+ return () => ids.forEach(clearTimeout);
106
+ }
107
+
108
+ /** `count` ticks, `every` ms apart, from `start` ms on; returns what cancels the ones still to come. */
109
+ export function ticks(count: number, every: number, start = 0): () => void {
110
+ if (!fine()) return none;
111
+ return at(Array.from({ length: count }, (_, i) => start + i * every));
112
+ }
113
+
114
+ /**
115
+ * Lucy writing: a tick every WRITE_EVERY words, at most WRITE_MOST a line. A word lands every 62 ms, too quick to
116
+ * feel one by one (a tick under each was one long rumble), so the writing is felt as a light texture instead.
117
+ */
118
+ export const WRITE_EVERY = 3;
119
+ export const WRITE_MOST = 4;
120
+ export function writing(words: number, every: number, start = 0): () => void {
121
+ if (!fine()) return none;
122
+ const times: number[] = [];
123
+ for (let i = 0; i < words && times.length < WRITE_MOST; i += WRITE_EVERY) times.push(start + i * every);
124
+ return at(times);
125
+ }
126
+
127
+ /**
128
+ * A reel passing `rows` rows in `duration` ms from `start` ms on, eased as its animation is (`ease`): a tick as each
129
+ * row goes by, quick at first and slowing as the reel does. The last row is left out: arriving is the thud's.
130
+ */
131
+ export function reel(rows: number, duration: number, start: number, ease: (t: number) => number): () => void {
132
+ if (!fine()) return none;
133
+ const times: number[] = [];
134
+ for (let k = 1; k < rows; k++) times.push(start + Math.round(duration * reach(ease, k / rows)));
135
+ return at(times);
136
+ }
137
+
138
+ /** When a rising easing first reaches `y` (0 to 1), as a fraction of its time. */
139
+ export function reach(ease: (t: number) => number, y: number): number {
140
+ let lo = 0;
141
+ let hi = 1;
142
+ for (let i = 0; i < 24; i++) {
143
+ const mid = (lo + hi) / 2;
144
+ if (ease(mid) < y) lo = mid;
145
+ else hi = mid;
146
+ }
147
+ return hi;
148
+ }
149
+
150
+ const IMPACT: Record<Buzz, 'Soft' | 'Light' | 'Medium' | 'Rigid' | 'Heavy'> = {
151
+ soft: 'Soft',
152
+ light: 'Light',
153
+ medium: 'Medium',
154
+ rigid: 'Rigid',
155
+ heavy: 'Heavy',
156
+ };
157
+
158
+ /** One step of a composed run: played as written, but it still counts as the last haptic. */
159
+ function play(kind: Buzz): void {
160
+ lastAt = Date.now();
161
+ lastStrength = kind === 'heavy' ? STRENGTH.thud : STRENGTH.tap;
162
+ const h = haptics();
163
+ h?.impactAsync(h.ImpactFeedbackStyle[IMPACT[kind]]).catch(quiet);
164
+ }
165
+
166
+ /**
167
+ * The power-on's vibration (powerOn.ts), on the picture's clock. It is composed, so it plays past the gap rule. An
168
+ * iPhone plays every step on the Taptic Engine. Android plays the click, the thoom and the heartbeat as full-strength
169
+ * buzzes through React Native's Vibration: expo-haptics runs its motor at about a quarter strength, and would buzz the
170
+ * fine taps. Returns what stops the steps still to come.
171
+ */
172
+ export function powerOn(): () => void {
173
+ if (!fine()) {
174
+ Vibration.vibrate(vibrationPattern(POWER_ON_ANDROID));
175
+ return () => Vibration.cancel();
176
+ }
177
+ const ids = POWER_ON_TRACK.map(([ms, kind]) => setTimeout(() => play(kind), ms));
178
+ return () => ids.forEach(clearTimeout);
179
+ }