@sia.soul/sia-react-ui 0.1.106 → 0.1.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/Button-BiL3Wjsd.d.ts +44 -0
  2. package/dist/Button-O_pNB3SQ.d.cts +44 -0
  3. package/dist/{Select-DmT9pFRW.d.ts → Select-BddM4uXC.d.ts} +4 -42
  4. package/dist/{Select-DQpfyK7I.d.cts → Select-Cf0xz1Tg.d.cts} +4 -42
  5. package/dist/chart.js +5 -3
  6. package/dist/chunk-4TTHKFJ7.js +706 -0
  7. package/dist/chunk-CZ2ITBRW.js +65 -0
  8. package/dist/{chunk-EYB55TC5.js → chunk-D3HXXEEZ.js} +9 -5
  9. package/dist/{chunk-X4OLHWC3.js → chunk-GPCUD6FA.js} +23 -13
  10. package/dist/chunk-KY6A5IJH.js +18 -0
  11. package/dist/{chunk-NURPAO7G.js → chunk-MMSYWDTR.js} +9 -5
  12. package/dist/{chunk-PUZWLIIJ.js → chunk-NZMUW5XI.js} +1 -13
  13. package/dist/{chunk-D456SSL3.js → chunk-OJ2WDC66.js} +6 -4
  14. package/dist/{chunk-V6CRVCSB.js → chunk-QV3AP6A2.js} +40 -729
  15. package/dist/chunk-RX242MUO.js +0 -0
  16. package/dist/chunk-SCEHVGKV.js +75 -0
  17. package/dist/{chunk-TUXNOSCT.js → chunk-SO7IJZIR.js} +4 -2
  18. package/dist/{chunk-T3EGAN7O.js → chunk-WD56MJO2.js} +5 -3
  19. package/dist/{core-DF7gei-P.d.cts → core-KJBvQlUc.d.cts} +12 -3
  20. package/dist/{core-_1K1jLyH.d.ts → core-OuydQbFN.d.ts} +12 -3
  21. package/dist/core.cjs +15 -7
  22. package/dist/core.css +42 -0
  23. package/dist/core.d.cts +3 -2
  24. package/dist/core.d.ts +3 -2
  25. package/dist/core.js +12 -7
  26. package/dist/game.cjs +2815 -0
  27. package/dist/game.css +8929 -0
  28. package/dist/game.d.cts +439 -0
  29. package/dist/game.d.ts +439 -0
  30. package/dist/game.js +1034 -0
  31. package/dist/index.cjs +5528 -5464
  32. package/dist/index.css +82 -0
  33. package/dist/index.d.cts +45 -10
  34. package/dist/index.d.ts +45 -10
  35. package/dist/index.js +718 -656
  36. package/dist/markdown-editor.js +3 -2
  37. package/dist/rich-text-editor.cjs +3 -1
  38. package/dist/rich-text-editor.js +7 -4
  39. package/dist/{select-date-range-BT71tp7y.d.cts → select-date-range-Cm5o2xPp.d.cts} +1 -1
  40. package/dist/{select-date-range-CFGzoyLs.d.ts → select-date-range-yGDEA1RP.d.ts} +1 -1
  41. package/dist/select-date-range.d.cts +3 -2
  42. package/dist/select-date-range.d.ts +3 -2
  43. package/dist/select-date-range.js +8 -5
  44. package/package.json +9 -3
  45. package/dist/chunk-SJFT5OSX.js +0 -131
package/dist/game.js ADDED
@@ -0,0 +1,1034 @@
1
+ import "./chunk-RX242MUO.js";
2
+ import {
3
+ Modal
4
+ } from "./chunk-QV3AP6A2.js";
5
+ import {
6
+ Button
7
+ } from "./chunk-CZ2ITBRW.js";
8
+ import "./chunk-NZMUW5XI.js";
9
+
10
+ // src/game/engine.ts
11
+ function createIdleEngine(definition) {
12
+ const MAPS = definition.maps, PETS = definition.pets, slots = definition.slots, RARITIES = definition.rarities;
13
+ const slotKeys = Object.keys(slots), SLOTS = Object.fromEntries(slotKeys.map((key) => [key, slots[key].name]));
14
+ const positive = (value) => Number.isFinite(value) && value > 0;
15
+ if (!MAPS.length || !PETS.length || !slotKeys.length || RARITIES.length < 3 || new Set(PETS.map((p) => p.id)).size !== PETS.length || MAPS.some((m, i) => m.id !== i || !slots[m.rewardSlot] || !positive(m.hp) || !positive(m.bossHp) || [m.atk, m.bossAtk, m.xp, m.gold].some((n) => !Number.isFinite(n) || n < 0)) || PETS.some((p) => !p.id || !Number.isFinite(p.cost) || p.cost < 0 || !Number.isFinite(p.base) || p.base < 0) || slotKeys.some((k) => slots[k].names.length !== RARITIES.length || Object.values(slots[k].base).some((n) => !Number.isFinite(n) || n < 0)) || definition.turnDurationMs !== void 0 && (!Number.isInteger(definition.turnDurationMs) || definition.turnDurationMs < 1e3 || definition.turnDurationMs > 5e3) || definition.offlineCapSeconds !== void 0 && (!Number.isInteger(definition.offlineCapSeconds) || definition.offlineCapSeconds < 0 || definition.offlineCapSeconds > 43200))
16
+ throw new Error("\u6E38\u620F\u5185\u5BB9\u914D\u7F6E\u4E0D\u6B63\u786E");
17
+ const busy2 = (s) => Boolean(s.fight?.boss && s.fight.status === "active");
18
+ const copy = (value) => JSON.parse(JSON.stringify(value));
19
+ function makeGear(slot, tier = 0, rank = 0, id = Date.now()) {
20
+ const scale = (1 + tier * 0.75) * (1 + rank * 0.45);
21
+ return { id: String(id), slot, tier, rank, name: slots[slot].names[tier], atk: Math.round(slots[slot].base.atk * scale), def: Math.round(slots[slot].base.def * scale), hp: Math.round(slots[slot].base.hp * scale), locked: false };
22
+ }
23
+ function freshState(now = Date.now()) {
24
+ return { version: 1, name: definition.heroName, level: 1, xp: 0, gold: 120, essence: 30, material: 0, map: 0, unlocked: 0, cleared: [], idle: false, kills: 0, bossWins: 0, inventory: [], equipment: Object.fromEntries(slotKeys.map((key) => [key, slots[key].starter ? makeGear(key, 0, 0, `starter-${key}`) : null])), upgrades: Object.fromEntries(slotKeys.map((key) => [key, 0])), pet: PETS[0].id, pets: { [PETS[0].id]: 1 }, nextId: 1, savedAt: now, sessionGold: 0, sessionXp: 0, sessionDrops: 0, logs: [], fight: null };
25
+ }
26
+ const xpNeeded = (s) => 50 + s.level * 30;
27
+ function stats(s) {
28
+ const result = { power: 0, atk: 16 + (s.level - 1) * 4, def: 3 + (s.level - 1) * 2, hp: 165 + (s.level - 1) * 23 };
29
+ for (const [slot, item] of Object.entries(s.equipment))
30
+ if (item) {
31
+ const multiplier = 1 + s.upgrades[slot] * 0.16;
32
+ for (const key of ["atk", "def", "hp"])
33
+ result[key] += Math.round(item[key] * multiplier);
34
+ }
35
+ result.power = result.atk * 5 + result.def * 3 + Math.round(result.hp / 5) + (s.pets[s.pet] || 0) * 18;
36
+ return result;
37
+ }
38
+ function addLog(s, text, type = "info") {
39
+ s.logs.unshift({ text, type, time: Date.now() });
40
+ s.logs = s.logs.slice(0, 60);
41
+ }
42
+ function addDrop(s, item) {
43
+ s.sessionDrops++;
44
+ if (s.inventory.length >= 80) {
45
+ s.material += 2 + item.tier * 2;
46
+ return false;
47
+ }
48
+ s.inventory.push(item);
49
+ return true;
50
+ }
51
+ function grant(s, xp, gold) {
52
+ s.xp += xp;
53
+ s.gold += gold;
54
+ s.sessionGold += gold;
55
+ s.sessionXp += xp;
56
+ while (s.xp >= xpNeeded(s) && s.level < 60) {
57
+ s.xp -= xpNeeded(s);
58
+ s.level++;
59
+ addLog(s, `\u5883\u754C\u7CBE\u8FDB\uFF0C\u5347\u81F3 ${s.level} \u7EA7\uFF01`, "rare");
60
+ }
61
+ }
62
+ function beginFight(s, boss = false) {
63
+ if (boss && busy2(s))
64
+ return;
65
+ const m = MAPS[s.map], st = stats(s);
66
+ s.fight = { boss, hp: st.hp, maxHp: st.hp, enemyHp: boss ? m.bossHp : m.hp, enemyMax: boss ? m.bossHp : m.hp, turn: 0, status: "active", recovery: 0 };
67
+ if (boss)
68
+ addLog(s, `\u5411 ${m.boss} \u53D1\u8D77\u6311\u6218\u3002`, "boss");
69
+ }
70
+ function tick(s, rng = Math.random) {
71
+ if (!s.idle && !s.fight?.boss)
72
+ return null;
73
+ if (!s.fight)
74
+ beginFight(s);
75
+ let f = s.fight;
76
+ if (f.status !== "active") {
77
+ if (++f.recovery < 2)
78
+ return null;
79
+ if (!s.idle) {
80
+ s.fight = null;
81
+ return null;
82
+ }
83
+ beginFight(s);
84
+ f = s.fight;
85
+ }
86
+ const st = stats(s), m = MAPS[s.map];
87
+ f.turn++;
88
+ const skill = f.turn % 3 === 0, crit = rng() < 0.13;
89
+ const damage = Math.round(st.atk * (skill ? 1.65 : 1) * (crit ? 1.5 : 1));
90
+ const pet = PETS.find((p) => p.id === s.pet), petLevel = s.pets[s.pet] || 1;
91
+ const enemyBefore = f.enemyHp, heroBefore = f.hp;
92
+ const enemyAfterHero = Math.max(0, f.enemyHp - damage);
93
+ const petDamage = pet.effect === "attack" && enemyAfterHero > 0 ? pet.base + (petLevel - 1) * 3 : 0;
94
+ f.enemyHp = Math.max(0, enemyAfterHero - petDamage);
95
+ const cycle = f.turn % 5;
96
+ const move = !f.boss || cycle === 1 || cycle === 2 ? "strike" : cycle === 3 ? "charge" : cycle === 4 ? "heavy" : "recover";
97
+ const playback = { turn: f.turn, boss: f.boss, move, heroBefore, heroAfterImpact: heroBefore, heroAfter: heroBefore, enemyBefore, enemyAfterHero, enemyAfter: f.enemyHp, healed: 0, guarded: pet.effect === "guard", won: false, xp: 0, gold: 0 };
98
+ const event = { damage, petDamage, crit, skill, incoming: 0, playback };
99
+ if (f.enemyHp === 0) {
100
+ f.status = "won";
101
+ playback.won = true;
102
+ s.kills++;
103
+ if (f.boss) {
104
+ s.bossWins++;
105
+ const first = !s.cleared.includes(s.map);
106
+ grant(s, m.xp * (first ? 6 : 2), m.gold * (first ? 8 : 3));
107
+ playback.xp = m.xp * (first ? 6 : 2);
108
+ playback.gold = m.gold * (first ? 8 : 3);
109
+ s.essence += first ? 50 : 12;
110
+ if (first) {
111
+ s.cleared.push(s.map);
112
+ s.unlocked = Math.min(MAPS.length - 1, Math.max(s.unlocked, s.map + 1));
113
+ const item = makeGear(m.rewardSlot, 1, s.map, `drop-${s.nextId++}`);
114
+ addDrop(s, item);
115
+ event.reward = item.name;
116
+ addLog(s, `\u9996\u901A ${m.boss}\uFF01\u83B7\u5F97 ${item.name}\uFF0C${s.map < MAPS.length - 1 ? "\u65B0\u7684\u897F\u884C\u5730\u56FE\u5DF2\u89E3\u9501\u3002" : "\u5168\u90E8\u7AE0\u8282\u8BD5\u70BC\u5B8C\u6210\uFF01"}`, "rare");
117
+ } else
118
+ addLog(s, `\u518D\u6B21\u51FB\u8D25 ${m.boss}\uFF0C\u83B7\u5F97\u4FEE\u884C\u5956\u52B1\u3002`, "rare");
119
+ event.bossWin = true;
120
+ event.first = first;
121
+ } else {
122
+ grant(s, m.xp, m.gold);
123
+ playback.xp = m.xp;
124
+ playback.gold = m.gold;
125
+ s.essence += 2;
126
+ if (rng() < 0.38) {
127
+ const item = makeGear(Object.keys(SLOTS)[Math.min(slotKeys.length - 1, Math.floor(rng() * slotKeys.length))], rng() < 0.12 ? 2 : rng() < 0.45 ? 1 : 0, s.map, `drop-${s.nextId++}`);
128
+ const kept = addDrop(s, item);
129
+ addLog(s, kept ? `\u62FE\u5F97 ${RARITIES[item.tier]} \xB7 ${item.name}` : "\u80CC\u5305\u5DF2\u6EE1\uFF0C\u65B0\u6389\u843D\u5DF2\u8F6C\u4E3A\u953B\u6750\u3002", "loot");
130
+ event.drop = item.name;
131
+ }
132
+ }
133
+ return event;
134
+ }
135
+ const incoming = move === "charge" || move === "recover" ? 0 : Math.max(1, Math.round(((f.boss ? m.bossAtk : m.atk) * (move === "heavy" ? 2 : 1) - st.def) * (pet.effect === "guard" ? 0.75 : 1)));
136
+ f.hp = Math.max(0, f.hp - incoming);
137
+ event.incoming = incoming;
138
+ playback.heroAfterImpact = f.hp;
139
+ if (pet.effect === "heal" && f.hp > 0) {
140
+ playback.healed = Math.min(f.maxHp - f.hp, 7 + petLevel * 3);
141
+ f.hp += playback.healed;
142
+ }
143
+ playback.heroAfter = f.hp;
144
+ if (f.hp === 0 || f.turn >= 60) {
145
+ f.status = "lost";
146
+ event.lost = true;
147
+ addLog(s, `${f.boss ? m.boss : m.enemy}\u6311\u6218\u5931\u5229\uFF1A${f.hp === 0 ? "\u6C14\u8840\u8017\u5C3D\uFF0C\u53EF\u5F3A\u5316\u8863\u888D\u6216\u57F9\u517B\u7075\u5BA0\u3002" : "\u8F93\u51FA\u4E0D\u8DB3\uFF0C\u53EF\u66F4\u6362\u6B66\u5668\u3002"}\u4F11\u6574\u540E\u7EE7\u7EED\u3002`, "boss");
148
+ }
149
+ return event;
150
+ }
151
+ function equip(s, id) {
152
+ if (busy2(s))
153
+ return false;
154
+ const index = s.inventory.findIndex((i) => i.id === id);
155
+ if (index < 0)
156
+ return false;
157
+ const item = s.inventory.splice(index, 1)[0], old = s.equipment[item.slot];
158
+ if (old)
159
+ s.inventory.push(old);
160
+ s.equipment[item.slot] = item;
161
+ addLog(s, `\u88C5\u5907\u4E86 ${item.name}\u3002`, "loot");
162
+ return true;
163
+ }
164
+ const upgradeCost = (s, slot) => 45 + s.upgrades[slot] * 35;
165
+ function upgrade(s, slot) {
166
+ if (busy2(s))
167
+ return false;
168
+ if (!s.equipment[slot] || s.upgrades[slot] >= 10 || s.gold < upgradeCost(s, slot))
169
+ return false;
170
+ s.gold -= upgradeCost(s, slot);
171
+ s.upgrades[slot]++;
172
+ return true;
173
+ }
174
+ function dismantle(s, id) {
175
+ if (busy2(s))
176
+ return false;
177
+ const index = s.inventory.findIndex((i) => i.id === id && !i.locked);
178
+ if (index < 0)
179
+ return false;
180
+ const [item] = s.inventory.splice(index, 1);
181
+ s.material += 2 + item.tier * 2;
182
+ return true;
183
+ }
184
+ function forge(s) {
185
+ if (busy2(s))
186
+ return false;
187
+ if (s.material < 12)
188
+ return false;
189
+ s.material -= 12;
190
+ const slots2 = Object.keys(SLOTS), slot = slots2[(s.nextId - 1) % slotKeys.length];
191
+ addDrop(s, makeGear(slot, 2, s.map, `drop-${s.nextId++}`));
192
+ return true;
193
+ }
194
+ function trainPet(s, id) {
195
+ if (busy2(s))
196
+ return false;
197
+ const level = s.pets[id];
198
+ if (!level || level >= 20)
199
+ return false;
200
+ const cost = level * 15;
201
+ if (s.essence < cost)
202
+ return false;
203
+ s.essence -= cost;
204
+ s.pets[id]++;
205
+ return true;
206
+ }
207
+ function unlockPet(s, id) {
208
+ if (busy2(s))
209
+ return false;
210
+ const pet = PETS.find((p) => p.id === id);
211
+ if (!pet || s.pets[id] || s.essence < pet.cost)
212
+ return false;
213
+ s.essence -= pet.cost;
214
+ s.pets[id] = 1;
215
+ return true;
216
+ }
217
+ function hydrate(input, now = Date.now()) {
218
+ if (!input || typeof input !== "object")
219
+ throw new Error("\u5B58\u6863\u683C\u5F0F\u4E0D\u6B63\u786E");
220
+ const raw = input;
221
+ if (!raw || raw.version !== 1 || !Array.isArray(raw.inventory) || !raw.equipment || !raw.pets)
222
+ throw new Error("\u5B58\u6863\u683C\u5F0F\u4E0D\u6B63\u786E");
223
+ const s = freshState(now), number = (v, min, max) => typeof v === "number" && Number.isFinite(v) ? Math.max(min, Math.min(max, Math.floor(v))) : min;
224
+ for (const key of ["gold", "xp", "essence", "material", "kills", "bossWins", "sessionGold", "sessionXp", "sessionDrops"])
225
+ s[key] = number(raw[key], 0, 1e9);
226
+ s.level = number(raw.level, 1, 60);
227
+ s.unlocked = number(raw.unlocked, 0, MAPS.length - 1);
228
+ s.map = number(raw.map, 0, s.unlocked);
229
+ s.nextId = number(raw.nextId, 1, 1e9);
230
+ s.savedAt = number(raw.savedAt, 0, now);
231
+ s.idle = raw.idle === true;
232
+ s.cleared = [...new Set((Array.isArray(raw.cleared) ? raw.cleared : []).filter((v) => Number.isInteger(v) && v >= 0 && v < MAPS.length))];
233
+ const validItem = (item) => !!item && typeof item.id === "string" && item.id.length < 80 && /^[a-zA-Z0-9_-]+$/.test(item.id) && Object.hasOwn(SLOTS, item.slot) && Number.isInteger(item.tier) && item.tier >= 0 && item.tier < RARITIES.length;
234
+ const cleanItem = (item) => ({ ...makeGear(item.slot, item.tier, number(item.rank, 0, MAPS.length - 1), item.id), locked: item.locked === true });
235
+ s.inventory = raw.inventory.slice(0, 80).filter(validItem).map(cleanItem);
236
+ for (const slot of Object.keys(SLOTS)) {
237
+ s.equipment[slot] = validItem(raw.equipment[slot]) && raw.equipment[slot].slot === slot ? cleanItem(raw.equipment[slot]) : null;
238
+ s.upgrades[slot] = number(raw.upgrades?.[slot], 0, 10);
239
+ }
240
+ for (const pet of PETS)
241
+ if (raw.pets[pet.id])
242
+ s.pets[pet.id] = number(raw.pets[pet.id], 1, 20);
243
+ s.pet = Object.hasOwn(s.pets, raw.pet) ? raw.pet : PETS[0].id;
244
+ return s;
245
+ }
246
+ function settleOffline(s, now = Date.now(), rng = Math.random) {
247
+ const seconds = Math.min(definition.offlineCapSeconds ?? 43200, Math.max(0, Math.floor((now - s.savedAt) / 1e3)));
248
+ if (!s.idle || seconds < 15) {
249
+ s.savedAt = now;
250
+ return null;
251
+ }
252
+ const before = { xp: s.sessionXp, gold: s.gold, drops: s.sessionDrops, essence: s.essence, kills: s.kills };
253
+ s.fight = null;
254
+ for (let i = 0; i < Math.floor(seconds * 1e3 / (definition.turnDurationMs ?? 1e3)); i++)
255
+ tick(s, rng);
256
+ s.fight = null;
257
+ s.savedAt = now;
258
+ return { seconds, xp: s.sessionXp - before.xp, gold: s.gold - before.gold, drops: s.sessionDrops - before.drops, essence: s.essence - before.essence, kills: s.kills - before.kills };
259
+ }
260
+ function serialize(s, now = Date.now()) {
261
+ const saved = copy(s);
262
+ saved.savedAt = now;
263
+ saved.fight = null;
264
+ saved.logs = [];
265
+ return JSON.stringify(saved);
266
+ }
267
+ return { definition, freshState, makeGear, xpNeeded, stats, addLog, grant, beginFight, tick, equip, upgradeCost, upgrade, dismantle, forge, trainPet, unlockPet, hydrate, settleOffline, serialize };
268
+ }
269
+
270
+ // src/game/components.tsx
271
+ import { useRef, useState } from "react";
272
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
273
+ function GameSprite({ asset, className = "" }) {
274
+ return /* @__PURE__ */ jsx("img", { className: `unit-art ${asset.flip ? "face-left" : ""} ${className}`, src: asset.src, alt: "", "aria-hidden": "true", draggable: false, decoding: "async" });
275
+ }
276
+ function GameButton({ className = "", ...props }) {
277
+ return /* @__PURE__ */ jsx(Button, { ...props, className: `game-button ${className}` });
278
+ }
279
+ var fmt = (n) => Math.floor(n).toLocaleString("zh-CN");
280
+ var busy = (s) => Boolean(s.fight?.boss && s.fight.status === "active");
281
+ var command = (fn, type, id) => () => fn({ type, id });
282
+ function Title({ kicker, title, children }) {
283
+ return /* @__PURE__ */ jsxs("div", { className: "view-title", children: [
284
+ /* @__PURE__ */ jsxs("div", { children: [
285
+ /* @__PURE__ */ jsx("span", { className: "eyebrow", children: kicker }),
286
+ /* @__PURE__ */ jsx("h1", { children: title })
287
+ ] }),
288
+ children
289
+ ] });
290
+ }
291
+ function ItemStats({ item }) {
292
+ return /* @__PURE__ */ jsxs("div", { className: "item-stats", children: [
293
+ /* @__PURE__ */ jsxs("span", { children: [
294
+ "\u653B\u51FB +",
295
+ item.atk
296
+ ] }),
297
+ /* @__PURE__ */ jsxs("span", { children: [
298
+ "\u9632\u5FA1 +",
299
+ item.def
300
+ ] }),
301
+ /* @__PURE__ */ jsxs("span", { children: [
302
+ "\u6C14\u8840 +",
303
+ item.hp
304
+ ] })
305
+ ] });
306
+ }
307
+ function GameShell({ engine, state, onAction, page, children }) {
308
+ const d = engine.definition, view = { engine, state, onAction };
309
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
310
+ /* @__PURE__ */ jsxs("header", { className: "topbar", children: [
311
+ /* @__PURE__ */ jsxs("div", { className: "brand", children: [
312
+ /* @__PURE__ */ jsx("span", { className: "brand-seal", children: d.title[0] }),
313
+ /* @__PURE__ */ jsxs("span", { className: "brand-title", children: [
314
+ d.title,
315
+ /* @__PURE__ */ jsx("small", { children: d.subtitle })
316
+ ] })
317
+ ] }),
318
+ /* @__PURE__ */ jsxs("div", { className: "realm", children: [
319
+ /* @__PURE__ */ jsx("span", { className: "live-dot" }),
320
+ "\u5355\u4EBA\u4FEE\u884C / \u653E\u7F6E\u5386\u7EC3"
321
+ ] }),
322
+ /* @__PURE__ */ jsxs("div", { className: "top-actions", children: [
323
+ /* @__PURE__ */ jsx("span", { className: "version", children: "Sia Game \xB7 v0.3" }),
324
+ /* @__PURE__ */ jsx(GameButton, { className: "icon-button", "aria-label": "\u8BBE\u7F6E\u4E0E\u5B58\u6863", onClick: command(onAction, "settings"), children: "\u2699" })
325
+ ] })
326
+ ] }),
327
+ /* @__PURE__ */ jsxs("nav", { className: "navigation", "aria-label": "\u4E3B\u5BFC\u822A", children: [
328
+ [["battle", "\u2694", "\u6302\u673A\u5386\u7EC3"], ["maps", "\u25A7", "\u4E16\u754C\u5730\u56FE"], ["gear", "\u25A3", "\u88C5\u5907\u80CC\u5305"], ["pets", "\u2667", "\u4F19\u4F34\u56FE\u9274"]].map(([id, icon, text]) => /* @__PURE__ */ jsxs(GameButton, { className: `nav-item ${page === id ? "active" : ""}`, "aria-current": page === id ? "page" : void 0, onClick: command(onAction, "page", id), children: [
329
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon }),
330
+ d.labels?.[id] || text,
331
+ id === "gear" && /* @__PURE__ */ jsx("span", { className: "nav-count", children: state.inventory.length })
332
+ ] }, id)),
333
+ /* @__PURE__ */ jsx("span", { className: "nav-verse", children: d.subtitle })
334
+ ] }),
335
+ /* @__PURE__ */ jsxs("div", { className: "workspace", children: [
336
+ /* @__PURE__ */ jsx("aside", { className: "character-panel", children: /* @__PURE__ */ jsx(GameCharacterPanel, { ...view }) }),
337
+ /* @__PURE__ */ jsx("main", { children }),
338
+ /* @__PURE__ */ jsxs("aside", { className: "right-panel", children: [
339
+ /* @__PURE__ */ jsx(GameBossPanel, { ...view }),
340
+ /* @__PURE__ */ jsx(GameLogPanel, { ...view }),
341
+ /* @__PURE__ */ jsxs("div", { className: "save-state", children: [
342
+ "\u672C\u5730\u81EA\u52A8\u5B58\u6863 \xB7 \u79BB\u7EBF\u4E0A\u9650 ",
343
+ (d.offlineCapSeconds ?? 43200) / 3600,
344
+ " \u5C0F\u65F6"
345
+ ] })
346
+ ] })
347
+ ] }),
348
+ /* @__PURE__ */ jsxs("footer", { children: [
349
+ d.title,
350
+ " / ",
351
+ d.subtitle,
352
+ /* @__PURE__ */ jsx("span", { children: "\u7531 SiaWebUI Game Framework \u9A71\u52A8" })
353
+ ] })
354
+ ] });
355
+ }
356
+ function GameCharacterPanel({ engine, state: s, onAction }) {
357
+ const d = engine.definition, st = engine.stats(s), pet = d.pets.find((p) => p.id === s.pet);
358
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
359
+ /* @__PURE__ */ jsxs("div", { className: "profile-top", children: [
360
+ /* @__PURE__ */ jsx("div", { className: "avatar", children: /* @__PURE__ */ jsx(GameSprite, { asset: d.hero }) }),
361
+ /* @__PURE__ */ jsxs("div", { children: [
362
+ /* @__PURE__ */ jsx("span", { className: "eyebrow", children: d.hero.identity }),
363
+ /* @__PURE__ */ jsx("h2", { children: s.name }),
364
+ /* @__PURE__ */ jsxs("span", { className: "level-tag", children: [
365
+ "Lv.",
366
+ s.level,
367
+ " ",
368
+ /* @__PURE__ */ jsx("span", { children: "\u4FEE\u884C\u8005" })
369
+ ] })
370
+ ] })
371
+ ] }),
372
+ /* @__PURE__ */ jsxs("div", { className: "power", children: [
373
+ /* @__PURE__ */ jsx("span", { children: "\u7EFC\u5408\u6218\u529B" }),
374
+ /* @__PURE__ */ jsx("strong", { children: fmt(st.power) })
375
+ ] }),
376
+ /* @__PURE__ */ jsxs("div", { className: "experience", children: [
377
+ /* @__PURE__ */ jsxs("div", { children: [
378
+ /* @__PURE__ */ jsx("span", { children: "\u4FEE\u884C\u7ECF\u9A8C" }),
379
+ /* @__PURE__ */ jsxs("span", { children: [
380
+ fmt(s.xp),
381
+ " / ",
382
+ engine.xpNeeded(s)
383
+ ] })
384
+ ] }),
385
+ /* @__PURE__ */ jsx("div", { className: "progress", role: "progressbar", "aria-label": "\u4FEE\u884C\u7ECF\u9A8C", "aria-valuenow": s.xp, "aria-valuemin": 0, "aria-valuemax": engine.xpNeeded(s), children: /* @__PURE__ */ jsx("i", { style: { width: `${Math.min(100, s.xp / engine.xpNeeded(s) * 100)}%` } }) })
386
+ ] }),
387
+ /* @__PURE__ */ jsx("div", { className: "attributes", children: [["\u6C14\u8840", st.hp], ["\u653B\u51FB", st.atk], ["\u9632\u5FA1", st.def], ["\u66B4\u51FB", "13%"]].map(([name, value]) => /* @__PURE__ */ jsxs("div", { children: [
388
+ /* @__PURE__ */ jsx("span", { children: name }),
389
+ /* @__PURE__ */ jsx("b", { children: value })
390
+ ] }, name)) }),
391
+ /* @__PURE__ */ jsx("div", { className: "line-heading", children: "\u968F\u8EAB\u8D44\u8D22" }),
392
+ /* @__PURE__ */ jsx("div", { className: "wallet", children: [["\u94DC\u94B1", s.gold], ["\u7075\u8574", s.essence], ["\u953B\u6750", s.material]].map(([name, value]) => /* @__PURE__ */ jsxs("div", { children: [
393
+ /* @__PURE__ */ jsx("span", { children: name }),
394
+ /* @__PURE__ */ jsx("b", { children: fmt(Number(value)) })
395
+ ] }, name)) }),
396
+ /* @__PURE__ */ jsxs("div", { className: "line-heading", children: [
397
+ /* @__PURE__ */ jsx("span", { children: "\u8EAB\u4E0A\u88C5\u5907" }),
398
+ /* @__PURE__ */ jsx(GameButton, { className: "text-button", onClick: command(onAction, "page", "gear"), children: "\u7BA1\u7406 \u203A" })
399
+ ] }),
400
+ /* @__PURE__ */ jsx("div", { className: "equipped-list", children: Object.entries(d.slots).map(([key, slot]) => /* @__PURE__ */ jsxs(GameButton, { className: "equipped-item", onClick: command(onAction, "page", "gear"), children: [
401
+ /* @__PURE__ */ jsx("span", { className: "slot-symbol", children: "\u25C7" }),
402
+ /* @__PURE__ */ jsxs("span", { children: [
403
+ /* @__PURE__ */ jsx("small", { children: slot.name }),
404
+ /* @__PURE__ */ jsx("b", { children: s.equipment[key]?.name || "\u5C1A\u672A\u88C5\u5907" })
405
+ ] }),
406
+ /* @__PURE__ */ jsx("em", { children: s.upgrades[key] ? `+${s.upgrades[key]}` : "\u203A" })
407
+ ] }, key)) }),
408
+ /* @__PURE__ */ jsxs(GameButton, { className: "pet-mini", onClick: command(onAction, "page", "pets"), children: [
409
+ /* @__PURE__ */ jsx("span", { className: "pet-mini-art", children: /* @__PURE__ */ jsx(GameSprite, { asset: pet.art }) }),
410
+ /* @__PURE__ */ jsxs("span", { children: [
411
+ /* @__PURE__ */ jsx("small", { children: "\u51FA\u6218\u7075\u5BA0" }),
412
+ /* @__PURE__ */ jsxs("b", { children: [
413
+ pet.name,
414
+ " ",
415
+ /* @__PURE__ */ jsxs("em", { children: [
416
+ "Lv.",
417
+ s.pets[s.pet]
418
+ ] })
419
+ ] })
420
+ ] })
421
+ ] }),
422
+ /* @__PURE__ */ jsx("div", { className: "character-bottom", children: s.idle ? "\u25CF \u6B63\u5728\u6302\u673A\u4FEE\u884C" : "\u25CB \u95F2\u5EAD\u4FE1\u6B65 \xB7 \u7B49\u5F85\u5386\u7EC3" })
423
+ ] });
424
+ }
425
+ function GameBattleStage({ engine, state: s, onAction, event, sequence = 0 }) {
426
+ const d = engine.definition, m = d.maps[s.map], f = s.fight, st = engine.stats(s), isBoss = Boolean(f?.boss), pet = d.pets.find((p) => p.id === s.pet);
427
+ const units = [{ side: "hero", name: s.name, identity: d.hero.identity, asset: d.hero, hp: f?.hp ?? st.hp, max: f?.maxHp ?? st.hp, damage: event?.incoming }, { side: "enemy", name: isBoss ? `\u5996\u738B \xB7 ${m.boss}` : m.enemy, identity: (isBoss ? m.bossArt : m.enemyArt).identity, asset: isBoss ? m.bossArt : m.enemyArt, hp: f?.enemyHp ?? m.hp, max: f?.enemyMax ?? m.hp, damage: event ? event.damage + event.petDamage : 0 }];
428
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
429
+ /* @__PURE__ */ jsx(Title, { kicker: `\u897F\u884C\u5386\u7EC3 / \u7B2C ${s.map + 1} \u7AE0`, title: m.name, children: /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s), onClick: command(onAction, "page", "maps"), children: "\u25A7 \u5207\u6362\u5730\u56FE" }) }),
430
+ /* @__PURE__ */ jsxs("div", { className: `scene ${isBoss ? "boss-fight" : ""}`, children: [
431
+ /* @__PURE__ */ jsx("div", { className: "scene-art", children: /* @__PURE__ */ jsx("img", { className: "landscape", src: m.scene, alt: "" }) }),
432
+ /* @__PURE__ */ jsxs("div", { className: "scene-top", children: [
433
+ /* @__PURE__ */ jsxs("span", { className: "scene-label", children: [
434
+ "\u263C ",
435
+ m.subtitle
436
+ ] }),
437
+ /* @__PURE__ */ jsx("span", { className: "scene-label", children: busy(s) ? "\u5996\u738B\u6311\u6218\u4E2D" : s.idle ? "\u6302\u673A\u4FEE\u884C\u4E2D" : "\u5C1A\u672A\u5F00\u59CB" })
438
+ ] }),
439
+ /* @__PURE__ */ jsxs("div", { className: "scene-inscription", children: [
440
+ /* @__PURE__ */ jsx("span", { children: m.name }),
441
+ /* @__PURE__ */ jsx("small", { children: "\u5C71 \u6D77 \u6709 \u7075 \xB7 \u897F \u884C \u65E0 \u5C3D" })
442
+ ] }),
443
+ units.map((u) => /* @__PURE__ */ jsxs("div", { className: `fighter ${u.side}`, children: [
444
+ /* @__PURE__ */ jsxs("div", { className: "unit-label", children: [
445
+ u.name,
446
+ u.side === "hero" && /* @__PURE__ */ jsxs("em", { children: [
447
+ " Lv.",
448
+ s.level
449
+ ] })
450
+ ] }),
451
+ /* @__PURE__ */ jsx("div", { className: "unit-identity", children: u.identity }),
452
+ /* @__PURE__ */ jsx("div", { className: `unit-health ${u.side === "enemy" ? "red" : ""}`, children: /* @__PURE__ */ jsx("i", { style: { width: `${u.hp / u.max * 100}%` } }) }),
453
+ /* @__PURE__ */ jsxs("div", { className: "health-text", children: [
454
+ u.hp,
455
+ " / ",
456
+ u.max
457
+ ] }),
458
+ /* @__PURE__ */ jsx("div", { className: `sprite ${event ? u.side === "hero" ? "attack" : "hit" : ""}`, children: /* @__PURE__ */ jsx(GameSprite, { asset: u.asset }) }, sequence),
459
+ Boolean(u.damage) && /* @__PURE__ */ jsxs("div", { className: "damage float", children: [
460
+ u.side === "enemy" && event?.skill ? d.skillName + " " : "",
461
+ "\u2212",
462
+ u.damage
463
+ ] }, `damage-${sequence}`)
464
+ ] }, u.side)),
465
+ /* @__PURE__ */ jsxs("div", { className: "companion", children: [
466
+ /* @__PURE__ */ jsx(GameSprite, { asset: pet.art }),
467
+ /* @__PURE__ */ jsx("span", { children: pet.name })
468
+ ] }),
469
+ event?.skill && /* @__PURE__ */ jsx("div", { className: "attack-flash cast", children: "\u6555" }, sequence),
470
+ /* @__PURE__ */ jsxs("div", { className: "scene-bottom", children: [
471
+ /* @__PURE__ */ jsx("span", { children: "\u25C7 \u81EA\u52A8\u62FE\u53D6\u5DF2\u5F00\u542F" }),
472
+ /* @__PURE__ */ jsx("span", { children: f ? `\u7B2C ${f.turn} \u56DE\u5408 / 60` : "\u9759\u5019\u51FA\u53D1" })
473
+ ] })
474
+ ] }),
475
+ /* @__PURE__ */ jsxs("div", { className: "battle-controls", children: [
476
+ /* @__PURE__ */ jsxs("div", { children: [
477
+ /* @__PURE__ */ jsx("div", { className: "status-label", children: s.idle ? "\u884C\u8DEF\u4E0D\u6B47\uFF0C\u4FEE\u4E3A\u6E10\u957F" : "\u4E07\u91CC\u897F\u884C\uFF0C\u4ECE\u8FD9\u91CC\u5F00\u59CB" }),
478
+ /* @__PURE__ */ jsx("small", { children: "\u81EA\u52A8\u6218\u6597 \xB7 \u81EA\u52A8\u62FE\u53D6 \xB7 \u6301\u7EED\u6210\u957F" })
479
+ ] }),
480
+ /* @__PURE__ */ jsx(GameButton, { className: "primary-button", disabled: busy(s), onClick: command(onAction, "idle"), children: s.idle ? "\u2161 \u6682\u505C\u6302\u673A" : "\u25B6 \u5F00\u59CB\u6302\u673A" })
481
+ ] }),
482
+ /* @__PURE__ */ jsx(GameResourceSummary, { state: s }),
483
+ /* @__PURE__ */ jsxs("div", { className: "tip", children: [
484
+ /* @__PURE__ */ jsxs("p", { children: [
485
+ "\u6BCF\u4E09\u6B21\u51FA\u624B\u81EA\u52A8\u65BD\u653E\u300C",
486
+ d.skillName,
487
+ "\u300D\u3002\u88C5\u5907\u4E0E\u7075\u5BA0\u7684\u63D0\u5347\uFF0C\u4E5F\u4F1A\u8BA1\u5165\u79BB\u7EBF\u4FEE\u884C\u3002"
488
+ ] }),
489
+ /* @__PURE__ */ jsx(GameButton, { className: "text-button", onClick: command(onAction, "help"), children: "\u73A9\u6CD5\u8BF4\u660E \u203A" })
490
+ ] })
491
+ ] });
492
+ }
493
+ function GameResourceSummary({ state: s }) {
494
+ return /* @__PURE__ */ jsxs("section", { className: "income", children: [
495
+ /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
496
+ /* @__PURE__ */ jsx("h3", { children: "\u4FEE\u884C\u7D2F\u8BA1\u6240\u5F97" }),
497
+ /* @__PURE__ */ jsxs("span", { children: [
498
+ "\u7D2F\u8BA1\u51FB\u8D25 ",
499
+ fmt(s.kills),
500
+ " \u4E2A\u654C\u4EBA"
501
+ ] })
502
+ ] }),
503
+ /* @__PURE__ */ jsx("div", { className: "income-grid", children: [["\u7ECF\u9A8C", s.sessionXp], ["\u94DC\u94B1", s.sessionGold], ["\u88C5\u5907", s.sessionDrops]].map(([label, value]) => /* @__PURE__ */ jsxs("div", { children: [
504
+ /* @__PURE__ */ jsx("span", { children: label }),
505
+ /* @__PURE__ */ jsxs("b", { children: [
506
+ fmt(Number(value)),
507
+ label === "\u88C5\u5907" ? " \u4EF6" : ""
508
+ ] })
509
+ ] }, label)) })
510
+ ] });
511
+ }
512
+ function GameBossPanel({ engine, state: s, onAction }) {
513
+ const d = engine.definition, m = d.maps[s.map], cleared = s.cleared.includes(s.map);
514
+ return /* @__PURE__ */ jsxs("section", { id: "quest", children: [
515
+ /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
516
+ /* @__PURE__ */ jsx("h3", { children: "\u2694 \u7AE0\u8282\u5996\u738B" }),
517
+ /* @__PURE__ */ jsxs("span", { children: [
518
+ "\u7B2C ",
519
+ s.map + 1,
520
+ " / ",
521
+ d.maps.length,
522
+ " \u7AE0"
523
+ ] })
524
+ ] }),
525
+ /* @__PURE__ */ jsxs("div", { className: "boss-portrait", children: [
526
+ /* @__PURE__ */ jsx(GameSprite, { asset: m.bossArt }),
527
+ /* @__PURE__ */ jsx("span", { className: "boss-seal", children: cleared ? "\u5DF2\u7834" : "\u5996\u738B" })
528
+ ] }),
529
+ /* @__PURE__ */ jsxs("div", { className: "boss-title", children: [
530
+ /* @__PURE__ */ jsx("h2", { children: m.boss }),
531
+ /* @__PURE__ */ jsx("span", { children: m.bossArt.identity })
532
+ ] }),
533
+ /* @__PURE__ */ jsx("p", { className: "identity-traits", children: m.bossArt.traits }),
534
+ /* @__PURE__ */ jsxs("div", { className: "boss-stats", children: [
535
+ /* @__PURE__ */ jsxs("span", { children: [
536
+ "\u6C14\u8840 ",
537
+ fmt(m.bossHp)
538
+ ] }),
539
+ /* @__PURE__ */ jsxs("span", { children: [
540
+ "\u653B\u51FB ",
541
+ m.bossAtk
542
+ ] })
543
+ ] }),
544
+ /* @__PURE__ */ jsxs("div", { className: "boss-reward", children: [
545
+ /* @__PURE__ */ jsx("small", { children: cleared ? "\u518D\u6B21\u6311\u6218\u5956\u52B1" : "\u9996\u6B21\u51FB\u8D25\u5956\u52B1" }),
546
+ /* @__PURE__ */ jsx("div", { children: cleared ? "\u94DC\u94B1\u3001\u7ECF\u9A8C\u3001\u7075\u8574" : d.slots[m.rewardSlot].names[1] + " \xB7 \u7075\u8574 \xD750" })
547
+ ] }),
548
+ /* @__PURE__ */ jsx(GameButton, { className: "boss-button", disabled: busy(s), onClick: command(onAction, "boss"), children: busy(s) ? "\u6B63\u5728\u6311\u6218\u2026" : cleared ? "\u518D\u6B21\u6311\u6218" : "\u6311\u6218\u5996\u738B" }),
549
+ /* @__PURE__ */ jsx("p", { className: "boss-hint", children: s.map < d.maps.length - 1 ? `\u9996\u6B21\u51FB\u8D25\uFF0C\u89E3\u9501\u300C${d.maps[s.map + 1].name}\u300D` : "\u5B8C\u6210\u6311\u6218\uFF0C\u901A\u5173\u5168\u90E8\u7AE0\u8282\u8BD5\u70BC" })
550
+ ] });
551
+ }
552
+ function GameLogPanel({ state: s }) {
553
+ return /* @__PURE__ */ jsxs("section", { className: "journal", children: [
554
+ /* @__PURE__ */ jsxs("div", { className: "panel-heading", children: [
555
+ /* @__PURE__ */ jsx("h3", { children: "\u25A4 \u4E09\u754C\u89C1\u95FB" }),
556
+ /* @__PURE__ */ jsx("span", { children: "\u5B9E\u65F6\u6218\u62A5" })
557
+ ] }),
558
+ /* @__PURE__ */ jsx("div", { id: "logs", role: "log", "aria-label": "\u6218\u6597\u8BB0\u5F55", children: s.logs.map((log, i) => /* @__PURE__ */ jsxs("div", { className: `log-line ${log.type}`, children: [
559
+ /* @__PURE__ */ jsx("time", { children: new Date(log.time).toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" }) }),
560
+ /* @__PURE__ */ jsx("span", { children: log.text })
561
+ ] }, `${log.time}-${i}`)) })
562
+ ] });
563
+ }
564
+ function GameMapPanel({ engine, state: s, onAction }) {
565
+ const d = engine.definition;
566
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
567
+ /* @__PURE__ */ jsx(Title, { kicker: "\u4E09\u754C\u8206\u56FE / \u897F\u884C\u4E4B\u8DEF", title: d.labels?.mapsTitle || "\u63A2\u7D22\u65B0\u7684\u65C5\u7A0B" }),
568
+ /* @__PURE__ */ jsx("p", { className: "view-description", children: "\u8E0F\u8FC7\u4E00\u91CD\u5C71\uFF0C\u518D\u8D74\u4E0B\u4E00\u7A0B\u3002\u51FB\u8D25\u7AE0\u8282\u5996\u738B\uFF0C\u5373\u53EF\u5F00\u542F\u65B0\u7684\u5386\u7EC3\u3002" }),
569
+ /* @__PURE__ */ jsx("div", { className: "map-list", children: d.maps.map((m, i) => /* @__PURE__ */ jsxs(GameButton, { className: `map-card ${s.map === i ? "current" : ""}`, disabled: i > s.unlocked || busy(s), onClick: command(onAction, "map", String(i)), children: [
570
+ /* @__PURE__ */ jsx("div", { className: "map-art", children: /* @__PURE__ */ jsx("img", { className: "landscape", src: m.scene, alt: "" }) }),
571
+ /* @__PURE__ */ jsx("span", { className: "map-number", children: String(i + 1).padStart(2, "0") }),
572
+ /* @__PURE__ */ jsxs("div", { className: "map-content", children: [
573
+ /* @__PURE__ */ jsx("span", { className: "eyebrow", children: m.subtitle }),
574
+ /* @__PURE__ */ jsx("h2", { children: m.name }),
575
+ /* @__PURE__ */ jsx("p", { children: m.desc }),
576
+ /* @__PURE__ */ jsxs("div", { className: "map-meta", children: [
577
+ "\u5EFA\u8BAE\u7B49\u7EA7 ",
578
+ m.level,
579
+ " \xB7 \u51FB\u8D25\u5956\u52B1 ",
580
+ m.xp,
581
+ " \u7ECF\u9A8C / ",
582
+ m.gold,
583
+ " \u94DC\u94B1"
584
+ ] })
585
+ ] }),
586
+ /* @__PURE__ */ jsx("span", { className: "map-state", children: i > s.unlocked ? "\u51FB\u8D25\u4E0A\u4E00\u7AE0\u5996\u738B\u89E3\u9501" : s.map === i ? "\u5F53\u524D\u5386\u7EC3" : "\u524D\u5F80\u5386\u7EC3" })
587
+ ] }, m.id)) }),
588
+ /* @__PURE__ */ jsxs("div", { className: "tip", children: [
589
+ "\u5F53\u524D\u5DF2\u89E3\u9501 ",
590
+ s.unlocked + 1,
591
+ " / ",
592
+ d.maps.length,
593
+ " \u7AE0\u3002"
594
+ ] })
595
+ ] });
596
+ }
597
+ function GamePetPanel({ engine, state: s, onAction }) {
598
+ const d = engine.definition;
599
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
600
+ /* @__PURE__ */ jsx(Title, { kicker: "\u7075\u5BA0\u6D1E\u5929 / \u6709\u7075\u76F8\u4F34", title: d.labels?.petsTitle || "\u4F19\u4F34\u540C\u884C", children: /* @__PURE__ */ jsxs("span", { className: "capacity", children: [
601
+ "\u7075\u8574 ",
602
+ fmt(s.essence)
603
+ ] }) }),
604
+ /* @__PURE__ */ jsx("p", { className: "view-description", children: "\u7075\u5BA0\u968F\u4F60\u81EA\u52A8\u51FA\u6218\u3002\u4E0D\u540C\u7684\u4F19\u4F34\uFF0C\u8BA9\u6BCF\u4E00\u6BB5\u4FEE\u884C\u5404\u6709\u7AE0\u6CD5\u3002" }),
605
+ /* @__PURE__ */ jsx("div", { className: "pet-cards", children: d.pets.map((p) => /* @__PURE__ */ jsxs("article", { className: `pet-card ${s.pet === p.id ? "selected" : ""}`, children: [
606
+ /* @__PURE__ */ jsxs("div", { className: "pet-card-head", children: [
607
+ /* @__PURE__ */ jsx("span", { className: "pet-kind", children: p.kind }),
608
+ /* @__PURE__ */ jsx("span", { children: s.pets[p.id] ? `Lv.${s.pets[p.id]}` : "\u5C1A\u672A\u7ED3\u7F18" })
609
+ ] }),
610
+ /* @__PURE__ */ jsx("div", { className: "pet-art", children: /* @__PURE__ */ jsx(GameSprite, { asset: p.art }) }),
611
+ /* @__PURE__ */ jsx("h2", { children: p.name }),
612
+ /* @__PURE__ */ jsx("p", { className: "identity-traits", children: p.art.traits }),
613
+ /* @__PURE__ */ jsx("p", { children: p.desc }),
614
+ /* @__PURE__ */ jsxs("div", { className: "pet-stat", children: [
615
+ "\u51FA\u624B\u4F24\u5BB3 ",
616
+ /* @__PURE__ */ jsx("b", { children: p.base + ((s.pets[p.id] || 1) - 1) * 3 })
617
+ ] }),
618
+ s.pets[p.id] ? /* @__PURE__ */ jsxs(Fragment, { children: [
619
+ /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s) || s.pet === p.id, onClick: command(onAction, "deploy", p.id), children: s.pet === p.id ? "\u6B63\u5728\u51FA\u6218" : "\u8BBE\u4E3A\u51FA\u6218" }),
620
+ /* @__PURE__ */ jsx(GameButton, { className: "primary-button", disabled: busy(s) || s.pets[p.id] >= 20 || s.essence < s.pets[p.id] * 15, onClick: command(onAction, "train", p.id), children: s.pets[p.id] >= 20 ? "\u5DF2\u8FBE\u6700\u9AD8\u7B49\u7EA7" : `\u57F9\u517B \xB7 ${s.pets[p.id] * 15} \u7075\u8574` })
621
+ ] }) : /* @__PURE__ */ jsxs(GameButton, { className: "primary-button", disabled: busy(s) || s.essence < p.cost, onClick: command(onAction, "unlock", p.id), children: [
622
+ "\u7ED3\u7F18 \xB7 ",
623
+ p.cost,
624
+ " \u7075\u8574"
625
+ ] })
626
+ ] }, p.id)) }),
627
+ /* @__PURE__ */ jsx("div", { className: "tip", children: "\u666E\u901A\u6218\u6597\u83B7\u5F97 2 \u7075\u8574\uFF0C\u9996\u9886\u9996\u901A\u83B7\u5F97 50 \u7075\u8574\u3002\u57F9\u517B\u63D0\u5347\u8FFD\u51FB\u4F24\u5BB3\u3002" })
628
+ ] });
629
+ }
630
+ function GameEquipmentPanel({ engine, state: s, onAction }) {
631
+ const [filter, setFilter] = useState("all");
632
+ const d = engine.definition;
633
+ const inventory = s.inventory.filter((item) => filter === "all" || item.slot === filter);
634
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
635
+ /* @__PURE__ */ jsx(Title, { kicker: "\u884C\u56CA\u88C5\u5907 / \u767E\u70BC\u6210\u5668", title: d.labels?.gearTitle || "\u6574\u7406\u88C5\u5907\uFF0C\u63D0\u5347\u5B9E\u529B", children: /* @__PURE__ */ jsxs("span", { className: "capacity", children: [
636
+ "\u884C\u56CA ",
637
+ s.inventory.length,
638
+ " / 80"
639
+ ] }) }),
640
+ /* @__PURE__ */ jsx("div", { className: "gear-slots", children: Object.entries(d.slots).map(([key, slot]) => /* @__PURE__ */ jsxs("section", { className: "gear-slot", children: [
641
+ /* @__PURE__ */ jsxs("div", { className: "gear-info", children: [
642
+ /* @__PURE__ */ jsxs("span", { className: "eyebrow", children: [
643
+ slot.name,
644
+ " \xB7 \u5F3A\u5316 +",
645
+ s.upgrades[key]
646
+ ] }),
647
+ /* @__PURE__ */ jsx("h3", { children: s.equipment[key]?.name || "\u5C1A\u672A\u88C5\u5907" }),
648
+ s.equipment[key] && /* @__PURE__ */ jsx(ItemStats, { item: s.equipment[key] })
649
+ ] }),
650
+ /* @__PURE__ */ jsx(GameButton, { className: "small-button", disabled: busy(s) || !s.equipment[key] || s.upgrades[key] >= 10 || s.gold < engine.upgradeCost(s, key), onClick: command(onAction, "upgrade", key), children: s.upgrades[key] >= 10 ? "\u5DF2\u5F3A\u5316\u81F3\u4E0A\u9650" : `\u5F3A\u5316 \xB7 ${engine.upgradeCost(s, key)} \u94DC\u94B1` })
651
+ ] }, key)) }),
652
+ /* @__PURE__ */ jsxs("div", { className: "inventory-toolbar", children: [
653
+ /* @__PURE__ */ jsx("div", { className: "filters", children: [["all", "\u5168\u90E8"], ...Object.entries(d.slots).map(([key, slot]) => [key, slot.name])].map(([key, name]) => /* @__PURE__ */ jsx(GameButton, { className: `filter ${filter === key ? "active" : ""}`, "aria-pressed": filter === key, onClick: () => setFilter(key), children: name }, key)) }),
654
+ /* @__PURE__ */ jsxs("span", { children: [
655
+ "\u953B\u6750 ",
656
+ s.material
657
+ ] }),
658
+ /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", disabled: busy(s) || s.material < 12, onClick: command(onAction, "forge"), children: "\u953B\u9020\u4E0A\u54C1 \xB7 12 \u953B\u6750" })
659
+ ] }),
660
+ /* @__PURE__ */ jsx("div", { className: "inventory-list", children: inventory.length ? inventory.map((item) => /* @__PURE__ */ jsxs("article", { className: "item-row", children: [
661
+ /* @__PURE__ */ jsx("span", { className: `item-icon rarity-${item.tier}`, children: "\u25C7" }),
662
+ /* @__PURE__ */ jsxs("div", { className: "item-detail", children: [
663
+ /* @__PURE__ */ jsxs("strong", { children: [
664
+ item.name,
665
+ " ",
666
+ /* @__PURE__ */ jsxs("small", { children: [
667
+ d.rarities[item.tier],
668
+ " \xB7 ",
669
+ d.slots[item.slot].name
670
+ ] })
671
+ ] }),
672
+ /* @__PURE__ */ jsx(ItemStats, { item })
673
+ ] }),
674
+ /* @__PURE__ */ jsx(GameButton, { className: "small-button", onClick: command(onAction, "inspect", item.id), children: "\u5BF9\u6BD4" }),
675
+ /* @__PURE__ */ jsx(GameButton, { className: "small-button jade-button", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" }),
676
+ /* @__PURE__ */ jsx(GameButton, { className: "text-button", disabled: busy(s), onClick: command(onAction, "lock", item.id), children: item.locked ? "\u89E3\u9501" : "\u9501\u5B9A" }),
677
+ /* @__PURE__ */ jsx(GameButton, { className: "text-button", disabled: busy(s) || item.locked, onClick: command(onAction, "dismantle", item.id), children: "\u5206\u89E3" })
678
+ ] }, item.id)) : /* @__PURE__ */ jsxs("div", { className: "empty-state", children: [
679
+ /* @__PURE__ */ jsx("h3", { children: "\u884C\u56CA\u5C1A\u6709\u4F59\u5730" }),
680
+ /* @__PURE__ */ jsx("p", { children: "\u6302\u673A\u51FB\u8D25\u5996\u602A\uFF0C\u6709\u673A\u4F1A\u62FE\u5F97\u88C5\u5907\u3002" }),
681
+ /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: command(onAction, "page", "battle"), children: "\u524D\u5F80\u5386\u7EC3" })
682
+ ] }) }),
683
+ /* @__PURE__ */ jsx("div", { className: "tip", children: "\u5F3A\u5316\u968F\u90E8\u4F4D\u7EE7\u627F\u3002\u80CC\u5305\u6EE1\u540E\uFF0C\u65B0\u6389\u843D\u8F6C\u4E3A\u953B\u6750\uFF1B\u9501\u5B9A\u88C5\u5907\u4E0D\u80FD\u5206\u89E3\u3002" })
684
+ ] });
685
+ }
686
+ function GameSavePanel({ onExport, onImport }) {
687
+ const input = useRef(null);
688
+ return /* @__PURE__ */ jsxs("div", { className: "help-content", children: [
689
+ /* @__PURE__ */ jsx("p", { children: "\u8FDB\u5EA6\u81EA\u52A8\u4FDD\u5B58\u5728\u5F53\u524D\u6D4F\u89C8\u5668\u3002\u5BFC\u5165\u901A\u8FC7\u6821\u9A8C\u540E\uFF0C\u9700\u8981\u518D\u6B21\u786E\u8BA4\u624D\u80FD\u66FF\u6362\u5F53\u524D\u8FDB\u5EA6\u3002" }),
690
+ /* @__PURE__ */ jsxs("div", { className: "settings-actions", children: [
691
+ /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: onExport, children: "\u5BFC\u51FA\u5B58\u6863" }),
692
+ /* @__PURE__ */ jsx(GameButton, { className: "subtle-button", onClick: () => input.current?.click(), children: "\u5BFC\u5165\u5B58\u6863" }),
693
+ /* @__PURE__ */ jsx("input", { ref: input, type: "file", accept: ".json,application/json", hidden: true, onChange: (e) => {
694
+ const file = e.target.files?.[0];
695
+ e.target.value = "";
696
+ if (file)
697
+ void onImport(file);
698
+ } })
699
+ ] }),
700
+ /* @__PURE__ */ jsx("p", { children: "\u5B58\u6863\u4FDD\u5B58\u5728\u672C\u673A\uFF0C\u4E0D\u5305\u542B\u8D26\u53F7\u540C\u6B65\u548C\u591A\u4EBA\u8054\u7F51\u3002" })
701
+ ] });
702
+ }
703
+ function GameDialog({ open, title, children, onClose, container }) {
704
+ return /* @__PURE__ */ jsx(Modal, { open, title, footer: null, centered: true, className: "sia-game-dialog", onCancel: onClose, getContainer: container, children });
705
+ }
706
+ function GameEquipmentComparison({ engine, state: s, onAction, itemId }) {
707
+ const item = s.inventory.find((i) => i.id === itemId);
708
+ if (!item)
709
+ return /* @__PURE__ */ jsx("p", { children: "\u7269\u54C1\u5DF2\u4E0D\u5728\u80CC\u5305\u4E2D\u3002" });
710
+ const old = s.equipment[item.slot];
711
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
712
+ /* @__PURE__ */ jsxs("div", { className: "compare", children: [
713
+ /* @__PURE__ */ jsxs("section", { children: [
714
+ /* @__PURE__ */ jsx("span", { className: "eyebrow", children: "\u5F53\u524D\u88C5\u5907" }),
715
+ /* @__PURE__ */ jsx("h3", { children: old?.name || "\u672A\u88C5\u5907" }),
716
+ old && /* @__PURE__ */ jsx(ItemStats, { item: old })
717
+ ] }),
718
+ /* @__PURE__ */ jsxs("section", { children: [
719
+ /* @__PURE__ */ jsxs("span", { className: "eyebrow", children: [
720
+ "\u5F85\u88C5\u5907 \xB7 ",
721
+ engine.definition.rarities[item.tier]
722
+ ] }),
723
+ /* @__PURE__ */ jsx("h3", { children: item.name }),
724
+ /* @__PURE__ */ jsx(ItemStats, { item })
725
+ ] })
726
+ ] }),
727
+ /* @__PURE__ */ jsxs("p", { children: [
728
+ "\u540C\u90E8\u4F4D\u5F3A\u5316 +",
729
+ s.upgrades[item.slot],
730
+ " \u5B8C\u6574\u7EE7\u627F\u3002"
731
+ ] }),
732
+ /* @__PURE__ */ jsx("div", { className: "compare-delta", children: ["atk", "def", "hp"].map((key, i) => {
733
+ const delta = item[key] - (old?.[key] || 0);
734
+ return /* @__PURE__ */ jsxs("span", { className: delta >= 0 ? "jade" : "red-text", children: [
735
+ ["\u653B\u51FB", "\u9632\u5FA1", "\u6C14\u8840"][i],
736
+ " ",
737
+ delta >= 0 ? "+" : "",
738
+ delta
739
+ ] }, key);
740
+ }) }),
741
+ /* @__PURE__ */ jsx(GameButton, { className: "primary-button full", disabled: busy(s), onClick: command(onAction, "equip", item.id), children: "\u88C5\u5907" })
742
+ ] });
743
+ }
744
+
745
+ // src/game/IdleGameApp.tsx
746
+ import { useEffect, useReducer, useRef as useRef2, useState as useState2 } from "react";
747
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
748
+ function IdleGameApp({ definition, className = "", style, onStateChange }) {
749
+ const engineRef = useRef2();
750
+ if (!engineRef.current)
751
+ engineRef.current = createIdleEngine(definition);
752
+ const engine = engineRef.current;
753
+ const stateRef = useRef2();
754
+ if (!stateRef.current)
755
+ stateRef.current = engine.freshState();
756
+ const s = stateRef.current;
757
+ const [, refresh] = useReducer((n) => n + 1, 0);
758
+ const [page, setPage] = useState2("battle"), [dialog, setDialog] = useState2(""), [message, setMessage] = useState2("");
759
+ const [event, setEvent] = useState2(null), [sequence, setSequence] = useState2(0);
760
+ const [report, setReport] = useState2(null), [pending, setPending] = useState2(null), [itemId, setItemId] = useState2("");
761
+ const host = useRef2(null), lastTick = useRef2(Date.now()), initialized = useRef2(false), saveWarning = useRef2(false);
762
+ const observe = useRef2(onStateChange);
763
+ observe.current = onStateChange;
764
+ function save() {
765
+ const current = stateRef.current;
766
+ try {
767
+ current.savedAt = Date.now();
768
+ localStorage.setItem(definition.saveKey, engine.serialize(current, current.savedAt));
769
+ saveWarning.current = false;
770
+ } catch {
771
+ if (!saveWarning.current) {
772
+ setMessage("\u6D4F\u89C8\u5668\u672A\u80FD\u4FDD\u5B58\u8FDB\u5EA6\uFF0C\u8BF7\u5728\u8BBE\u7F6E\u4E2D\u5BFC\u51FA\u5B58\u6863\u3002");
773
+ saveWarning.current = true;
774
+ }
775
+ }
776
+ }
777
+ function changed() {
778
+ save();
779
+ refresh();
780
+ observe.current?.(stateRef.current);
781
+ }
782
+ useEffect(() => {
783
+ if (message) {
784
+ const timer = setTimeout(() => setMessage(""), 3200);
785
+ return () => clearTimeout(timer);
786
+ }
787
+ }, [message]);
788
+ useEffect(() => {
789
+ if (!initialized.current) {
790
+ try {
791
+ const raw = localStorage.getItem(definition.saveKey);
792
+ if (raw) {
793
+ stateRef.current = engine.hydrate(JSON.parse(raw));
794
+ const result = engine.settleOffline(stateRef.current);
795
+ if (result) {
796
+ setReport(result);
797
+ setDialog("offline");
798
+ }
799
+ }
800
+ } catch {
801
+ setMessage("\u5B58\u6863\u8BFB\u53D6\u5931\u8D25\uFF0C\u5F53\u524D\u4EE5\u5185\u5B58\u65B0\u6863\u8FD0\u884C\uFF1B\u53EF\u5728\u8BBE\u7F6E\u4E2D\u5BFC\u5165\u5907\u4EFD\u3002");
802
+ }
803
+ engine.addLog(stateRef.current, "\u6B22\u8FCE\u5F52\u6765\uFF0C\u70B9\u51FB\u5F00\u59CB\u6302\u673A\u7EE7\u7EED\u5386\u7EC3\u3002");
804
+ initialized.current = true;
805
+ lastTick.current = Date.now();
806
+ refresh();
807
+ }
808
+ const timer = setInterval(() => {
809
+ if (document.hidden)
810
+ return;
811
+ const now = Date.now(), elapsed = Math.floor((now - lastTick.current) / 1e3);
812
+ if (elapsed < 1)
813
+ return;
814
+ const current = stateRef.current;
815
+ if (elapsed > 15 && current.idle) {
816
+ current.savedAt = lastTick.current;
817
+ engine.settleOffline(current, now);
818
+ setEvent(null);
819
+ } else {
820
+ const next = engine.tick(current);
821
+ setEvent(next);
822
+ if (next) {
823
+ setSequence((n) => n + 1);
824
+ if (next.bossWin)
825
+ setMessage(next.first ? `\u9996\u901A\u6210\u529F\uFF01${next.reward}\u5DF2\u6536\u5165\u884C\u56CA\u3002` : "\u9996\u9886\u6311\u6218\u6210\u529F\uFF01");
826
+ }
827
+ }
828
+ lastTick.current = now;
829
+ changed();
830
+ }, 1e3);
831
+ const visibility = () => {
832
+ if (document.hidden) {
833
+ save();
834
+ lastTick.current = Date.now();
835
+ } else {
836
+ const result = engine.settleOffline(stateRef.current);
837
+ if (result) {
838
+ setReport(result);
839
+ setDialog("offline");
840
+ }
841
+ lastTick.current = Date.now();
842
+ setEvent(null);
843
+ changed();
844
+ }
845
+ };
846
+ window.addEventListener("pagehide", save);
847
+ document.addEventListener("visibilitychange", visibility);
848
+ return () => {
849
+ clearInterval(timer);
850
+ window.removeEventListener("pagehide", save);
851
+ document.removeEventListener("visibilitychange", visibility);
852
+ save();
853
+ };
854
+ }, [engine, definition]);
855
+ function action({ type, id = "" }) {
856
+ const current = stateRef.current, locked = Boolean(current.fight?.boss && current.fight.status === "active");
857
+ if (type === "page") {
858
+ if (["battle", "maps", "gear", "pets"].includes(id))
859
+ setPage(id);
860
+ return;
861
+ }
862
+ if (type === "settings" || type === "help") {
863
+ setDialog(type);
864
+ return;
865
+ }
866
+ if (type === "inspect") {
867
+ setItemId(id);
868
+ setDialog("compare");
869
+ return;
870
+ }
871
+ if (locked) {
872
+ setMessage("\u9996\u9886\u6311\u6218\u4E2D\uFF0C\u8BF7\u7B49\u5F85\u6218\u6597\u7ED3\u675F\u3002");
873
+ return;
874
+ }
875
+ let success = true;
876
+ if (type === "idle") {
877
+ current.idle = !current.idle;
878
+ if (!current.idle)
879
+ current.fight = null;
880
+ engine.addLog(current, current.idle ? "\u5F00\u59CB\u6302\u673A\u4FEE\u884C\u3002" : "\u6682\u505C\u6302\u673A\uFF0C\u9759\u5FC3\u6574\u5907\u3002");
881
+ }
882
+ if (type === "boss") {
883
+ engine.beginFight(current, true);
884
+ setPage("battle");
885
+ }
886
+ if (type === "map") {
887
+ const index = Number(id);
888
+ if (!Number.isInteger(index) || index < 0 || index > current.unlocked)
889
+ return;
890
+ current.map = index;
891
+ current.fight = null;
892
+ setPage("battle");
893
+ engine.addLog(current, `\u6765\u5230${definition.maps[index].name}\u3002`);
894
+ }
895
+ if (type === "equip") {
896
+ success = engine.equip(current, id);
897
+ if (success) {
898
+ current.fight = null;
899
+ setDialog("");
900
+ setMessage("\u88C5\u5907\u6210\u529F\uFF0C\u6218\u529B\u5DF2\u66F4\u65B0\u3002");
901
+ }
902
+ }
903
+ if (type === "upgrade") {
904
+ success = engine.upgrade(current, id);
905
+ if (success) {
906
+ current.fight = null;
907
+ setMessage("\u90E8\u4F4D\u5F3A\u5316\u6210\u529F\u3002");
908
+ }
909
+ }
910
+ if (type === "dismantle")
911
+ success = engine.dismantle(current, id);
912
+ if (type === "forge")
913
+ success = engine.forge(current);
914
+ if (type === "train") {
915
+ success = engine.trainPet(current, id);
916
+ if (success)
917
+ current.fight = null;
918
+ }
919
+ if (type === "unlock")
920
+ success = engine.unlockPet(current, id);
921
+ if (type === "deploy" && current.pets[id]) {
922
+ current.pet = id;
923
+ current.fight = null;
924
+ }
925
+ if (type === "lock") {
926
+ const item = current.inventory.find((i) => i.id === id);
927
+ if (item)
928
+ item.locked = !item.locked;
929
+ }
930
+ if (!success)
931
+ setMessage("\u5F53\u524D\u6761\u4EF6\u4E0D\u8DB3\uFF0C\u64CD\u4F5C\u672A\u6267\u884C\u3002");
932
+ setEvent(null);
933
+ changed();
934
+ }
935
+ async function importFile(file) {
936
+ try {
937
+ if (file.size > 1e6)
938
+ throw new Error("\u6587\u4EF6\u8FC7\u5927");
939
+ const loaded = engine.hydrate(JSON.parse(await file.text()));
940
+ setPending(loaded);
941
+ setDialog("import");
942
+ } catch {
943
+ setMessage("\u5BFC\u5165\u5931\u8D25\uFF0C\u8BF7\u9009\u62E9\u6709\u6548\u7684\u6E38\u620F JSON \u5B58\u6863\u3002");
944
+ }
945
+ }
946
+ function exportFile() {
947
+ save();
948
+ const url = URL.createObjectURL(new Blob([engine.serialize(stateRef.current)], { type: "application/json;charset=utf-8" }));
949
+ const anchor = document.createElement("a");
950
+ anchor.href = url;
951
+ anchor.download = `${definition.title}-\u4FEE\u884C\u5B58\u6863.json`;
952
+ anchor.click();
953
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
954
+ }
955
+ const view = { engine, state: s, onAction: action };
956
+ const titles = { settings: "\u4FEE\u884C\u8BBE\u7F6E \xB7 \u5B58\u6863", help: "\u4FEE\u884C\u5165\u95E8", compare: "\u88C5\u5907\u5BF9\u6BD4", offline: "\u4E45\u522B\u5F52\u6765\uFF0C\u4FEE\u884C\u672A\u6B47", import: "\u786E\u8BA4\u5BFC\u5165\u5B58\u6863" };
957
+ return /* @__PURE__ */ jsxs2("div", { ref: host, className: `sia-game ${className}`, style, "data-sia-theme": "dark", children: [
958
+ /* @__PURE__ */ jsx2(GameShell, { ...view, page, children: page === "battle" ? /* @__PURE__ */ jsx2(GameBattleStage, { ...view, event, sequence }) : page === "maps" ? /* @__PURE__ */ jsx2(GameMapPanel, { ...view }) : page === "gear" ? /* @__PURE__ */ jsx2(GameEquipmentPanel, { ...view }) : /* @__PURE__ */ jsx2(GamePetPanel, { ...view }) }),
959
+ /* @__PURE__ */ jsxs2(GameDialog, { open: Boolean(dialog), title: titles[dialog] || "", onClose: () => setDialog(""), container: () => host.current, children: [
960
+ dialog === "settings" && /* @__PURE__ */ jsx2(GameSavePanel, { onExport: exportFile, onImport: importFile }),
961
+ dialog === "compare" && /* @__PURE__ */ jsx2(GameEquipmentComparison, { ...view, itemId }),
962
+ dialog === "help" && /* @__PURE__ */ jsxs2("div", { className: "help-content", children: [
963
+ /* @__PURE__ */ jsxs2("p", { children: [
964
+ "\u5F00\u59CB\u6302\u673A\u540E\uFF0C\u6BCF\u79D2\u81EA\u52A8\u51FA\u624B\u5E76\u62FE\u53D6\u5956\u52B1\u3002\u5173\u95ED\u9875\u9762\u540E\uFF0C\u4E0B\u6B21\u8FDB\u5165\u7ED3\u7B97\u6700\u591A ",
965
+ (definition.offlineCapSeconds ?? 43200) / 3600,
966
+ " \u5C0F\u65F6\u7684\u666E\u901A\u6218\u6597\u6536\u76CA\u3002"
967
+ ] }),
968
+ /* @__PURE__ */ jsxs2("ol", { children: [
969
+ /* @__PURE__ */ jsx2("li", { children: "\u6302\u673A\u83B7\u5F97\u7ECF\u9A8C\u3001\u94DC\u94B1\u3001\u88C5\u5907\u548C\u7075\u8574\u3002" }),
970
+ /* @__PURE__ */ jsx2("li", { children: "\u66F4\u6362\u88C5\u5907\uFF0C\u5F3A\u5316\u90E8\u4F4D\uFF1B\u5F3A\u5316\u4E0D\u4F1A\u968F\u6362\u88C5\u4E22\u5931\u3002" }),
971
+ /* @__PURE__ */ jsx2("li", { children: "\u7ED3\u7F18\u5E76\u57F9\u517B\u4F19\u4F34\uFF0C\u6539\u53D8\u8FFD\u51FB\u3001\u6CBB\u7597\u4E0E\u51CF\u4F24\u6548\u679C\u3002" }),
972
+ /* @__PURE__ */ jsx2("li", { children: "\u6311\u6218\u9996\u9886\uFF0C\u9996\u901A\u83B7\u5F97\u88C5\u5907\u5E76\u89E3\u9501\u4E0B\u4E00\u7AE0\u3002" })
973
+ ] }),
974
+ /* @__PURE__ */ jsx2("p", { children: "\u6311\u6218\u5931\u8D25\u4E0D\u6263\u8D44\u6E90\u3002\u9996\u9886\u6218\u671F\u95F4\u6682\u65F6\u4E0D\u80FD\u6362\u88C5\u3001\u57F9\u517B\u6216\u5207\u6362\u5730\u56FE\u3002" })
975
+ ] }),
976
+ dialog === "offline" && report && /* @__PURE__ */ jsxs2(Fragment2, { children: [
977
+ /* @__PURE__ */ jsxs2("p", { children: [
978
+ "\u79BB\u5F00 ",
979
+ Math.floor(report.seconds / 3600),
980
+ " \u5C0F\u65F6 ",
981
+ Math.floor(report.seconds % 3600 / 60),
982
+ " \u5206\u949F\uFF0C\u6536\u76CA\u5DF2\u81EA\u52A8\u5165\u8D26\u3002"
983
+ ] }),
984
+ /* @__PURE__ */ jsx2("div", { className: "offline-grid", children: [["\u7ECF\u9A8C", report.xp], ["\u94DC\u94B1", report.gold], ["\u7075\u8574", report.essence], ["\u88C5\u5907\u6389\u843D", report.drops]].map(([label, value]) => /* @__PURE__ */ jsxs2("div", { children: [
985
+ /* @__PURE__ */ jsx2("span", { children: label }),
986
+ /* @__PURE__ */ jsx2("b", { children: value })
987
+ ] }, label)) }),
988
+ /* @__PURE__ */ jsxs2("p", { children: [
989
+ "\u51FB\u8D25 ",
990
+ report.kills,
991
+ " \u4E2A\u654C\u4EBA\uFF0C\u80CC\u5305\u6EA2\u51FA\u6389\u843D\u5DF2\u8F6C\u4E3A\u953B\u6750\u3002"
992
+ ] }),
993
+ /* @__PURE__ */ jsx2(GameButton, { className: "primary-button full", onClick: () => setDialog(""), children: "\u7EE7\u7EED\u5386\u7EC3" })
994
+ ] }),
995
+ dialog === "import" && pending && /* @__PURE__ */ jsxs2(Fragment2, { children: [
996
+ /* @__PURE__ */ jsxs2("p", { children: [
997
+ "\u5373\u5C06\u8F7D\u5165 Lv.",
998
+ pending.level,
999
+ " \u7684\u89D2\u8272\uFF0C\u5DF2\u89E3\u9501 ",
1000
+ pending.unlocked + 1,
1001
+ " \u7AE0\u3002\u786E\u8BA4\u540E\u5C06\u66FF\u6362\u5F53\u524D\u5B58\u6863\u3002"
1002
+ ] }),
1003
+ /* @__PURE__ */ jsx2(GameButton, { className: "primary-button full", disabled: Boolean(s.fight?.boss && s.fight.status === "active"), onClick: () => {
1004
+ stateRef.current = pending;
1005
+ setPending(null);
1006
+ setDialog("");
1007
+ setEvent(null);
1008
+ lastTick.current = Date.now();
1009
+ changed();
1010
+ setMessage("\u5B58\u6863\u5DF2\u5BFC\u5165\u3002");
1011
+ }, children: "\u786E\u8BA4\u66FF\u6362\u5F53\u524D\u5B58\u6863" })
1012
+ ] })
1013
+ ] }),
1014
+ /* @__PURE__ */ jsx2("div", { className: `game-toast ${message ? "visible" : ""}`, role: "status", children: message })
1015
+ ] });
1016
+ }
1017
+ export {
1018
+ GameBattleStage,
1019
+ GameBossPanel,
1020
+ GameButton,
1021
+ GameCharacterPanel,
1022
+ GameDialog,
1023
+ GameEquipmentComparison,
1024
+ GameEquipmentPanel,
1025
+ GameLogPanel,
1026
+ GameMapPanel,
1027
+ GamePetPanel,
1028
+ GameResourceSummary,
1029
+ GameSavePanel,
1030
+ GameShell,
1031
+ GameSprite,
1032
+ IdleGameApp,
1033
+ createIdleEngine
1034
+ };