@buoy-gg/shared-ui 7.0.26 → 7.0.27

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 (209) hide show
  1. package/lib/commonjs/JsModal.js +156 -20
  2. package/lib/commonjs/JsModal.web.js +85 -39
  3. package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +14 -4
  4. package/lib/commonjs/dataViewer/diffThemes.js +20 -18
  5. package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +8 -8
  6. package/lib/commonjs/hooks/safe-area-impl.js +1 -1
  7. package/lib/commonjs/icons/lucide-icons.js +74 -15
  8. package/lib/commonjs/index.js +86 -0
  9. package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +248 -74
  10. package/lib/commonjs/ui/backgrounds/README.md +102 -20
  11. package/lib/commonjs/ui/backgrounds/backgroundStore.js +20 -6
  12. package/lib/commonjs/ui/backgrounds/index.js +91 -1
  13. package/lib/commonjs/ui/backgrounds/primitives.js +50 -14
  14. package/lib/commonjs/ui/backgrounds/registry.js +41 -64
  15. package/lib/commonjs/ui/backgrounds/rng.js +21 -0
  16. package/lib/commonjs/ui/backgrounds/skyClock.js +45 -0
  17. package/lib/commonjs/ui/backgrounds/variants/daylight.js +453 -0
  18. package/lib/commonjs/ui/backgrounds/variants/deepField.js +60 -30
  19. package/lib/commonjs/ui/backgrounds/variants/hyperspace.js +218 -0
  20. package/lib/commonjs/ui/backgrounds/variants/liveSky.js +898 -0
  21. package/lib/commonjs/ui/backgrounds/variants/meteors.js +257 -0
  22. package/lib/commonjs/ui/backgrounds/variants/moonlight.js +472 -0
  23. package/lib/commonjs/ui/backgrounds/variants/underwater.js +757 -0
  24. package/lib/commonjs/ui/components/Badge.js +11 -10
  25. package/lib/commonjs/ui/components/CompactRow.js +30 -17
  26. package/lib/commonjs/ui/components/DevToolsCard.js +12 -8
  27. package/lib/commonjs/ui/components/DynamicFilterView.js +43 -41
  28. package/lib/commonjs/ui/components/EventStepperFooter.js +38 -10
  29. package/lib/commonjs/ui/components/FilterComponents.js +11 -11
  30. package/lib/commonjs/ui/components/ModalHeader.js +13 -13
  31. package/lib/commonjs/ui/components/SectionHeader.js +3 -1
  32. package/lib/commonjs/ui/components/StorageTypeBadge.js +3 -2
  33. package/lib/commonjs/ui/components/TabSelector.js +56 -38
  34. package/lib/commonjs/ui/components/ValueTypeBadge.js +7 -6
  35. package/lib/commonjs/ui/components/WindowControls.js +37 -10
  36. package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +8 -0
  37. package/lib/commonjs/ui/night/nightTheme.js +120 -0
  38. package/lib/commonjs/ui/night/primitives.js +498 -0
  39. package/lib/module/JsModal.js +156 -20
  40. package/lib/module/JsModal.web.js +83 -39
  41. package/lib/module/dataViewer/VirtualizedDataExplorer.js +14 -4
  42. package/lib/module/dataViewer/diffThemes.js +20 -18
  43. package/lib/module/dataViewer/tree/TreeDiffViewer.js +9 -9
  44. package/lib/module/hooks/safe-area-impl.js +1 -1
  45. package/lib/module/icons/lucide-icons.js +74 -15
  46. package/lib/module/index.js +4 -0
  47. package/lib/module/ui/backgrounds/BackgroundSwitcher.js +250 -76
  48. package/lib/module/ui/backgrounds/README.md +102 -20
  49. package/lib/module/ui/backgrounds/backgroundStore.js +19 -5
  50. package/lib/module/ui/backgrounds/index.js +11 -2
  51. package/lib/module/ui/backgrounds/primitives.js +53 -16
  52. package/lib/module/ui/backgrounds/registry.js +41 -64
  53. package/lib/module/ui/backgrounds/rng.js +20 -0
  54. package/lib/module/ui/backgrounds/skyClock.js +39 -0
  55. package/lib/module/ui/backgrounds/variants/daylight.js +449 -0
  56. package/lib/module/ui/backgrounds/variants/deepField.js +62 -31
  57. package/lib/module/ui/backgrounds/variants/hyperspace.js +214 -0
  58. package/lib/module/ui/backgrounds/variants/liveSky.js +893 -0
  59. package/lib/module/ui/backgrounds/variants/meteors.js +253 -0
  60. package/lib/module/ui/backgrounds/variants/moonlight.js +468 -0
  61. package/lib/module/ui/backgrounds/variants/underwater.js +753 -0
  62. package/lib/module/ui/components/Badge.js +11 -10
  63. package/lib/module/ui/components/CompactRow.js +30 -17
  64. package/lib/module/ui/components/DevToolsCard.js +12 -8
  65. package/lib/module/ui/components/DynamicFilterView.js +43 -41
  66. package/lib/module/ui/components/EventStepperFooter.js +38 -10
  67. package/lib/module/ui/components/FilterComponents.js +11 -11
  68. package/lib/module/ui/components/ModalHeader.js +13 -13
  69. package/lib/module/ui/components/SectionHeader.js +3 -1
  70. package/lib/module/ui/components/StorageTypeBadge.js +3 -2
  71. package/lib/module/ui/components/TabSelector.js +57 -39
  72. package/lib/module/ui/components/ValueTypeBadge.js +7 -6
  73. package/lib/module/ui/components/WindowControls.js +37 -10
  74. package/lib/module/ui/gameUI/constants/gameUIColors.js +8 -0
  75. package/lib/module/ui/night/nightTheme.js +116 -0
  76. package/lib/module/ui/night/primitives.js +485 -0
  77. package/lib/typescript/commonjs/JsModal.d.ts +18 -0
  78. package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/JsModal.web.d.ts +13 -0
  80. package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts +3 -1
  83. package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  86. package/lib/typescript/commonjs/icons/lucide-icons.d.ts +12 -1
  87. package/lib/typescript/commonjs/icons/lucide-icons.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/index.d.ts +3 -0
  89. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
  91. package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +3 -0
  93. package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -1
  95. package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +18 -3
  97. package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +8 -0
  99. package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +6 -0
  101. package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts +17 -0
  103. package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +1 -1
  105. package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts +30 -0
  107. package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts.map +1 -0
  108. package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +19 -4
  109. package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts +39 -0
  111. package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts +41 -0
  113. package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts +26 -0
  115. package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts +35 -0
  117. package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts +51 -0
  119. package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/ui/components/Badge.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/ui/components/DynamicFilterView.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts +2 -0
  124. package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/ui/components/StorageTypeBadge.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/components/TabSelector.d.ts +9 -0
  127. package/lib/typescript/commonjs/ui/components/TabSelector.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/ui/components/ValueTypeBadge.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/ui/components/WindowControls.d.ts +4 -2
  130. package/lib/typescript/commonjs/ui/components/WindowControls.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +8 -0
  132. package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/ui/night/nightTheme.d.ts +113 -0
  134. package/lib/typescript/commonjs/ui/night/nightTheme.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/ui/night/primitives.d.ts +111 -0
  136. package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -0
  137. package/lib/typescript/module/JsModal.d.ts +18 -0
  138. package/lib/typescript/module/JsModal.d.ts.map +1 -1
  139. package/lib/typescript/module/JsModal.web.d.ts +13 -0
  140. package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
  141. package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
  142. package/lib/typescript/module/dataViewer/diffThemes.d.ts +3 -1
  143. package/lib/typescript/module/dataViewer/diffThemes.d.ts.map +1 -1
  144. package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
  145. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  146. package/lib/typescript/module/icons/lucide-icons.d.ts +12 -1
  147. package/lib/typescript/module/icons/lucide-icons.d.ts.map +1 -1
  148. package/lib/typescript/module/index.d.ts +3 -0
  149. package/lib/typescript/module/index.d.ts.map +1 -1
  150. package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
  151. package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
  152. package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +3 -0
  153. package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -1
  154. package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -1
  155. package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/backgrounds/primitives.d.ts +18 -3
  157. package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -1
  158. package/lib/typescript/module/ui/backgrounds/registry.d.ts +8 -0
  159. package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -1
  160. package/lib/typescript/module/ui/backgrounds/rng.d.ts +6 -0
  161. package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -1
  162. package/lib/typescript/module/ui/backgrounds/skyClock.d.ts +17 -0
  163. package/lib/typescript/module/ui/backgrounds/skyClock.d.ts.map +1 -0
  164. package/lib/typescript/module/ui/backgrounds/types.d.ts +1 -1
  165. package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -1
  166. package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts +30 -0
  167. package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts.map +1 -0
  168. package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +19 -4
  169. package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -1
  170. package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts +39 -0
  171. package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
  172. package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts +41 -0
  173. package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
  174. package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts +26 -0
  175. package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts.map +1 -0
  176. package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts +35 -0
  177. package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
  178. package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts +51 -0
  179. package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts.map +1 -0
  180. package/lib/typescript/module/ui/components/Badge.d.ts.map +1 -1
  181. package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
  182. package/lib/typescript/module/ui/components/DynamicFilterView.d.ts.map +1 -1
  183. package/lib/typescript/module/ui/components/EventStepperFooter.d.ts +2 -0
  184. package/lib/typescript/module/ui/components/EventStepperFooter.d.ts.map +1 -1
  185. package/lib/typescript/module/ui/components/StorageTypeBadge.d.ts.map +1 -1
  186. package/lib/typescript/module/ui/components/TabSelector.d.ts +9 -0
  187. package/lib/typescript/module/ui/components/TabSelector.d.ts.map +1 -1
  188. package/lib/typescript/module/ui/components/ValueTypeBadge.d.ts.map +1 -1
  189. package/lib/typescript/module/ui/components/WindowControls.d.ts +4 -2
  190. package/lib/typescript/module/ui/components/WindowControls.d.ts.map +1 -1
  191. package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +8 -0
  192. package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
  193. package/lib/typescript/module/ui/night/nightTheme.d.ts +113 -0
  194. package/lib/typescript/module/ui/night/nightTheme.d.ts.map +1 -0
  195. package/lib/typescript/module/ui/night/primitives.d.ts +111 -0
  196. package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -0
  197. package/package.json +4 -4
  198. package/lib/commonjs/ui/backgrounds/variants/lattice.js +0 -579
  199. package/lib/commonjs/ui/backgrounds/variants/starfield.js +0 -210
  200. package/lib/module/ui/backgrounds/variants/lattice.js +0 -575
  201. package/lib/module/ui/backgrounds/variants/starfield.js +0 -206
  202. package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +0 -33
  203. package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +0 -1
  204. package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +0 -12
  205. package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +0 -1
  206. package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +0 -33
  207. package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +0 -1
  208. package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +0 -12
  209. package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +0 -1
@@ -0,0 +1,898 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LiveSkyTunable = exports.LiveSky = void 0;
7
+ exports.workdaySceneMinutes = workdaySceneMinutes;
8
+ var _react = require("react");
9
+ var _reactNative = require("react-native");
10
+ var _absoluteFill = require("../../../utils/absoluteFill.js");
11
+ var _primitives = require("../primitives.js");
12
+ var _rng = require("../rng.js");
13
+ var _skyClock = require("../skyClock.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ /**
16
+ * Live Sky — the cove on your clock.
17
+ *
18
+ * One scene that tracks the actual local time — through the WORKDAY REMAP
19
+ * (`workdaySceneMinutes` below): the real clock is compressed onto the scene's
20
+ * day so sunrise lands ~9:00, noon at lunch, sunset ~17:30 and night after
21
+ * ~20:00, and a normal working session sees the whole cycle. In scene time the
22
+ * sun runs 06:30→19:00 and the moon takes the night shift; dawn, golden hour,
23
+ * sunset and dusk are palette keyframes lerped in between. The night keyframe
24
+ * is Moonlight's palette and the noon keyframe is Daylight's, so the live
25
+ * scene passes through both fixed siblings exactly.
26
+ *
27
+ * THE CHEAP TRICK (see LIVE_SKY_PLAN.md): real time IS the cheap version. The
28
+ * sun moves ~0.4px per minute on this surface — invisible as motion — so the
29
+ * cycle itself animates NOTHING. The scene is laid out statically for the
30
+ * current minute and a once-a-minute tick re-renders it (~one small React
31
+ * commit). That also sidesteps the native driver's hard limit (transform and
32
+ * opacity only, never colour): colour "animation" here is just new style
33
+ * values in an ordinary render. Between ticks the preset costs exactly what
34
+ * Daylight costs — a handful of native loops that never touch JS.
35
+ *
36
+ * The scrub slider in `BackgroundSwitcher` writes `skyClock.ts`; a non-null
37
+ * scrub freezes this scene at that minute and stops the tick.
38
+ *
39
+ * Same contract as ../README.md otherwise: native-driven loops only, static
40
+ * geometry rasterized, scatter tables at module load, light geometry sized
41
+ * from the WINDOW (resizing crops, never stretches).
42
+ */
43
+
44
+ const HORIZON = 0.46;
45
+ const SUN_RISE = 6.5 * 60;
46
+ const SUN_SET = 19 * 60;
47
+ const MOON_SPAN = 1440 - (SUN_SET - SUN_RISE);
48
+ const SUN_DIA = 50;
49
+ const MOON_DIA = 56;
50
+
51
+ /** Moon craters, fixed — the moon doesn't take the palette's disc colour. */
52
+ const CRATERS = [[0.24, -0.12, 0.2], [-0.16, 0.2, 0.13], [0.08, 0.06, 0.1]];
53
+
54
+ // ============================================================================
55
+ // The palette — keyframes lerped by time of day
56
+ // ============================================================================
57
+
58
+ const NIGHT = {
59
+ skyTop: "#070C15",
60
+ skyHorizon: "#040609",
61
+ skyHorizonAlpha: 1,
62
+ seaColor: "#04070C",
63
+ seaFade: "#010409",
64
+ seaFadeAlpha: 0.5,
65
+ hazeBand: "#17293F",
66
+ hazeAlpha: 0.28,
67
+ cloudRim: "#1D2A42",
68
+ cloudRimAlpha: 0.35,
69
+ cloudBody: "#070D18",
70
+ cloudBodyAlpha: 0.94,
71
+ peakNear: "#030609",
72
+ peakFar: "#020408",
73
+ glitter: "#CFE0F4",
74
+ glitterAlpha: 0.95,
75
+ bloom: "#A9C2DE",
76
+ bloomAlpha: 0.15,
77
+ glow: "#DCE8F6",
78
+ glowAlpha: 0.34,
79
+ disc: "#EDF3FB",
80
+ horizonLine: "#9FB8D4",
81
+ horizonLineAlpha: 0.12,
82
+ underLine: "#C6DAF0",
83
+ underLineAlpha: 0.32,
84
+ vignette: "#020305",
85
+ starAlpha: 1,
86
+ dayness: 0
87
+ };
88
+ const DAWN = {
89
+ skyTop: "#12263E",
90
+ skyHorizon: "#C4756B",
91
+ skyHorizonAlpha: 0.5,
92
+ seaColor: "#0C1E30",
93
+ seaFade: "#03080F",
94
+ seaFadeAlpha: 0.52,
95
+ hazeBand: "#D98F7E",
96
+ hazeAlpha: 0.34,
97
+ cloudRim: "#F2A98C",
98
+ cloudRimAlpha: 0.5,
99
+ cloudBody: "#2E2B41",
100
+ cloudBodyAlpha: 0.9,
101
+ peakNear: "#1A2536",
102
+ peakFar: "#131B29",
103
+ glitter: "#F2C4A0",
104
+ glitterAlpha: 0.8,
105
+ bloom: "#FFB37A",
106
+ bloomAlpha: 0.24,
107
+ glow: "#FFD9B0",
108
+ glowAlpha: 0.4,
109
+ disc: "#FFE9C4",
110
+ horizonLine: "#E8B49A",
111
+ horizonLineAlpha: 0.24,
112
+ underLine: "#FFD2A8",
113
+ underLineAlpha: 0.4,
114
+ vignette: "#080810",
115
+ starAlpha: 0.35,
116
+ dayness: 0.15
117
+ };
118
+ const SUNRISE = {
119
+ skyTop: "#27567D",
120
+ skyHorizon: "#F2B26A",
121
+ skyHorizonAlpha: 0.55,
122
+ seaColor: "#12324C",
123
+ seaFade: "#051220",
124
+ seaFadeAlpha: 0.54,
125
+ hazeBand: "#F2C08A",
126
+ hazeAlpha: 0.36,
127
+ cloudRim: "#FFDCB0",
128
+ cloudRimAlpha: 0.6,
129
+ cloudBody: "#7E88A6",
130
+ cloudBodyAlpha: 0.88,
131
+ peakNear: "#264A64",
132
+ peakFar: "#1E3D54",
133
+ glitter: "#FFD9A0",
134
+ glitterAlpha: 1.05,
135
+ bloom: "#FFCE8A",
136
+ bloomAlpha: 0.26,
137
+ glow: "#FFE6C0",
138
+ glowAlpha: 0.46,
139
+ disc: "#FFF2D4",
140
+ horizonLine: "#F5D2A4",
141
+ horizonLineAlpha: 0.28,
142
+ underLine: "#FFE0AE",
143
+ underLineAlpha: 0.46,
144
+ vignette: "#0A1420",
145
+ starAlpha: 0,
146
+ dayness: 0.6
147
+ };
148
+
149
+ /** Noon — Daylight's palette, verbatim. */
150
+ const DAY = {
151
+ skyTop: "#1C4E74",
152
+ skyHorizon: "#A9CDE6",
153
+ skyHorizonAlpha: 0.42,
154
+ seaColor: "#16405E",
155
+ seaFade: "#06192B",
156
+ seaFadeAlpha: 0.55,
157
+ hazeBand: "#CFE3F1",
158
+ hazeAlpha: 0.3,
159
+ cloudRim: "#FFFFFF",
160
+ cloudRimAlpha: 0.6,
161
+ cloudBody: "#C7DCEC",
162
+ cloudBodyAlpha: 0.88,
163
+ peakNear: "#2E5E80",
164
+ peakFar: "#27516F",
165
+ glitter: "#FFE9B0",
166
+ glitterAlpha: 1,
167
+ bloom: "#FFE9B0",
168
+ bloomAlpha: 0.18,
169
+ glow: "#FFF4D2",
170
+ glowAlpha: 0.42,
171
+ disc: "#FFF9E6",
172
+ horizonLine: "#E4F0F8",
173
+ horizonLineAlpha: 0.2,
174
+ underLine: "#FFEFC2",
175
+ underLineAlpha: 0.42,
176
+ vignette: "#0A2033",
177
+ starAlpha: 0,
178
+ dayness: 1
179
+ };
180
+ const GOLDEN = {
181
+ skyTop: "#31618B",
182
+ skyHorizon: "#F5C26B",
183
+ skyHorizonAlpha: 0.5,
184
+ seaColor: "#1A3C58",
185
+ seaFade: "#071626",
186
+ seaFadeAlpha: 0.55,
187
+ hazeBand: "#F2C888",
188
+ hazeAlpha: 0.36,
189
+ cloudRim: "#FFE0A8",
190
+ cloudRimAlpha: 0.62,
191
+ cloudBody: "#8FA3BC",
192
+ cloudBodyAlpha: 0.88,
193
+ peakNear: "#2A5070",
194
+ peakFar: "#223F5A",
195
+ glitter: "#FFCE7E",
196
+ glitterAlpha: 1.1,
197
+ bloom: "#FFC26E",
198
+ bloomAlpha: 0.24,
199
+ glow: "#FFDCA0",
200
+ glowAlpha: 0.48,
201
+ disc: "#FFEDC2",
202
+ horizonLine: "#F8D8A0",
203
+ horizonLineAlpha: 0.28,
204
+ underLine: "#FFD088",
205
+ underLineAlpha: 0.48,
206
+ vignette: "#0C1B2A",
207
+ starAlpha: 0,
208
+ dayness: 1
209
+ };
210
+ const SUNSET = {
211
+ skyTop: "#232F55",
212
+ skyHorizon: "#E86A3C",
213
+ skyHorizonAlpha: 0.6,
214
+ seaColor: "#1E3049",
215
+ seaFade: "#050A14",
216
+ seaFadeAlpha: 0.55,
217
+ hazeBand: "#F08A4A",
218
+ hazeAlpha: 0.4,
219
+ cloudRim: "#FFC48A",
220
+ cloudRimAlpha: 0.65,
221
+ cloudBody: "#3A2F45",
222
+ cloudBodyAlpha: 0.9,
223
+ peakNear: "#1C2438",
224
+ peakFar: "#151C2C",
225
+ glitter: "#FF9D5C",
226
+ glitterAlpha: 1.15,
227
+ bloom: "#FF8A50",
228
+ bloomAlpha: 0.3,
229
+ glow: "#FFB27A",
230
+ glowAlpha: 0.5,
231
+ disc: "#FFD9A0",
232
+ horizonLine: "#FFD2A0",
233
+ horizonLineAlpha: 0.3,
234
+ underLine: "#FFB070",
235
+ underLineAlpha: 0.5,
236
+ vignette: "#120A18",
237
+ starAlpha: 0,
238
+ dayness: 0.4
239
+ };
240
+ const DUSK = {
241
+ skyTop: "#131B33",
242
+ skyHorizon: "#7A4260",
243
+ skyHorizonAlpha: 0.45,
244
+ seaColor: "#0B1526",
245
+ seaFade: "#02060E",
246
+ seaFadeAlpha: 0.52,
247
+ hazeBand: "#3A2C4E",
248
+ hazeAlpha: 0.3,
249
+ cloudRim: "#5A4668",
250
+ cloudRimAlpha: 0.4,
251
+ cloudBody: "#12141F",
252
+ cloudBodyAlpha: 0.92,
253
+ peakNear: "#0A1220",
254
+ peakFar: "#070D18",
255
+ glitter: "#D8C4D8",
256
+ glitterAlpha: 0.8,
257
+ bloom: "#C0A8C4",
258
+ bloomAlpha: 0.18,
259
+ glow: "#E4D2E4",
260
+ glowAlpha: 0.36,
261
+ disc: "#F2E4E8",
262
+ horizonLine: "#B49CB4",
263
+ horizonLineAlpha: 0.18,
264
+ underLine: "#D0BCD0",
265
+ underLineAlpha: 0.34,
266
+ vignette: "#050408",
267
+ starAlpha: 0.5,
268
+ dayness: 0
269
+ };
270
+
271
+ /** [minutes since midnight, palette] — adjacent identical entries hold. */
272
+ const KEYFRAMES = [[0, NIGHT], [300, NIGHT],
273
+ // 05:00 — night holds
274
+ [360, DAWN],
275
+ // 06:00
276
+ [415, SUNRISE],
277
+ // 06:55
278
+ [510, DAY],
279
+ // 08:30
280
+ [1050, DAY],
281
+ // 17:30 — day holds
282
+ [1080, GOLDEN],
283
+ // 18:00
284
+ [1130, SUNSET],
285
+ // 18:50
286
+ [1180, DUSK],
287
+ // 19:40
288
+ [1245, NIGHT],
289
+ // 20:45
290
+ [1440, NIGHT]];
291
+ function lerpPalette(a, b, t) {
292
+ const out = {};
293
+ for (const k of Object.keys(a)) {
294
+ const av = a[k];
295
+ const bv = b[k];
296
+ out[k] = typeof av === "number" ? av + (bv - av) * t : (0, _rng.lerpColor)(av, bv, t);
297
+ }
298
+ return out;
299
+ }
300
+ function paletteAt(minutes) {
301
+ for (let i = 0; i < KEYFRAMES.length - 1; i++) {
302
+ const [t0, p0] = KEYFRAMES[i];
303
+ const [t1, p1] = KEYFRAMES[i + 1];
304
+ if (minutes >= t0 && minutes <= t1) {
305
+ if (p0 === p1 || t1 === t0) return p0;
306
+ return lerpPalette(p0, p1, (minutes - t0) / (t1 - t0));
307
+ }
308
+ }
309
+ return NIGHT;
310
+ }
311
+
312
+ // ============================================================================
313
+ // The workday remap — THE mapping LIVE mode runs on
314
+ // ============================================================================
315
+
316
+ /**
317
+ * Real minutes → scene minutes, compressing the planet's day onto a working
318
+ * human's: dawn as you sit down (~8:00), sunrise ~9:00, noon at lunch, golden
319
+ * hour ~16:30, sunset as the workday ends (~17:30), night after ~20:00. A 9–5
320
+ * session sees the whole cycle; the honest 1:1 mapping (auditioned against
321
+ * this via two play buttons, and cut) held featureless DAY for all of it —
322
+ * the pretty parts fired while nobody was at their desk.
323
+ *
324
+ * The scrub slider and the ▶ movie also run through this (the slider thumb is
325
+ * a WALL clock; the scene is always the remap of it).
326
+ *
327
+ * Anchors are [real, scene] minute pairs, strictly increasing, folded across
328
+ * midnight so the night segment (20:00 → 7:30 next day) is one linear piece.
329
+ */
330
+ const WORKDAY_ANCHORS = [[450, 330],
331
+ // 07:30 → 05:30 pre-dawn
332
+ [540, 420],
333
+ // 09:00 → 07:00 just after sunrise
334
+ [750, 720],
335
+ // 12:30 → noon
336
+ [990, 1080],
337
+ // 16:30 → 18:00 golden hour
338
+ [1050, 1130],
339
+ // 17:30 → 18:50 sunset
340
+ [1140, 1180],
341
+ // 19:00 → 19:40 dusk
342
+ [1200, 1260],
343
+ // 20:00 → 21:00 night
344
+ [1890, 1770] // 07:30 next day → 05:30 next day (the night piece, wrapped)
345
+ ];
346
+ function workdaySceneMinutes(realMinutes) {
347
+ let m = realMinutes;
348
+ if (m < WORKDAY_ANCHORS[0][0]) m += 1440;
349
+ for (let i = 0; i < WORKDAY_ANCHORS.length - 1; i++) {
350
+ const [r0, s0] = WORKDAY_ANCHORS[i];
351
+ const [r1, s1] = WORKDAY_ANCHORS[i + 1];
352
+ if (m >= r0 && m <= r1) {
353
+ return (s0 + (m - r0) / (r1 - r0) * (s1 - s0)) % 1440;
354
+ }
355
+ }
356
+ return realMinutes;
357
+ }
358
+
359
+ // ============================================================================
360
+ // The clock — one small render per minute, AppState-gated like the loops
361
+ // ============================================================================
362
+
363
+ function nowMinutes() {
364
+ const d = new Date();
365
+ return d.getHours() * 60 + d.getMinutes();
366
+ }
367
+ function useMinuteClock(enabled) {
368
+ const [minutes, setMinutes] = (0, _react.useState)(nowMinutes);
369
+ (0, _react.useEffect)(() => {
370
+ if (!enabled) return;
371
+ let timeout = null;
372
+ let interval = null;
373
+ const stop = () => {
374
+ if (timeout) clearTimeout(timeout);
375
+ if (interval) clearInterval(interval);
376
+ timeout = interval = null;
377
+ };
378
+ // Snap to now, then align the tick to the minute boundary.
379
+ const start = () => {
380
+ setMinutes(nowMinutes());
381
+ const d = new Date();
382
+ const untilNext = 60_000 - (d.getSeconds() * 1000 + d.getMilliseconds()) + 50;
383
+ timeout = setTimeout(() => {
384
+ setMinutes(nowMinutes());
385
+ interval = setInterval(() => setMinutes(nowMinutes()), 60_000);
386
+ }, untilNext);
387
+ };
388
+ start();
389
+ const sub = _reactNative.AppState.addEventListener("change", state => {
390
+ stop();
391
+ // Re-snapping on foreground means an hour in the background comes back
392
+ // to the RIGHT sky, not a stale one.
393
+ if (state === "active") start();
394
+ });
395
+ return () => {
396
+ stop();
397
+ sub.remove();
398
+ };
399
+ }, [enabled]);
400
+ return minutes;
401
+ }
402
+
403
+ // ============================================================================
404
+ // Shared geometry (same specs as the fixed siblings)
405
+ // ============================================================================
406
+
407
+ /** Stride 3: x, y, size — Moonlight's star field. */
408
+ const SKY_STAR_COUNT = 22;
409
+ const SKY_STARS = (0, _rng.scatter)(0x52b7, SKY_STAR_COUNT * 3);
410
+ const CLOUDS = [{
411
+ at: [0.16, 0.3],
412
+ puffs: [[-62, 4, 150, 20], [-44, -8, 62, 24], [-4, -14, 74, 30], [38, -4, 54, 20]],
413
+ bodyAlpha: 1
414
+ }, {
415
+ at: [0.84, 0.37],
416
+ puffs: [[-55, 3, 130, 18], [-30, -8, 56, 22], [8, -13, 64, 27], [42, -3, 44, 17]],
417
+ bodyAlpha: 1
418
+ }, {
419
+ at: [0.46, 0.425],
420
+ puffs: [[-40, 2, 96, 13], [-12, -6, 48, 16], [22, -2, 38, 12]],
421
+ bodyAlpha: 0.95
422
+ }];
423
+
424
+ /** The lit rim tilts toward wherever the light currently is. */
425
+ function rimFor(cloudX, lightXFrac) {
426
+ if (lightXFrac === null) return [0, -3.5];
427
+ const dx = Math.max(-4, Math.min(4, (lightXFrac - cloudX) * 10));
428
+ return [dx, -3.5];
429
+ }
430
+ function cloudPuffs(cloud, cx, cy, rim, rimColor, bodyColor, key) {
431
+ const parts = [];
432
+ for (let i = 0; i < cloud.puffs.length; i++) {
433
+ const [dx, dy, w, h] = cloud.puffs[i];
434
+ parts.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
435
+ style: {
436
+ position: "absolute",
437
+ left: cx + dx + rim[0] - w / 2,
438
+ top: cy + dy + rim[1] - h / 2,
439
+ width: w,
440
+ height: h,
441
+ borderRadius: h / 2,
442
+ backgroundColor: rimColor
443
+ }
444
+ }, `${key}-r${i}`));
445
+ }
446
+ for (let i = 0; i < cloud.puffs.length; i++) {
447
+ const [dx, dy, w, h] = cloud.puffs[i];
448
+ parts.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
449
+ style: {
450
+ position: "absolute",
451
+ left: cx + dx - w / 2,
452
+ top: cy + dy - h / 2,
453
+ width: w,
454
+ height: h,
455
+ borderRadius: h / 2,
456
+ backgroundColor: bodyColor
457
+ }
458
+ }, `${key}-b${i}`));
459
+ }
460
+ return parts;
461
+ }
462
+
463
+ /** [xFrac, yFrac (of the horizon), wing length]. */
464
+ const GULLS = [[0.2, 0.42, 6], [0.3, 0.28, 5], [0.42, 0.52, 4]];
465
+
466
+ /** [xFrac, base width, height, near?] — near peaks take peakNear. */
467
+ const PEAKS = [[0.03, 120, 24, 1], [0.11, 96, 36, 0], [0.2, 140, 24, 1], [0.29, 76, 15, 0], [0.9, 96, 18, 1], [0.98, 130, 27, 0]];
468
+ const SAILS = [[0.07, 6], [0.14, 4.5], [0.23, 5.5]];
469
+ const SHORE_LIGHTS = [0.06, 0.13, 0.18, 0.26];
470
+
471
+ // ============================================================================
472
+ // The glade — glitter column under whichever body is up
473
+ // ============================================================================
474
+
475
+ /** Stride 4: depth, x jitter, width jitter, alpha jitter. */
476
+ const GLADE_LAYERS = [{
477
+ count: 44,
478
+ seed: 0x3aa1
479
+ }, {
480
+ count: 34,
481
+ seed: 0x77c2
482
+ }, {
483
+ count: 26,
484
+ seed: 0xb4e9
485
+ }];
486
+ const GLADE_TABLES = GLADE_LAYERS.map(l => (0, _rng.scatter)(l.seed, l.count * 4));
487
+ const ROW_STEP = 7;
488
+ const GlitterLayer = /*#__PURE__*/(0, _react.memo)(function GlitterLayer({
489
+ layerIndex,
490
+ drive,
491
+ lightXFrac,
492
+ color,
493
+ alphaScale,
494
+ width,
495
+ height,
496
+ animated
497
+ }) {
498
+ const sway = (0, _primitives.usePulse)(drive === "swayA" ? 9000 : 12500, animated && drive !== "breathe");
499
+ const breathe = (0, _primitives.usePulse)(6200, animated && drive === "breathe");
500
+ const lightX = width * lightXFrac;
501
+ const horizonY = height * HORIZON;
502
+ const layer = GLADE_LAYERS[layerIndex];
503
+ const table = GLADE_TABLES[layerIndex];
504
+ const blocks = [];
505
+ for (let i = 0; i < layer.count; i++) {
506
+ const d = table[i * 4];
507
+ const jx = table[i * 4 + 1];
508
+ const jw = table[i * 4 + 2];
509
+ const ja = table[i * 4 + 3];
510
+ const y = horizonY + 4 + d * (height - horizonY) * 0.94;
511
+ const halfSpread = width * (0.03 + d * 0.16);
512
+ const x = lightX + (jx - 0.5) * 2 * halfSpread;
513
+ const blockW = 6 + d * 26 + jw * 10;
514
+ const blockH = d < 0.3 ? 1 : d < 0.62 ? 2 : 3;
515
+ const arc = Math.sin(Math.PI * (0.12 + d * 0.82));
516
+ const centered = Math.max(0.25, 1 - Math.abs(jx - 0.5) * 1.4);
517
+ const alpha = (0.16 + arc * 0.48) * centered * (0.75 + ja * 0.25) * alphaScale;
518
+ if (alpha < 0.02) continue;
519
+ blocks.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
520
+ style: {
521
+ position: "absolute",
522
+ left: x - blockW / 2,
523
+ top: Math.round(y / ROW_STEP) * ROW_STEP,
524
+ width: blockW,
525
+ height: blockH,
526
+ borderRadius: 0.5,
527
+ backgroundColor: (0, _rng.withAlpha)(color, Math.min(1, alpha))
528
+ }
529
+ }, i));
530
+ }
531
+ const style = drive === "breathe" ? {
532
+ opacity: breathe.interpolate({
533
+ inputRange: [0, 1],
534
+ outputRange: [0.55, 1]
535
+ })
536
+ } : {
537
+ transform: [{
538
+ translateX: sway.interpolate({
539
+ inputRange: [0, 1],
540
+ outputRange: drive === "swayA" ? [-7, 7] : [6, -6]
541
+ })
542
+ }]
543
+ };
544
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
545
+ style: [_absoluteFill.absoluteFill, style],
546
+ pointerEvents: "none",
547
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RasterLayer, {
548
+ style: _absoluteFill.absoluteFill,
549
+ children: blocks
550
+ })
551
+ });
552
+ });
553
+
554
+ // ============================================================================
555
+ // The scene
556
+ // ============================================================================
557
+
558
+ /** Progress 0..1 → position on the east→west arc. */
559
+ function arcPos(progress, width, horizonY) {
560
+ return {
561
+ xFrac: 0.08 + 0.84 * progress,
562
+ x: width * (0.08 + 0.84 * progress),
563
+ y: horizonY - Math.sin(Math.PI * progress) * horizonY * 0.75,
564
+ altitude: Math.sin(Math.PI * progress)
565
+ };
566
+ }
567
+ const LiveSkyTunable = exports.LiveSkyTunable = /*#__PURE__*/(0, _react.memo)(function LiveSkyTunable({
568
+ clockMinutes,
569
+ ...props
570
+ }) {
571
+ const {
572
+ width,
573
+ height,
574
+ animated
575
+ } = props;
576
+ const live = useMinuteClock(clockMinutes === undefined);
577
+ const minutes = workdaySceneMinutes(clockMinutes ?? live);
578
+ const p = paletteAt(minutes);
579
+ const horizonY = height * HORIZON;
580
+ // Light geometry is sized from the WINDOW so resizing the modal never
581
+ // swells or shrinks the blooms — only positions follow the modal.
582
+ const refW = _reactNative.Dimensions.get("window").width;
583
+
584
+ // Exactly one body is in its window at any minute (the windows adjoin at
585
+ // 06:30 and 19:00, where both sit half-set on opposite horizons).
586
+ const sunP = (minutes - SUN_RISE) / (SUN_SET - SUN_RISE);
587
+ const moonP = (minutes - SUN_SET + 1440) % 1440 / MOON_SPAN;
588
+ const sunUp = sunP >= 0 && sunP <= 1;
589
+ const moonUp = moonP >= 0 && moonP <= 1;
590
+ const sun = sunUp ? arcPos(sunP, width, horizonY) : null;
591
+ const moon = moonUp ? arcPos(moonP, width, horizonY) : null;
592
+ // The dominant body carries the bloom, the glade column and the cloud rims.
593
+ const dominant = sun && moon ? sun.altitude >= moon.altitude ? sun : moon : sun ?? moon;
594
+ const twinkle = (0, _primitives.usePulse)(7400, animated && p.starAlpha > 0.01);
595
+ const cloudDrift = (0, _primitives.usePulse)(26000, animated);
596
+ const twinkleOpacity = twinkle.interpolate({
597
+ inputRange: [0, 1],
598
+ outputRange: [0.7, 1]
599
+ });
600
+ const cloudX = cloudDrift.interpolate({
601
+ inputRange: [0, 1],
602
+ outputRange: [-8, 8]
603
+ });
604
+ const stars = [];
605
+ if (p.starAlpha > 0.01) {
606
+ for (let i = 0; i < SKY_STAR_COUNT; i++) {
607
+ const size = SKY_STARS[i * 3 + 2];
608
+ const dia = 1 + size * 1.3;
609
+ const x = SKY_STARS[i * 3] * width;
610
+ const y = SKY_STARS[i * 3 + 1] * horizonY * 0.92;
611
+ // Keep the sky clear around the current body so its bloom stays clean.
612
+ if (dominant && Math.hypot(x - dominant.x, y - dominant.y) < refW * 0.18) continue;
613
+ stars.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
614
+ style: {
615
+ position: "absolute",
616
+ left: x - dia / 2,
617
+ top: y - dia / 2,
618
+ width: dia,
619
+ height: dia,
620
+ borderRadius: dia / 2,
621
+ backgroundColor: (0, _rng.withAlpha)("#C9DAF0", (0.3 + size * 0.4) * p.starAlpha)
622
+ }
623
+ }, i));
624
+ }
625
+ }
626
+ const rimColor = (0, _rng.withAlpha)(p.cloudRim, p.cloudRimAlpha);
627
+ const clouds = CLOUDS.flatMap((cloud, i) => cloudPuffs(cloud, width * cloud.at[0], height * cloud.at[1], rimFor(cloud.at[0], dominant ? dominant.xFrac : null), rimColor, (0, _rng.withAlpha)(p.cloudBody, cloud.bodyAlpha * p.cloudBodyAlpha), `c${i}`));
628
+ const gulls = p.dayness > 0.03 ? GULLS.flatMap(([xf, yf, len], i) => {
629
+ const wing = {
630
+ position: "absolute",
631
+ top: horizonY * yf,
632
+ width: len,
633
+ height: 1.4,
634
+ borderRadius: 0.7,
635
+ backgroundColor: (0, _rng.withAlpha)("#123049", 0.75 * p.dayness)
636
+ };
637
+ const x = width * xf;
638
+ return [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
639
+ style: [wing, {
640
+ left: x - len,
641
+ transform: [{
642
+ rotate: "18deg"
643
+ }]
644
+ }]
645
+ }, `g${i}l`), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
646
+ style: [wing, {
647
+ left: x,
648
+ transform: [{
649
+ rotate: "-18deg"
650
+ }]
651
+ }]
652
+ }, `g${i}r`)];
653
+ }) : [];
654
+ const mountains = PEAKS.map(([xf, wBase, h, near], i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
655
+ style: {
656
+ position: "absolute",
657
+ left: width * xf - wBase / 2,
658
+ top: horizonY - h,
659
+ width: 0,
660
+ height: 0,
661
+ borderLeftWidth: wBase / 2,
662
+ borderRightWidth: wBase / 2,
663
+ borderBottomWidth: h,
664
+ borderLeftColor: "transparent",
665
+ borderRightColor: "transparent",
666
+ borderBottomColor: near ? p.peakNear : p.peakFar
667
+ }
668
+ }, `m${i}`));
669
+ const sails = p.dayness > 0.03 ? SAILS.map(([xf, h], i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
670
+ style: {
671
+ position: "absolute",
672
+ left: width * xf,
673
+ top: horizonY - h,
674
+ width: 0,
675
+ height: 0,
676
+ borderLeftWidth: 2,
677
+ borderRightWidth: 2,
678
+ borderBottomWidth: h,
679
+ borderLeftColor: "transparent",
680
+ borderRightColor: "transparent",
681
+ borderBottomColor: (0, _rng.withAlpha)("#F2F8FC", 0.85 * p.dayness)
682
+ }
683
+ }, `s${i}`)) : [];
684
+ const nightness = 1 - p.dayness;
685
+ const lights = nightness > 0.03 ? SHORE_LIGHTS.map((xf, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
686
+ style: {
687
+ position: "absolute",
688
+ left: width * xf,
689
+ top: horizonY - 3,
690
+ width: 2,
691
+ height: 1.5,
692
+ backgroundColor: (0, _rng.withAlpha)("#E8D9A8", (0.55 + i % 2 * 0.2) * nightness)
693
+ }
694
+ }, `sl${i}`)) : [];
695
+
696
+ /** A body's disc (+ craters for the moon), drawn UNDER the sea rect so the
697
+ * horizon clips a rising or setting body for free. */
698
+ const disc = (pos, isMoon, key) => {
699
+ const dia = isMoon ? MOON_DIA : SUN_DIA;
700
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
701
+ style: {
702
+ position: "absolute",
703
+ left: pos.x - dia / 2,
704
+ top: pos.y - dia / 2,
705
+ width: dia,
706
+ height: dia,
707
+ borderRadius: dia / 2,
708
+ // Fully opaque: any translucency lets the app behind the modal
709
+ // bleed through the brightest surface in the scene.
710
+ backgroundColor: isMoon ? "#EDF3FB" : p.disc,
711
+ overflow: "hidden"
712
+ },
713
+ children: isMoon ? CRATERS.map(([dx, dy, frac], i) => {
714
+ const d = dia * frac;
715
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
716
+ style: {
717
+ position: "absolute",
718
+ left: dia / 2 + dx * dia - d / 2,
719
+ top: dia / 2 + dy * dia - d / 2,
720
+ width: d,
721
+ height: d,
722
+ borderRadius: d / 2,
723
+ backgroundColor: (0, _rng.withAlpha)("#9DB2C8", 0.32)
724
+ }
725
+ }, i);
726
+ }) : null
727
+ }, key);
728
+ };
729
+ return (
730
+ /*#__PURE__*/
731
+ // Clips: the blooms are window-sized, so a small modal crops the scene.
732
+ (0, _jsxRuntime.jsxs)(_reactNative.View, {
733
+ style: [_absoluteFill.absoluteFill, {
734
+ overflow: "hidden"
735
+ }],
736
+ pointerEvents: "none",
737
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Base, {
738
+ color: p.skyTop
739
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
740
+ style: {
741
+ position: "absolute",
742
+ left: 0,
743
+ right: 0,
744
+ top: 0,
745
+ height: horizonY
746
+ },
747
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
748
+ color: p.skyHorizon,
749
+ from: 0,
750
+ to: p.skyHorizonAlpha,
751
+ direction: "down",
752
+ bands: 20,
753
+ flattenBase: p.skyTop
754
+ })
755
+ }), p.starAlpha > 0.01 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
756
+ style: [_absoluteFill.absoluteFill, {
757
+ opacity: twinkleOpacity
758
+ }],
759
+ pointerEvents: "none",
760
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RasterLayer, {
761
+ style: _absoluteFill.absoluteFill,
762
+ children: stars
763
+ })
764
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
765
+ style: [_absoluteFill.absoluteFill, {
766
+ transform: [{
767
+ translateX: cloudX
768
+ }]
769
+ }],
770
+ pointerEvents: "none",
771
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.RasterLayer, {
772
+ style: _absoluteFill.absoluteFill,
773
+ children: [clouds, gulls]
774
+ })
775
+ }), dominant ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
776
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RadialGlow, {
777
+ size: refW * 0.46,
778
+ color: p.bloom,
779
+ alpha: p.bloomAlpha,
780
+ rings: 20,
781
+ falloff: 1.9,
782
+ style: {
783
+ position: "absolute",
784
+ left: dominant.x - refW * 0.23,
785
+ top: dominant.y - refW * 0.23
786
+ }
787
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.RadialGlow, {
788
+ size: 118,
789
+ color: p.glow,
790
+ alpha: p.glowAlpha,
791
+ rings: 10,
792
+ falloff: 1.6,
793
+ style: {
794
+ position: "absolute",
795
+ left: dominant.x - 59,
796
+ top: dominant.y - 59
797
+ }
798
+ })]
799
+ }) : null, sun ? disc(sun, false, "sun") : null, moon ? disc(moon, true, "moon") : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
800
+ style: {
801
+ position: "absolute",
802
+ left: 0,
803
+ right: 0,
804
+ top: horizonY,
805
+ bottom: 0,
806
+ backgroundColor: p.seaColor
807
+ }
808
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
809
+ style: {
810
+ position: "absolute",
811
+ left: 0,
812
+ right: 0,
813
+ top: horizonY - 76,
814
+ height: 76
815
+ },
816
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
817
+ color: p.hazeBand,
818
+ from: 0,
819
+ to: p.hazeAlpha,
820
+ direction: "down",
821
+ bands: 12
822
+ })
823
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.RasterLayer, {
824
+ style: _absoluteFill.absoluteFill,
825
+ children: [mountains, sails, lights]
826
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
827
+ style: {
828
+ position: "absolute",
829
+ left: 0,
830
+ right: 0,
831
+ top: horizonY,
832
+ height: 1,
833
+ backgroundColor: (0, _rng.withAlpha)(p.horizonLine, p.horizonLineAlpha)
834
+ }
835
+ }), dominant ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
836
+ style: {
837
+ position: "absolute",
838
+ left: dominant.x - width * 0.16,
839
+ top: horizonY,
840
+ width: width * 0.32,
841
+ height: 1,
842
+ backgroundColor: (0, _rng.withAlpha)(p.underLine, p.underLineAlpha)
843
+ }
844
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
845
+ style: {
846
+ position: "absolute",
847
+ left: 0,
848
+ right: 0,
849
+ top: horizonY,
850
+ bottom: 0
851
+ },
852
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.LinearFade, {
853
+ color: p.seaFade,
854
+ from: 0,
855
+ to: p.seaFadeAlpha,
856
+ direction: "down",
857
+ bands: 12
858
+ })
859
+ }), dominant ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
860
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GlitterLayer, {
861
+ layerIndex: 0,
862
+ drive: "swayA",
863
+ lightXFrac: dominant.xFrac,
864
+ color: p.glitter,
865
+ alphaScale: p.glitterAlpha,
866
+ ...props
867
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlitterLayer, {
868
+ layerIndex: 1,
869
+ drive: "swayB",
870
+ lightXFrac: dominant.xFrac,
871
+ color: p.glitter,
872
+ alphaScale: p.glitterAlpha,
873
+ ...props
874
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(GlitterLayer, {
875
+ layerIndex: 2,
876
+ drive: "breathe",
877
+ lightXFrac: dominant.xFrac,
878
+ color: p.glitter,
879
+ alphaScale: p.glitterAlpha,
880
+ ...props
881
+ })]
882
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Vignette, {
883
+ color: p.vignette,
884
+ alpha: 0.4,
885
+ spread: 0.34
886
+ })]
887
+ })
888
+ );
889
+ });
890
+ const LiveSky = exports.LiveSky = /*#__PURE__*/(0, _react.memo)(function LiveSky(props) {
891
+ // A non-null scrub (the switcher's slider) freezes the scene at that minute
892
+ // and stops the tick; LIVE clears it.
893
+ const scrub = (0, _skyClock.useSkyScrub)();
894
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LiveSkyTunable, {
895
+ ...props,
896
+ clockMinutes: scrub ?? undefined
897
+ });
898
+ });