@buoy-gg/ask-buoy 7.0.41 → 7.0.42

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 (313) hide show
  1. package/README.md +13 -98
  2. package/lib/commonjs/blocks/AskBlocks.js +1 -338
  3. package/lib/commonjs/blocks/BlockRenderer.js +1 -262
  4. package/lib/commonjs/blocks/ChromePrototypes.js +1 -514
  5. package/lib/commonjs/blocks/DataBlocks.js +1 -783
  6. package/lib/commonjs/blocks/ExtraBlocks.js +1 -1862
  7. package/lib/commonjs/blocks/MediaBlocks.js +1 -158
  8. package/lib/commonjs/blocks/ReceiptBlocks.js +2 -592
  9. package/lib/commonjs/blocks/blockText.js +1 -60
  10. package/lib/commonjs/blocks/blockText.test.js +1 -53
  11. package/lib/commonjs/blocks/context.js +1 -42
  12. package/lib/commonjs/blocks/icons.js +1 -96
  13. package/lib/commonjs/blocks/index.js +1 -95
  14. package/lib/commonjs/blocks/listRow.test.js +1 -55
  15. package/lib/commonjs/blocks/pageState.js +1 -34
  16. package/lib/commonjs/blocks/pageState.test.js +1 -57
  17. package/lib/commonjs/blocks/primitives.js +1 -457
  18. package/lib/commonjs/blocks/primitivesIndex.js +1 -62
  19. package/lib/commonjs/blocks/ruleStates.js +1 -39
  20. package/lib/commonjs/components/ApprovalCard.js +1 -297
  21. package/lib/commonjs/components/AskBuoyHeader.js +1 -196
  22. package/lib/commonjs/components/AskBuoyIcon.js +1 -19
  23. package/lib/commonjs/components/AskBuoyModal.js +2 -482
  24. package/lib/commonjs/components/AskBuoySettings.js +1 -181
  25. package/lib/commonjs/components/ChangesBar.js +1 -212
  26. package/lib/commonjs/components/Composer.js +1 -255
  27. package/lib/commonjs/components/EmptyState.js +1 -161
  28. package/lib/commonjs/components/KeyboardPad.js +1 -80
  29. package/lib/commonjs/components/Markdown.js +1 -310
  30. package/lib/commonjs/components/MessageList.js +1 -970
  31. package/lib/commonjs/components/QueuedMessages.js +1 -145
  32. package/lib/commonjs/components/ThinkingStrip.js +1 -223
  33. package/lib/commonjs/components/TypingDots.js +1 -63
  34. package/lib/commonjs/components/markdownParse.js +1 -131
  35. package/lib/commonjs/components/markdownParse.test.js +1 -99
  36. package/lib/commonjs/components/useCopyAction.js +1 -50
  37. package/lib/commonjs/index.js +1 -252
  38. package/lib/commonjs/preset.js +1 -91
  39. package/lib/commonjs/store/activityGroups.js +1 -110
  40. package/lib/commonjs/store/activityGroups.test.js +1 -78
  41. package/lib/commonjs/store/askBuoySettings.js +1 -72
  42. package/lib/commonjs/store/askBuoyStore.js +2 -588
  43. package/lib/commonjs/store/blockPlacement.js +1 -64
  44. package/lib/commonjs/store/blockPlacement.test.js +1 -123
  45. package/lib/commonjs/store/queue.test.js +1 -150
  46. package/lib/commonjs/store/resetConversation.js +1 -77
  47. package/lib/commonjs/store/restorePending.test.js +1 -63
  48. package/lib/commonjs/store/restoredIds.test.js +1 -47
  49. package/lib/commonjs/store/suggestions.js +1 -54
  50. package/lib/commonjs/store/suggestions.test.js +1 -58
  51. package/lib/commonjs/store/systemLine.test.js +1 -77
  52. package/lib/commonjs/store/ticketPrompt.js +1 -17
  53. package/lib/commonjs/store/traceText.js +1 -81
  54. package/lib/commonjs/store/traceText.test.js +1 -112
  55. package/lib/commonjs/store/transcriptPersistence.js +1 -297
  56. package/lib/commonjs/store/transcriptPersistence.test.js +1 -333
  57. package/lib/commonjs/store/turnRendering.test.js +1 -151
  58. package/lib/commonjs/store/useAskBuoy.js +1 -651
  59. package/lib/commonjs/store/useAskBuoySettings.js +1 -14
  60. package/lib/commonjs/sync/askBuoySyncAdapter.js +1 -153
  61. package/lib/commonjs/sync/askBuoySyncAdapter.test.js +1 -141
  62. package/lib/commonjs/sync/wire.js +1 -58
  63. package/lib/commonjs/types.js +1 -6
  64. package/lib/module/blocks/AskBlocks.js +1 -331
  65. package/lib/module/blocks/BlockRenderer.js +1 -257
  66. package/lib/module/blocks/ChromePrototypes.js +1 -503
  67. package/lib/module/blocks/DataBlocks.js +1 -769
  68. package/lib/module/blocks/ExtraBlocks.js +1 -1835
  69. package/lib/module/blocks/MediaBlocks.js +1 -153
  70. package/lib/module/blocks/ReceiptBlocks.js +2 -580
  71. package/lib/module/blocks/blockText.js +1 -55
  72. package/lib/module/blocks/blockText.test.js +1 -53
  73. package/lib/module/blocks/context.js +1 -35
  74. package/lib/module/blocks/icons.js +1 -91
  75. package/lib/module/blocks/index.js +1 -8
  76. package/lib/module/blocks/listRow.test.js +1 -56
  77. package/lib/module/blocks/pageState.js +1 -30
  78. package/lib/module/blocks/pageState.test.js +1 -56
  79. package/lib/module/blocks/primitives.js +1 -445
  80. package/lib/module/blocks/primitivesIndex.js +1 -5
  81. package/lib/module/blocks/ruleStates.js +1 -35
  82. package/lib/module/components/ApprovalCard.js +1 -292
  83. package/lib/module/components/AskBuoyHeader.js +1 -193
  84. package/lib/module/components/AskBuoyIcon.js +1 -8
  85. package/lib/module/components/AskBuoyModal.js +2 -477
  86. package/lib/module/components/AskBuoySettings.js +1 -176
  87. package/lib/module/components/ChangesBar.js +1 -206
  88. package/lib/module/components/Composer.js +1 -250
  89. package/lib/module/components/EmptyState.js +1 -156
  90. package/lib/module/components/KeyboardPad.js +1 -75
  91. package/lib/module/components/Markdown.js +1 -305
  92. package/lib/module/components/MessageList.js +1 -964
  93. package/lib/module/components/QueuedMessages.js +1 -140
  94. package/lib/module/components/ThinkingStrip.js +1 -218
  95. package/lib/module/components/TypingDots.js +1 -58
  96. package/lib/module/components/markdownParse.js +1 -125
  97. package/lib/module/components/markdownParse.test.js +1 -98
  98. package/lib/module/components/useCopyAction.js +1 -46
  99. package/lib/module/index.js +1 -34
  100. package/lib/module/preset.js +1 -74
  101. package/lib/module/store/activityGroups.js +1 -103
  102. package/lib/module/store/activityGroups.test.js +1 -77
  103. package/lib/module/store/askBuoySettings.js +1 -67
  104. package/lib/module/store/askBuoyStore.js +2 -582
  105. package/lib/module/store/blockPlacement.js +1 -59
  106. package/lib/module/store/blockPlacement.test.js +1 -122
  107. package/lib/module/store/queue.test.js +1 -149
  108. package/lib/module/store/resetConversation.js +1 -72
  109. package/lib/module/store/restorePending.test.js +1 -62
  110. package/lib/module/store/restoredIds.test.js +1 -46
  111. package/lib/module/store/suggestions.js +1 -49
  112. package/lib/module/store/suggestions.test.js +1 -57
  113. package/lib/module/store/systemLine.test.js +1 -76
  114. package/lib/module/store/ticketPrompt.js +1 -13
  115. package/lib/module/store/traceText.js +1 -75
  116. package/lib/module/store/traceText.test.js +1 -111
  117. package/lib/module/store/transcriptPersistence.js +1 -287
  118. package/lib/module/store/transcriptPersistence.test.js +1 -332
  119. package/lib/module/store/turnRendering.test.js +1 -150
  120. package/lib/module/store/useAskBuoy.js +1 -646
  121. package/lib/module/store/useAskBuoySettings.js +1 -9
  122. package/lib/module/sync/askBuoySyncAdapter.js +1 -148
  123. package/lib/module/sync/askBuoySyncAdapter.test.js +1 -140
  124. package/lib/module/sync/wire.js +1 -47
  125. package/lib/module/types.js +1 -4
  126. package/lib/web/index.mjs +11 -12
  127. package/package.json +8 -8
  128. package/lib/commonjs/blocks/AskBlocks.js.map +0 -1
  129. package/lib/commonjs/blocks/BlockRenderer.js.map +0 -1
  130. package/lib/commonjs/blocks/ChromePrototypes.js.map +0 -1
  131. package/lib/commonjs/blocks/DataBlocks.js.map +0 -1
  132. package/lib/commonjs/blocks/ExtraBlocks.js.map +0 -1
  133. package/lib/commonjs/blocks/MediaBlocks.js.map +0 -1
  134. package/lib/commonjs/blocks/ReceiptBlocks.js.map +0 -1
  135. package/lib/commonjs/blocks/blockText.js.map +0 -1
  136. package/lib/commonjs/blocks/blockText.test.js.map +0 -1
  137. package/lib/commonjs/blocks/context.js.map +0 -1
  138. package/lib/commonjs/blocks/icons.js.map +0 -1
  139. package/lib/commonjs/blocks/index.js.map +0 -1
  140. package/lib/commonjs/blocks/listRow.test.js.map +0 -1
  141. package/lib/commonjs/blocks/pageState.js.map +0 -1
  142. package/lib/commonjs/blocks/pageState.test.js.map +0 -1
  143. package/lib/commonjs/blocks/primitives.js.map +0 -1
  144. package/lib/commonjs/blocks/primitivesIndex.js.map +0 -1
  145. package/lib/commonjs/blocks/ruleStates.js.map +0 -1
  146. package/lib/commonjs/components/ApprovalCard.js.map +0 -1
  147. package/lib/commonjs/components/AskBuoyHeader.js.map +0 -1
  148. package/lib/commonjs/components/AskBuoyIcon.js.map +0 -1
  149. package/lib/commonjs/components/AskBuoyModal.js.map +0 -1
  150. package/lib/commonjs/components/AskBuoySettings.js.map +0 -1
  151. package/lib/commonjs/components/ChangesBar.js.map +0 -1
  152. package/lib/commonjs/components/Composer.js.map +0 -1
  153. package/lib/commonjs/components/EmptyState.js.map +0 -1
  154. package/lib/commonjs/components/KeyboardPad.js.map +0 -1
  155. package/lib/commonjs/components/Markdown.js.map +0 -1
  156. package/lib/commonjs/components/MessageList.js.map +0 -1
  157. package/lib/commonjs/components/QueuedMessages.js.map +0 -1
  158. package/lib/commonjs/components/ThinkingStrip.js.map +0 -1
  159. package/lib/commonjs/components/TypingDots.js.map +0 -1
  160. package/lib/commonjs/components/markdownParse.js.map +0 -1
  161. package/lib/commonjs/components/markdownParse.test.js.map +0 -1
  162. package/lib/commonjs/components/useCopyAction.js.map +0 -1
  163. package/lib/commonjs/index.js.map +0 -1
  164. package/lib/commonjs/preset.js.map +0 -1
  165. package/lib/commonjs/store/activityGroups.js.map +0 -1
  166. package/lib/commonjs/store/activityGroups.test.js.map +0 -1
  167. package/lib/commonjs/store/askBuoySettings.js.map +0 -1
  168. package/lib/commonjs/store/askBuoyStore.js.map +0 -1
  169. package/lib/commonjs/store/blockPlacement.js.map +0 -1
  170. package/lib/commonjs/store/blockPlacement.test.js.map +0 -1
  171. package/lib/commonjs/store/queue.test.js.map +0 -1
  172. package/lib/commonjs/store/resetConversation.js.map +0 -1
  173. package/lib/commonjs/store/restorePending.test.js.map +0 -1
  174. package/lib/commonjs/store/restoredIds.test.js.map +0 -1
  175. package/lib/commonjs/store/suggestions.js.map +0 -1
  176. package/lib/commonjs/store/suggestions.test.js.map +0 -1
  177. package/lib/commonjs/store/systemLine.test.js.map +0 -1
  178. package/lib/commonjs/store/ticketPrompt.js.map +0 -1
  179. package/lib/commonjs/store/traceText.js.map +0 -1
  180. package/lib/commonjs/store/traceText.test.js.map +0 -1
  181. package/lib/commonjs/store/transcriptPersistence.js.map +0 -1
  182. package/lib/commonjs/store/transcriptPersistence.test.js.map +0 -1
  183. package/lib/commonjs/store/turnRendering.test.js.map +0 -1
  184. package/lib/commonjs/store/useAskBuoy.js.map +0 -1
  185. package/lib/commonjs/store/useAskBuoySettings.js.map +0 -1
  186. package/lib/commonjs/sync/askBuoySyncAdapter.js.map +0 -1
  187. package/lib/commonjs/sync/askBuoySyncAdapter.test.js.map +0 -1
  188. package/lib/commonjs/sync/wire.js.map +0 -1
  189. package/lib/commonjs/types.js.map +0 -1
  190. package/lib/module/blocks/AskBlocks.js.map +0 -1
  191. package/lib/module/blocks/BlockRenderer.js.map +0 -1
  192. package/lib/module/blocks/ChromePrototypes.js.map +0 -1
  193. package/lib/module/blocks/DataBlocks.js.map +0 -1
  194. package/lib/module/blocks/ExtraBlocks.js.map +0 -1
  195. package/lib/module/blocks/MediaBlocks.js.map +0 -1
  196. package/lib/module/blocks/ReceiptBlocks.js.map +0 -1
  197. package/lib/module/blocks/blockText.js.map +0 -1
  198. package/lib/module/blocks/blockText.test.js.map +0 -1
  199. package/lib/module/blocks/context.js.map +0 -1
  200. package/lib/module/blocks/icons.js.map +0 -1
  201. package/lib/module/blocks/index.js.map +0 -1
  202. package/lib/module/blocks/listRow.test.js.map +0 -1
  203. package/lib/module/blocks/pageState.js.map +0 -1
  204. package/lib/module/blocks/pageState.test.js.map +0 -1
  205. package/lib/module/blocks/primitives.js.map +0 -1
  206. package/lib/module/blocks/primitivesIndex.js.map +0 -1
  207. package/lib/module/blocks/ruleStates.js.map +0 -1
  208. package/lib/module/components/ApprovalCard.js.map +0 -1
  209. package/lib/module/components/AskBuoyHeader.js.map +0 -1
  210. package/lib/module/components/AskBuoyIcon.js.map +0 -1
  211. package/lib/module/components/AskBuoyModal.js.map +0 -1
  212. package/lib/module/components/AskBuoySettings.js.map +0 -1
  213. package/lib/module/components/ChangesBar.js.map +0 -1
  214. package/lib/module/components/Composer.js.map +0 -1
  215. package/lib/module/components/EmptyState.js.map +0 -1
  216. package/lib/module/components/KeyboardPad.js.map +0 -1
  217. package/lib/module/components/Markdown.js.map +0 -1
  218. package/lib/module/components/MessageList.js.map +0 -1
  219. package/lib/module/components/QueuedMessages.js.map +0 -1
  220. package/lib/module/components/ThinkingStrip.js.map +0 -1
  221. package/lib/module/components/TypingDots.js.map +0 -1
  222. package/lib/module/components/markdownParse.js.map +0 -1
  223. package/lib/module/components/markdownParse.test.js.map +0 -1
  224. package/lib/module/components/useCopyAction.js.map +0 -1
  225. package/lib/module/index.js.map +0 -1
  226. package/lib/module/preset.js.map +0 -1
  227. package/lib/module/store/activityGroups.js.map +0 -1
  228. package/lib/module/store/activityGroups.test.js.map +0 -1
  229. package/lib/module/store/askBuoySettings.js.map +0 -1
  230. package/lib/module/store/askBuoyStore.js.map +0 -1
  231. package/lib/module/store/blockPlacement.js.map +0 -1
  232. package/lib/module/store/blockPlacement.test.js.map +0 -1
  233. package/lib/module/store/queue.test.js.map +0 -1
  234. package/lib/module/store/resetConversation.js.map +0 -1
  235. package/lib/module/store/restorePending.test.js.map +0 -1
  236. package/lib/module/store/restoredIds.test.js.map +0 -1
  237. package/lib/module/store/suggestions.js.map +0 -1
  238. package/lib/module/store/suggestions.test.js.map +0 -1
  239. package/lib/module/store/systemLine.test.js.map +0 -1
  240. package/lib/module/store/ticketPrompt.js.map +0 -1
  241. package/lib/module/store/traceText.js.map +0 -1
  242. package/lib/module/store/traceText.test.js.map +0 -1
  243. package/lib/module/store/transcriptPersistence.js.map +0 -1
  244. package/lib/module/store/transcriptPersistence.test.js.map +0 -1
  245. package/lib/module/store/turnRendering.test.js.map +0 -1
  246. package/lib/module/store/useAskBuoy.js.map +0 -1
  247. package/lib/module/store/useAskBuoySettings.js.map +0 -1
  248. package/lib/module/sync/askBuoySyncAdapter.js.map +0 -1
  249. package/lib/module/sync/askBuoySyncAdapter.test.js.map +0 -1
  250. package/lib/module/sync/wire.js.map +0 -1
  251. package/lib/module/types.js.map +0 -1
  252. package/lib/typescript/blocks/AskBlocks.d.ts.map +0 -1
  253. package/lib/typescript/blocks/BlockRenderer.d.ts.map +0 -1
  254. package/lib/typescript/blocks/ChromePrototypes.d.ts.map +0 -1
  255. package/lib/typescript/blocks/DataBlocks.d.ts.map +0 -1
  256. package/lib/typescript/blocks/ExtraBlocks.d.ts.map +0 -1
  257. package/lib/typescript/blocks/MediaBlocks.d.ts.map +0 -1
  258. package/lib/typescript/blocks/ReceiptBlocks.d.ts.map +0 -1
  259. package/lib/typescript/blocks/blockText.d.ts.map +0 -1
  260. package/lib/typescript/blocks/blockText.test.d.ts.map +0 -1
  261. package/lib/typescript/blocks/context.d.ts.map +0 -1
  262. package/lib/typescript/blocks/icons.d.ts.map +0 -1
  263. package/lib/typescript/blocks/index.d.ts.map +0 -1
  264. package/lib/typescript/blocks/listRow.test.d.ts.map +0 -1
  265. package/lib/typescript/blocks/pageState.d.ts.map +0 -1
  266. package/lib/typescript/blocks/pageState.test.d.ts.map +0 -1
  267. package/lib/typescript/blocks/primitives.d.ts.map +0 -1
  268. package/lib/typescript/blocks/primitivesIndex.d.ts.map +0 -1
  269. package/lib/typescript/blocks/ruleStates.d.ts.map +0 -1
  270. package/lib/typescript/components/ApprovalCard.d.ts.map +0 -1
  271. package/lib/typescript/components/AskBuoyHeader.d.ts.map +0 -1
  272. package/lib/typescript/components/AskBuoyIcon.d.ts.map +0 -1
  273. package/lib/typescript/components/AskBuoyModal.d.ts.map +0 -1
  274. package/lib/typescript/components/AskBuoySettings.d.ts.map +0 -1
  275. package/lib/typescript/components/ChangesBar.d.ts.map +0 -1
  276. package/lib/typescript/components/Composer.d.ts.map +0 -1
  277. package/lib/typescript/components/EmptyState.d.ts.map +0 -1
  278. package/lib/typescript/components/KeyboardPad.d.ts.map +0 -1
  279. package/lib/typescript/components/Markdown.d.ts.map +0 -1
  280. package/lib/typescript/components/MessageList.d.ts.map +0 -1
  281. package/lib/typescript/components/QueuedMessages.d.ts.map +0 -1
  282. package/lib/typescript/components/ThinkingStrip.d.ts.map +0 -1
  283. package/lib/typescript/components/TypingDots.d.ts.map +0 -1
  284. package/lib/typescript/components/markdownParse.d.ts.map +0 -1
  285. package/lib/typescript/components/markdownParse.test.d.ts.map +0 -1
  286. package/lib/typescript/components/useCopyAction.d.ts.map +0 -1
  287. package/lib/typescript/index.d.ts.map +0 -1
  288. package/lib/typescript/preset.d.ts.map +0 -1
  289. package/lib/typescript/store/activityGroups.d.ts.map +0 -1
  290. package/lib/typescript/store/activityGroups.test.d.ts.map +0 -1
  291. package/lib/typescript/store/askBuoySettings.d.ts.map +0 -1
  292. package/lib/typescript/store/askBuoyStore.d.ts.map +0 -1
  293. package/lib/typescript/store/blockPlacement.d.ts.map +0 -1
  294. package/lib/typescript/store/blockPlacement.test.d.ts.map +0 -1
  295. package/lib/typescript/store/queue.test.d.ts.map +0 -1
  296. package/lib/typescript/store/resetConversation.d.ts.map +0 -1
  297. package/lib/typescript/store/restorePending.test.d.ts.map +0 -1
  298. package/lib/typescript/store/restoredIds.test.d.ts.map +0 -1
  299. package/lib/typescript/store/suggestions.d.ts.map +0 -1
  300. package/lib/typescript/store/suggestions.test.d.ts.map +0 -1
  301. package/lib/typescript/store/systemLine.test.d.ts.map +0 -1
  302. package/lib/typescript/store/ticketPrompt.d.ts.map +0 -1
  303. package/lib/typescript/store/traceText.d.ts.map +0 -1
  304. package/lib/typescript/store/traceText.test.d.ts.map +0 -1
  305. package/lib/typescript/store/transcriptPersistence.d.ts.map +0 -1
  306. package/lib/typescript/store/transcriptPersistence.test.d.ts.map +0 -1
  307. package/lib/typescript/store/turnRendering.test.d.ts.map +0 -1
  308. package/lib/typescript/store/useAskBuoy.d.ts.map +0 -1
  309. package/lib/typescript/store/useAskBuoySettings.d.ts.map +0 -1
  310. package/lib/typescript/sync/askBuoySyncAdapter.d.ts.map +0 -1
  311. package/lib/typescript/sync/askBuoySyncAdapter.test.d.ts.map +0 -1
  312. package/lib/typescript/sync/wire.d.ts.map +0 -1
  313. package/lib/typescript/types.d.ts.map +0 -1
@@ -1,1862 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Banner = Banner;
7
- exports.CardCarousel = CardCarousel;
8
- exports.CardView = CardView;
9
- exports.Checkpoint = Checkpoint;
10
- exports.Claim = Claim;
11
- exports.Compare = Compare;
12
- exports.DateTime = DateTime;
13
- exports.Details = Details;
14
- exports.File = File;
15
- exports.Form = Form;
16
- exports.LivePill = LivePill;
17
- exports.MultiSelect = MultiSelect;
18
- exports.Plan = Plan;
19
- exports.Proposal = Proposal;
20
- exports.Screenshot = Screenshot;
21
- exports.Select = Select;
22
- exports.Slider = Slider;
23
- exports.Sparkline = Sparkline;
24
- exports.Suggestions = Suggestions;
25
- exports.Tabs = Tabs;
26
- exports.Task = Task;
27
- exports.Timeline = Timeline;
28
- exports.Upload = Upload;
29
- var _react = require("react");
30
- var _reactNative = require("react-native");
31
- var _sharedUi = require("@buoy-gg/shared-ui");
32
- var _context = require("./context");
33
- var _primitives = require("./primitives");
34
- var _jsxRuntime = require("react/jsx-runtime");
35
- /**
36
- * Second-wave blocks from the survey (plan §11). Prototype-quality on purpose:
37
- * each one exists so it can be judged on the review page, and the ones that
38
- * survive get the same care as the first wave.
39
- */
40
-
41
- const fmt = v => typeof v === "string" ? v : v === undefined ? "—" : JSON.stringify(v);
42
-
43
- // ---------------------------------------------------------------- Suggestions
44
- function Suggestions({
45
- block
46
- }) {
47
- const h = (0, _context.useBlockHandlers)();
48
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
49
- style: styles.chips,
50
- testID: `buoy-block-suggestions-${block.id}`,
51
- children: block.chips.slice(0, 4).map(c => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
52
- disabled: !!h.busy,
53
- onPress: () => void h.runAction({
54
- label: c.label,
55
- send: c.send ?? c.label
56
- }, block.id),
57
- style: ({
58
- pressed
59
- }) => [styles.chip, pressed && styles.pressed],
60
- accessibilityRole: "button",
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
62
- style: styles.chipText,
63
- children: c.label
64
- })
65
- }, c.label))
66
- });
67
- }
68
-
69
- // ---------------------------------------------------------------- MultiSelect
70
- function MultiSelect({
71
- block
72
- }) {
73
- const h = (0, _context.useBlockHandlers)();
74
- const answer = h.answered[block.id];
75
- const locked = !!answer;
76
- const [picked, setPicked] = (0, _react.useState)([]);
77
- const chosen = answer?.kind === "multi" ? answer.optionIds : picked;
78
- const toggle = id => setPicked(p => p.includes(id) ? p.filter(x => x !== id) : [...p, id]);
79
- const ok = picked.length >= (block.min ?? 1) && (!block.max || picked.length <= block.max);
80
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
81
- testID: `buoy-block-multi-${block.id}`,
82
- tone: locked ? undefined : "info",
83
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
84
- style: styles.question,
85
- children: block.question
86
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
87
- style: styles.optionsBox,
88
- children: block.options.map((o, i) => {
89
- const on = chosen.includes(o.id);
90
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
91
- disabled: locked,
92
- onPress: () => toggle(o.id),
93
- style: [styles.option, i > 0 && _primitives.blockStyles.rowDivider, locked && !on && styles.dim],
94
- accessibilityRole: "checkbox",
95
- accessibilityState: {
96
- checked: on
97
- },
98
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
99
- style: [styles.checkbox, on && styles.checkboxOn],
100
- children: on ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
101
- size: 11,
102
- color: _sharedUi.night.color.onAccent
103
- }) : null
104
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
105
- style: styles.flex,
106
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
107
- style: styles.optionLabel,
108
- children: o.label
109
- }), o.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
110
- style: styles.optionDetail,
111
- children: o.detail
112
- }) : null]
113
- })]
114
- }, o.id);
115
- })
116
- }), locked ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
117
- style: styles.rowEnd,
118
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
119
- testID: "buoy-block-multi-submit",
120
- disabled: !ok,
121
- onPress: () => h.answer({
122
- blockId: block.id,
123
- kind: "multi",
124
- optionIds: picked,
125
- labels: block.options.filter(o => picked.includes(o.id)).map(o => o.label)
126
- }),
127
- style: [styles.button, styles.buttonPrimary, !ok && styles.disabled],
128
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
129
- style: styles.buttonTextPrimary,
130
- children: block.submitLabel ?? `Use ${picked.length || ""}`.trim()
131
- })
132
- })
133
- })]
134
- });
135
- }
136
-
137
- // ---------------------------------------------------------------- Select (long list)
138
- /** Options needed before a search field earns its space. */
139
- const SEARCH_FROM = 8;
140
- function Select({
141
- block
142
- }) {
143
- const h = (0, _context.useBlockHandlers)();
144
- const answer = h.answered[block.id];
145
- const [q, setQ] = (0, _react.useState)("");
146
- const [open, setOpen] = (0, _react.useState)(false);
147
- const chosen = answer?.kind === "select" ? answer.label : null;
148
- const items = block.options.filter(o => !q || o.label.toLowerCase().includes(q.toLowerCase())).slice(0, 8);
149
- /**
150
- * A search field over four options is furniture. `searchable` stays the
151
- * author's opt-OUT (false always hides it); it is no longer an opt-IN for a
152
- * list short enough to read at a glance.
153
- */
154
- const showSearch = block.searchable !== false && block.options.length >= SEARCH_FROM;
155
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
156
- testID: `buoy-block-select-${block.id}`,
157
- tone: answer ? undefined : "info",
158
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
159
- style: styles.question,
160
- children: block.label
161
- }), chosen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
162
- style: styles.decided,
163
- children: chosen
164
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
165
- style: styles.selectBox,
166
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
167
- onPress: () => setOpen(v => !v),
168
- style: styles.selectField,
169
- accessibilityRole: "button",
170
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
171
- style: styles.selectPlaceholder,
172
- children: open ? "Choose…" : `${block.options.length} options`
173
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
174
- size: 14,
175
- color: _sharedUi.night.color.textSecondary
176
- })]
177
- }), open && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
178
- children: [showSearch && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
179
- style: styles.search,
180
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
181
- size: 12,
182
- color: _sharedUi.night.color.textSecondary
183
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
184
- style: styles.searchInput,
185
- value: q,
186
- onChangeText: setQ,
187
- placeholder: "Search",
188
- placeholderTextColor: _sharedUi.night.color.placeholder,
189
- autoCapitalize: "none",
190
- autoCorrect: false
191
- })]
192
- }), items.map((o, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
193
- onPress: () => h.answer({
194
- blockId: block.id,
195
- kind: "select",
196
- optionId: o.id,
197
- label: o.label
198
- }),
199
- style: [styles.option, i > 0 && _primitives.blockStyles.rowDivider],
200
- accessibilityRole: "button",
201
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
202
- style: styles.flex,
203
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
204
- style: styles.optionLabel,
205
- children: o.label
206
- }), o.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
207
- style: styles.optionDetail,
208
- children: o.detail
209
- }) : null]
210
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
211
- size: 12,
212
- color: _sharedUi.night.color.textTertiary
213
- })]
214
- }, o.id)), block.options.length > items.length ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
215
- style: styles.hint,
216
- children: [block.options.length - items.length, " more \u2014 keep typing"]
217
- }) : null]
218
- })]
219
- })]
220
- });
221
- }
222
-
223
- // ---------------------------------------------------------------- Slider
224
- /**
225
- * Tap anywhere on the track to jump there, or use the − / + steppers. No drag
226
- * on purpose: a drag inside a scrolling transcript fights the list for the
227
- * gesture, and a tap-to-place slider does the job with none of that.
228
- */
229
- function SliderControl({
230
- min,
231
- max,
232
- step = 1,
233
- value,
234
- unit,
235
- onChange,
236
- disabled
237
- }) {
238
- const width = (0, _react.useRef)(0);
239
- const pct = max > min ? (value - min) / (max - min) * 100 : 0;
240
- const quantise = raw => Math.min(max, Math.max(min, +(Math.round((raw - min) / step) * step + min).toFixed(6)));
241
- const bump = d => !disabled && onChange(quantise(value + d * step));
242
- const onTrackPress = e => {
243
- if (disabled || width.current <= 0) return;
244
- const ratio = Math.min(1, Math.max(0, e.nativeEvent.locationX / width.current));
245
- onChange(quantise(min + ratio * (max - min)));
246
- };
247
- const onLayout = e => {
248
- width.current = e.nativeEvent.layout.width;
249
- };
250
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
251
- style: styles.sliderRow,
252
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
253
- disabled: disabled,
254
- onPress: () => bump(-1),
255
- style: styles.stepBtn,
256
- accessibilityRole: "button",
257
- accessibilityLabel: "Decrease",
258
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
259
- style: styles.stepText,
260
- children: "\u2212"
261
- })
262
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
263
- style: styles.trackHit,
264
- onLayout: onLayout,
265
- onPress: onTrackPress,
266
- disabled: disabled,
267
- accessibilityRole: "adjustable",
268
- accessibilityValue: {
269
- min,
270
- max,
271
- now: value
272
- },
273
- accessibilityActions: [{
274
- name: "increment"
275
- }, {
276
- name: "decrement"
277
- }],
278
- onAccessibilityAction: e => bump(e.nativeEvent.actionName === "increment" ? 1 : -1),
279
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
280
- style: styles.track,
281
- pointerEvents: "none",
282
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
283
- style: [styles.fill, {
284
- width: `${pct}%`
285
- }]
286
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
287
- style: [styles.thumb, {
288
- left: `${pct}%`
289
- }]
290
- })]
291
- })
292
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
293
- disabled: disabled,
294
- onPress: () => bump(1),
295
- style: styles.stepBtn,
296
- accessibilityRole: "button",
297
- accessibilityLabel: "Increase",
298
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
299
- style: styles.stepText,
300
- children: "+"
301
- })
302
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
303
- style: styles.sliderValue,
304
- children: [value, unit ? ` ${unit}` : ""]
305
- })]
306
- });
307
- }
308
- function Slider({
309
- block
310
- }) {
311
- const h = (0, _context.useBlockHandlers)();
312
- const answer = h.answered[block.id];
313
- const [v, setV] = (0, _react.useState)(block.value ?? block.min);
314
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
315
- testID: `buoy-block-slider-${block.id}`,
316
- tone: answer ? undefined : "info",
317
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
318
- style: styles.question,
319
- children: block.label
320
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
321
- style: styles.pad,
322
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(SliderControl, {
323
- min: block.min,
324
- max: block.max,
325
- step: block.step,
326
- value: answer?.kind === "slider" ? answer.value : v,
327
- unit: block.unit,
328
- onChange: setV,
329
- disabled: !!answer
330
- })
331
- }), answer ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
332
- style: styles.rowEnd,
333
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
334
- onPress: () => h.answer({
335
- blockId: block.id,
336
- kind: "slider",
337
- value: v,
338
- unit: block.unit
339
- }),
340
- style: [styles.button, styles.buttonPrimary],
341
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
342
- style: styles.buttonTextPrimary,
343
- children: ["Use ", v, block.unit ? ` ${block.unit}` : ""]
344
- })
345
- })
346
- })]
347
- });
348
- }
349
-
350
- // ---------------------------------------------------------------- DateTime
351
- function DateTime({
352
- block
353
- }) {
354
- const h = (0, _context.useBlockHandlers)();
355
- const answer = h.answered[block.id];
356
- const [text, setText] = (0, _react.useState)("");
357
- const presets = block.presets ?? [{
358
- label: "Now",
359
- value: new Date().toISOString()
360
- }, {
361
- label: "Tomorrow",
362
- value: new Date(Date.now() + 864e5).toISOString()
363
- }, {
364
- label: "+7 days",
365
- value: new Date(Date.now() + 7 * 864e5).toISOString()
366
- }, {
367
- label: "+30 days",
368
- value: new Date(Date.now() + 30 * 864e5).toISOString()
369
- }];
370
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
371
- testID: `buoy-block-datetime-${block.id}`,
372
- tone: answer ? undefined : "info",
373
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
374
- style: styles.question,
375
- children: block.label
376
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
377
- style: styles.decided,
378
- children: answer.kind === "dateTime" ? answer.label ?? answer.value : "(skipped)"
379
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
380
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
381
- style: [styles.chips, styles.pad],
382
- children: presets.map(p => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
383
- onPress: () => h.answer({
384
- blockId: block.id,
385
- kind: "dateTime",
386
- value: p.value,
387
- label: p.label
388
- }),
389
- style: styles.chip,
390
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
391
- style: styles.chipText,
392
- children: p.label
393
- })
394
- }, p.label))
395
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
396
- style: [styles.inputRow, styles.pad],
397
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
398
- style: styles.input,
399
- value: text,
400
- onChangeText: setText,
401
- placeholder: block.mode === "time" ? "14:30" : "2026-09-15",
402
- placeholderTextColor: _sharedUi.night.color.placeholder,
403
- keyboardType: "numbers-and-punctuation"
404
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
405
- disabled: !text.trim(),
406
- onPress: () => h.answer({
407
- blockId: block.id,
408
- kind: "dateTime",
409
- value: text.trim()
410
- }),
411
- style: [styles.button, styles.buttonPrimary, !text.trim() && styles.disabled],
412
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
413
- style: styles.buttonTextPrimary,
414
- children: "Use"
415
- })
416
- })]
417
- })]
418
- })]
419
- });
420
- }
421
-
422
- // ---------------------------------------------------------------- Form / Proposal
423
- function FieldRow({
424
- f,
425
- value,
426
- onChange,
427
- disabled
428
- }) {
429
- if (f.type === "toggle") {
430
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
431
- style: styles.fieldRow,
432
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
433
- style: styles.fieldLabel,
434
- children: f.label
435
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
436
- value: !!value,
437
- onValueChange: onChange,
438
- disabled: disabled,
439
- trackColor: {
440
- true: _sharedUi.night.color.accent,
441
- false: _sharedUi.night.color.fillTertiary
442
- },
443
- thumbColor: _sharedUi.night.color.knob
444
- })]
445
- });
446
- }
447
- if (f.type === "select") {
448
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
449
- style: styles.fieldCol,
450
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
451
- style: styles.fieldLabel,
452
- children: f.label
453
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
454
- style: styles.chips,
455
- children: f.options.map(o => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
456
- disabled: disabled,
457
- onPress: () => onChange(o.id),
458
- style: [styles.chip, value === o.id && styles.chipOn],
459
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
460
- style: [styles.chipText, value === o.id && styles.chipTextOn],
461
- children: o.label
462
- })
463
- }, o.id))
464
- })]
465
- });
466
- }
467
- if (f.type === "slider") {
468
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
469
- style: styles.fieldCol,
470
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
471
- style: styles.fieldLabel,
472
- children: f.label
473
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(SliderControl, {
474
- min: f.min,
475
- max: f.max,
476
- step: f.step,
477
- unit: f.unit,
478
- value: typeof value === "number" ? value : f.min,
479
- onChange: onChange,
480
- disabled: disabled
481
- })]
482
- });
483
- }
484
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
485
- style: styles.fieldRow,
486
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
487
- style: styles.fieldLabel,
488
- children: f.label
489
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
490
- style: styles.fieldInput,
491
- value: value === undefined || value === null ? "" : String(value),
492
- onChangeText: onChange,
493
- editable: !disabled,
494
- placeholder: f.placeholder ?? "",
495
- placeholderTextColor: _sharedUi.night.color.placeholder,
496
- keyboardType: f.type === "number" ? "numeric" : "ascii-capable",
497
- secureTextEntry: f.type === "secret",
498
- autoCapitalize: "none",
499
- autoCorrect: false
500
- })]
501
- });
502
- }
503
- function useFormValues(fields) {
504
- const [values, setValues] = (0, _react.useState)(() => Object.fromEntries(fields.map(f => [f.key, f.value])));
505
- return {
506
- values,
507
- set: (k, v) => setValues(m => ({
508
- ...m,
509
- [k]: v
510
- }))
511
- };
512
- }
513
- function Form({
514
- block
515
- }) {
516
- const h = (0, _context.useBlockHandlers)();
517
- const answer = h.answered[block.id];
518
- const {
519
- values,
520
- set
521
- } = useFormValues(block.fields);
522
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
523
- title: block.title,
524
- testID: `buoy-block-form-${block.id}`,
525
- tone: answer ? undefined : "info",
526
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
527
- style: styles.pad,
528
- children: block.fields.map(f => /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldRow, {
529
- f: f,
530
- value: values[f.key],
531
- onChange: v => set(f.key, v),
532
- disabled: !!answer
533
- }, f.key))
534
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
535
- style: styles.decided,
536
- children: "Sent"
537
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
538
- style: styles.rowEnd,
539
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
540
- onPress: () => h.answer({
541
- blockId: block.id,
542
- kind: "form",
543
- values
544
- }),
545
- style: [styles.button, styles.buttonPrimary],
546
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
547
- style: styles.buttonTextPrimary,
548
- children: block.submitLabel ?? "Send"
549
- })
550
- })
551
- })]
552
- });
553
- }
554
- function Proposal({
555
- block
556
- }) {
557
- const h = (0, _context.useBlockHandlers)();
558
- const answer = h.answered[block.id];
559
- const {
560
- values,
561
- set
562
- } = useFormValues(block.fields);
563
- const approved = answer?.kind === "proposal" ? answer.approved : null;
564
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
565
- testID: `buoy-block-proposal-${block.id}`,
566
- tone: answer ? undefined : "warning",
567
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
568
- style: styles.confirmTitle,
569
- children: block.title
570
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
571
- style: styles.confirmChange,
572
- children: block.change
573
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
574
- style: styles.pad,
575
- children: block.fields.map(f => /*#__PURE__*/(0, _jsxRuntime.jsx)(FieldRow, {
576
- f: f,
577
- value: values[f.key],
578
- onChange: v => set(f.key, v),
579
- disabled: !!answer
580
- }, f.key))
581
- }), block.consequence ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
582
- style: styles.consequence,
583
- children: block.consequence
584
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
585
- style: styles.actionsRow,
586
- children: answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
587
- style: styles.decided,
588
- children: approved ? "✓ Applied with these values" : "✕ Not applied"
589
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
590
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
591
- onPress: () => h.answer({
592
- blockId: block.id,
593
- kind: "proposal",
594
- approved: true,
595
- values
596
- }),
597
- style: [styles.button, styles.buttonPrimary],
598
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
599
- style: styles.buttonTextPrimary,
600
- children: block.approveLabel ?? "Apply"
601
- })
602
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
603
- onPress: () => h.answer({
604
- blockId: block.id,
605
- kind: "proposal",
606
- approved: false
607
- }),
608
- style: [styles.button, styles.buttonPlate],
609
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
610
- style: styles.buttonTextPlate,
611
- children: "Not now"
612
- })
613
- })]
614
- })
615
- })]
616
- });
617
- }
618
-
619
- // ---------------------------------------------------------------- Claim (citations + verify)
620
- function Claim({
621
- block
622
- }) {
623
- const h = (0, _context.useBlockHandlers)();
624
- const [open, setOpen] = (0, _react.useState)(null);
625
- const state = h.actionState?.[`${block.id}:${block.verify?.label ?? "Verify"}`];
626
- const verified = block.verified || state === "done";
627
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
628
- style: styles.claim,
629
- testID: `buoy-block-claim-${block.id}`,
630
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
631
- style: styles.claimText,
632
- children: [block.text, block.sources.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
633
- onPress: () => setOpen(open === i ? null : i),
634
- style: styles.cite,
635
- children: [" [", i + 1, "]"]
636
- }, i)), verified ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
637
- style: styles.verified,
638
- children: " \u2713 verified"
639
- }) : null]
640
- }), open !== null && block.sources[open] ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
641
- style: styles.citeBox,
642
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
643
- style: styles.citeLabel,
644
- children: ["[", open + 1, "] ", block.sources[open].label]
645
- }), block.sources[open].detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
646
- style: styles.citeDetail,
647
- children: block.sources[open].detail
648
- }) : null]
649
- }) : null, block.verify && !verified ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
650
- onPress: () => void h.runAction(block.verify, block.id),
651
- style: styles.verifyBtn,
652
- accessibilityRole: "button",
653
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.RefreshCw, {
654
- size: 11,
655
- color: _sharedUi.night.color.accent
656
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
657
- style: styles.verifyText,
658
- children: state === "running" ? "Checking…" : block.verify.label
659
- })]
660
- }) : null]
661
- });
662
- }
663
-
664
- // ---------------------------------------------------------------- Details / Tabs
665
- function Details({
666
- block
667
- }) {
668
- const [open, setOpen] = (0, _react.useState)(!!block.open);
669
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
670
- testID: `buoy-block-details-${block.id}`,
671
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
672
- onPress: () => setOpen(v => !v),
673
- style: _primitives.blockStyles.row,
674
- accessibilityRole: "button",
675
- accessibilityState: {
676
- expanded: open
677
- },
678
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
679
- style: _primitives.blockStyles.rowTitle,
680
- children: block.summary
681
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
682
- size: 12,
683
- color: _sharedUi.night.color.textTertiary
684
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronRight, {
685
- size: 12,
686
- color: _sharedUi.night.color.textTertiary
687
- })]
688
- }), open ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
689
- style: styles.detailsBody,
690
- selectable: true,
691
- children: block.body
692
- }) : null]
693
- });
694
- }
695
-
696
- /**
697
- * The tool-header segmented control, not a strip of this block's own.
698
- *
699
- * `NightSegmented` is what the dial settings and the network tool mount, so a
700
- * tabbed block now reads as part of the same product rather than as a
701
- * lookalike drawn next to it. `sm` is its compact variant, which is what a
702
- * control inside a chat bubble wants.
703
- *
704
- * Keyed by INDEX, not label: two tabs may legitimately share a label, and a
705
- * duplicate key would collapse them into one.
706
- */
707
- function Tabs({
708
- block,
709
- renderNested
710
- }) {
711
- const [i, setI] = (0, _react.useState)(0);
712
- const tabs = block.tabs.map((t, k) => ({
713
- key: String(k),
714
- label: t.label
715
- }));
716
- const active = block.tabs[i];
717
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
718
- style: styles.tabsWrap,
719
- testID: `buoy-block-tabs-${block.id}`,
720
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.NightSegmented, {
721
- tabs: tabs,
722
- activeKey: String(i),
723
- onChange: key => setI(Number(key)),
724
- size: "sm"
725
- }), active && renderNested ? renderNested(active.block) : null]
726
- });
727
- }
728
-
729
- // ---------------------------------------------------------------- Timeline
730
- /** Ten fits a phone without the answer above it scrolling away. */
731
- const TIMELINE_CAP = 10;
732
- function Timeline({
733
- block
734
- }) {
735
- /**
736
- * The cap used to be a bare `.slice(0, 10)` while the "+N more" line below
737
- * compared `total` against the FULL event array — so eleven events with a
738
- * matching total rendered ten and said nothing about the eleventh, and a
739
- * total larger than the array rendered a "+N more" that was only ever a
740
- * label. Both counts come from the pager now.
741
- */
742
- const paged = (0, _primitives.usePaged)(block.events, TIMELINE_CAP);
743
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
744
- title: block.title ?? "What happened",
745
- source: block.source,
746
- testID: `buoy-block-timeline-${block.id}`,
747
- children: [paged.visible.map((e, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
748
- style: styles.tlRow,
749
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
750
- style: styles.tlAt,
751
- children: e.at
752
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
753
- style: styles.tlLine,
754
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
755
- style: [styles.tlDot, {
756
- backgroundColor: (0, _primitives.toneColor)(e.tone ?? "muted")
757
- }]
758
- }), i < paged.visible.length - 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
759
- style: styles.tlStem
760
- }) : null]
761
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
762
- style: styles.flex,
763
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
764
- style: styles.tlSource,
765
- children: e.source.toUpperCase()
766
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
767
- style: _primitives.blockStyles.rowTitle,
768
- numberOfLines: 2,
769
- children: e.label
770
- })]
771
- })]
772
- }, i)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.More, {
773
- paged: paged
774
- })]
775
- });
776
- }
777
-
778
- // ---------------------------------------------------------------- Sparkline
779
- function Sparkline({
780
- block
781
- }) {
782
- const s = block.series.slice(-60);
783
- const max = Math.max(1, ...s);
784
- const min = Math.min(...s, 0);
785
- const H = 44;
786
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
787
- title: block.title,
788
- source: block.source,
789
- testID: `buoy-block-sparkline-${block.id}`,
790
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
791
- style: styles.sparkHead,
792
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
793
- style: styles.sparkCurrent,
794
- children: [block.current ?? s[s.length - 1], block.unit ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
795
- style: styles.sparkUnit,
796
- children: [" ", block.unit]
797
- }) : null]
798
- }), block.live ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LivePill, {}) : null]
799
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
800
- style: [styles.spark, {
801
- height: H
802
- }],
803
- children: s.map((v, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
804
- style: [styles.sparkBar, {
805
- height: Math.max(2, (v - min) / (max - min || 1) * H),
806
- backgroundColor: i === s.length - 1 ? _sharedUi.night.color.accent : _sharedUi.night.color.accentBorderStrong
807
- }]
808
- }, i))
809
- }), block.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
810
- style: styles.hint,
811
- children: block.label
812
- }) : null]
813
- });
814
- }
815
- function LivePill() {
816
- const o = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
817
- (0, _react.useEffect)(() => {
818
- const loop = _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(o, {
819
- toValue: 0.3,
820
- duration: 700,
821
- useNativeDriver: true
822
- }), _reactNative.Animated.timing(o, {
823
- toValue: 1,
824
- duration: 700,
825
- useNativeDriver: true
826
- })]));
827
- loop.start();
828
- return () => loop.stop();
829
- }, [o]);
830
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
831
- style: styles.live,
832
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
833
- style: [styles.liveDot, {
834
- opacity: o
835
- }]
836
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
837
- style: styles.liveText,
838
- children: "LIVE"
839
- })]
840
- });
841
- }
842
-
843
- // ---------------------------------------------------------------- Compare
844
- function Compare({
845
- block
846
- }) {
847
- const keys = [...new Set([...block.left.pairs.map(p => p.key), ...block.right.pairs.map(p => p.key)])];
848
- const l = Object.fromEntries(block.left.pairs.map(p => [p.key, p.value]));
849
- const r = Object.fromEntries(block.right.pairs.map(p => [p.key, p.value]));
850
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
851
- title: block.title,
852
- source: block.source,
853
- testID: `buoy-block-compare-${block.id}`,
854
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
855
- style: styles.cmpHead,
856
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
857
- style: styles.cmpKey
858
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
859
- style: styles.cmpCol,
860
- children: block.left.title
861
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
862
- style: styles.cmpCol,
863
- children: block.right.title
864
- })]
865
- }), keys.map((k, i) => {
866
- const diff = JSON.stringify(l[k]) !== JSON.stringify(r[k]);
867
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
868
- style: [styles.cmpRow, i > 0 && _primitives.blockStyles.rowDivider, diff && styles.cmpDiff],
869
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
870
- style: styles.cmpKey,
871
- numberOfLines: 1,
872
- children: k
873
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
874
- style: [styles.cmpVal, diff && {
875
- color: _sharedUi.night.color.danger
876
- }],
877
- numberOfLines: 2,
878
- children: fmt(l[k])
879
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
880
- style: [styles.cmpVal, diff && {
881
- color: _sharedUi.night.color.accent
882
- }],
883
- numberOfLines: 2,
884
- children: fmt(r[k])
885
- })]
886
- }, k);
887
- })]
888
- });
889
- }
890
-
891
- // ---------------------------------------------------------------- Card / carousel
892
- function CardBody({
893
- c,
894
- id
895
- }) {
896
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
897
- children: [c.image ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
898
- testID: "buoy-internal-chat-image",
899
- source: {
900
- uri: c.image
901
- },
902
- style: styles.cardImage,
903
- resizeMode: "contain",
904
- accessibilityLabel: c.title
905
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
906
- style: styles.cardText,
907
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
908
- style: styles.cardTitle,
909
- numberOfLines: 2,
910
- children: c.title
911
- }), c.subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
912
- style: _primitives.blockStyles.rowSub,
913
- numberOfLines: 2,
914
- children: c.subtitle
915
- }) : null, c.facts?.slice(0, 4).map(f => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
916
- style: styles.fact,
917
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
918
- style: styles.factLabel,
919
- children: f.label
920
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
921
- style: [styles.factValue, f.tone && {
922
- color: (0, _primitives.toneColor)(f.tone)
923
- }],
924
- children: f.value
925
- })]
926
- }, f.label))]
927
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
928
- actions: c.actions,
929
- blockId: id
930
- })]
931
- });
932
- }
933
- function CardView({
934
- block
935
- }) {
936
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Card, {
937
- source: block.source,
938
- testID: `buoy-block-card-${block.id}`,
939
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBody, {
940
- c: block,
941
- id: block.id
942
- })
943
- });
944
- }
945
- function CardCarousel({
946
- block
947
- }) {
948
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
949
- testID: `buoy-block-cardcarousel-${block.id}`,
950
- children: [block.title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
951
- style: styles.carouselTitle,
952
- children: block.title
953
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
954
- horizontal: true,
955
- showsHorizontalScrollIndicator: false,
956
- snapToInterval: 232,
957
- decelerationRate: "fast",
958
- contentContainerStyle: styles.carousel,
959
- children: block.cards.slice(0, 8).map((c, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
960
- style: styles.carouselCard,
961
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CardBody, {
962
- c: c,
963
- id: `${block.id}-${i}`
964
- })
965
- }, `${c.title}-${i}`))
966
- })]
967
- });
968
- }
969
-
970
- // ---------------------------------------------------------------- Screenshot
971
- function Screenshot({
972
- block
973
- }) {
974
- const [big, setBig] = (0, _react.useState)(false);
975
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
976
- title: block.route ? `Screen · ${block.route}` : "Screen",
977
- source: block.source,
978
- testID: `buoy-block-screenshot-${block.id}`,
979
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
980
- onPress: () => setBig(v => !v),
981
- accessibilityRole: "imagebutton",
982
- accessibilityLabel: block.caption ?? "Screenshot",
983
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
984
- testID: "buoy-internal-chat-image",
985
- source: {
986
- uri: block.url
987
- },
988
- style: [styles.shot, big && styles.shotBig],
989
- resizeMode: "contain"
990
- })
991
- }), block.caption ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
992
- style: styles.hint,
993
- children: block.caption
994
- }) : null]
995
- });
996
- }
997
-
998
- // ---------------------------------------------------------------- Plan / Checkpoint / Task
999
- function Plan({
1000
- block
1001
- }) {
1002
- const done = block.steps.filter(s => s.state === "done").length;
1003
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1004
- title: block.title,
1005
- testID: `buoy-block-plan-${block.id}`,
1006
- tone: block.pending ? "info" : undefined,
1007
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1008
- style: styles.progress,
1009
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1010
- style: [styles.progressFill, {
1011
- width: `${done / Math.max(1, block.steps.length) * 100}%`
1012
- }]
1013
- })
1014
- }), block.steps.map((s, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1015
- style: [styles.step, i > 0 && _primitives.blockStyles.rowDivider],
1016
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1017
- style: [styles.stepMark, s.state === "done" && styles.stepDone, s.state === "failed" && styles.stepFailed, s.state === "running" && styles.stepRunning],
1018
- children: s.state === "done" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Check, {
1019
- size: 10,
1020
- color: _sharedUi.night.color.onAccent
1021
- }) : s.state === "failed" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
1022
- size: 10,
1023
- color: _sharedUi.night.color.text
1024
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1025
- style: styles.stepNum,
1026
- children: i + 1
1027
- })
1028
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
1029
- style: [_primitives.blockStyles.rowTitle, s.state === "done" && styles.muted],
1030
- children: [s.text, s.state === "running" ? "…" : ""]
1031
- })]
1032
- }, i)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1033
- actions: block.actions ?? (block.pending ? [{
1034
- label: "Go",
1035
- primary: true,
1036
- send: "Go ahead with the plan."
1037
- }, {
1038
- label: "Change it",
1039
- send: "Let me change the plan first."
1040
- }] : undefined),
1041
- blockId: block.id
1042
- })]
1043
- });
1044
- }
1045
- function Checkpoint({
1046
- block
1047
- }) {
1048
- const h = (0, _context.useBlockHandlers)();
1049
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
1050
- testID: `buoy-block-checkpoint-${block.id}`,
1051
- disabled: !block.restore,
1052
- onPress: () => block.restore && void h.runAction(block.restore, block.id),
1053
- style: styles.checkpoint,
1054
- accessibilityRole: "button",
1055
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1056
- style: styles.cpFlag
1057
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
1058
- style: styles.cpText,
1059
- children: [block.label, block.at ? ` · ${block.at}` : ""]
1060
- }), block.restore ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1061
- style: styles.cpRestore,
1062
- children: block.restore.label
1063
- }) : null]
1064
- });
1065
- }
1066
- function Task({
1067
- block
1068
- }) {
1069
- const color = block.status === "failed" ? _sharedUi.night.color.danger : block.status === "done" ? _sharedUi.night.color.accent : _sharedUi.night.color.info;
1070
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1071
- testID: `buoy-block-task-${block.id}`,
1072
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1073
- style: styles.taskHead,
1074
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1075
- style: styles.cardTitle,
1076
- children: block.title
1077
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1078
- style: [_primitives.blockStyles.pill, {
1079
- backgroundColor: `${color}22`
1080
- }],
1081
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1082
- style: [_primitives.blockStyles.pillText, {
1083
- color
1084
- }],
1085
- children: block.status.toUpperCase()
1086
- })
1087
- })]
1088
- }), block.progress !== undefined ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1089
- style: [styles.progress, styles.pad],
1090
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1091
- style: [styles.progressFill, {
1092
- width: `${Math.round(block.progress * 100)}%`,
1093
- backgroundColor: color
1094
- }]
1095
- })
1096
- }) : null, block.detail ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1097
- style: styles.hint,
1098
- children: block.detail
1099
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1100
- actions: block.actions,
1101
- blockId: block.id
1102
- })]
1103
- });
1104
- }
1105
-
1106
- // ---------------------------------------------------------------- Banner / File / Upload / NotBuilt
1107
- function Banner({
1108
- block
1109
- }) {
1110
- const color = block.tone === "danger" ? _sharedUi.night.color.danger : block.tone === "warning" ? _sharedUi.night.color.warning : _sharedUi.night.color.info;
1111
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1112
- style: [styles.banner, {
1113
- borderColor: color,
1114
- backgroundColor: `${color}1A`
1115
- }],
1116
- testID: `buoy-block-banner-${block.id}`,
1117
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
1118
- size: 13,
1119
- color: color
1120
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1121
- style: [styles.bannerText, {
1122
- color
1123
- }],
1124
- numberOfLines: 2,
1125
- children: block.text
1126
- }), block.actions?.[0] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1127
- actions: block.actions.slice(0, 1),
1128
- blockId: block.id,
1129
- align: "right"
1130
- }) : null]
1131
- });
1132
- }
1133
- function File({
1134
- block
1135
- }) {
1136
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1137
- testID: `buoy-block-file-${block.id}`,
1138
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1139
- style: _primitives.blockStyles.row,
1140
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1141
- style: styles.fileIcon,
1142
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1143
- style: styles.fileExt,
1144
- children: (block.type ?? block.name.split(".").pop() ?? "file").toUpperCase().slice(0, 4)
1145
- })
1146
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1147
- style: styles.flex,
1148
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1149
- style: _primitives.blockStyles.rowTitle,
1150
- numberOfLines: 1,
1151
- children: block.name
1152
- }), block.size ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1153
- style: _primitives.blockStyles.rowSub,
1154
- children: block.size
1155
- }) : null]
1156
- })]
1157
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.ActionRow, {
1158
- actions: block.actions,
1159
- blockId: block.id
1160
- })]
1161
- });
1162
- }
1163
- function Upload({
1164
- block
1165
- }) {
1166
- const h = (0, _context.useBlockHandlers)();
1167
- const answer = h.answered[block.id];
1168
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Card, {
1169
- testID: `buoy-block-upload-${block.id}`,
1170
- tone: answer ? undefined : "info",
1171
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1172
- style: styles.question,
1173
- children: block.label
1174
- }), answer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1175
- style: styles.decided,
1176
- children: answer.kind === "upload" ? `Attached ${answer.name}` : "(skipped)"
1177
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1178
- style: [styles.rowEnd, {
1179
- justifyContent: "flex-start"
1180
- }],
1181
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
1182
- onPress: () => h.answer({
1183
- blockId: block.id,
1184
- kind: "upload",
1185
- name: "screenshot.png"
1186
- }),
1187
- style: [styles.button, styles.buttonPlate],
1188
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1189
- style: styles.buttonTextPlate,
1190
- children: block.accept === "image" ? "Choose a screenshot" : "Choose a file"
1191
- })
1192
- })
1193
- })]
1194
- });
1195
- }
1196
- const styles = _reactNative.StyleSheet.create({
1197
- flex: {
1198
- flex: 1
1199
- },
1200
- pad: {
1201
- paddingHorizontal: 12,
1202
- paddingBottom: 8
1203
- },
1204
- muted: {
1205
- color: _sharedUi.night.color.textSecondary
1206
- },
1207
- dim: {
1208
- opacity: 0.45
1209
- },
1210
- disabled: {
1211
- opacity: 0.5
1212
- },
1213
- pressed: {
1214
- opacity: 0.7
1215
- },
1216
- question: {
1217
- color: _sharedUi.night.color.text,
1218
- fontSize: _sharedUi.night.font.row,
1219
- fontWeight: "600",
1220
- lineHeight: 20,
1221
- paddingHorizontal: 12,
1222
- paddingTop: 12,
1223
- paddingBottom: 8
1224
- },
1225
- hint: {
1226
- color: _sharedUi.night.color.textTertiary,
1227
- fontSize: _sharedUi.night.font.micro,
1228
- paddingHorizontal: 12,
1229
- paddingBottom: 10
1230
- },
1231
- decided: {
1232
- color: _sharedUi.night.color.textSecondary,
1233
- fontSize: _sharedUi.night.font.caption,
1234
- fontWeight: "600",
1235
- paddingHorizontal: 12,
1236
- paddingVertical: 10
1237
- },
1238
- rowEnd: {
1239
- flexDirection: "row",
1240
- justifyContent: "flex-end",
1241
- paddingHorizontal: 12,
1242
- paddingBottom: 12,
1243
- gap: 8
1244
- },
1245
- actionsRow: {
1246
- flexDirection: "row",
1247
- gap: 8,
1248
- paddingHorizontal: 12,
1249
- paddingVertical: 12,
1250
- alignItems: "center"
1251
- },
1252
- button: {
1253
- paddingHorizontal: 14,
1254
- paddingVertical: 9,
1255
- borderRadius: _sharedUi.night.radius.row
1256
- },
1257
- buttonPrimary: {
1258
- backgroundColor: _sharedUi.night.color.accent
1259
- },
1260
- buttonPlate: {
1261
- backgroundColor: _sharedUi.night.color.button
1262
- },
1263
- buttonTextPrimary: {
1264
- color: _sharedUi.night.color.onAccent,
1265
- fontSize: _sharedUi.night.font.caption,
1266
- fontWeight: "600"
1267
- },
1268
- buttonTextPlate: {
1269
- color: _sharedUi.night.color.text,
1270
- fontSize: _sharedUi.night.font.caption,
1271
- fontWeight: "600"
1272
- },
1273
- chips: {
1274
- flexDirection: "row",
1275
- flexWrap: "wrap",
1276
- gap: 6
1277
- },
1278
- chip: {
1279
- paddingHorizontal: 12,
1280
- paddingVertical: 7,
1281
- borderRadius: _sharedUi.night.radius.chip,
1282
- backgroundColor: _sharedUi.night.color.fill,
1283
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1284
- borderColor: _sharedUi.night.color.border
1285
- },
1286
- chipOn: {
1287
- backgroundColor: _sharedUi.night.color.accentSoft,
1288
- borderColor: _sharedUi.night.color.accentBorderStrong
1289
- },
1290
- chipText: {
1291
- color: _sharedUi.night.color.text,
1292
- fontSize: _sharedUi.night.font.caption
1293
- },
1294
- chipTextOn: {
1295
- color: _sharedUi.night.color.accent,
1296
- fontWeight: "600"
1297
- },
1298
- optionsBox: {
1299
- marginHorizontal: 8,
1300
- marginBottom: 8,
1301
- borderRadius: _sharedUi.night.radius.row,
1302
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1303
- overflow: "hidden"
1304
- },
1305
- option: {
1306
- flexDirection: "row",
1307
- alignItems: "center",
1308
- gap: 10,
1309
- paddingHorizontal: 12,
1310
- paddingVertical: 10
1311
- },
1312
- optionLabel: {
1313
- color: _sharedUi.night.color.text,
1314
- fontSize: _sharedUi.night.font.body,
1315
- fontWeight: "500"
1316
- },
1317
- optionDetail: {
1318
- color: _sharedUi.night.color.textSecondary,
1319
- fontSize: _sharedUi.night.font.caption
1320
- },
1321
- checkbox: {
1322
- width: 20,
1323
- height: 20,
1324
- borderRadius: 6,
1325
- borderWidth: 1.5,
1326
- borderColor: _sharedUi.night.color.textTertiary,
1327
- alignItems: "center",
1328
- justifyContent: "center"
1329
- },
1330
- checkboxOn: {
1331
- backgroundColor: _sharedUi.night.color.accent,
1332
- borderColor: _sharedUi.night.color.accent
1333
- },
1334
- selectBox: {
1335
- marginHorizontal: 12,
1336
- marginBottom: 12,
1337
- borderRadius: _sharedUi.night.radius.row,
1338
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1339
- overflow: "hidden"
1340
- },
1341
- selectField: {
1342
- flexDirection: "row",
1343
- alignItems: "center",
1344
- justifyContent: "space-between",
1345
- paddingHorizontal: 12,
1346
- paddingVertical: 11
1347
- },
1348
- selectPlaceholder: {
1349
- color: _sharedUi.night.color.textSecondary,
1350
- fontSize: _sharedUi.night.font.body
1351
- },
1352
- search: {
1353
- flexDirection: "row",
1354
- alignItems: "center",
1355
- gap: 6,
1356
- paddingHorizontal: 12,
1357
- paddingVertical: 6,
1358
- borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
1359
- borderTopColor: _sharedUi.night.color.separator
1360
- },
1361
- searchInput: {
1362
- flex: 1,
1363
- color: _sharedUi.night.color.text,
1364
- fontSize: _sharedUi.night.font.caption,
1365
- paddingVertical: 4
1366
- },
1367
- sliderRow: {
1368
- flexDirection: "row",
1369
- alignItems: "center",
1370
- gap: 8
1371
- },
1372
- stepBtn: {
1373
- width: 28,
1374
- height: 28,
1375
- borderRadius: 14,
1376
- backgroundColor: _sharedUi.night.color.fill,
1377
- alignItems: "center",
1378
- justifyContent: "center"
1379
- },
1380
- stepText: {
1381
- color: _sharedUi.night.color.text,
1382
- fontSize: 16,
1383
- fontWeight: "600"
1384
- },
1385
- trackHit: {
1386
- flex: 1,
1387
- height: 36,
1388
- justifyContent: "center"
1389
- },
1390
- track: {
1391
- height: 6,
1392
- borderRadius: 3,
1393
- backgroundColor: _sharedUi.night.color.fillTertiary,
1394
- justifyContent: "center"
1395
- },
1396
- fill: {
1397
- height: 6,
1398
- borderRadius: 3,
1399
- backgroundColor: _sharedUi.night.color.accent
1400
- },
1401
- thumb: {
1402
- position: "absolute",
1403
- width: 20,
1404
- height: 20,
1405
- borderRadius: 10,
1406
- backgroundColor: _sharedUi.night.color.knob,
1407
- marginLeft: -10,
1408
- shadowColor: "#000",
1409
- shadowOpacity: 0.35,
1410
- shadowRadius: 3,
1411
- shadowOffset: {
1412
- width: 0,
1413
- height: 1
1414
- }
1415
- },
1416
- sliderValue: {
1417
- width: 64,
1418
- textAlign: "right",
1419
- color: _sharedUi.night.color.text,
1420
- fontSize: _sharedUi.night.font.caption,
1421
- fontWeight: "600"
1422
- },
1423
- inputRow: {
1424
- flexDirection: "row",
1425
- alignItems: "center",
1426
- gap: 8,
1427
- paddingBottom: 12
1428
- },
1429
- input: {
1430
- flex: 1,
1431
- height: 38,
1432
- paddingHorizontal: 12,
1433
- borderRadius: _sharedUi.night.radius.row,
1434
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1435
- color: _sharedUi.night.color.text,
1436
- fontSize: _sharedUi.night.font.body
1437
- },
1438
- fieldRow: {
1439
- flexDirection: "row",
1440
- alignItems: "center",
1441
- justifyContent: "space-between",
1442
- gap: 10,
1443
- paddingVertical: 6
1444
- },
1445
- fieldCol: {
1446
- paddingVertical: 6,
1447
- gap: 6
1448
- },
1449
- fieldLabel: {
1450
- color: _sharedUi.night.color.textSecondary,
1451
- fontSize: _sharedUi.night.font.caption,
1452
- width: 110
1453
- },
1454
- fieldInput: {
1455
- flex: 1,
1456
- height: 34,
1457
- paddingHorizontal: 10,
1458
- borderRadius: _sharedUi.night.radius.segment,
1459
- backgroundColor: _sharedUi.night.color.surfaceElevated,
1460
- color: _sharedUi.night.color.text,
1461
- fontSize: _sharedUi.night.font.caption
1462
- },
1463
- confirmTitle: {
1464
- color: _sharedUi.night.color.text,
1465
- fontSize: _sharedUi.night.font.row,
1466
- fontWeight: "600",
1467
- paddingHorizontal: 12,
1468
- paddingTop: 12
1469
- },
1470
- confirmChange: {
1471
- color: _sharedUi.night.color.text,
1472
- fontSize: _sharedUi.night.font.body,
1473
- lineHeight: 19,
1474
- paddingHorizontal: 12,
1475
- paddingTop: 6,
1476
- paddingBottom: 6
1477
- },
1478
- consequence: {
1479
- color: _sharedUi.night.color.warning,
1480
- fontSize: _sharedUi.night.font.caption,
1481
- paddingHorizontal: 12
1482
- },
1483
- claim: {
1484
- gap: 6,
1485
- paddingHorizontal: 2
1486
- },
1487
- claimText: {
1488
- color: _sharedUi.night.color.text,
1489
- fontSize: _sharedUi.night.font.row,
1490
- lineHeight: 22
1491
- },
1492
- cite: {
1493
- color: _sharedUi.night.color.accent,
1494
- fontSize: _sharedUi.night.font.caption,
1495
- fontWeight: "700"
1496
- },
1497
- verified: {
1498
- color: _sharedUi.night.color.accent,
1499
- fontSize: _sharedUi.night.font.caption,
1500
- fontWeight: "600"
1501
- },
1502
- citeBox: {
1503
- padding: 10,
1504
- borderRadius: _sharedUi.night.radius.row,
1505
- backgroundColor: _sharedUi.night.color.surface,
1506
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1507
- borderColor: _sharedUi.night.color.border,
1508
- gap: 2
1509
- },
1510
- citeLabel: {
1511
- color: _sharedUi.night.color.text,
1512
- fontSize: _sharedUi.night.font.caption,
1513
- fontWeight: "600"
1514
- },
1515
- citeDetail: {
1516
- color: _sharedUi.night.color.textSecondary,
1517
- fontSize: _sharedUi.night.font.caption,
1518
- fontFamily: "Menlo"
1519
- },
1520
- verifyBtn: {
1521
- alignSelf: "flex-start",
1522
- flexDirection: "row",
1523
- alignItems: "center",
1524
- gap: 5,
1525
- paddingHorizontal: 10,
1526
- paddingVertical: 5,
1527
- borderRadius: _sharedUi.night.radius.chip,
1528
- backgroundColor: _sharedUi.night.color.accentSoft
1529
- },
1530
- verifyText: {
1531
- color: _sharedUi.night.color.accent,
1532
- fontSize: _sharedUi.night.font.micro,
1533
- fontWeight: "700"
1534
- },
1535
- detailsBody: {
1536
- color: _sharedUi.night.color.textSecondary,
1537
- fontSize: _sharedUi.night.font.caption,
1538
- lineHeight: 18,
1539
- paddingHorizontal: 12,
1540
- paddingBottom: 12
1541
- },
1542
- tabsWrap: {
1543
- gap: 8
1544
- },
1545
- tabBar: {
1546
- flexDirection: "row",
1547
- gap: 6
1548
- },
1549
- tab: {
1550
- paddingHorizontal: 12,
1551
- paddingVertical: 6,
1552
- borderRadius: _sharedUi.night.radius.badge,
1553
- backgroundColor: _sharedUi.night.color.fill
1554
- },
1555
- tabOn: {
1556
- backgroundColor: _sharedUi.night.color.accentSoft
1557
- },
1558
- tabText: {
1559
- color: _sharedUi.night.color.textSecondary,
1560
- fontSize: _sharedUi.night.font.caption,
1561
- fontWeight: "600"
1562
- },
1563
- tabTextOn: {
1564
- color: _sharedUi.night.color.accent
1565
- },
1566
- tlRow: {
1567
- flexDirection: "row",
1568
- gap: 10,
1569
- paddingHorizontal: 12,
1570
- paddingVertical: 4,
1571
- alignItems: "flex-start"
1572
- },
1573
- tlAt: {
1574
- width: 46,
1575
- color: _sharedUi.night.color.textTertiary,
1576
- fontSize: _sharedUi.night.font.micro,
1577
- fontFamily: "Menlo",
1578
- paddingTop: 3
1579
- },
1580
- tlLine: {
1581
- width: 12,
1582
- alignItems: "center"
1583
- },
1584
- tlDot: {
1585
- width: 8,
1586
- height: 8,
1587
- borderRadius: 4,
1588
- marginTop: 5
1589
- },
1590
- tlStem: {
1591
- width: 1,
1592
- flex: 1,
1593
- minHeight: 18,
1594
- backgroundColor: _sharedUi.night.color.separator,
1595
- marginTop: 2
1596
- },
1597
- tlSource: {
1598
- color: _sharedUi.night.color.textTertiary,
1599
- fontSize: 9,
1600
- fontWeight: "700",
1601
- letterSpacing: 0.6
1602
- },
1603
- sparkHead: {
1604
- flexDirection: "row",
1605
- alignItems: "center",
1606
- justifyContent: "space-between",
1607
- paddingHorizontal: 12,
1608
- paddingTop: 8
1609
- },
1610
- sparkCurrent: {
1611
- color: _sharedUi.night.color.text,
1612
- fontSize: 22,
1613
- fontWeight: "700"
1614
- },
1615
- sparkUnit: {
1616
- color: _sharedUi.night.color.textSecondary,
1617
- fontSize: _sharedUi.night.font.caption,
1618
- fontWeight: "500"
1619
- },
1620
- spark: {
1621
- flexDirection: "row",
1622
- alignItems: "flex-end",
1623
- gap: 2,
1624
- paddingHorizontal: 12,
1625
- paddingTop: 6,
1626
- paddingBottom: 6
1627
- },
1628
- sparkBar: {
1629
- flex: 1,
1630
- borderRadius: 1
1631
- },
1632
- live: {
1633
- flexDirection: "row",
1634
- alignItems: "center",
1635
- gap: 5,
1636
- paddingHorizontal: 8,
1637
- paddingVertical: 3,
1638
- borderRadius: _sharedUi.night.radius.badge,
1639
- backgroundColor: _sharedUi.night.color.dangerSoft
1640
- },
1641
- liveDot: {
1642
- width: 6,
1643
- height: 6,
1644
- borderRadius: 3,
1645
- backgroundColor: _sharedUi.night.color.danger
1646
- },
1647
- liveText: {
1648
- color: _sharedUi.night.color.danger,
1649
- fontSize: 9,
1650
- fontWeight: "800",
1651
- letterSpacing: 0.8
1652
- },
1653
- cmpHead: {
1654
- flexDirection: "row",
1655
- paddingHorizontal: 12,
1656
- paddingVertical: 6,
1657
- backgroundColor: _sharedUi.night.color.fill,
1658
- gap: 8
1659
- },
1660
- cmpCol: {
1661
- flex: 1,
1662
- color: _sharedUi.night.color.textTertiary,
1663
- fontSize: _sharedUi.night.font.micro,
1664
- fontWeight: "700",
1665
- letterSpacing: 0.6,
1666
- textTransform: "uppercase"
1667
- },
1668
- cmpRow: {
1669
- flexDirection: "row",
1670
- paddingHorizontal: 12,
1671
- paddingVertical: 8,
1672
- gap: 8,
1673
- alignItems: "flex-start"
1674
- },
1675
- cmpDiff: {
1676
- backgroundColor: _sharedUi.night.color.fill
1677
- },
1678
- cmpKey: {
1679
- width: 90,
1680
- color: _sharedUi.night.color.textSecondary,
1681
- fontSize: _sharedUi.night.font.caption
1682
- },
1683
- cmpVal: {
1684
- flex: 1,
1685
- color: _sharedUi.night.color.text,
1686
- fontSize: _sharedUi.night.font.caption,
1687
- fontFamily: "Menlo"
1688
- },
1689
- /**
1690
- * A fixed box the image is fitted INTO, never cropped to.
1691
- *
1692
- * This was `cover`, which is right for a decorative banner and wrong for
1693
- * everything the agent actually passes: product art, avatars and sprites are
1694
- * square, and a square scaled to fill a 2.4:1 box loses its top and bottom —
1695
- * a Charizard reduced to a band of its own middle. These pictures are the
1696
- * app's DATA, being looked at in a devtool; cropping hides the thing you
1697
- * opened the card to see. `contain` letterboxes a wide image instead, which
1698
- * costs a little space and no information. The fill behind it is the
1699
- * letterbox. Same reasoning as the screenshot block, which was already
1700
- * `contain`.
1701
- */
1702
- cardImage: {
1703
- width: "100%",
1704
- height: 140,
1705
- backgroundColor: _sharedUi.night.color.fill
1706
- },
1707
- cardText: {
1708
- paddingHorizontal: 12,
1709
- paddingTop: 10,
1710
- paddingBottom: 4,
1711
- gap: 4
1712
- },
1713
- cardTitle: {
1714
- color: _sharedUi.night.color.text,
1715
- fontSize: _sharedUi.night.font.row,
1716
- fontWeight: "600"
1717
- },
1718
- fact: {
1719
- flexDirection: "row",
1720
- justifyContent: "space-between",
1721
- gap: 8
1722
- },
1723
- factLabel: {
1724
- color: _sharedUi.night.color.textSecondary,
1725
- fontSize: _sharedUi.night.font.caption
1726
- },
1727
- factValue: {
1728
- color: _sharedUi.night.color.text,
1729
- fontSize: _sharedUi.night.font.caption,
1730
- fontWeight: "500"
1731
- },
1732
- carouselTitle: {
1733
- color: _sharedUi.night.color.text,
1734
- fontSize: _sharedUi.night.font.caption,
1735
- fontWeight: "600",
1736
- paddingBottom: 8
1737
- },
1738
- carousel: {
1739
- gap: 8,
1740
- paddingRight: 8
1741
- },
1742
- carouselCard: {
1743
- width: 224,
1744
- borderRadius: _sharedUi.night.radius.card,
1745
- borderWidth: _reactNative.StyleSheet.hairlineWidth,
1746
- borderColor: _sharedUi.night.color.border,
1747
- backgroundColor: _sharedUi.night.color.surface,
1748
- overflow: "hidden"
1749
- },
1750
- shot: {
1751
- width: "100%",
1752
- height: 220,
1753
- backgroundColor: _sharedUi.night.color.fill
1754
- },
1755
- shotBig: {
1756
- height: 520
1757
- },
1758
- progress: {
1759
- height: 4,
1760
- backgroundColor: _sharedUi.night.color.fill,
1761
- marginHorizontal: 12,
1762
- marginTop: 6,
1763
- marginBottom: 8,
1764
- borderRadius: 2,
1765
- overflow: "hidden"
1766
- },
1767
- progressFill: {
1768
- height: 4,
1769
- backgroundColor: _sharedUi.night.color.accent
1770
- },
1771
- step: {
1772
- flexDirection: "row",
1773
- alignItems: "center",
1774
- gap: 10,
1775
- paddingHorizontal: 12,
1776
- paddingVertical: 9
1777
- },
1778
- stepMark: {
1779
- width: 20,
1780
- height: 20,
1781
- borderRadius: 10,
1782
- backgroundColor: _sharedUi.night.color.fillTertiary,
1783
- alignItems: "center",
1784
- justifyContent: "center"
1785
- },
1786
- stepDone: {
1787
- backgroundColor: _sharedUi.night.color.accent
1788
- },
1789
- stepFailed: {
1790
- backgroundColor: _sharedUi.night.color.danger
1791
- },
1792
- stepRunning: {
1793
- backgroundColor: _sharedUi.night.color.info
1794
- },
1795
- stepNum: {
1796
- color: _sharedUi.night.color.text,
1797
- fontSize: _sharedUi.night.font.micro,
1798
- fontWeight: "700"
1799
- },
1800
- checkpoint: {
1801
- alignSelf: "flex-start",
1802
- flexDirection: "row",
1803
- alignItems: "center",
1804
- gap: 8,
1805
- paddingHorizontal: 12,
1806
- paddingVertical: 7,
1807
- borderRadius: _sharedUi.night.radius.chip,
1808
- backgroundColor: _sharedUi.night.color.fill
1809
- },
1810
- cpFlag: {
1811
- width: 8,
1812
- height: 8,
1813
- borderRadius: 2,
1814
- backgroundColor: _sharedUi.night.color.info
1815
- },
1816
- cpText: {
1817
- color: _sharedUi.night.color.textSecondary,
1818
- fontSize: _sharedUi.night.font.caption
1819
- },
1820
- cpRestore: {
1821
- color: _sharedUi.night.color.accent,
1822
- fontSize: _sharedUi.night.font.caption,
1823
- fontWeight: "600"
1824
- },
1825
- taskHead: {
1826
- flexDirection: "row",
1827
- alignItems: "center",
1828
- justifyContent: "space-between",
1829
- gap: 8,
1830
- paddingHorizontal: 12,
1831
- paddingTop: 12
1832
- },
1833
- banner: {
1834
- flexDirection: "row",
1835
- alignItems: "center",
1836
- gap: 8,
1837
- paddingLeft: 12,
1838
- paddingRight: 4,
1839
- paddingVertical: 4,
1840
- borderRadius: _sharedUi.night.radius.row,
1841
- borderWidth: _reactNative.StyleSheet.hairlineWidth
1842
- },
1843
- bannerText: {
1844
- flex: 1,
1845
- fontSize: _sharedUi.night.font.caption,
1846
- fontWeight: "600"
1847
- },
1848
- fileIcon: {
1849
- width: 40,
1850
- height: 40,
1851
- borderRadius: 8,
1852
- backgroundColor: _sharedUi.night.color.fill,
1853
- alignItems: "center",
1854
- justifyContent: "center"
1855
- },
1856
- fileExt: {
1857
- color: _sharedUi.night.color.textSecondary,
1858
- fontSize: 10,
1859
- fontWeight: "800"
1860
- }
1861
- });
1862
- //# sourceMappingURL=ExtraBlocks.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Banner=Banner;exports.CardCarousel=CardCarousel;exports.CardView=CardView;exports.Checkpoint=Checkpoint;exports.Claim=Claim;exports.Compare=Compare;exports.DateTime=DateTime;exports.Details=Details;exports.File=File;exports.Form=Form;exports.LivePill=LivePill;exports.MultiSelect=MultiSelect;exports.Plan=Plan;exports.Proposal=Proposal;exports.Screenshot=Screenshot;exports.Select=Select;exports.Slider=Slider;exports.Sparkline=Sparkline;exports.Suggestions=Suggestions;exports.Tabs=Tabs;exports.Task=Task;exports.Timeline=Timeline;exports.Upload=Upload;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _context=require("./context");var _primitives=require("./primitives");var _jsxRuntime=require("react/jsx-runtime");const fmt=e=>typeof e==="string"?e:e===void 0?"\u2014":JSON.stringify(e);function Suggestions({block:e}){const i=(0,_context.useBlockHandlers)();return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.chips,testID:`buoy-block-suggestions-${e.id}`,children:e.chips.slice(0,4).map(t=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!!i.busy,onPress:()=>void i.runAction({label:t.label,send:t.send??t.label},e.id),style:({pressed:n})=>[styles.chip,n&&styles.pressed],accessibilityRole:"button",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.chipText,children:t.label})},t.label))})}function MultiSelect({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const n=!!t;const[o,l]=(0,_react.useState)([]);const r=t?.kind==="multi"?t.optionIds:o;const d=a=>l(s=>s.includes(a)?s.filter(c=>c!==a):[...s,a]);const h=o.length>=(e.min??1)&&(!e.max||o.length<=e.max);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-multi-${e.id}`,tone:n?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.question}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.optionsBox,children:e.options.map((a,s)=>{const c=r.includes(a.id);return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{disabled:n,onPress:()=>d(a.id),style:[styles.option,s>0&&_primitives.blockStyles.rowDivider,n&&!c&&styles.dim],accessibilityRole:"checkbox",accessibilityState:{checked:c},children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.checkbox,c&&styles.checkboxOn],children:c?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:11,color:_sharedUi.night.color.onAccent}):null}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionLabel,children:a.label}),a.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionDetail,children:a.detail}):null]})]},a.id)})}),n?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{testID:"buoy-block-multi-submit",disabled:!h,onPress:()=>i.answer({blockId:e.id,kind:"multi",optionIds:o,labels:e.options.filter(a=>o.includes(a.id)).map(a=>a.label)}),style:[styles.button,styles.buttonPrimary,!h&&styles.disabled],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.submitLabel??`Use ${o.length||""}`.trim()})})})]})}const SEARCH_FROM=8;function Select({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const[n,o]=(0,_react.useState)("");const[l,r]=(0,_react.useState)(false);const d=t?.kind==="select"?t.label:null;const h=e.options.filter(s=>!n||s.label.toLowerCase().includes(n.toLowerCase())).slice(0,8);const a=e.searchable!==false&&e.options.length>=SEARCH_FROM;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-select-${e.id}`,tone:t?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),d?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:d}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.selectBox,children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>r(s=>!s),style:styles.selectField,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.selectPlaceholder,children:l?"Choose\u2026":`${e.options.length} options`}),(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:14,color:_sharedUi.night.color.textSecondary})]}),l&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[a&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.search,children:[(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:12,color:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.searchInput,value:n,onChangeText:o,placeholder:"Search",placeholderTextColor:_sharedUi.night.color.placeholder,autoCapitalize:"none",autoCorrect:false})]}),h.map((s,c)=>(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"select",optionId:s.id,label:s.label}),style:[styles.option,c>0&&_primitives.blockStyles.rowDivider],accessibilityRole:"button",children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionLabel,children:s.label}),s.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.optionDetail,children:s.detail}):null]}),(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]},s.id)),e.options.length>h.length?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.hint,children:[e.options.length-h.length," more \u2014 keep typing"]}):null]})]})]})}function SliderControl({min:e,max:i,step:t=1,value:n,unit:o,onChange:l,disabled:r}){const d=(0,_react.useRef)(0);const h=i>e?(n-e)/(i-e)*100:0;const a=g=>Math.min(i,Math.max(e,+(Math.round((g-e)/t)*t+e).toFixed(6)));const s=g=>!r&&l(a(n+g*t));const c=g=>{if(r||d.current<=0)return;const x=Math.min(1,Math.max(0,g.nativeEvent.locationX/d.current));l(a(e+x*(i-e)))};const u=g=>{d.current=g.nativeEvent.layout.width};return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sliderRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:r,onPress:()=>s(-1),style:styles.stepBtn,accessibilityRole:"button",accessibilityLabel:"Decrease",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepText,children:"\u2212"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{style:styles.trackHit,onLayout:u,onPress:c,disabled:r,accessibilityRole:"adjustable",accessibilityValue:{min:e,max:i,now:n},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:g=>s(g.nativeEvent.actionName==="increment"?1:-1),children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.track,pointerEvents:"none",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.fill,{width:`${h}%`}]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.thumb,{left:`${h}%`}]})]})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:r,onPress:()=>s(1),style:styles.stepBtn,accessibilityRole:"button",accessibilityLabel:"Increase",children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepText,children:"+"})}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sliderValue,children:[n,o?` ${o}`:""]})]})}function Slider({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const[n,o]=(0,_react.useState)(e.value??e.min);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-slider-${e.id}`,tone:t?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:(0,_jsxRuntime.jsx)(SliderControl,{min:e.min,max:e.max,step:e.step,value:t?.kind==="slider"?t.value:n,unit:e.unit,onChange:o,disabled:!!t})}),t?null:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"slider",value:n,unit:e.unit}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.buttonTextPrimary,children:["Use ",n,e.unit?` ${e.unit}`:""]})})})]})}function DateTime({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const[n,o]=(0,_react.useState)("");const l=e.presets??[{label:"Now",value:new Date().toISOString()},{label:"Tomorrow",value:new Date(Date.now()+864e5).toISOString()},{label:"+7 days",value:new Date(Date.now()+7*864e5).toISOString()},{label:"+30 days",value:new Date(Date.now()+30*864e5).toISOString()}];return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-datetime-${e.id}`,tone:t?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),t?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:t.kind==="dateTime"?t.label??t.value:"(skipped)"}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.chips,styles.pad],children:l.map(r=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"dateTime",value:r.value,label:r.label}),style:styles.chip,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.chipText,children:r.label})},r.label))}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.inputRow,styles.pad],children:[(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.input,value:n,onChangeText:o,placeholder:e.mode==="time"?"14:30":"2026-09-15",placeholderTextColor:_sharedUi.night.color.placeholder,keyboardType:"numbers-and-punctuation"}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!n.trim(),onPress:()=>i.answer({blockId:e.id,kind:"dateTime",value:n.trim()}),style:[styles.button,styles.buttonPrimary,!n.trim()&&styles.disabled],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:"Use"})})]})]})]})}function FieldRow({f:e,value:i,onChange:t,disabled:n}){if(e.type==="toggle"){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.Switch,{value:!!i,onValueChange:t,disabled:n,trackColor:{true:_sharedUi.night.color.accent,false:_sharedUi.night.color.fillTertiary},thumbColor:_sharedUi.night.color.knob})]})}if(e.type==="select"){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.chips,children:e.options.map(o=>(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:n,onPress:()=>t(o.id),style:[styles.chip,i===o.id&&styles.chipOn],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.chipText,i===o.id&&styles.chipTextOn],children:o.label})},o.id))})]})}if(e.type==="slider"){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldCol,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(SliderControl,{min:e.min,max:e.max,step:e.step,unit:e.unit,value:typeof i==="number"?i:e.min,onChange:t,disabled:n})]})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fieldRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fieldLabel,children:e.label}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:styles.fieldInput,value:i===void 0||i===null?"":String(i),onChangeText:t,editable:!n,placeholder:e.placeholder??"",placeholderTextColor:_sharedUi.night.color.placeholder,keyboardType:e.type==="number"?"numeric":"ascii-capable",secureTextEntry:e.type==="secret",autoCapitalize:"none",autoCorrect:false})]})}function useFormValues(e){const[i,t]=(0,_react.useState)(()=>Object.fromEntries(e.map(n=>[n.key,n.value])));return{values:i,set:(n,o)=>t(l=>({...l,[n]:o}))}}function Form({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const{values:n,set:o}=useFormValues(e.fields);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,testID:`buoy-block-form-${e.id}`,tone:t?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:e.fields.map(l=>(0,_jsxRuntime.jsx)(FieldRow,{f:l,value:n[l.key],onChange:r=>o(l.key,r),disabled:!!t},l.key))}),t?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:"Sent"}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.rowEnd,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"form",values:n}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.submitLabel??"Send"})})})]})}function Proposal({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];const{values:n,set:o}=useFormValues(e.fields);const l=t?.kind==="proposal"?t.approved:null;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-proposal-${e.id}`,tone:t?void 0:"warning",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmTitle,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.confirmChange,children:e.change}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.pad,children:e.fields.map(r=>(0,_jsxRuntime.jsx)(FieldRow,{f:r,value:n[r.key],onChange:d=>o(r.key,d),disabled:!!t},r.key))}),e.consequence?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.consequence,children:e.consequence}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actionsRow,children:t?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:l?"\u2713 Applied with these values":"\u2715 Not applied"}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"proposal",approved:true,values:n}),style:[styles.button,styles.buttonPrimary],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPrimary,children:e.approveLabel??"Apply"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"proposal",approved:false}),style:[styles.button,styles.buttonPlate],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPlate,children:"Not now"})})]})})]})}function Claim({block:e}){const i=(0,_context.useBlockHandlers)();const[t,n]=(0,_react.useState)(null);const o=i.actionState?.[`${e.id}:${e.verify?.label??"Verify"}`];const l=e.verified||o==="done";return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.claim,testID:`buoy-block-claim-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.claimText,children:[e.text,e.sources.map((r,d)=>(0,_jsxRuntime.jsxs)(_reactNative.Text,{onPress:()=>n(t===d?null:d),style:styles.cite,children:[" [",d+1,"]"]},d)),l?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.verified,children:" \u2713 verified"}):null]}),t!==null&&e.sources[t]?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.citeBox,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.citeLabel,children:["[",t+1,"] ",e.sources[t].label]}),e.sources[t].detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.citeDetail,children:e.sources[t].detail}):null]}):null,e.verify&&!l?(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>void i.runAction(e.verify,e.id),style:styles.verifyBtn,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_sharedUi.RefreshCw,{size:11,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.verifyText,children:o==="running"?"Checking\u2026":e.verify.label})]}):null]})}function Details({block:e}){const[i,t]=(0,_react.useState)(!!e.open);return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-details-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{onPress:()=>t(n=>!n),style:_primitives.blockStyles.row,accessibilityRole:"button",accessibilityState:{expanded:i},children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,children:e.summary}),i?(0,_jsxRuntime.jsx)(_sharedUi.ChevronDown,{size:12,color:_sharedUi.night.color.textTertiary}):(0,_jsxRuntime.jsx)(_sharedUi.ChevronRight,{size:12,color:_sharedUi.night.color.textTertiary})]}),i?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.detailsBody,selectable:true,children:e.body}):null]})}function Tabs({block:e,renderNested:i}){const[t,n]=(0,_react.useState)(0);const o=e.tabs.map((r,d)=>({key:String(d),label:r.label}));const l=e.tabs[t];return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tabsWrap,testID:`buoy-block-tabs-${e.id}`,children:[(0,_jsxRuntime.jsx)(_sharedUi.NightSegmented,{tabs:o,activeKey:String(t),onChange:r=>n(Number(r)),size:"sm"}),l&&i?i(l.block):null]})}const TIMELINE_CAP=10;function Timeline({block:e}){const i=(0,_primitives.usePaged)(e.events,TIMELINE_CAP);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title??"What happened",source:e.source,testID:`buoy-block-timeline-${e.id}`,children:[i.visible.map((t,n)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tlRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.tlAt,children:t.at}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.tlLine,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.tlDot,{backgroundColor:(0,_primitives.toneColor)(t.tone??"muted")}]}),n<i.visible.length-1?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.tlStem}):null]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.tlSource,children:t.source.toUpperCase()}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,numberOfLines:2,children:t.label})]})]},n)),(0,_jsxRuntime.jsx)(_primitives.More,{paged:i})]})}function Sparkline({block:e}){const i=e.series.slice(-60);const t=Math.max(1,...i);const n=Math.min(...i,0);const o=44;return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,source:e.source,testID:`buoy-block-sparkline-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.sparkHead,children:[(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sparkCurrent,children:[e.current??i[i.length-1],e.unit?(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.sparkUnit,children:[" ",e.unit]}):null]}),e.live?(0,_jsxRuntime.jsx)(LivePill,{}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.spark,{height:o}],children:i.map((l,r)=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.sparkBar,{height:Math.max(2,(l-n)/(t-n||1)*o),backgroundColor:r===i.length-1?_sharedUi.night.color.accent:_sharedUi.night.color.accentBorderStrong}]},r))}),e.label?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.label}):null]})}function LivePill(){const e=(0,_react.useRef)(new _reactNative.Animated.Value(1)).current;(0,_react.useEffect)(()=>{const i=_reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(e,{toValue:.3,duration:700,useNativeDriver:true}),_reactNative.Animated.timing(e,{toValue:1,duration:700,useNativeDriver:true})]));i.start();return()=>i.stop()},[e]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.live,children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.liveDot,{opacity:e}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.liveText,children:"LIVE"})]})}function Compare({block:e}){const i=[...new Set([...e.left.pairs.map(o=>o.key),...e.right.pairs.map(o=>o.key)])];const t=Object.fromEntries(e.left.pairs.map(o=>[o.key,o.value]));const n=Object.fromEntries(e.right.pairs.map(o=>[o.key,o.value]));return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,source:e.source,testID:`buoy-block-compare-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cmpHead,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpKey}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpCol,children:e.left.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpCol,children:e.right.title})]}),i.map((o,l)=>{const r=JSON.stringify(t[o])!==JSON.stringify(n[o]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.cmpRow,l>0&&_primitives.blockStyles.rowDivider,r&&styles.cmpDiff],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cmpKey,numberOfLines:1,children:o}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cmpVal,r&&{color:_sharedUi.night.color.danger}],numberOfLines:2,children:fmt(t[o])}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.cmpVal,r&&{color:_sharedUi.night.color.accent}],numberOfLines:2,children:fmt(n[o])})]},o)})]})}function CardBody({c:e,id:i}){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[e.image?(0,_jsxRuntime.jsx)(_reactNative.Image,{testID:"buoy-internal-chat-image",source:{uri:e.image},style:styles.cardImage,resizeMode:"contain",accessibilityLabel:e.title}):null,(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.cardText,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cardTitle,numberOfLines:2,children:e.title}),e.subtitle?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowSub,numberOfLines:2,children:e.subtitle}):null,e.facts?.slice(0,4).map(t=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.fact,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.factLabel,children:t.label}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.factValue,t.tone&&{color:(0,_primitives.toneColor)(t.tone)}],children:t.value})]},t.label))]}),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:i})]})}function CardView({block:e}){return(0,_jsxRuntime.jsx)(_primitives.Card,{source:e.source,testID:`buoy-block-card-${e.id}`,children:(0,_jsxRuntime.jsx)(CardBody,{c:e,id:e.id})})}function CardCarousel({block:e}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{testID:`buoy-block-cardcarousel-${e.id}`,children:[e.title?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.carouselTitle,children:e.title}):null,(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,snapToInterval:232,decelerationRate:"fast",contentContainerStyle:styles.carousel,children:e.cards.slice(0,8).map((i,t)=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.carouselCard,children:(0,_jsxRuntime.jsx)(CardBody,{c:i,id:`${e.id}-${t}`})},`${i.title}-${t}`))})]})}function Screenshot({block:e}){const[i,t]=(0,_react.useState)(false);return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.route?`Screen \xB7 ${e.route}`:"Screen",source:e.source,testID:`buoy-block-screenshot-${e.id}`,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>t(n=>!n),accessibilityRole:"imagebutton",accessibilityLabel:e.caption??"Screenshot",children:(0,_jsxRuntime.jsx)(_reactNative.Image,{testID:"buoy-internal-chat-image",source:{uri:e.url},style:[styles.shot,i&&styles.shotBig],resizeMode:"contain"})}),e.caption?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.caption}):null]})}function Plan({block:e}){const i=e.steps.filter(t=>t.state==="done").length;return(0,_jsxRuntime.jsxs)(_primitives.Card,{title:e.title,testID:`buoy-block-plan-${e.id}`,tone:e.pending?"info":void 0,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.progress,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progressFill,{width:`${i/Math.max(1,e.steps.length)*100}%`}]})}),e.steps.map((t,n)=>(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.step,n>0&&_primitives.blockStyles.rowDivider],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.stepMark,t.state==="done"&&styles.stepDone,t.state==="failed"&&styles.stepFailed,t.state==="running"&&styles.stepRunning],children:t.state==="done"?(0,_jsxRuntime.jsx)(_sharedUi.Check,{size:10,color:_sharedUi.night.color.onAccent}):t.state==="failed"?(0,_jsxRuntime.jsx)(_sharedUi.X,{size:10,color:_sharedUi.night.color.text}):(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.stepNum,children:n+1})}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[_primitives.blockStyles.rowTitle,t.state==="done"&&styles.muted],children:[t.text,t.state==="running"?"\u2026":""]})]},n)),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions??(e.pending?[{label:"Go",primary:true,send:"Go ahead with the plan."},{label:"Change it",send:"Let me change the plan first."}]:void 0),blockId:e.id})]})}function Checkpoint({block:e}){const i=(0,_context.useBlockHandlers)();return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{testID:`buoy-block-checkpoint-${e.id}`,disabled:!e.restore,onPress:()=>e.restore&&void i.runAction(e.restore,e.id),style:styles.checkpoint,accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.cpFlag}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.cpText,children:[e.label,e.at?` \xB7 ${e.at}`:""]}),e.restore?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cpRestore,children:e.restore.label}):null]})}function Task({block:e}){const i=e.status==="failed"?_sharedUi.night.color.danger:e.status==="done"?_sharedUi.night.color.accent:_sharedUi.night.color.info;return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-task-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.taskHead,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.cardTitle,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[_primitives.blockStyles.pill,{backgroundColor:`${i}22`}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[_primitives.blockStyles.pillText,{color:i}],children:e.status.toUpperCase()})})]}),e.progress!==void 0?(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progress,styles.pad],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.progressFill,{width:`${Math.round(e.progress*100)}%`,backgroundColor:i}]})}):null,e.detail?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:e.detail}):null,(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:e.id})]})}function Banner({block:e}){const i=e.tone==="danger"?_sharedUi.night.color.danger:e.tone==="warning"?_sharedUi.night.color.warning:_sharedUi.night.color.info;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.banner,{borderColor:i,backgroundColor:`${i}1A`}],testID:`buoy-block-banner-${e.id}`,children:[(0,_jsxRuntime.jsx)(_sharedUi.AlertTriangle,{size:13,color:i}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.bannerText,{color:i}],numberOfLines:2,children:e.text}),e.actions?.[0]?(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions.slice(0,1),blockId:e.id,align:"right"}):null]})}function File({block:e}){return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-file-${e.id}`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_primitives.blockStyles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.fileIcon,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.fileExt,children:(e.type??e.name.split(".").pop()??"file").toUpperCase().slice(0,4)})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.flex,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowTitle,numberOfLines:1,children:e.name}),e.size?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_primitives.blockStyles.rowSub,children:e.size}):null]})]}),(0,_jsxRuntime.jsx)(_primitives.ActionRow,{actions:e.actions,blockId:e.id})]})}function Upload({block:e}){const i=(0,_context.useBlockHandlers)();const t=i.answered[e.id];return(0,_jsxRuntime.jsxs)(_primitives.Card,{testID:`buoy-block-upload-${e.id}`,tone:t?void 0:"info",children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.question,children:e.label}),t?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.decided,children:t.kind==="upload"?`Attached ${t.name}`:"(skipped)"}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.rowEnd,{justifyContent:"flex-start"}],children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:()=>i.answer({blockId:e.id,kind:"upload",name:"screenshot.png"}),style:[styles.button,styles.buttonPlate],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.buttonTextPlate,children:e.accept==="image"?"Choose a screenshot":"Choose a file"})})})]})}const styles=_reactNative.StyleSheet.create({flex:{flex:1},pad:{paddingHorizontal:12,paddingBottom:8},muted:{color:_sharedUi.night.color.textSecondary},dim:{opacity:.45},disabled:{opacity:.5},pressed:{opacity:.7},question:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",lineHeight:20,paddingHorizontal:12,paddingTop:12,paddingBottom:8},hint:{color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,paddingHorizontal:12,paddingBottom:10},decided:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600",paddingHorizontal:12,paddingVertical:10},rowEnd:{flexDirection:"row",justifyContent:"flex-end",paddingHorizontal:12,paddingBottom:12,gap:8},actionsRow:{flexDirection:"row",gap:8,paddingHorizontal:12,paddingVertical:12,alignItems:"center"},button:{paddingHorizontal:14,paddingVertical:9,borderRadius:_sharedUi.night.radius.row},buttonPrimary:{backgroundColor:_sharedUi.night.color.accent},buttonPlate:{backgroundColor:_sharedUi.night.color.button},buttonTextPrimary:{color:_sharedUi.night.color.onAccent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},buttonTextPlate:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},chips:{flexDirection:"row",flexWrap:"wrap",gap:6},chip:{paddingHorizontal:12,paddingVertical:7,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.fill,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border},chipOn:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},chipText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},chipTextOn:{color:_sharedUi.night.color.accent,fontWeight:"600"},optionsBox:{marginHorizontal:8,marginBottom:8,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,overflow:"hidden"},option:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:10},optionLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,fontWeight:"500"},optionDetail:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},checkbox:{width:20,height:20,borderRadius:6,borderWidth:1.5,borderColor:_sharedUi.night.color.textTertiary,alignItems:"center",justifyContent:"center"},checkboxOn:{backgroundColor:_sharedUi.night.color.accent,borderColor:_sharedUi.night.color.accent},selectBox:{marginHorizontal:12,marginBottom:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,overflow:"hidden"},selectField:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:11},selectPlaceholder:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.body},search:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:6,borderTopWidth:_reactNative.StyleSheet.hairlineWidth,borderTopColor:_sharedUi.night.color.separator},searchInput:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,paddingVertical:4},sliderRow:{flexDirection:"row",alignItems:"center",gap:8},stepBtn:{width:28,height:28,borderRadius:14,backgroundColor:_sharedUi.night.color.fill,alignItems:"center",justifyContent:"center"},stepText:{color:_sharedUi.night.color.text,fontSize:16,fontWeight:"600"},trackHit:{flex:1,height:36,justifyContent:"center"},track:{height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.fillTertiary,justifyContent:"center"},fill:{height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.accent},thumb:{position:"absolute",width:20,height:20,borderRadius:10,backgroundColor:_sharedUi.night.color.knob,marginLeft:-10,shadowColor:"#000",shadowOpacity:.35,shadowRadius:3,shadowOffset:{width:0,height:1}},sliderValue:{width:64,textAlign:"right",color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},inputRow:{flexDirection:"row",alignItems:"center",gap:8,paddingBottom:12},input:{flex:1,height:38,paddingHorizontal:12,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body},fieldRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:10,paddingVertical:6},fieldCol:{paddingVertical:6,gap:6},fieldLabel:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,width:110},fieldInput:{flex:1,height:34,paddingHorizontal:10,borderRadius:_sharedUi.night.radius.segment,backgroundColor:_sharedUi.night.color.surfaceElevated,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption},confirmTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600",paddingHorizontal:12,paddingTop:12},confirmChange:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.body,lineHeight:19,paddingHorizontal:12,paddingTop:6,paddingBottom:6},consequence:{color:_sharedUi.night.color.warning,fontSize:_sharedUi.night.font.caption,paddingHorizontal:12},claim:{gap:6,paddingHorizontal:2},claimText:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,lineHeight:22},cite:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"700"},verified:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},citeBox:{padding:10,borderRadius:_sharedUi.night.radius.row,backgroundColor:_sharedUi.night.color.surface,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,gap:2},citeLabel:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},citeDetail:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontFamily:"Menlo"},verifyBtn:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:10,paddingVertical:5,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.accentSoft},verifyText:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.micro,fontWeight:"700"},detailsBody:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,lineHeight:18,paddingHorizontal:12,paddingBottom:12},tabsWrap:{gap:8},tabBar:{flexDirection:"row",gap:6},tab:{paddingHorizontal:12,paddingVertical:6,borderRadius:_sharedUi.night.radius.badge,backgroundColor:_sharedUi.night.color.fill},tabOn:{backgroundColor:_sharedUi.night.color.accentSoft},tabText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},tabTextOn:{color:_sharedUi.night.color.accent},tlRow:{flexDirection:"row",gap:10,paddingHorizontal:12,paddingVertical:4,alignItems:"flex-start"},tlAt:{width:46,color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontFamily:"Menlo",paddingTop:3},tlLine:{width:12,alignItems:"center"},tlDot:{width:8,height:8,borderRadius:4,marginTop:5},tlStem:{width:1,flex:1,minHeight:18,backgroundColor:_sharedUi.night.color.separator,marginTop:2},tlSource:{color:_sharedUi.night.color.textTertiary,fontSize:9,fontWeight:"700",letterSpacing:.6},sparkHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingTop:8},sparkCurrent:{color:_sharedUi.night.color.text,fontSize:22,fontWeight:"700"},sparkUnit:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption,fontWeight:"500"},spark:{flexDirection:"row",alignItems:"flex-end",gap:2,paddingHorizontal:12,paddingTop:6,paddingBottom:6},sparkBar:{flex:1,borderRadius:1},live:{flexDirection:"row",alignItems:"center",gap:5,paddingHorizontal:8,paddingVertical:3,borderRadius:_sharedUi.night.radius.badge,backgroundColor:_sharedUi.night.color.dangerSoft},liveDot:{width:6,height:6,borderRadius:3,backgroundColor:_sharedUi.night.color.danger},liveText:{color:_sharedUi.night.color.danger,fontSize:9,fontWeight:"800",letterSpacing:.8},cmpHead:{flexDirection:"row",paddingHorizontal:12,paddingVertical:6,backgroundColor:_sharedUi.night.color.fill,gap:8},cmpCol:{flex:1,color:_sharedUi.night.color.textTertiary,fontSize:_sharedUi.night.font.micro,fontWeight:"700",letterSpacing:.6,textTransform:"uppercase"},cmpRow:{flexDirection:"row",paddingHorizontal:12,paddingVertical:8,gap:8,alignItems:"flex-start"},cmpDiff:{backgroundColor:_sharedUi.night.color.fill},cmpKey:{width:90,color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},cmpVal:{flex:1,color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontFamily:"Menlo"},cardImage:{width:"100%",height:140,backgroundColor:_sharedUi.night.color.fill},cardText:{paddingHorizontal:12,paddingTop:10,paddingBottom:4,gap:4},cardTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.row,fontWeight:"600"},fact:{flexDirection:"row",justifyContent:"space-between",gap:8},factLabel:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},factValue:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"500"},carouselTitle:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.caption,fontWeight:"600",paddingBottom:8},carousel:{gap:8,paddingRight:8},carouselCard:{width:224,borderRadius:_sharedUi.night.radius.card,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.surface,overflow:"hidden"},shot:{width:"100%",height:220,backgroundColor:_sharedUi.night.color.fill},shotBig:{height:520},progress:{height:4,backgroundColor:_sharedUi.night.color.fill,marginHorizontal:12,marginTop:6,marginBottom:8,borderRadius:2,overflow:"hidden"},progressFill:{height:4,backgroundColor:_sharedUi.night.color.accent},step:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:12,paddingVertical:9},stepMark:{width:20,height:20,borderRadius:10,backgroundColor:_sharedUi.night.color.fillTertiary,alignItems:"center",justifyContent:"center"},stepDone:{backgroundColor:_sharedUi.night.color.accent},stepFailed:{backgroundColor:_sharedUi.night.color.danger},stepRunning:{backgroundColor:_sharedUi.night.color.info},stepNum:{color:_sharedUi.night.color.text,fontSize:_sharedUi.night.font.micro,fontWeight:"700"},checkpoint:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:12,paddingVertical:7,borderRadius:_sharedUi.night.radius.chip,backgroundColor:_sharedUi.night.color.fill},cpFlag:{width:8,height:8,borderRadius:2,backgroundColor:_sharedUi.night.color.info},cpText:{color:_sharedUi.night.color.textSecondary,fontSize:_sharedUi.night.font.caption},cpRestore:{color:_sharedUi.night.color.accent,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},taskHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:12,paddingTop:12},banner:{flexDirection:"row",alignItems:"center",gap:8,paddingLeft:12,paddingRight:4,paddingVertical:4,borderRadius:_sharedUi.night.radius.row,borderWidth:_reactNative.StyleSheet.hairlineWidth},bannerText:{flex:1,fontSize:_sharedUi.night.font.caption,fontWeight:"600"},fileIcon:{width:40,height:40,borderRadius:8,backgroundColor:_sharedUi.night.color.fill,alignItems:"center",justifyContent:"center"},fileExt:{color:_sharedUi.night.color.textSecondary,fontSize:10,fontWeight:"800"}});