@servantcdh/ez-planet-cosmos 0.2.0 → 0.2.1
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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js +492 -423
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as p, jsx as t, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Handle as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { Canvas as
|
|
6
|
-
import { Points as
|
|
7
|
-
function
|
|
8
|
-
const { label:
|
|
1
|
+
import { jsxs as p, jsx as t, Fragment as Bt } from "react/jsx-runtime";
|
|
2
|
+
import { memo as ot, useRef as K, useMemo as R, useState as _, useCallback as v, useEffect as at } from "react";
|
|
3
|
+
import { Handle as tt, Position as et, getBezierPath as zt, BaseEdge as it, ReactFlowProvider as $t, useReactFlow as Lt, useNodesState as Mt, useEdgesState as Ft, ReactFlow as Dt, Background as Tt, BackgroundVariant as Wt, Controls as At, MiniMap as Rt } from "@xyflow/react";
|
|
4
|
+
import { motion as w, AnimatePresence as E } from "framer-motion";
|
|
5
|
+
import { Canvas as Et, useFrame as nt } from "@react-three/fiber";
|
|
6
|
+
import { Points as rt, PointMaterial as lt } from "@react-three/drei";
|
|
7
|
+
function Ot({ data: e }) {
|
|
8
|
+
const { label: h, subtitle: u, color: l, status: o, isSelected: n } = e, c = n ? 35 : o === "running" ? 30 : o === "error" ? 20 : 15, d = o === "running" ? [1, 1.08, 1] : [1, 1.02, 1], y = n ? 110 : 100;
|
|
9
9
|
return /* @__PURE__ */ p("div", { style: { position: "relative", cursor: "pointer" }, children: [
|
|
10
10
|
/* @__PURE__ */ t(
|
|
11
|
-
|
|
11
|
+
tt,
|
|
12
12
|
{
|
|
13
13
|
type: "target",
|
|
14
|
-
position:
|
|
14
|
+
position: et.Left,
|
|
15
15
|
style: { background: l, border: "none", width: 8, height: 8, opacity: 0.6 }
|
|
16
16
|
}
|
|
17
17
|
),
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
n && /* @__PURE__ */ t(
|
|
19
|
+
w.div,
|
|
20
20
|
{
|
|
21
21
|
initial: { scale: 0.8, opacity: 0 },
|
|
22
22
|
animate: { scale: 1, opacity: 1, rotate: 360 },
|
|
@@ -28,8 +28,8 @@ function Wt({ data: e }) {
|
|
|
28
28
|
position: "absolute",
|
|
29
29
|
top: -12,
|
|
30
30
|
left: -12,
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
31
|
+
width: y + 24,
|
|
32
|
+
height: y + 24,
|
|
33
33
|
borderRadius: "50%",
|
|
34
34
|
border: `1.5px dashed ${l}88`,
|
|
35
35
|
pointerEvents: "none"
|
|
@@ -37,24 +37,24 @@ function Wt({ data: e }) {
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ p(
|
|
40
|
-
|
|
40
|
+
w.div,
|
|
41
41
|
{
|
|
42
|
-
animate: { scale:
|
|
42
|
+
animate: { scale: d },
|
|
43
43
|
transition: { duration: 3, repeat: 1 / 0, ease: "easeInOut" },
|
|
44
44
|
whileHover: {
|
|
45
|
-
boxShadow: `0 0 ${
|
|
45
|
+
boxShadow: `0 0 ${c + 15}px ${l}aa, inset 0 0 25px rgba(255,255,255,0.15)`
|
|
46
46
|
},
|
|
47
47
|
style: {
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
48
|
+
width: y,
|
|
49
|
+
height: y,
|
|
50
50
|
borderRadius: "50%",
|
|
51
51
|
background: `radial-gradient(circle at 35% 35%, ${l}cc, ${l}44)`,
|
|
52
|
-
boxShadow: `0 0 ${
|
|
52
|
+
boxShadow: `0 0 ${c}px ${l}88, inset 0 0 20px rgba(255,255,255,0.1)`,
|
|
53
53
|
display: "flex",
|
|
54
54
|
flexDirection: "column",
|
|
55
55
|
alignItems: "center",
|
|
56
56
|
justifyContent: "center",
|
|
57
|
-
border: `2px solid ${
|
|
57
|
+
border: `2px solid ${n ? `${l}aa` : `${l}66`}`,
|
|
58
58
|
transition: "width 0.3s, height 0.3s, border-color 0.3s"
|
|
59
59
|
},
|
|
60
60
|
children: [
|
|
@@ -68,15 +68,15 @@ function Wt({ data: e }) {
|
|
|
68
68
|
letterSpacing: 1,
|
|
69
69
|
textShadow: "0 1px 4px rgba(0,0,0,0.8)"
|
|
70
70
|
},
|
|
71
|
-
children:
|
|
71
|
+
children: h
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
/* @__PURE__ */ t("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: 10, marginTop: 2 }, children:
|
|
74
|
+
/* @__PURE__ */ t("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: 10, marginTop: 2 }, children: u })
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
o !== "idle" && o !== "disabled" && /* @__PURE__ */ t(
|
|
79
|
+
w.div,
|
|
80
80
|
{
|
|
81
81
|
animate: { opacity: [0.5, 1, 0.5] },
|
|
82
82
|
transition: { duration: 1.5, repeat: 1 / 0 },
|
|
@@ -87,13 +87,13 @@ function Wt({ data: e }) {
|
|
|
87
87
|
width: 14,
|
|
88
88
|
height: 14,
|
|
89
89
|
borderRadius: "50%",
|
|
90
|
-
background:
|
|
90
|
+
background: o === "running" ? "#2ecc71" : o === "error" ? "#e74c3c" : "#27ae60",
|
|
91
91
|
border: "2px solid rgba(0,0,0,0.4)"
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
n && /* @__PURE__ */ t(
|
|
96
|
+
w.div,
|
|
97
97
|
{
|
|
98
98
|
initial: { opacity: 0, y: 8 },
|
|
99
99
|
animate: { opacity: 0.5, y: 0 },
|
|
@@ -112,65 +112,65 @@ function Wt({ data: e }) {
|
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
114
|
/* @__PURE__ */ t(
|
|
115
|
-
|
|
115
|
+
tt,
|
|
116
116
|
{
|
|
117
117
|
type: "source",
|
|
118
|
-
position:
|
|
118
|
+
position: et.Right,
|
|
119
119
|
style: { background: l, border: "none", width: 8, height: 8, opacity: 0.6 }
|
|
120
120
|
}
|
|
121
121
|
)
|
|
122
122
|
] });
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
function
|
|
124
|
+
const _t = ot(Ot);
|
|
125
|
+
function Gt({
|
|
126
126
|
id: e,
|
|
127
|
-
sourceX:
|
|
128
|
-
sourceY:
|
|
127
|
+
sourceX: h,
|
|
128
|
+
sourceY: u,
|
|
129
129
|
targetX: l,
|
|
130
|
-
targetY:
|
|
131
|
-
sourcePosition:
|
|
132
|
-
targetPosition:
|
|
133
|
-
data:
|
|
134
|
-
style:
|
|
130
|
+
targetY: o,
|
|
131
|
+
sourcePosition: n,
|
|
132
|
+
targetPosition: c,
|
|
133
|
+
data: d,
|
|
134
|
+
style: y = {}
|
|
135
135
|
}) {
|
|
136
|
-
const [
|
|
137
|
-
sourceX:
|
|
138
|
-
sourceY:
|
|
139
|
-
sourcePosition:
|
|
136
|
+
const [m] = zt({
|
|
137
|
+
sourceX: h,
|
|
138
|
+
sourceY: u,
|
|
139
|
+
sourcePosition: n,
|
|
140
140
|
targetX: l,
|
|
141
|
-
targetY:
|
|
142
|
-
targetPosition:
|
|
143
|
-
}),
|
|
144
|
-
return /* @__PURE__ */ p(
|
|
141
|
+
targetY: o,
|
|
142
|
+
targetPosition: c
|
|
143
|
+
}), b = (d == null ? void 0 : d.isActive) ?? !1, C = (d == null ? void 0 : d.isDimmed) ?? !1, M = b ? "rgba(46, 204, 113, 0.25)" : "rgba(100, 149, 237, 0.15)", $ = b ? "rgba(46, 204, 113, 0.7)" : C ? "rgba(100, 149, 237, 0.12)" : "rgba(100, 149, 237, 0.4)", r = b ? 3 : 2, I = b ? "12 4" : "8 4";
|
|
144
|
+
return /* @__PURE__ */ p(Bt, { children: [
|
|
145
145
|
/* @__PURE__ */ t(
|
|
146
|
-
|
|
146
|
+
it,
|
|
147
147
|
{
|
|
148
148
|
id: `${e}-glow`,
|
|
149
|
-
path:
|
|
149
|
+
path: m,
|
|
150
150
|
style: {
|
|
151
|
-
stroke:
|
|
152
|
-
strokeWidth:
|
|
153
|
-
filter: `blur(${
|
|
151
|
+
stroke: M,
|
|
152
|
+
strokeWidth: b ? 10 : 6,
|
|
153
|
+
filter: `blur(${b ? 5 : 3}px)`,
|
|
154
154
|
transition: "stroke 0.6s, stroke-width 0.6s",
|
|
155
|
-
...
|
|
155
|
+
...y
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
159
|
/* @__PURE__ */ t(
|
|
160
|
-
|
|
160
|
+
it,
|
|
161
161
|
{
|
|
162
162
|
id: e,
|
|
163
|
-
path:
|
|
163
|
+
path: m,
|
|
164
164
|
style: {
|
|
165
|
-
stroke:
|
|
166
|
-
strokeWidth:
|
|
167
|
-
strokeDasharray:
|
|
165
|
+
stroke: $,
|
|
166
|
+
strokeWidth: r,
|
|
167
|
+
strokeDasharray: I,
|
|
168
168
|
transition: "stroke 0.6s, stroke-width 0.6s",
|
|
169
|
-
...
|
|
169
|
+
...y
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
),
|
|
173
|
-
(
|
|
173
|
+
(d == null ? void 0 : d.label) && /* @__PURE__ */ t("text", { children: /* @__PURE__ */ t(
|
|
174
174
|
"textPath",
|
|
175
175
|
{
|
|
176
176
|
href: `#${e}`,
|
|
@@ -181,23 +181,23 @@ function Rt({
|
|
|
181
181
|
fill: "rgba(255, 255, 255, 0.4)",
|
|
182
182
|
fontFamily: "monospace"
|
|
183
183
|
},
|
|
184
|
-
children:
|
|
184
|
+
children: d.label
|
|
185
185
|
}
|
|
186
186
|
) })
|
|
187
187
|
] });
|
|
188
188
|
}
|
|
189
|
-
const
|
|
190
|
-
function
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
for (let
|
|
194
|
-
|
|
195
|
-
return
|
|
196
|
-
}, [
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
}), /* @__PURE__ */ t(
|
|
200
|
-
|
|
189
|
+
const Ht = ot(Gt);
|
|
190
|
+
function Jt({ config: e }) {
|
|
191
|
+
const h = K(null), u = e.starCount ?? 2e3, l = e.rotationSpeed ?? 0.02, o = R(() => {
|
|
192
|
+
const n = new Float32Array(u * 3);
|
|
193
|
+
for (let c = 0; c < u; c++)
|
|
194
|
+
n[c * 3] = (Math.random() - 0.5) * 50, n[c * 3 + 1] = (Math.random() - 0.5) * 50, n[c * 3 + 2] = (Math.random() - 0.5) * 50;
|
|
195
|
+
return n;
|
|
196
|
+
}, [u]);
|
|
197
|
+
return nt((n, c) => {
|
|
198
|
+
h.current && (h.current.rotation.x -= c * l, h.current.rotation.y -= c * (l * 0.5));
|
|
199
|
+
}), /* @__PURE__ */ t(rt, { ref: h, positions: o, stride: 3, frustumCulled: !1, children: /* @__PURE__ */ t(
|
|
200
|
+
lt,
|
|
201
201
|
{
|
|
202
202
|
transparent: !0,
|
|
203
203
|
color: e.starColor ?? "#6495ed",
|
|
@@ -208,19 +208,19 @@ function Et({ config: e }) {
|
|
|
208
208
|
}
|
|
209
209
|
) });
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
for (let
|
|
215
|
-
const
|
|
216
|
-
n
|
|
211
|
+
function Kt({ config: e }) {
|
|
212
|
+
const h = K(null), u = e.nebulaCount ?? 500, l = R(() => {
|
|
213
|
+
const o = new Float32Array(u * 3);
|
|
214
|
+
for (let n = 0; n < u; n++) {
|
|
215
|
+
const c = Math.random() * Math.PI * 2, d = Math.random() * 8 + 5;
|
|
216
|
+
o[n * 3] = Math.cos(c) * d + (Math.random() - 0.5) * 3, o[n * 3 + 1] = (Math.random() - 0.5) * 4, o[n * 3 + 2] = Math.sin(c) * d + (Math.random() - 0.5) * 3 - 15;
|
|
217
217
|
}
|
|
218
|
-
return
|
|
219
|
-
}, [
|
|
220
|
-
return
|
|
221
|
-
|
|
222
|
-
}), /* @__PURE__ */ t(
|
|
223
|
-
|
|
218
|
+
return o;
|
|
219
|
+
}, [u]);
|
|
220
|
+
return nt((o, n) => {
|
|
221
|
+
h.current && (h.current.rotation.y += n * 5e-3);
|
|
222
|
+
}), /* @__PURE__ */ t(rt, { ref: h, positions: l, stride: 3, frustumCulled: !1, children: /* @__PURE__ */ t(
|
|
223
|
+
lt,
|
|
224
224
|
{
|
|
225
225
|
transparent: !0,
|
|
226
226
|
color: e.nebulaColor ?? "#9b59b6",
|
|
@@ -231,81 +231,80 @@ function Gt({ config: e }) {
|
|
|
231
231
|
}
|
|
232
232
|
) });
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Ut({ config: e = {}, background: h }) {
|
|
235
235
|
return /* @__PURE__ */ p(
|
|
236
|
-
|
|
236
|
+
Et,
|
|
237
237
|
{
|
|
238
238
|
camera: { position: [0, 0, 15], fov: 60 },
|
|
239
|
-
style: { background:
|
|
239
|
+
style: { background: h ?? "radial-gradient(ellipse at center, #0a0a2e 0%, #000008 100%)", pointerEvents: "none" },
|
|
240
240
|
events: () => ({ enabled: !1, priority: 0, compute: () => {
|
|
241
241
|
} }),
|
|
242
242
|
children: [
|
|
243
243
|
/* @__PURE__ */ t("ambientLight", { intensity: 0.1 }),
|
|
244
|
-
/* @__PURE__ */ t(
|
|
245
|
-
/* @__PURE__ */ t(
|
|
244
|
+
/* @__PURE__ */ t(Jt, { config: e }),
|
|
245
|
+
/* @__PURE__ */ t(Kt, { config: e })
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
root:
|
|
250
|
+
const Vt = "cc-root-eSR-1", jt = "cc-layerStarField-jOb4M", Xt = "cc-layerReactFlow-CeHI9", qt = "cc-sidePanel-PzU72", Zt = "cc-sidePanelHeader-cWPCq", Qt = "cc-sidePanelTitle-Yfh5N", Yt = "cc-sidePanelPlanetIcon-aRuLt", te = "cc-sidePanelName-TFFeE", ee = "cc-sidePanelSubtitle-8fp2Y", ie = "cc-sidePanelClose-Sdg-J", oe = "cc-sidePanelContent-QIEEQ", ae = "cc-sidePanelFooter-DVOHi", ne = "cc-satelliteList--vkXn", re = "cc-satelliteItem-JGdmG", le = "cc-satelliteIcon-arUe3", se = "cc-satelliteInfo-NaKLd", ce = "cc-satelliteName-zfOPN", de = "cc-satelliteSummary-XARVm", ue = "cc-enterButton-5Vnri", me = "cc-zoomTransition-Wcju8", pe = "cc-zoomPlanetLabel-3SJT2", he = "cc-planetInterior-GlnW1", ye = "cc-interiorBackButton-qJAiZ", be = "cc-interiorCenter-xdKsX", ge = "cc-interiorPlanet--XIzf", fe = "cc-interiorPlanetLabel-e7yxq", ve = "cc-interiorPlanetSubtitle-e2vON", Ne = "cc-orbitRing-hbvmD", Pe = "cc-satelliteNode-01STS", we = "cc-satelliteNodeIcon-Xq45f", xe = "cc-satelliteNodeLabel-LLOJ5", Ce = "cc-satelliteNodeBadge-HsUFp", Ie = "cc-tutorialOverlay-3GHo7", ke = "cc-tutorialWelcome-21KDP", Se = "cc-tutorialWelcomeTitle-7GwS9", Be = "cc-tutorialWelcomeDesc--pznv", ze = "cc-tutorialActions-szJ0-", $e = "cc-tutorialButton-wL9-p", Le = "cc-tutorialCard-LGIkK", Me = "cc-tutorialChip-bUoEb", Fe = "cc-tutorialCardTitle-r2Y1I", De = "cc-tutorialCardDesc-nOS-M", Te = "cc-tutorialProgress-wIAT9", We = "cc-tutorialProgressBar-PFBdE", Ae = "cc-tutorialCardFooter-bSdyM", Re = "cc-tutorialDots-8M0QU", Ee = "cc-tutorialDot-518t4", Oe = "cc-topBarSlot-EJGvM", i = {
|
|
251
|
+
root: Vt,
|
|
252
252
|
layerStarField: jt,
|
|
253
|
-
layerReactFlow:
|
|
254
|
-
sidePanel:
|
|
255
|
-
sidePanelHeader:
|
|
256
|
-
sidePanelTitle:
|
|
257
|
-
sidePanelPlanetIcon:
|
|
258
|
-
sidePanelName:
|
|
259
|
-
sidePanelSubtitle:
|
|
260
|
-
sidePanelClose:
|
|
261
|
-
sidePanelContent:
|
|
262
|
-
sidePanelFooter:
|
|
263
|
-
satelliteList:
|
|
264
|
-
satelliteItem:
|
|
265
|
-
satelliteIcon:
|
|
266
|
-
satelliteInfo:
|
|
267
|
-
satelliteName:
|
|
268
|
-
satelliteSummary:
|
|
269
|
-
enterButton:
|
|
270
|
-
zoomTransition:
|
|
271
|
-
zoomPlanetLabel:
|
|
272
|
-
planetInterior:
|
|
273
|
-
interiorBackButton:
|
|
274
|
-
interiorCenter:
|
|
275
|
-
interiorPlanet:
|
|
276
|
-
interiorPlanetLabel:
|
|
277
|
-
interiorPlanetSubtitle:
|
|
278
|
-
orbitRing:
|
|
279
|
-
satelliteNode:
|
|
280
|
-
satelliteNodeIcon:
|
|
281
|
-
satelliteNodeLabel:
|
|
282
|
-
satelliteNodeBadge:
|
|
283
|
-
tutorialOverlay:
|
|
284
|
-
tutorialWelcome:
|
|
253
|
+
layerReactFlow: Xt,
|
|
254
|
+
sidePanel: qt,
|
|
255
|
+
sidePanelHeader: Zt,
|
|
256
|
+
sidePanelTitle: Qt,
|
|
257
|
+
sidePanelPlanetIcon: Yt,
|
|
258
|
+
sidePanelName: te,
|
|
259
|
+
sidePanelSubtitle: ee,
|
|
260
|
+
sidePanelClose: ie,
|
|
261
|
+
sidePanelContent: oe,
|
|
262
|
+
sidePanelFooter: ae,
|
|
263
|
+
satelliteList: ne,
|
|
264
|
+
satelliteItem: re,
|
|
265
|
+
satelliteIcon: le,
|
|
266
|
+
satelliteInfo: se,
|
|
267
|
+
satelliteName: ce,
|
|
268
|
+
satelliteSummary: de,
|
|
269
|
+
enterButton: ue,
|
|
270
|
+
zoomTransition: me,
|
|
271
|
+
zoomPlanetLabel: pe,
|
|
272
|
+
planetInterior: he,
|
|
273
|
+
interiorBackButton: ye,
|
|
274
|
+
interiorCenter: be,
|
|
275
|
+
interiorPlanet: ge,
|
|
276
|
+
interiorPlanetLabel: fe,
|
|
277
|
+
interiorPlanetSubtitle: ve,
|
|
278
|
+
orbitRing: Ne,
|
|
279
|
+
satelliteNode: Pe,
|
|
280
|
+
satelliteNodeIcon: we,
|
|
281
|
+
satelliteNodeLabel: xe,
|
|
282
|
+
satelliteNodeBadge: Ce,
|
|
283
|
+
tutorialOverlay: Ie,
|
|
284
|
+
tutorialWelcome: ke,
|
|
285
285
|
tutorialWelcomeTitle: Se,
|
|
286
|
-
tutorialWelcomeDesc:
|
|
287
|
-
tutorialActions:
|
|
288
|
-
tutorialButton:
|
|
289
|
-
tutorialCard:
|
|
290
|
-
tutorialChip:
|
|
291
|
-
tutorialCardTitle:
|
|
292
|
-
tutorialCardDesc:
|
|
293
|
-
tutorialProgress:
|
|
294
|
-
tutorialProgressBar:
|
|
295
|
-
tutorialCardFooter:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
topBarSlot: Ae
|
|
286
|
+
tutorialWelcomeDesc: Be,
|
|
287
|
+
tutorialActions: ze,
|
|
288
|
+
tutorialButton: $e,
|
|
289
|
+
tutorialCard: Le,
|
|
290
|
+
tutorialChip: Me,
|
|
291
|
+
tutorialCardTitle: Fe,
|
|
292
|
+
tutorialCardDesc: De,
|
|
293
|
+
tutorialProgress: Te,
|
|
294
|
+
tutorialProgressBar: We,
|
|
295
|
+
tutorialCardFooter: Ae,
|
|
296
|
+
tutorialDots: Re,
|
|
297
|
+
tutorialDot: Ee,
|
|
298
|
+
topBarSlot: Oe
|
|
300
299
|
};
|
|
301
|
-
function
|
|
300
|
+
function _e({
|
|
302
301
|
planet: e,
|
|
303
|
-
onClose:
|
|
304
|
-
onEnterPlanet:
|
|
302
|
+
onClose: h,
|
|
303
|
+
onEnterPlanet: u,
|
|
305
304
|
onSatelliteClick: l
|
|
306
305
|
}) {
|
|
307
306
|
return /* @__PURE__ */ p(
|
|
308
|
-
|
|
307
|
+
w.div,
|
|
309
308
|
{
|
|
310
309
|
className: i.sidePanel,
|
|
311
310
|
initial: { x: 340 },
|
|
@@ -334,37 +333,37 @@ function Re({
|
|
|
334
333
|
/* @__PURE__ */ t("div", { className: i.sidePanelSubtitle, children: e.subtitle })
|
|
335
334
|
] })
|
|
336
335
|
] }),
|
|
337
|
-
/* @__PURE__ */ t("button", { className: i.sidePanelClose, onClick:
|
|
336
|
+
/* @__PURE__ */ t("button", { className: i.sidePanelClose, onClick: h, children: "✕" })
|
|
338
337
|
] }),
|
|
339
|
-
/* @__PURE__ */ t("div", { className: i.sidePanelContent, children: /* @__PURE__ */ t("div", { className: i.satelliteList, children: e.satellites.map((
|
|
338
|
+
/* @__PURE__ */ t("div", { className: i.sidePanelContent, children: /* @__PURE__ */ t("div", { className: i.satelliteList, children: e.satellites.map((o) => /* @__PURE__ */ p(
|
|
340
339
|
"div",
|
|
341
340
|
{
|
|
342
341
|
className: i.satelliteItem,
|
|
343
342
|
onClick: () => l == null ? void 0 : l({
|
|
344
343
|
planetId: e.id,
|
|
345
|
-
satelliteId:
|
|
346
|
-
satellite:
|
|
344
|
+
satelliteId: o.id,
|
|
345
|
+
satellite: o
|
|
347
346
|
}),
|
|
348
347
|
children: [
|
|
349
|
-
/* @__PURE__ */ t("div", { className: i.satelliteIcon, children:
|
|
348
|
+
/* @__PURE__ */ t("div", { className: i.satelliteIcon, children: o.icon ?? "●" }),
|
|
350
349
|
/* @__PURE__ */ p("div", { className: i.satelliteInfo, children: [
|
|
351
|
-
/* @__PURE__ */ t("div", { className: i.satelliteName, children:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
350
|
+
/* @__PURE__ */ t("div", { className: i.satelliteName, children: o.label }),
|
|
351
|
+
o.summary && /* @__PURE__ */ p("div", { className: i.satelliteSummary, children: [
|
|
352
|
+
o.summary.total != null && `${o.summary.total} total`,
|
|
353
|
+
o.summary.running != null && ` · ${o.summary.running} running`,
|
|
354
|
+
o.summary.failed != null && o.summary.failed > 0 && ` · ${o.summary.failed} failed`
|
|
356
355
|
] })
|
|
357
356
|
] })
|
|
358
357
|
]
|
|
359
358
|
},
|
|
360
|
-
|
|
359
|
+
o.id
|
|
361
360
|
)) }) }),
|
|
362
361
|
/* @__PURE__ */ t("div", { className: i.sidePanelFooter, children: /* @__PURE__ */ p(
|
|
363
362
|
"button",
|
|
364
363
|
{
|
|
365
364
|
className: i.enterButton,
|
|
366
365
|
style: { borderColor: `${e.color}44` },
|
|
367
|
-
onClick:
|
|
366
|
+
onClick: u,
|
|
368
367
|
children: [
|
|
369
368
|
"Enter ",
|
|
370
369
|
e.label
|
|
@@ -375,39 +374,39 @@ function Re({
|
|
|
375
374
|
}
|
|
376
375
|
);
|
|
377
376
|
}
|
|
378
|
-
function
|
|
377
|
+
function Ge({
|
|
379
378
|
planet: e,
|
|
380
|
-
onExit:
|
|
381
|
-
onSatelliteClick:
|
|
379
|
+
onExit: h,
|
|
380
|
+
onSatelliteClick: u,
|
|
382
381
|
renderCustom: l
|
|
383
382
|
}) {
|
|
384
|
-
const [
|
|
383
|
+
const [o, n] = _(null);
|
|
385
384
|
if (l)
|
|
386
385
|
return /* @__PURE__ */ t(
|
|
387
|
-
|
|
386
|
+
w.div,
|
|
388
387
|
{
|
|
389
388
|
className: i.planetInterior,
|
|
390
389
|
initial: { opacity: 0 },
|
|
391
390
|
animate: { opacity: 1 },
|
|
392
391
|
exit: { opacity: 0 },
|
|
393
392
|
transition: { duration: 0.4 },
|
|
394
|
-
children: l(e,
|
|
393
|
+
children: l(e, h)
|
|
395
394
|
}
|
|
396
395
|
);
|
|
397
|
-
const
|
|
398
|
-
(
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
|
|
396
|
+
const c = e.satellites, d = Math.max(180, c.length * 35), y = v(
|
|
397
|
+
(m) => {
|
|
398
|
+
n(m);
|
|
399
|
+
const b = c.find((C) => C.id === m);
|
|
400
|
+
u == null || u({
|
|
402
401
|
planetId: e.id,
|
|
403
|
-
satelliteId:
|
|
404
|
-
satellite:
|
|
402
|
+
satelliteId: m,
|
|
403
|
+
satellite: b
|
|
405
404
|
});
|
|
406
405
|
},
|
|
407
|
-
[e.id,
|
|
406
|
+
[e.id, c, u]
|
|
408
407
|
);
|
|
409
408
|
return /* @__PURE__ */ p(
|
|
410
|
-
|
|
409
|
+
w.div,
|
|
411
410
|
{
|
|
412
411
|
className: i.planetInterior,
|
|
413
412
|
initial: { opacity: 0 },
|
|
@@ -415,20 +414,20 @@ function Oe({
|
|
|
415
414
|
exit: { opacity: 0 },
|
|
416
415
|
transition: { duration: 0.4 },
|
|
417
416
|
children: [
|
|
418
|
-
/* @__PURE__ */ t("button", { className: i.interiorBackButton, onClick:
|
|
417
|
+
/* @__PURE__ */ t("button", { className: i.interiorBackButton, onClick: h, children: "← Back to Universe" }),
|
|
419
418
|
/* @__PURE__ */ p("div", { className: i.interiorCenter, children: [
|
|
420
|
-
[1, 2, 3].map((
|
|
419
|
+
[1, 2, 3].map((m) => /* @__PURE__ */ t(
|
|
421
420
|
"div",
|
|
422
421
|
{
|
|
423
422
|
className: i.orbitRing,
|
|
424
423
|
style: {
|
|
425
|
-
width:
|
|
426
|
-
height:
|
|
427
|
-
top: `calc(50% - ${
|
|
428
|
-
left: `calc(50% - ${
|
|
424
|
+
width: d * m * 0.7,
|
|
425
|
+
height: d * m * 0.7,
|
|
426
|
+
top: `calc(50% - ${d * m * 0.7 / 2}px)`,
|
|
427
|
+
left: `calc(50% - ${d * m * 0.7 / 2}px)`
|
|
429
428
|
}
|
|
430
429
|
},
|
|
431
|
-
|
|
430
|
+
m
|
|
432
431
|
)),
|
|
433
432
|
/* @__PURE__ */ p(
|
|
434
433
|
"div",
|
|
@@ -444,11 +443,11 @@ function Oe({
|
|
|
444
443
|
]
|
|
445
444
|
}
|
|
446
445
|
),
|
|
447
|
-
/* @__PURE__ */ t(
|
|
448
|
-
var
|
|
449
|
-
const
|
|
446
|
+
/* @__PURE__ */ t(E, { children: c.map((m, b) => {
|
|
447
|
+
var r;
|
|
448
|
+
const C = b / c.length * Math.PI * 2 - Math.PI / 2, M = Math.cos(C) * d, $ = Math.sin(C) * d;
|
|
450
449
|
return /* @__PURE__ */ p(
|
|
451
|
-
|
|
450
|
+
w.div,
|
|
452
451
|
{
|
|
453
452
|
className: i.satelliteNode,
|
|
454
453
|
initial: { scale: 0, opacity: 0 },
|
|
@@ -457,32 +456,32 @@ function Oe({
|
|
|
457
456
|
type: "spring",
|
|
458
457
|
damping: 15,
|
|
459
458
|
stiffness: 200,
|
|
460
|
-
delay:
|
|
459
|
+
delay: b * 0.08
|
|
461
460
|
},
|
|
462
461
|
style: {
|
|
463
|
-
left: `calc(50% + ${
|
|
464
|
-
top: `calc(50% + ${
|
|
462
|
+
left: `calc(50% + ${M}px - 32px)`,
|
|
463
|
+
top: `calc(50% + ${$}px - 40px)`
|
|
465
464
|
},
|
|
466
|
-
onClick: () =>
|
|
465
|
+
onClick: () => y(m.id),
|
|
467
466
|
children: [
|
|
468
467
|
/* @__PURE__ */ p(
|
|
469
468
|
"div",
|
|
470
469
|
{
|
|
471
470
|
className: i.satelliteNodeIcon,
|
|
472
471
|
style: {
|
|
473
|
-
borderColor:
|
|
474
|
-
boxShadow:
|
|
472
|
+
borderColor: o === m.id ? `${e.color}88` : "rgba(255,255,255,0.15)",
|
|
473
|
+
boxShadow: o === m.id ? `0 0 20px ${e.color}44` : "none"
|
|
475
474
|
},
|
|
476
475
|
children: [
|
|
477
|
-
|
|
478
|
-
((
|
|
476
|
+
m.icon ?? "●",
|
|
477
|
+
((r = m.summary) == null ? void 0 : r.running) != null && m.summary.running > 0 && /* @__PURE__ */ t("span", { className: i.satelliteNodeBadge, children: m.summary.running })
|
|
479
478
|
]
|
|
480
479
|
}
|
|
481
480
|
),
|
|
482
|
-
/* @__PURE__ */ t("span", { className: i.satelliteNodeLabel, children:
|
|
481
|
+
/* @__PURE__ */ t("span", { className: i.satelliteNodeLabel, children: m.label })
|
|
483
482
|
]
|
|
484
483
|
},
|
|
485
|
-
|
|
484
|
+
m.id
|
|
486
485
|
);
|
|
487
486
|
}) })
|
|
488
487
|
] })
|
|
@@ -490,9 +489,9 @@ function Oe({
|
|
|
490
489
|
}
|
|
491
490
|
);
|
|
492
491
|
}
|
|
493
|
-
function
|
|
492
|
+
function He({ planet: e }) {
|
|
494
493
|
return /* @__PURE__ */ t(
|
|
495
|
-
|
|
494
|
+
w.div,
|
|
496
495
|
{
|
|
497
496
|
className: i.zoomTransition,
|
|
498
497
|
initial: { opacity: 0 },
|
|
@@ -500,7 +499,7 @@ function Ee({ planet: e }) {
|
|
|
500
499
|
exit: { opacity: 0 },
|
|
501
500
|
transition: { duration: 0.9, ease: "easeInOut" },
|
|
502
501
|
children: /* @__PURE__ */ t(
|
|
503
|
-
|
|
502
|
+
w.span,
|
|
504
503
|
{
|
|
505
504
|
className: i.zoomPlanetLabel,
|
|
506
505
|
initial: { scale: 0.5, opacity: 0 },
|
|
@@ -517,41 +516,46 @@ function Ee({ planet: e }) {
|
|
|
517
516
|
}
|
|
518
517
|
);
|
|
519
518
|
}
|
|
520
|
-
function
|
|
519
|
+
function Je({
|
|
521
520
|
steps: e,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
521
|
+
planets: h,
|
|
522
|
+
onHighlightPlanet: u,
|
|
523
|
+
onStepChange: l,
|
|
524
|
+
onFinish: o,
|
|
525
525
|
flyTo: n
|
|
526
526
|
}) {
|
|
527
|
-
const [
|
|
528
|
-
(
|
|
529
|
-
if (
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
|
|
527
|
+
const [c, d] = _("welcome"), [y, m] = _(0), b = v(
|
|
528
|
+
(S) => {
|
|
529
|
+
if (S < 0 || S >= e.length) return;
|
|
530
|
+
m(S), l(S);
|
|
531
|
+
const P = e[S];
|
|
532
|
+
if (P.planetId) {
|
|
533
|
+
u(P.planetId);
|
|
534
|
+
const O = h.find((N) => N.id === P.planetId);
|
|
535
|
+
O && n && n(O.x + 50, O.y + 50, 1.5, 800);
|
|
536
|
+
}
|
|
533
537
|
},
|
|
534
|
-
[e,
|
|
535
|
-
),
|
|
536
|
-
|
|
537
|
-
}, [
|
|
538
|
-
|
|
539
|
-
}, [
|
|
540
|
-
|
|
541
|
-
}, [
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
|
|
545
|
-
if (
|
|
546
|
-
const
|
|
547
|
-
|
|
538
|
+
[e, h, l, u, n]
|
|
539
|
+
), C = v(() => {
|
|
540
|
+
d("stepping"), b(0);
|
|
541
|
+
}, [b]), M = v(() => {
|
|
542
|
+
y < e.length - 1 ? b(y + 1) : (d("complete"), l(-1), u(null), n == null || n(800, 400, 0.8, 600), setTimeout(() => o(), 1500));
|
|
543
|
+
}, [y, e.length, b, l, u, o, n]), $ = v(() => {
|
|
544
|
+
y > 0 && b(y - 1);
|
|
545
|
+
}, [y, b]), r = v(() => {
|
|
546
|
+
l(-1), u(null), n == null || n(800, 400, 0.8, 600), o();
|
|
547
|
+
}, [l, u, o, n]);
|
|
548
|
+
at(() => {
|
|
549
|
+
if (c !== "stepping") return;
|
|
550
|
+
const S = (P) => {
|
|
551
|
+
P.key === "ArrowRight" || P.key === "Enter" ? M() : P.key === "ArrowLeft" ? $() : P.key === "Escape" && r();
|
|
548
552
|
};
|
|
549
|
-
return window.addEventListener("keydown",
|
|
550
|
-
}, [
|
|
551
|
-
const
|
|
552
|
-
return /* @__PURE__ */ p(
|
|
553
|
-
|
|
554
|
-
|
|
553
|
+
return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
|
|
554
|
+
}, [c, M, $, r]);
|
|
555
|
+
const I = e[y], G = e.length > 0 ? (y + 1) / e.length * 100 : 0;
|
|
556
|
+
return /* @__PURE__ */ p(E, { mode: "wait", children: [
|
|
557
|
+
c === "welcome" && /* @__PURE__ */ t(
|
|
558
|
+
w.div,
|
|
555
559
|
{
|
|
556
560
|
className: i.tutorialOverlay,
|
|
557
561
|
initial: { opacity: 0 },
|
|
@@ -559,7 +563,7 @@ function Ge({
|
|
|
559
563
|
exit: { opacity: 0 },
|
|
560
564
|
children: /* @__PURE__ */ p("div", { className: i.tutorialWelcome, children: [
|
|
561
565
|
/* @__PURE__ */ t(
|
|
562
|
-
|
|
566
|
+
w.div,
|
|
563
567
|
{
|
|
564
568
|
initial: { scale: 0.8 },
|
|
565
569
|
animate: { scale: 1 },
|
|
@@ -576,7 +580,7 @@ function Ge({
|
|
|
576
580
|
{
|
|
577
581
|
className: i.tutorialButton,
|
|
578
582
|
"data-variant": "ghost",
|
|
579
|
-
onClick:
|
|
583
|
+
onClick: r,
|
|
580
584
|
children: "SKIP"
|
|
581
585
|
}
|
|
582
586
|
),
|
|
@@ -585,7 +589,7 @@ function Ge({
|
|
|
585
589
|
{
|
|
586
590
|
className: i.tutorialButton,
|
|
587
591
|
"data-variant": "primary",
|
|
588
|
-
onClick:
|
|
592
|
+
onClick: C,
|
|
589
593
|
children: "LET'S GO"
|
|
590
594
|
}
|
|
591
595
|
)
|
|
@@ -594,8 +598,8 @@ function Ge({
|
|
|
594
598
|
},
|
|
595
599
|
"welcome"
|
|
596
600
|
),
|
|
597
|
-
|
|
598
|
-
|
|
601
|
+
c === "stepping" && I && /* @__PURE__ */ p(
|
|
602
|
+
w.div,
|
|
599
603
|
{
|
|
600
604
|
className: i.tutorialCard,
|
|
601
605
|
initial: { opacity: 0, y: 20 },
|
|
@@ -603,50 +607,55 @@ function Ge({
|
|
|
603
607
|
exit: { opacity: 0, y: -10 },
|
|
604
608
|
transition: { duration: 0.25 },
|
|
605
609
|
children: [
|
|
606
|
-
|
|
610
|
+
I.chipText && /* @__PURE__ */ t(
|
|
607
611
|
"span",
|
|
608
612
|
{
|
|
609
613
|
className: i.tutorialChip,
|
|
610
614
|
style: {
|
|
611
|
-
background: `${
|
|
612
|
-
color:
|
|
615
|
+
background: `${I.chipColor ?? "#3b82f6"}22`,
|
|
616
|
+
color: I.chipColor ?? "#3b82f6"
|
|
613
617
|
},
|
|
614
|
-
children:
|
|
618
|
+
children: I.chipText
|
|
615
619
|
}
|
|
616
620
|
),
|
|
617
|
-
/* @__PURE__ */ t("h3", { className: i.tutorialCardTitle, children:
|
|
618
|
-
/* @__PURE__ */ t("p", { className: i.tutorialCardDesc, children:
|
|
621
|
+
/* @__PURE__ */ t("h3", { className: i.tutorialCardTitle, children: I.title }),
|
|
622
|
+
/* @__PURE__ */ t("p", { className: i.tutorialCardDesc, children: I.description }),
|
|
619
623
|
/* @__PURE__ */ t("div", { className: i.tutorialProgress, children: /* @__PURE__ */ t(
|
|
620
624
|
"div",
|
|
621
625
|
{
|
|
622
626
|
className: i.tutorialProgressBar,
|
|
623
|
-
style: { width: `${
|
|
627
|
+
style: { width: `${G}%` }
|
|
624
628
|
}
|
|
625
629
|
) }),
|
|
626
630
|
/* @__PURE__ */ p("div", { className: i.tutorialCardFooter, children: [
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
631
|
+
/* @__PURE__ */ t(
|
|
632
|
+
"button",
|
|
633
|
+
{
|
|
634
|
+
className: i.tutorialButton,
|
|
635
|
+
"data-variant": "ghost",
|
|
636
|
+
style: { padding: "0.375rem 0.75rem", fontSize: "0.6875rem" },
|
|
637
|
+
onClick: r,
|
|
638
|
+
children: "SKIP"
|
|
639
|
+
}
|
|
640
|
+
),
|
|
641
|
+
/* @__PURE__ */ t("div", { className: i.tutorialDots, children: e.map((S, P) => /* @__PURE__ */ t(
|
|
633
642
|
"div",
|
|
634
643
|
{
|
|
635
644
|
className: i.tutorialDot,
|
|
636
|
-
"data-active":
|
|
637
|
-
"data-done":
|
|
638
|
-
onClick: () =>
|
|
645
|
+
"data-active": P === y || void 0,
|
|
646
|
+
"data-done": P < y || void 0,
|
|
647
|
+
onClick: () => b(P)
|
|
639
648
|
},
|
|
640
|
-
|
|
649
|
+
P
|
|
641
650
|
)) }),
|
|
642
651
|
/* @__PURE__ */ p("div", { style: { display: "flex", gap: "0.5rem" }, children: [
|
|
643
|
-
|
|
652
|
+
y > 0 && /* @__PURE__ */ t(
|
|
644
653
|
"button",
|
|
645
654
|
{
|
|
646
655
|
className: i.tutorialButton,
|
|
647
656
|
"data-variant": "ghost",
|
|
648
657
|
style: { padding: "0.375rem 0.75rem", fontSize: "0.75rem" },
|
|
649
|
-
onClick:
|
|
658
|
+
onClick: $,
|
|
650
659
|
children: "←"
|
|
651
660
|
}
|
|
652
661
|
),
|
|
@@ -656,18 +665,18 @@ function Ge({
|
|
|
656
665
|
className: i.tutorialButton,
|
|
657
666
|
"data-variant": "primary",
|
|
658
667
|
style: { padding: "0.375rem 0.75rem", fontSize: "0.75rem" },
|
|
659
|
-
onClick:
|
|
660
|
-
children:
|
|
668
|
+
onClick: M,
|
|
669
|
+
children: y === e.length - 1 ? "Finish" : "→"
|
|
661
670
|
}
|
|
662
671
|
)
|
|
663
672
|
] })
|
|
664
673
|
] })
|
|
665
674
|
]
|
|
666
675
|
},
|
|
667
|
-
`step-${
|
|
676
|
+
`step-${y}`
|
|
668
677
|
),
|
|
669
|
-
|
|
670
|
-
|
|
678
|
+
c === "complete" && /* @__PURE__ */ t(
|
|
679
|
+
w.div,
|
|
671
680
|
{
|
|
672
681
|
className: i.tutorialOverlay,
|
|
673
682
|
initial: { opacity: 0 },
|
|
@@ -675,7 +684,7 @@ function Ge({
|
|
|
675
684
|
exit: { opacity: 0 },
|
|
676
685
|
transition: { duration: 1 },
|
|
677
686
|
children: /* @__PURE__ */ t(
|
|
678
|
-
|
|
687
|
+
w.h1,
|
|
679
688
|
{
|
|
680
689
|
className: i.tutorialWelcomeTitle,
|
|
681
690
|
initial: { scale: 0.8 },
|
|
@@ -689,176 +698,211 @@ function Ge({
|
|
|
689
698
|
)
|
|
690
699
|
] });
|
|
691
700
|
}
|
|
692
|
-
const
|
|
693
|
-
function
|
|
701
|
+
const Ke = { planet: _t }, Ue = { orbit: Ht };
|
|
702
|
+
function Ve({
|
|
694
703
|
planets: e,
|
|
695
|
-
orbits:
|
|
696
|
-
onPlanetClick:
|
|
704
|
+
orbits: h,
|
|
705
|
+
onPlanetClick: u,
|
|
697
706
|
onPlanetEnter: l,
|
|
698
|
-
onPlanetExit:
|
|
699
|
-
onSatelliteClick:
|
|
700
|
-
onPlanetDrag:
|
|
701
|
-
tutorialSteps:
|
|
702
|
-
showTutorial:
|
|
703
|
-
onTutorialComplete:
|
|
704
|
-
initialView:
|
|
705
|
-
onViewChange:
|
|
706
|
-
renderPlanetInterior:
|
|
707
|
-
topBar:
|
|
708
|
-
theme:
|
|
709
|
-
starField:
|
|
710
|
-
nodeTypes:
|
|
711
|
-
edgeTypes:
|
|
712
|
-
className:
|
|
713
|
-
style:
|
|
707
|
+
onPlanetExit: o,
|
|
708
|
+
onSatelliteClick: n,
|
|
709
|
+
onPlanetDrag: c,
|
|
710
|
+
tutorialSteps: d,
|
|
711
|
+
showTutorial: y,
|
|
712
|
+
onTutorialComplete: m,
|
|
713
|
+
initialView: b,
|
|
714
|
+
onViewChange: C,
|
|
715
|
+
renderPlanetInterior: M,
|
|
716
|
+
topBar: $,
|
|
717
|
+
theme: r,
|
|
718
|
+
starField: I = !0,
|
|
719
|
+
nodeTypes: G,
|
|
720
|
+
edgeTypes: S,
|
|
721
|
+
className: P,
|
|
722
|
+
style: O
|
|
714
723
|
}) {
|
|
715
|
-
const [
|
|
716
|
-
(
|
|
717
|
-
|
|
724
|
+
const [N, st] = _(b ?? { mode: "universe" }), [H, ct] = _(y ?? !1), Z = K(0), Q = K(""), { setCenter: x, fitView: J } = Lt(), k = v(
|
|
725
|
+
(a) => {
|
|
726
|
+
st(a), C == null || C(a);
|
|
718
727
|
},
|
|
719
|
-
[
|
|
720
|
-
),
|
|
721
|
-
(
|
|
728
|
+
[C]
|
|
729
|
+
), U = v(
|
|
730
|
+
(a) => e.find((s) => s.id === a),
|
|
722
731
|
[e]
|
|
723
|
-
),
|
|
724
|
-
() => e.map((
|
|
725
|
-
id:
|
|
732
|
+
), dt = R(
|
|
733
|
+
() => e.map((a) => ({
|
|
734
|
+
id: a.id,
|
|
726
735
|
type: "planet",
|
|
727
|
-
position: { x:
|
|
736
|
+
position: { x: a.x, y: a.y },
|
|
728
737
|
data: {
|
|
729
|
-
label:
|
|
730
|
-
subtitle:
|
|
731
|
-
color:
|
|
732
|
-
status:
|
|
738
|
+
label: a.label,
|
|
739
|
+
subtitle: a.subtitle,
|
|
740
|
+
color: a.color,
|
|
741
|
+
status: a.status ?? "idle",
|
|
733
742
|
isSelected: !1
|
|
734
743
|
}
|
|
735
744
|
})),
|
|
736
745
|
[e]
|
|
737
|
-
),
|
|
738
|
-
() =>
|
|
739
|
-
id: `orbit-${
|
|
740
|
-
source:
|
|
741
|
-
target:
|
|
746
|
+
), ut = R(
|
|
747
|
+
() => h.map((a, s) => ({
|
|
748
|
+
id: `orbit-${s}`,
|
|
749
|
+
source: a.source,
|
|
750
|
+
target: a.target,
|
|
742
751
|
type: "orbit",
|
|
743
|
-
data: { label:
|
|
752
|
+
data: { label: a.label },
|
|
744
753
|
animated: !0
|
|
745
754
|
})),
|
|
746
|
-
[
|
|
747
|
-
), [
|
|
748
|
-
(
|
|
749
|
-
|
|
750
|
-
(
|
|
751
|
-
...
|
|
752
|
-
data: { ...
|
|
755
|
+
[h]
|
|
756
|
+
), [V, F, mt] = Mt(dt), [pt, j, ht] = Ft(ut), B = v(
|
|
757
|
+
(a) => {
|
|
758
|
+
F(
|
|
759
|
+
(s) => s.map((g) => ({
|
|
760
|
+
...g,
|
|
761
|
+
data: { ...g.data, isSelected: g.id === a }
|
|
753
762
|
}))
|
|
754
763
|
);
|
|
755
764
|
},
|
|
756
|
-
[
|
|
757
|
-
),
|
|
758
|
-
(
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
765
|
+
[F]
|
|
766
|
+
), yt = v(() => {
|
|
767
|
+
F(
|
|
768
|
+
(a) => a.map((s) => {
|
|
769
|
+
const g = e.find((L) => L.id === s.id);
|
|
770
|
+
return g ? { ...s, position: { x: g.x, y: g.y } } : s;
|
|
771
|
+
})
|
|
772
|
+
), setTimeout(() => J({ duration: 600, padding: 0.2 }), 50);
|
|
773
|
+
}, [e, F, J]), bt = v(() => {
|
|
774
|
+
const a = V.length;
|
|
775
|
+
if (a === 0) return;
|
|
776
|
+
const s = 800, g = 400, L = Math.max(200, a * 40);
|
|
777
|
+
F(
|
|
778
|
+
(D) => D.map((z, f) => {
|
|
779
|
+
const T = 2 * Math.PI * f / a - Math.PI / 2;
|
|
780
|
+
return {
|
|
781
|
+
...z,
|
|
782
|
+
position: {
|
|
783
|
+
x: s + L * Math.cos(T),
|
|
784
|
+
y: g + L * Math.sin(T)
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
})
|
|
788
|
+
), setTimeout(() => J({ duration: 600, padding: 0.2 }), 50);
|
|
789
|
+
}, [V.length, F, J]), gt = v(
|
|
790
|
+
(a) => {
|
|
791
|
+
var D;
|
|
792
|
+
if (!d) return;
|
|
793
|
+
if (a < 0) {
|
|
794
|
+
F(
|
|
795
|
+
(z) => z.map((f) => ({
|
|
796
|
+
...f,
|
|
797
|
+
data: { ...f.data, status: "idle", isSelected: !1 }
|
|
766
798
|
}))
|
|
767
|
-
),
|
|
768
|
-
(
|
|
769
|
-
...
|
|
799
|
+
), j(
|
|
800
|
+
(z) => z.map((f) => ({
|
|
801
|
+
...f,
|
|
770
802
|
animated: !0,
|
|
771
|
-
data: { ...
|
|
803
|
+
data: { ...f.data, isActive: !1, isDimmed: !1 }
|
|
772
804
|
}))
|
|
773
805
|
);
|
|
774
806
|
return;
|
|
775
807
|
}
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
(
|
|
779
|
-
let
|
|
780
|
-
return
|
|
781
|
-
...
|
|
782
|
-
data: { ...
|
|
808
|
+
const s = new Set(d.slice(0, a).map((z) => z.planetId)), g = (D = d[a]) == null ? void 0 : D.planetId;
|
|
809
|
+
F(
|
|
810
|
+
(z) => z.map((f) => {
|
|
811
|
+
let T = "idle";
|
|
812
|
+
return f.id === g ? T = "running" : s.has(f.id) && (T = "success"), {
|
|
813
|
+
...f,
|
|
814
|
+
data: { ...f.data, status: T, isSelected: f.id === g }
|
|
783
815
|
};
|
|
784
816
|
})
|
|
785
817
|
);
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
(
|
|
789
|
-
const
|
|
818
|
+
const L = /* @__PURE__ */ new Set([...s, g]);
|
|
819
|
+
j(
|
|
820
|
+
(z) => z.map((f) => {
|
|
821
|
+
const T = s.has(f.source), St = L.has(f.target), q = T && St;
|
|
790
822
|
return {
|
|
791
|
-
...
|
|
792
|
-
animated:
|
|
793
|
-
data: { ...
|
|
823
|
+
...f,
|
|
824
|
+
animated: q,
|
|
825
|
+
data: { ...f.data, isActive: q, isDimmed: !q }
|
|
794
826
|
};
|
|
795
827
|
})
|
|
796
828
|
);
|
|
797
829
|
},
|
|
798
|
-
[
|
|
799
|
-
),
|
|
800
|
-
(
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
|
|
830
|
+
[d, F, j]
|
|
831
|
+
), ft = v(
|
|
832
|
+
(a, s) => {
|
|
833
|
+
const g = Date.now(), L = g - Z.current < 300 && Q.current === s.id;
|
|
834
|
+
Z.current = g, Q.current = s.id;
|
|
835
|
+
const D = U(s.id);
|
|
836
|
+
L && D ? Y(D) : N.mode === "inspecting" && N.planetId === s.id ? (k({ mode: "universe" }), B(null), x(800, 400, { zoom: 0.8, duration: 600 })) : (k({ mode: "inspecting", planetId: s.id }), B(s.id), x(s.position.x + 50, s.position.y + 50, { zoom: 1.5, duration: 600 }), D && (u == null || u(D)));
|
|
805
837
|
},
|
|
806
|
-
[
|
|
807
|
-
),
|
|
808
|
-
(
|
|
809
|
-
|
|
810
|
-
|
|
838
|
+
[N, B, U, k, u, x]
|
|
839
|
+
), Y = v(
|
|
840
|
+
(a) => {
|
|
841
|
+
k({ mode: "entering", planetId: a.id }), B(null), l == null || l(a), x(a.x + 50, a.y + 50, { zoom: 6, duration: 800 }), setTimeout(() => {
|
|
842
|
+
k({ mode: "planet", planetId: a.id });
|
|
811
843
|
}, 900);
|
|
812
844
|
},
|
|
813
|
-
[
|
|
814
|
-
),
|
|
815
|
-
|
|
816
|
-
|
|
845
|
+
[x, B, k, l]
|
|
846
|
+
), X = v(() => {
|
|
847
|
+
k({ mode: "universe" }), o == null || o(), setTimeout(() => {
|
|
848
|
+
x(800, 400, { zoom: 0.8, duration: 600 });
|
|
817
849
|
}, 100);
|
|
818
|
-
}, [
|
|
819
|
-
(
|
|
820
|
-
|
|
850
|
+
}, [x, k, o]), vt = v(
|
|
851
|
+
(a, s) => {
|
|
852
|
+
c == null || c(s.id, { x: s.position.x, y: s.position.y });
|
|
821
853
|
},
|
|
822
|
-
[
|
|
823
|
-
),
|
|
824
|
-
|
|
825
|
-
}, [
|
|
826
|
-
() =>
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
)
|
|
832
|
-
|
|
854
|
+
[c]
|
|
855
|
+
), Nt = v(() => {
|
|
856
|
+
N.mode === "inspecting" && (k({ mode: "universe" }), B(null), x(800, 400, { zoom: 0.8, duration: 600 }));
|
|
857
|
+
}, [N, B, k, x]), Pt = v(
|
|
858
|
+
(a, s, g, L) => {
|
|
859
|
+
x(a, s, { zoom: g, duration: L });
|
|
860
|
+
},
|
|
861
|
+
[x]
|
|
862
|
+
);
|
|
863
|
+
at(() => {
|
|
864
|
+
const a = (s) => {
|
|
865
|
+
s.key === "Escape" && (H || (N.mode === "inspecting" ? (k({ mode: "universe" }), B(null), x(800, 400, { zoom: 0.8, duration: 600 })) : N.mode === "planet" && X()));
|
|
866
|
+
};
|
|
867
|
+
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
868
|
+
}, [N, H, k, B, x, X]);
|
|
869
|
+
const W = N.mode !== "universe" ? U(N.planetId) : void 0, wt = N.mode !== "planet", xt = R(
|
|
870
|
+
() => ({ ...Ke, ...G }),
|
|
871
|
+
[G]
|
|
872
|
+
), Ct = R(
|
|
873
|
+
() => ({ ...Ue, ...S }),
|
|
874
|
+
[S]
|
|
875
|
+
), It = I !== !1, kt = typeof I == "object" ? I : {}, A = {};
|
|
876
|
+
return r != null && r.background && (A["--cc-bg"] = r.background), r != null && r.textColor && (A["--cc-text"] = r.textColor), r != null && r.panelBackground && (A["--cc-panel-bg"] = r.panelBackground), r != null && r.panelBorder && (A["--cc-panel-border"] = r.panelBorder), r != null && r.controlsBackground && (A["--cc-controls-bg"] = r.controlsBackground), r != null && r.fontFamily && (A["--cc-font-family"] = r.fontFamily), /* @__PURE__ */ p(
|
|
833
877
|
"div",
|
|
834
878
|
{
|
|
835
|
-
className: `${i.root} ${
|
|
836
|
-
style: { ...
|
|
879
|
+
className: `${i.root} ${P ?? ""}`,
|
|
880
|
+
style: { ...A, ...O },
|
|
837
881
|
children: [
|
|
838
|
-
|
|
839
|
-
|
|
882
|
+
It && /* @__PURE__ */ t("div", { className: i.layerStarField, children: /* @__PURE__ */ t(
|
|
883
|
+
Ut,
|
|
840
884
|
{
|
|
841
|
-
config:
|
|
842
|
-
background:
|
|
885
|
+
config: kt,
|
|
886
|
+
background: r == null ? void 0 : r.background
|
|
843
887
|
}
|
|
844
888
|
) }),
|
|
845
889
|
/* @__PURE__ */ t(
|
|
846
890
|
"div",
|
|
847
891
|
{
|
|
848
892
|
className: i.layerReactFlow,
|
|
849
|
-
"data-hidden": !
|
|
893
|
+
"data-hidden": !wt || void 0,
|
|
850
894
|
children: /* @__PURE__ */ p(
|
|
851
|
-
|
|
895
|
+
Dt,
|
|
852
896
|
{
|
|
853
|
-
nodes:
|
|
854
|
-
edges:
|
|
855
|
-
onNodesChange:
|
|
856
|
-
onEdgesChange:
|
|
857
|
-
onNodeClick:
|
|
858
|
-
onNodeDragStop:
|
|
859
|
-
onPaneClick:
|
|
860
|
-
nodeTypes:
|
|
861
|
-
edgeTypes:
|
|
897
|
+
nodes: V,
|
|
898
|
+
edges: pt,
|
|
899
|
+
onNodesChange: mt,
|
|
900
|
+
onEdgesChange: ht,
|
|
901
|
+
onNodeClick: ft,
|
|
902
|
+
onNodeDragStop: vt,
|
|
903
|
+
onPaneClick: Nt,
|
|
904
|
+
nodeTypes: xt,
|
|
905
|
+
edgeTypes: Ct,
|
|
862
906
|
nodesDraggable: !0,
|
|
863
907
|
nodeDragThreshold: 5,
|
|
864
908
|
fitView: !0,
|
|
@@ -868,36 +912,59 @@ function je({
|
|
|
868
912
|
maxZoom: 8,
|
|
869
913
|
children: [
|
|
870
914
|
/* @__PURE__ */ t(
|
|
871
|
-
|
|
915
|
+
Tt,
|
|
872
916
|
{
|
|
873
|
-
variant:
|
|
917
|
+
variant: Wt.Dots,
|
|
874
918
|
gap: 50,
|
|
875
919
|
size: 1,
|
|
876
920
|
color: "rgba(255, 255, 255, 0.05)"
|
|
877
921
|
}
|
|
878
922
|
),
|
|
879
|
-
/* @__PURE__ */
|
|
880
|
-
|
|
923
|
+
/* @__PURE__ */ p(
|
|
924
|
+
At,
|
|
881
925
|
{
|
|
882
|
-
style: {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
926
|
+
style: { top: 60 },
|
|
927
|
+
showInteractive: !1,
|
|
928
|
+
children: [
|
|
929
|
+
/* @__PURE__ */ t(
|
|
930
|
+
"button",
|
|
931
|
+
{
|
|
932
|
+
className: "react-flow__controls-button",
|
|
933
|
+
onClick: yt,
|
|
934
|
+
title: "Reset layout",
|
|
935
|
+
children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z" }) })
|
|
936
|
+
}
|
|
937
|
+
),
|
|
938
|
+
/* @__PURE__ */ t(
|
|
939
|
+
"button",
|
|
940
|
+
{
|
|
941
|
+
className: "react-flow__controls-button",
|
|
942
|
+
onClick: bt,
|
|
943
|
+
title: "Auto layout",
|
|
944
|
+
children: /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "currentColor", children: [
|
|
945
|
+
/* @__PURE__ */ t("circle", { cx: "12", cy: "3", r: "2" }),
|
|
946
|
+
/* @__PURE__ */ t("circle", { cx: "19.8", cy: "8", r: "2" }),
|
|
947
|
+
/* @__PURE__ */ t("circle", { cx: "17.6", cy: "17", r: "2" }),
|
|
948
|
+
/* @__PURE__ */ t("circle", { cx: "6.4", cy: "17", r: "2" }),
|
|
949
|
+
/* @__PURE__ */ t("circle", { cx: "4.2", cy: "8", r: "2" }),
|
|
950
|
+
/* @__PURE__ */ t("path", { d: "M12 5a7 7 0 1 1 0 14 7 7 0 0 1 0-14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeDasharray: "3 2" })
|
|
951
|
+
] })
|
|
952
|
+
}
|
|
953
|
+
)
|
|
954
|
+
]
|
|
887
955
|
}
|
|
888
956
|
),
|
|
889
957
|
/* @__PURE__ */ t(
|
|
890
|
-
|
|
958
|
+
Rt,
|
|
891
959
|
{
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
},
|
|
896
|
-
nodeColor: (c) => {
|
|
897
|
-
var y;
|
|
898
|
-
return ((y = c.data) == null ? void 0 : y.color) || "#666";
|
|
960
|
+
nodeColor: (a) => {
|
|
961
|
+
var s;
|
|
962
|
+
return ((s = a.data) == null ? void 0 : s.color) || "#666";
|
|
899
963
|
},
|
|
900
|
-
maskColor: "rgba(10, 10, 26, 0.7)"
|
|
964
|
+
maskColor: "rgba(10, 10, 26, 0.7)",
|
|
965
|
+
style: {
|
|
966
|
+
background: "rgba(10, 10, 26, 0.9)"
|
|
967
|
+
}
|
|
901
968
|
}
|
|
902
969
|
)
|
|
903
970
|
]
|
|
@@ -905,53 +972,55 @@ function je({
|
|
|
905
972
|
)
|
|
906
973
|
}
|
|
907
974
|
),
|
|
908
|
-
/* @__PURE__ */ t(
|
|
909
|
-
/* @__PURE__ */ t(
|
|
910
|
-
|
|
975
|
+
/* @__PURE__ */ t(E, { children: N.mode === "entering" && W && /* @__PURE__ */ t(He, { planet: W }) }),
|
|
976
|
+
/* @__PURE__ */ t(E, { children: N.mode === "planet" && W && /* @__PURE__ */ t(
|
|
977
|
+
Ge,
|
|
911
978
|
{
|
|
912
|
-
planet:
|
|
913
|
-
onExit:
|
|
914
|
-
onSatelliteClick:
|
|
915
|
-
renderCustom:
|
|
979
|
+
planet: W,
|
|
980
|
+
onExit: X,
|
|
981
|
+
onSatelliteClick: n,
|
|
982
|
+
renderCustom: M
|
|
916
983
|
}
|
|
917
984
|
) }),
|
|
918
|
-
/* @__PURE__ */ t(
|
|
919
|
-
|
|
985
|
+
/* @__PURE__ */ t(E, { children: N.mode === "inspecting" && W && /* @__PURE__ */ t(
|
|
986
|
+
_e,
|
|
920
987
|
{
|
|
921
|
-
planet:
|
|
988
|
+
planet: W,
|
|
922
989
|
onClose: () => {
|
|
923
|
-
|
|
990
|
+
k({ mode: "universe" }), B(null), x(800, 400, { zoom: 0.8, duration: 600 });
|
|
924
991
|
},
|
|
925
|
-
onEnterPlanet: () =>
|
|
926
|
-
onSatelliteClick:
|
|
992
|
+
onEnterPlanet: () => Y(W),
|
|
993
|
+
onSatelliteClick: n
|
|
927
994
|
}
|
|
928
995
|
) }),
|
|
929
|
-
|
|
930
|
-
/* @__PURE__ */ t(
|
|
931
|
-
|
|
996
|
+
$ && !H && /* @__PURE__ */ t("div", { className: i.topBarSlot, children: $ }),
|
|
997
|
+
/* @__PURE__ */ t(E, { children: H && d && d.length > 0 && /* @__PURE__ */ t(
|
|
998
|
+
Je,
|
|
932
999
|
{
|
|
933
|
-
steps:
|
|
1000
|
+
steps: d,
|
|
1001
|
+
planets: e,
|
|
934
1002
|
onHighlightPlanet: B,
|
|
935
|
-
onStepChange:
|
|
1003
|
+
onStepChange: gt,
|
|
936
1004
|
onFinish: () => {
|
|
937
|
-
|
|
938
|
-
}
|
|
1005
|
+
ct(!1), m == null || m();
|
|
1006
|
+
},
|
|
1007
|
+
flyTo: Pt
|
|
939
1008
|
}
|
|
940
1009
|
) })
|
|
941
1010
|
]
|
|
942
1011
|
}
|
|
943
1012
|
);
|
|
944
1013
|
}
|
|
945
|
-
function
|
|
946
|
-
return /* @__PURE__ */ t(
|
|
1014
|
+
function ti(e) {
|
|
1015
|
+
return /* @__PURE__ */ t($t, { children: /* @__PURE__ */ t(Ve, { ...e }) });
|
|
947
1016
|
}
|
|
948
1017
|
export {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1018
|
+
ti as CosmosCanvas,
|
|
1019
|
+
Je as CosmosTutorial,
|
|
1020
|
+
Ht as OrbitEdge,
|
|
1021
|
+
Ge as PlanetInterior,
|
|
1022
|
+
_t as PlanetNode,
|
|
1023
|
+
_e as SidePanel,
|
|
1024
|
+
Ut as StarField,
|
|
1025
|
+
He as ZoomTransition
|
|
957
1026
|
};
|