@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.js CHANGED
@@ -1,22 +1,22 @@
1
- import { jsxs as p, jsx as t, Fragment as St } from "react/jsx-runtime";
2
- import { memo as Q, useRef as E, useMemo as D, useState as R, useCallback as v, useEffect as It } from "react";
3
- import { Handle as q, Position as V, getBezierPath as wt, BaseEdge as Z, ReactFlowProvider as xt, useReactFlow as kt, useNodesState as Bt, useEdgesState as Tt, ReactFlow as $t, Background as zt, BackgroundVariant as Ft, Controls as Lt, MiniMap as Dt } from "@xyflow/react";
4
- import { motion as N, AnimatePresence as M } from "framer-motion";
5
- import { Canvas as Mt, useFrame as Y } from "@react-three/fiber";
6
- import { Points as tt, PointMaterial as et } from "@react-three/drei";
7
- function Wt({ data: e }) {
8
- const { label: m, subtitle: d, color: l, status: n, isSelected: s } = e, u = s ? 35 : n === "running" ? 30 : n === "error" ? 20 : 15, o = n === "running" ? [1, 1.08, 1] : [1, 1.02, 1], P = s ? 110 : 100;
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
- q,
11
+ tt,
12
12
  {
13
13
  type: "target",
14
- position: V.Left,
14
+ position: et.Left,
15
15
  style: { background: l, border: "none", width: 8, height: 8, opacity: 0.6 }
16
16
  }
17
17
  ),
18
- s && /* @__PURE__ */ t(
19
- N.div,
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: P + 24,
32
- height: P + 24,
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
- N.div,
40
+ w.div,
41
41
  {
42
- animate: { scale: o },
42
+ animate: { scale: d },
43
43
  transition: { duration: 3, repeat: 1 / 0, ease: "easeInOut" },
44
44
  whileHover: {
45
- boxShadow: `0 0 ${u + 15}px ${l}aa, inset 0 0 25px rgba(255,255,255,0.15)`
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: P,
49
- height: P,
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 ${u}px ${l}88, inset 0 0 20px rgba(255,255,255,0.1)`,
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 ${s ? `${l}aa` : `${l}66`}`,
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: m
71
+ children: h
72
72
  }
73
73
  ),
74
- /* @__PURE__ */ t("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: 10, marginTop: 2 }, children: d })
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
- n !== "idle" && n !== "disabled" && /* @__PURE__ */ t(
79
- N.div,
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: n === "running" ? "#2ecc71" : n === "error" ? "#e74c3c" : "#27ae60",
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
- s && /* @__PURE__ */ t(
96
- N.div,
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
- q,
115
+ tt,
116
116
  {
117
117
  type: "source",
118
- position: V.Right,
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 At = Q(Wt);
125
- function Rt({
124
+ const _t = ot(Ot);
125
+ function Gt({
126
126
  id: e,
127
- sourceX: m,
128
- sourceY: d,
127
+ sourceX: h,
128
+ sourceY: u,
129
129
  targetX: l,
130
- targetY: n,
131
- sourcePosition: s,
132
- targetPosition: u,
133
- data: o,
134
- style: P = {}
130
+ targetY: o,
131
+ sourcePosition: n,
132
+ targetPosition: c,
133
+ data: d,
134
+ style: y = {}
135
135
  }) {
136
- const [r] = wt({
137
- sourceX: m,
138
- sourceY: d,
139
- sourcePosition: s,
136
+ const [m] = zt({
137
+ sourceX: h,
138
+ sourceY: u,
139
+ sourcePosition: n,
140
140
  targetX: l,
141
- targetY: n,
142
- targetPosition: u
143
- }), h = (o == null ? void 0 : o.isActive) ?? !1, f = (o == null ? void 0 : o.isDimmed) ?? !1, k = h ? "rgba(46, 204, 113, 0.25)" : "rgba(100, 149, 237, 0.15)", w = h ? "rgba(46, 204, 113, 0.7)" : f ? "rgba(100, 149, 237, 0.12)" : "rgba(100, 149, 237, 0.4)", a = h ? 3 : 2, $ = h ? "12 4" : "8 4";
144
- return /* @__PURE__ */ p(St, { children: [
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
- Z,
146
+ it,
147
147
  {
148
148
  id: `${e}-glow`,
149
- path: r,
149
+ path: m,
150
150
  style: {
151
- stroke: k,
152
- strokeWidth: h ? 10 : 6,
153
- filter: `blur(${h ? 5 : 3}px)`,
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
- ...P
155
+ ...y
156
156
  }
157
157
  }
158
158
  ),
159
159
  /* @__PURE__ */ t(
160
- Z,
160
+ it,
161
161
  {
162
162
  id: e,
163
- path: r,
163
+ path: m,
164
164
  style: {
165
- stroke: w,
166
- strokeWidth: a,
167
- strokeDasharray: $,
165
+ stroke: $,
166
+ strokeWidth: r,
167
+ strokeDasharray: I,
168
168
  transition: "stroke 0.6s, stroke-width 0.6s",
169
- ...P
169
+ ...y
170
170
  }
171
171
  }
172
172
  ),
173
- (o == null ? void 0 : o.label) && /* @__PURE__ */ t("text", { children: /* @__PURE__ */ t(
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: o.label
184
+ children: d.label
185
185
  }
186
186
  ) })
187
187
  ] });
188
188
  }
189
- const Ot = Q(Rt);
190
- function Et({ config: e }) {
191
- const m = E(null), d = e.starCount ?? 2e3, l = e.rotationSpeed ?? 0.02, n = D(() => {
192
- const s = new Float32Array(d * 3);
193
- for (let u = 0; u < d; u++)
194
- s[u * 3] = (Math.random() - 0.5) * 50, s[u * 3 + 1] = (Math.random() - 0.5) * 50, s[u * 3 + 2] = (Math.random() - 0.5) * 50;
195
- return s;
196
- }, [d]);
197
- return Y((s, u) => {
198
- m.current && (m.current.rotation.x -= u * l, m.current.rotation.y -= u * (l * 0.5));
199
- }), /* @__PURE__ */ t(tt, { ref: m, positions: n, stride: 3, frustumCulled: !1, children: /* @__PURE__ */ t(
200
- et,
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 Gt({ config: e }) {
212
- const m = E(null), d = e.nebulaCount ?? 500, l = D(() => {
213
- const n = new Float32Array(d * 3);
214
- for (let s = 0; s < d; s++) {
215
- const u = Math.random() * Math.PI * 2, o = Math.random() * 8 + 5;
216
- n[s * 3] = Math.cos(u) * o + (Math.random() - 0.5) * 3, n[s * 3 + 1] = (Math.random() - 0.5) * 4, n[s * 3 + 2] = Math.sin(u) * o + (Math.random() - 0.5) * 3 - 15;
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 n;
219
- }, [d]);
220
- return Y((n, s) => {
221
- m.current && (m.current.rotation.y += s * 5e-3);
222
- }), /* @__PURE__ */ t(tt, { ref: m, positions: l, stride: 3, frustumCulled: !1, children: /* @__PURE__ */ t(
223
- et,
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 Jt({ config: e = {}, background: m }) {
234
+ function Ut({ config: e = {}, background: h }) {
235
235
  return /* @__PURE__ */ p(
236
- Mt,
236
+ Et,
237
237
  {
238
238
  camera: { position: [0, 0, 15], fov: 60 },
239
- style: { background: m ?? "radial-gradient(ellipse at center, #0a0a2e 0%, #000008 100%)", pointerEvents: "none" },
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(Et, { config: e }),
245
- /* @__PURE__ */ t(Gt, { config: e })
244
+ /* @__PURE__ */ t(Jt, { config: e }),
245
+ /* @__PURE__ */ t(Kt, { config: e })
246
246
  ]
247
247
  }
248
248
  );
249
249
  }
250
- const Ut = "cc-root-eSR-1", jt = "cc-layerStarField-jOb4M", Ht = "cc-layerReactFlow-CeHI9", Xt = "cc-sidePanel-PzU72", _t = "cc-sidePanelHeader-cWPCq", Kt = "cc-sidePanelTitle-Yfh5N", qt = "cc-sidePanelPlanetIcon-aRuLt", Vt = "cc-sidePanelName-TFFeE", Zt = "cc-sidePanelSubtitle-8fp2Y", Qt = "cc-sidePanelClose-Sdg-J", Yt = "cc-sidePanelContent-QIEEQ", te = "cc-sidePanelFooter-DVOHi", ee = "cc-satelliteList--vkXn", ie = "cc-satelliteItem-JGdmG", oe = "cc-satelliteIcon-arUe3", ae = "cc-satelliteInfo-NaKLd", ne = "cc-satelliteName-zfOPN", re = "cc-satelliteSummary-XARVm", le = "cc-enterButton-5Vnri", se = "cc-zoomTransition-Wcju8", ce = "cc-zoomPlanetLabel-3SJT2", de = "cc-planetInterior-GlnW1", ue = "cc-interiorBackButton-qJAiZ", me = "cc-interiorCenter-xdKsX", pe = "cc-interiorPlanet--XIzf", ye = "cc-interiorPlanetLabel-e7yxq", be = "cc-interiorPlanetSubtitle-e2vON", he = "cc-orbitRing-hbvmD", fe = "cc-satelliteNode-01STS", ge = "cc-satelliteNodeIcon-Xq45f", ve = "cc-satelliteNodeLabel-LLOJ5", Ne = "cc-satelliteNodeBadge-HsUFp", Pe = "cc-tutorialOverlay-3GHo7", Ce = "cc-tutorialWelcome-21KDP", Se = "cc-tutorialWelcomeTitle-7GwS9", Ie = "cc-tutorialWelcomeDesc--pznv", we = "cc-tutorialActions-szJ0-", xe = "cc-tutorialButton-wL9-p", ke = "cc-tutorialCard-LGIkK", Be = "cc-tutorialChip-bUoEb", Te = "cc-tutorialCardTitle-r2Y1I", $e = "cc-tutorialCardDesc-nOS-M", ze = "cc-tutorialProgress-wIAT9", Fe = "cc-tutorialProgressBar-PFBdE", Le = "cc-tutorialCardFooter-bSdyM", De = "cc-tutorialStepCounter-i7c5G", Me = "cc-tutorialDots-8M0QU", We = "cc-tutorialDot-518t4", Ae = "cc-topBarSlot-EJGvM", i = {
251
- root: Ut,
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: 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,
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: 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
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 Re({
300
+ function _e({
302
301
  planet: e,
303
- onClose: m,
304
- onEnterPlanet: d,
302
+ onClose: h,
303
+ onEnterPlanet: u,
305
304
  onSatelliteClick: l
306
305
  }) {
307
306
  return /* @__PURE__ */ p(
308
- N.div,
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: m, children: "✕" })
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((n) => /* @__PURE__ */ p(
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: n.id,
346
- satellite: n
344
+ satelliteId: o.id,
345
+ satellite: o
347
346
  }),
348
347
  children: [
349
- /* @__PURE__ */ t("div", { className: i.satelliteIcon, children: n.icon ?? "●" }),
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: n.label }),
352
- n.summary && /* @__PURE__ */ p("div", { className: i.satelliteSummary, children: [
353
- n.summary.total != null && `${n.summary.total} total`,
354
- n.summary.running != null && ` · ${n.summary.running} running`,
355
- n.summary.failed != null && n.summary.failed > 0 && ` · ${n.summary.failed} failed`
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
- n.id
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: d,
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 Oe({
377
+ function Ge({
379
378
  planet: e,
380
- onExit: m,
381
- onSatelliteClick: d,
379
+ onExit: h,
380
+ onSatelliteClick: u,
382
381
  renderCustom: l
383
382
  }) {
384
- const [n, s] = R(null);
383
+ const [o, n] = _(null);
385
384
  if (l)
386
385
  return /* @__PURE__ */ t(
387
- N.div,
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, m)
393
+ children: l(e, h)
395
394
  }
396
395
  );
397
- const u = e.satellites, o = Math.max(180, u.length * 35), P = v(
398
- (r) => {
399
- s(r);
400
- const h = u.find((f) => f.id === r);
401
- d == null || d({
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: r,
404
- satellite: h
402
+ satelliteId: m,
403
+ satellite: b
405
404
  });
406
405
  },
407
- [e.id, u, d]
406
+ [e.id, c, u]
408
407
  );
409
408
  return /* @__PURE__ */ p(
410
- N.div,
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: m, children: "← Back to Universe" }),
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((r) => /* @__PURE__ */ t(
419
+ [1, 2, 3].map((m) => /* @__PURE__ */ t(
421
420
  "div",
422
421
  {
423
422
  className: i.orbitRing,
424
423
  style: {
425
- width: o * r * 0.7,
426
- height: o * r * 0.7,
427
- top: `calc(50% - ${o * r * 0.7 / 2}px)`,
428
- left: `calc(50% - ${o * r * 0.7 / 2}px)`
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
- r
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(M, { children: u.map((r, h) => {
448
- var a;
449
- const f = h / u.length * Math.PI * 2 - Math.PI / 2, k = Math.cos(f) * o, w = Math.sin(f) * o;
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
- N.div,
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: h * 0.08
459
+ delay: b * 0.08
461
460
  },
462
461
  style: {
463
- left: `calc(50% + ${k}px - 32px)`,
464
- top: `calc(50% + ${w}px - 40px)`
462
+ left: `calc(50% + ${M}px - 32px)`,
463
+ top: `calc(50% + ${$}px - 40px)`
465
464
  },
466
- onClick: () => P(r.id),
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: n === r.id ? `${e.color}88` : "rgba(255,255,255,0.15)",
474
- boxShadow: n === r.id ? `0 0 20px ${e.color}44` : "none"
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
- r.icon ?? "●",
478
- ((a = r.summary) == null ? void 0 : a.running) != null && r.summary.running > 0 && /* @__PURE__ */ t("span", { className: i.satelliteNodeBadge, children: r.summary.running })
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: r.label })
481
+ /* @__PURE__ */ t("span", { className: i.satelliteNodeLabel, children: m.label })
483
482
  ]
484
483
  },
485
- r.id
484
+ m.id
486
485
  );
487
486
  }) })
488
487
  ] })
@@ -490,9 +489,9 @@ function Oe({
490
489
  }
491
490
  );
492
491
  }
493
- function Ee({ planet: e }) {
492
+ function He({ planet: e }) {
494
493
  return /* @__PURE__ */ t(
495
- N.div,
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
- N.span,
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 Ge({
519
+ function Je({
521
520
  steps: e,
522
- onHighlightPlanet: m,
523
- onStepChange: d,
524
- onFinish: l,
521
+ planets: h,
522
+ onHighlightPlanet: u,
523
+ onStepChange: l,
524
+ onFinish: o,
525
525
  flyTo: n
526
526
  }) {
527
- const [s, u] = R("welcome"), [o, P] = R(0), r = v(
528
- (C) => {
529
- if (C < 0 || C >= e.length) return;
530
- P(C), d(C);
531
- const g = e[C];
532
- g.planetId && m(g.planetId);
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, d, m]
535
- ), h = v(() => {
536
- u("stepping"), r(0);
537
- }, [r]), f = v(() => {
538
- o < e.length - 1 ? r(o + 1) : (u("complete"), d(-1), m(null), setTimeout(() => l(), 1500));
539
- }, [o, e.length, r, d, m, l]), k = v(() => {
540
- o > 0 && r(o - 1);
541
- }, [o, r]), w = v(() => {
542
- d(-1), m(null), l();
543
- }, [d, m, l]);
544
- It(() => {
545
- if (s !== "stepping") return;
546
- const C = (g) => {
547
- g.key === "ArrowRight" || g.key === "Enter" ? f() : g.key === "ArrowLeft" ? k() : g.key === "Escape" && w();
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", C), () => window.removeEventListener("keydown", C);
550
- }, [s, f, k, w]);
551
- const a = e[o], $ = e.length > 0 ? (o + 1) / e.length * 100 : 0;
552
- return /* @__PURE__ */ p(M, { mode: "wait", children: [
553
- s === "welcome" && /* @__PURE__ */ t(
554
- N.div,
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
- N.div,
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: w,
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: h,
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
- s === "stepping" && a && /* @__PURE__ */ p(
598
- N.div,
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
- a.chipText && /* @__PURE__ */ t(
610
+ I.chipText && /* @__PURE__ */ t(
607
611
  "span",
608
612
  {
609
613
  className: i.tutorialChip,
610
614
  style: {
611
- background: `${a.chipColor ?? "#3b82f6"}22`,
612
- color: a.chipColor ?? "#3b82f6"
615
+ background: `${I.chipColor ?? "#3b82f6"}22`,
616
+ color: I.chipColor ?? "#3b82f6"
613
617
  },
614
- children: a.chipText
618
+ children: I.chipText
615
619
  }
616
620
  ),
617
- /* @__PURE__ */ t("h3", { className: i.tutorialCardTitle, children: a.title }),
618
- /* @__PURE__ */ t("p", { className: i.tutorialCardDesc, children: a.description }),
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__ */ p("span", { className: i.tutorialStepCounter, children: [
628
- o + 1,
629
- " / ",
630
- e.length
631
- ] }),
632
- /* @__PURE__ */ t("div", { className: i.tutorialDots, children: e.map((C, g) => /* @__PURE__ */ t(
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": g === o || void 0,
637
- "data-done": g < o || void 0,
638
- onClick: () => r(g)
645
+ "data-active": P === y || void 0,
646
+ "data-done": P < y || void 0,
647
+ onClick: () => b(P)
639
648
  },
640
- g
649
+ P
641
650
  )) }),
642
651
  /* @__PURE__ */ p("div", { style: { display: "flex", gap: "0.5rem" }, children: [
643
- o > 0 && /* @__PURE__ */ t(
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: k,
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: f,
660
- children: o === e.length - 1 ? "Finish" : "→"
668
+ onClick: M,
669
+ children: y === e.length - 1 ? "Finish" : "→"
661
670
  }
662
671
  )
663
672
  ] })
664
673
  ] })
665
674
  ]
666
675
  },
667
- `step-${o}`
676
+ `step-${y}`
668
677
  ),
669
- s === "complete" && /* @__PURE__ */ t(
670
- N.div,
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
- N.h1,
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 Je = { planet: At }, Ue = { orbit: Ot };
693
- function je({
701
+ const Ke = { planet: _t }, Ue = { orbit: Ht };
702
+ function Ve({
694
703
  planets: e,
695
- orbits: m,
696
- onPlanetClick: d,
704
+ orbits: h,
705
+ onPlanetClick: u,
697
706
  onPlanetEnter: l,
698
- onPlanetExit: n,
699
- onSatelliteClick: s,
700
- onPlanetDrag: u,
701
- tutorialSteps: o,
702
- showTutorial: P,
703
- onTutorialComplete: r,
704
- initialView: h,
705
- onViewChange: f,
706
- renderPlanetInterior: k,
707
- topBar: w,
708
- theme: a,
709
- starField: $ = !0,
710
- nodeTypes: C,
711
- edgeTypes: g,
712
- className: it,
713
- style: ot
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 [S, at] = R(h ?? { mode: "universe" }), [H, nt] = R(P ?? !1), X = E(0), _ = E(""), { setCenter: O } = kt(), I = v(
716
- (c) => {
717
- at(c), f == null || f(c);
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
- [f]
720
- ), G = v(
721
- (c) => e.find((y) => y.id === c),
728
+ [C]
729
+ ), U = v(
730
+ (a) => e.find((s) => s.id === a),
722
731
  [e]
723
- ), rt = D(
724
- () => e.map((c) => ({
725
- id: c.id,
732
+ ), dt = R(
733
+ () => e.map((a) => ({
734
+ id: a.id,
726
735
  type: "planet",
727
- position: { x: c.x, y: c.y },
736
+ position: { x: a.x, y: a.y },
728
737
  data: {
729
- label: c.label,
730
- subtitle: c.subtitle,
731
- color: c.color,
732
- status: c.status ?? "idle",
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
- ), lt = D(
738
- () => m.map((c, y) => ({
739
- id: `orbit-${y}`,
740
- source: c.source,
741
- target: c.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: c.label },
752
+ data: { label: a.label },
744
753
  animated: !0
745
754
  })),
746
- [m]
747
- ), [st, W, ct] = Bt(rt), [dt, J, ut] = Tt(lt), B = v(
748
- (c) => {
749
- W(
750
- (y) => y.map((x) => ({
751
- ...x,
752
- data: { ...x.data, isSelected: x.id === c }
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
- [W]
757
- ), mt = v(
758
- (c) => {
759
- var L;
760
- if (!o) return;
761
- if (c < 0) {
762
- W(
763
- (T) => T.map((b) => ({
764
- ...b,
765
- data: { ...b.data, status: "idle", isSelected: !1 }
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
- ), J(
768
- (T) => T.map((b) => ({
769
- ...b,
799
+ ), j(
800
+ (z) => z.map((f) => ({
801
+ ...f,
770
802
  animated: !0,
771
- data: { ...b.data, isActive: !1, isDimmed: !1 }
803
+ data: { ...f.data, isActive: !1, isDimmed: !1 }
772
804
  }))
773
805
  );
774
806
  return;
775
807
  }
776
- const y = new Set(o.slice(0, c).map((T) => T.planetId)), x = (L = o[c]) == null ? void 0 : L.planetId;
777
- W(
778
- (T) => T.map((b) => {
779
- let A = "idle";
780
- return b.id === x ? A = "running" : y.has(b.id) && (A = "success"), {
781
- ...b,
782
- data: { ...b.data, status: A, isSelected: b.id === x }
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 U = /* @__PURE__ */ new Set([...y, x]);
787
- J(
788
- (T) => T.map((b) => {
789
- const A = y.has(b.source), Ct = U.has(b.target), j = A && Ct;
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
- ...b,
792
- animated: j,
793
- data: { ...b.data, isActive: j, isDimmed: !j }
823
+ ...f,
824
+ animated: q,
825
+ data: { ...f.data, isActive: q, isDimmed: !q }
794
826
  };
795
827
  })
796
828
  );
797
829
  },
798
- [o, W, J]
799
- ), pt = v(
800
- (c, y) => {
801
- const x = Date.now(), U = x - X.current < 300 && _.current === y.id;
802
- X.current = x, _.current = y.id;
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)));
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
- [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 });
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
- [O, B, I, l]
814
- ), yt = v(() => {
815
- I({ mode: "universe" }), n == null || n(), setTimeout(() => {
816
- O(800, 400, { zoom: 0.8, duration: 600 });
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
- }, [O, I, n]), bt = v(
819
- (c, y) => {
820
- u == null || u(y.id, { x: y.position.x, y: y.position.y });
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
- [u]
823
- ), ht = v(() => {
824
- S.mode === "inspecting" && (I({ mode: "universe" }), B(null));
825
- }, [S, B, I]), z = S.mode !== "universe" ? G(S.planetId) : void 0, ft = S.mode !== "planet", gt = D(
826
- () => ({ ...Je, ...C }),
827
- [C]
828
- ), vt = D(
829
- () => ({ ...Ue, ...g }),
830
- [g]
831
- ), Nt = $ !== !1, Pt = typeof $ == "object" ? $ : {}, F = {};
832
- return a != null && a.background && (F["--cc-bg"] = a.background), a != null && a.textColor && (F["--cc-text"] = a.textColor), a != null && a.panelBackground && (F["--cc-panel-bg"] = a.panelBackground), a != null && a.panelBorder && (F["--cc-panel-border"] = a.panelBorder), a != null && a.controlsBackground && (F["--cc-controls-bg"] = a.controlsBackground), a != null && a.fontFamily && (F["--cc-font-family"] = a.fontFamily), /* @__PURE__ */ p(
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} ${it ?? ""}`,
836
- style: { ...F, ...ot },
879
+ className: `${i.root} ${P ?? ""}`,
880
+ style: { ...A, ...O },
837
881
  children: [
838
- Nt && /* @__PURE__ */ t("div", { className: i.layerStarField, children: /* @__PURE__ */ t(
839
- Jt,
882
+ It && /* @__PURE__ */ t("div", { className: i.layerStarField, children: /* @__PURE__ */ t(
883
+ Ut,
840
884
  {
841
- config: Pt,
842
- background: a == null ? void 0 : a.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": !ft || void 0,
893
+ "data-hidden": !wt || void 0,
850
894
  children: /* @__PURE__ */ p(
851
- $t,
895
+ Dt,
852
896
  {
853
- nodes: st,
854
- edges: dt,
855
- onNodesChange: ct,
856
- onEdgesChange: ut,
857
- onNodeClick: pt,
858
- onNodeDragStop: bt,
859
- onPaneClick: ht,
860
- nodeTypes: gt,
861
- edgeTypes: vt,
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
- zt,
915
+ Tt,
872
916
  {
873
- variant: Ft.Dots,
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__ */ t(
880
- Lt,
923
+ /* @__PURE__ */ p(
924
+ At,
881
925
  {
882
- style: {
883
- top: 60,
884
- background: (a == null ? void 0 : a.controlsBackground) ?? "rgba(20, 20, 40, 0.8)",
885
- borderColor: "rgba(255, 255, 255, 0.1)"
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
- Dt,
958
+ Rt,
891
959
  {
892
- style: {
893
- background: "rgba(10, 10, 26, 0.9)",
894
- border: "1px solid rgba(255, 255, 255, 0.1)"
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(M, { children: S.mode === "entering" && z && /* @__PURE__ */ t(Ee, { planet: z }) }),
909
- /* @__PURE__ */ t(M, { children: S.mode === "planet" && z && /* @__PURE__ */ t(
910
- Oe,
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: z,
913
- onExit: yt,
914
- onSatelliteClick: s,
915
- renderCustom: k
979
+ planet: W,
980
+ onExit: X,
981
+ onSatelliteClick: n,
982
+ renderCustom: M
916
983
  }
917
984
  ) }),
918
- /* @__PURE__ */ t(M, { children: S.mode === "inspecting" && z && /* @__PURE__ */ t(
919
- Re,
985
+ /* @__PURE__ */ t(E, { children: N.mode === "inspecting" && W && /* @__PURE__ */ t(
986
+ _e,
920
987
  {
921
- planet: z,
988
+ planet: W,
922
989
  onClose: () => {
923
- I({ mode: "universe" }), B(null);
990
+ k({ mode: "universe" }), B(null), x(800, 400, { zoom: 0.8, duration: 600 });
924
991
  },
925
- onEnterPlanet: () => K(z),
926
- onSatelliteClick: s
992
+ onEnterPlanet: () => Y(W),
993
+ onSatelliteClick: n
927
994
  }
928
995
  ) }),
929
- w && !H && /* @__PURE__ */ t("div", { className: i.topBarSlot, children: w }),
930
- /* @__PURE__ */ t(M, { children: H && o && o.length > 0 && /* @__PURE__ */ t(
931
- Ge,
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: o,
1000
+ steps: d,
1001
+ planets: e,
934
1002
  onHighlightPlanet: B,
935
- onStepChange: mt,
1003
+ onStepChange: gt,
936
1004
  onFinish: () => {
937
- nt(!1), r == null || r();
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 Ze(e) {
946
- return /* @__PURE__ */ t(xt, { children: /* @__PURE__ */ t(je, { ...e }) });
1014
+ function ti(e) {
1015
+ return /* @__PURE__ */ t($t, { children: /* @__PURE__ */ t(Ve, { ...e }) });
947
1016
  }
948
1017
  export {
949
- Ze as CosmosCanvas,
950
- Ge as CosmosTutorial,
951
- Ot as OrbitEdge,
952
- Oe as PlanetInterior,
953
- At as PlanetNode,
954
- Re as SidePanel,
955
- Jt as StarField,
956
- Ee as ZoomTransition
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
  };