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