@eveshipfit/ui-ingame 1.3.0 → 1.4.0

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.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import './style.css';
2
2
  import { c } from "react/compiler-runtime";
3
- import { useEffect, useId, useRef, useState } from "react";
3
+ import { createContext, useContext, useEffect, useId, useRef, useState } from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- import { formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayContents, useBayUsage, useCanFit, useChargeSearch, useChargeTree, useChargedModules, useCharges, useDrag, useDroneRoom, useFit, useFitHistory, useFitStore, useHardpoints, useHullTree, useImages, useLocalFits, useMissingSkills, useModuleSearch, useModuleTree, usePlacement, usePreview, useRackUsage, useSde, useShownSnapshot, useSlots, useSnapshot, useStats, useType } from "@eveshipfit/react-hooks";
5
+ import { formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayContents, useBayUsage, useCanFit, useChargeSearch, useChargeTree, useChargedModules, useCharges, useDrag, useDroneRoom, useFighterTubeUsage, useFighterTubes, useFit, useFitHistory, useFitPrice, useFitStore, useHardpoints, useHullTree, useImages, useLocalFits, useMissingSkills, useModuleSearch, useModuleTree, usePlacement, usePreview, useRackUsage, useSde, useShownSnapshot, useSlots, useSnapshot, useStats, useType } from "@eveshipfit/react-hooks";
6
6
  //#region src/primitives/Dialog/Dialog.module.css
7
7
  var Dialog_module_default = {
8
8
  "close": "kwi1cG_close",
@@ -226,20 +226,21 @@ function TreeList(t0) {
226
226
  return t1;
227
227
  }
228
228
  function TreeGroup(t0) {
229
- const $ = c(31);
230
- const { label, typeId, icon, description, defaultOpen: t1, after, children } = t0;
229
+ const $ = c(34);
230
+ const { label, typeId, icon, description, defaultOpen: t1, after, onDragStart, onDragEnd, children } = t0;
231
231
  const [open, setOpen] = useState(t1 === void 0 ? false : t1);
232
232
  const descriptionId = useId();
233
233
  const t2 = description !== void 0 ? descriptionId : void 0;
234
- let t3;
234
+ const t3 = onDragStart !== void 0 || void 0;
235
+ let t4;
235
236
  if ($[0] !== open) {
236
- t3 = () => setOpen(!open);
237
+ t4 = () => setOpen(!open);
237
238
  $[0] = open;
238
- $[1] = t3;
239
- } else t3 = $[1];
240
- let t4;
239
+ $[1] = t4;
240
+ } else t4 = $[1];
241
+ let t5;
241
242
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
242
- t4 = /* @__PURE__ */ jsx("svg", {
243
+ t5 = /* @__PURE__ */ jsx("svg", {
243
244
  className: TreeList_module_default.chevron,
244
245
  viewBox: "0 0 12 12",
245
246
  "aria-hidden": true,
@@ -248,37 +249,37 @@ function TreeGroup(t0) {
248
249
  fill: "currentColor"
249
250
  })
250
251
  });
251
- $[2] = t4;
252
- } else t4 = $[2];
253
- let t5;
252
+ $[2] = t5;
253
+ } else t5 = $[2];
254
+ let t6;
254
255
  if ($[3] !== typeId) {
255
- t5 = typeId !== void 0 && /* @__PURE__ */ jsx(RowIcon, { typeId });
256
+ t6 = typeId !== void 0 && /* @__PURE__ */ jsx(RowIcon, { typeId });
256
257
  $[3] = typeId;
257
- $[4] = t5;
258
- } else t5 = $[4];
259
- let t6;
258
+ $[4] = t6;
259
+ } else t6 = $[4];
260
+ let t7;
260
261
  if ($[5] !== icon) {
261
- t6 = icon !== void 0 && /* @__PURE__ */ jsx("img", {
262
+ t7 = icon !== void 0 && /* @__PURE__ */ jsx("img", {
262
263
  className: TreeList_module_default.smallIcon,
263
264
  src: icon,
264
265
  alt: "",
265
266
  draggable: false
266
267
  });
267
268
  $[5] = icon;
268
- $[6] = t6;
269
- } else t6 = $[6];
270
- let t7;
269
+ $[6] = t7;
270
+ } else t7 = $[6];
271
+ let t8;
271
272
  if ($[7] !== label) {
272
- t7 = /* @__PURE__ */ jsx("span", {
273
+ t8 = /* @__PURE__ */ jsx("span", {
273
274
  className: TreeList_module_default.label,
274
275
  children: label
275
276
  });
276
277
  $[7] = label;
277
- $[8] = t7;
278
- } else t7 = $[8];
279
- let t8;
278
+ $[8] = t8;
279
+ } else t8 = $[8];
280
+ let t9;
280
281
  if ($[9] !== description || $[10] !== descriptionId) {
281
- t8 = description !== void 0 && /* @__PURE__ */ jsx("span", {
282
+ t9 = description !== void 0 && /* @__PURE__ */ jsx("span", {
282
283
  id: descriptionId,
283
284
  className: TreeList_module_default.label,
284
285
  "aria-hidden": true,
@@ -286,69 +287,75 @@ function TreeGroup(t0) {
286
287
  });
287
288
  $[9] = description;
288
289
  $[10] = descriptionId;
289
- $[11] = t8;
290
- } else t8 = $[11];
291
- let t9;
292
- if ($[12] !== t7 || $[13] !== t8) {
293
- t9 = /* @__PURE__ */ jsxs("span", {
290
+ $[11] = t9;
291
+ } else t9 = $[11];
292
+ let t10;
293
+ if ($[12] !== t8 || $[13] !== t9) {
294
+ t10 = /* @__PURE__ */ jsxs("span", {
294
295
  className: TreeList_module_default.text,
295
- children: [t7, t8]
296
+ children: [t8, t9]
296
297
  });
297
- $[12] = t7;
298
- $[13] = t8;
299
- $[14] = t9;
300
- } else t9 = $[14];
301
- let t10;
302
- if ($[15] !== open || $[16] !== t2 || $[17] !== t3 || $[18] !== t5 || $[19] !== t6 || $[20] !== t9) {
303
- t10 = /* @__PURE__ */ jsxs("button", {
298
+ $[12] = t8;
299
+ $[13] = t9;
300
+ $[14] = t10;
301
+ } else t10 = $[14];
302
+ let t11;
303
+ if ($[15] !== onDragEnd || $[16] !== onDragStart || $[17] !== open || $[18] !== t10 || $[19] !== t2 || $[20] !== t3 || $[21] !== t4 || $[22] !== t6 || $[23] !== t7) {
304
+ t11 = /* @__PURE__ */ jsxs("button", {
304
305
  type: "button",
305
306
  className: TreeList_module_default.row,
306
307
  "aria-expanded": open,
307
308
  "aria-describedby": t2,
308
- onClick: t3,
309
+ draggable: t3,
310
+ onClick: t4,
311
+ onDragStart,
312
+ onDragEnd,
309
313
  children: [
310
- t4,
311
314
  t5,
312
315
  t6,
313
- t9
316
+ t7,
317
+ t10
314
318
  ]
315
319
  });
316
- $[15] = open;
317
- $[16] = t2;
318
- $[17] = t3;
319
- $[18] = t5;
320
- $[19] = t6;
321
- $[20] = t9;
322
- $[21] = t10;
323
- } else t10 = $[21];
324
- let t11;
325
- if ($[22] !== after || $[23] !== t10) {
326
- t11 = /* @__PURE__ */ jsxs("div", {
327
- className: TreeList_module_default.head,
328
- children: [t10, after]
329
- });
330
- $[22] = after;
331
- $[23] = t10;
320
+ $[15] = onDragEnd;
321
+ $[16] = onDragStart;
322
+ $[17] = open;
323
+ $[18] = t10;
324
+ $[19] = t2;
325
+ $[20] = t3;
326
+ $[21] = t4;
327
+ $[22] = t6;
328
+ $[23] = t7;
332
329
  $[24] = t11;
333
330
  } else t11 = $[24];
334
331
  let t12;
335
- if ($[25] !== children || $[26] !== open) {
336
- t12 = open && /* @__PURE__ */ jsx("ul", {
337
- className: TreeList_module_default.group,
338
- children: children()
332
+ if ($[25] !== after || $[26] !== t11) {
333
+ t12 = /* @__PURE__ */ jsxs("div", {
334
+ className: TreeList_module_default.head,
335
+ children: [t11, after]
339
336
  });
340
- $[25] = children;
341
- $[26] = open;
337
+ $[25] = after;
338
+ $[26] = t11;
342
339
  $[27] = t12;
343
340
  } else t12 = $[27];
344
341
  let t13;
345
- if ($[28] !== t11 || $[29] !== t12) {
346
- t13 = /* @__PURE__ */ jsxs("li", { children: [t11, t12] });
347
- $[28] = t11;
348
- $[29] = t12;
342
+ if ($[28] !== children || $[29] !== open) {
343
+ t13 = open && /* @__PURE__ */ jsx("ul", {
344
+ className: TreeList_module_default.group,
345
+ children: children()
346
+ });
347
+ $[28] = children;
348
+ $[29] = open;
349
349
  $[30] = t13;
350
350
  } else t13 = $[30];
351
- return t13;
351
+ let t14;
352
+ if ($[31] !== t12 || $[32] !== t13) {
353
+ t14 = /* @__PURE__ */ jsxs("li", { children: [t12, t13] });
354
+ $[31] = t12;
355
+ $[32] = t13;
356
+ $[33] = t14;
357
+ } else t14 = $[33];
358
+ return t14;
352
359
  }
353
360
  /** Activates on double click, as EVE's own lists do; single clicks are for selecting text and dragging. */
354
361
  function TreeLeaf(t0) {
@@ -488,6 +495,15 @@ const textures = {
488
495
  statistics: "eveicon/system_icons/list_view_16px",
489
496
  cargo: "windowicons/ships",
490
497
  "drone-bay": "windowicons/dronebay",
498
+ "fighter-bay": "classes/shipui/fighters/iconfighterbay",
499
+ "fighter-light": "classes/carrierbay/iconfighterlight",
500
+ "fighter-support": "classes/carrierbay/iconfightermedium",
501
+ "fighter-heavy": "classes/carrierbay/iconfighterheavy",
502
+ "fighter-role-interceptor": "classes/shipui/fighters/roleicon_interceptor",
503
+ "fighter-role-attack": "classes/shipui/fighters/roleicon_general",
504
+ "fighter-role-support": "classes/shipui/fighters/roleicon_support",
505
+ "fighter-role-heavy-attack": "classes/shipui/fighters/roleicon_anticapital",
506
+ "fighter-role-bomber": "classes/shipui/fighters/roleicon_bomber",
491
507
  "ammo-hold": "windowicons/itemhangar",
492
508
  "arrow-left": "shared/triangleleft",
493
509
  "arrow-right": "shared/triangleright",
@@ -2153,7 +2169,7 @@ function useFittingSlot(rack, index, content, available) {
2153
2169
  let t1;
2154
2170
  if ($[4] !== available || $[5] !== charges || $[6] !== fit || $[7] !== index || $[8] !== placement || $[9] !== rack || $[10] !== ref || $[11] !== sde) {
2155
2171
  t1 = (drop) => {
2156
- if (!available || drop === void 0) return false;
2172
+ if (!available || drop === void 0 || drop.type === "hull") return false;
2157
2173
  if (drop.type === "item") return movesTo(fit, drop.ref, rack, index);
2158
2174
  const dropped = sde.type(drop.typeId);
2159
2175
  if (dropped === void 0) return false;
@@ -2344,7 +2360,7 @@ function useFittingSlot(rack, index, content, available) {
2344
2360
  }
2345
2361
  function allowDrop(event, dragging) {
2346
2362
  event.preventDefault();
2347
- event.dataTransfer.dropEffect = dragging.type === "type" ? "copy" : "move";
2363
+ event.dataTransfer.dropEffect = dragging.type === "item" ? "move" : "copy";
2348
2364
  }
2349
2365
  /** Whether a fitted item can move to this slot. */
2350
2366
  function movesTo(fit, ref, rack, index) {
@@ -2388,7 +2404,7 @@ function FittingWheel(t0) {
2388
2404
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2389
2405
  t3 = /* @__PURE__ */ jsx(FittingCentre, {});
2390
2406
  t4 = markedRacks.map(_temp$6);
2391
- t5 = racks.map(_temp2$3);
2407
+ t5 = racks.map(_temp2$4);
2392
2408
  $[2] = t3;
2393
2409
  $[3] = t4;
2394
2410
  $[4] = t5;
@@ -2456,7 +2472,7 @@ function FittingWheel(t0) {
2456
2472
  } else t10 = $[14];
2457
2473
  return t10;
2458
2474
  }
2459
- function _temp2$3(rack_0) {
2475
+ function _temp2$4(rack_0) {
2460
2476
  return /* @__PURE__ */ jsx(FittingRack, { rack: rack_0 }, rack_0);
2461
2477
  }
2462
2478
  function _temp$6(rack) {
@@ -2500,7 +2516,11 @@ function FittingCentre() {
2500
2516
  const fits = t0;
2501
2517
  let t1;
2502
2518
  if ($[3] !== fit || $[4] !== fits) {
2503
- t1 = (item) => item !== void 0 && (item.type === "type" ? fits : fit.items[item.ref] !== void 0);
2519
+ t1 = (item) => {
2520
+ if (item === void 0) return false;
2521
+ if (item.type === "item") return fit.items[item.ref] !== void 0;
2522
+ return item.type === "hull" || fits;
2523
+ };
2504
2524
  $[3] = fit;
2505
2525
  $[4] = fits;
2506
2526
  $[5] = t1;
@@ -2539,6 +2559,10 @@ function FittingCentre() {
2539
2559
  event_0.preventDefault();
2540
2560
  clear("centre");
2541
2561
  if (dragging.type === "type") store.fit(dragging.typeId);
2562
+ else if (dragging.type === "hull") store.replace({
2563
+ ship: { type_id: dragging.typeId },
2564
+ items: []
2565
+ });
2542
2566
  else store.remove(dragging.ref);
2543
2567
  end();
2544
2568
  };
@@ -2858,9 +2882,12 @@ var BayContents_module_default = {
2858
2882
  "box": "gVdevq_box",
2859
2883
  "count": "gVdevq_count",
2860
2884
  "icon": "gVdevq_icon",
2885
+ "kind": "gVdevq_kind",
2886
+ "kinds": "gVdevq_kinds",
2861
2887
  "list": "gVdevq_list",
2862
2888
  "middle": "gVdevq_middle",
2863
2889
  "name": "gVdevq_name",
2890
+ "none": "gVdevq_none",
2864
2891
  "panel": "gVdevq_panel",
2865
2892
  "quantity": "gVdevq_quantity",
2866
2893
  "remove": "gVdevq_remove",
@@ -2868,23 +2895,609 @@ var BayContents_module_default = {
2868
2895
  "row": "gVdevq_row",
2869
2896
  "selection": "gVdevq_selection",
2870
2897
  "steps": "gVdevq_steps",
2871
- "times": "gVdevq_times"
2898
+ "times": "gVdevq_times",
2899
+ "tubes": "gVdevq_tubes"
2900
+ };
2901
+ //#endregion
2902
+ //#region ../fitting/src/rules/attributes.ts
2903
+ /** A type's value for an attribute as the SDE has it, before any effect applies. */
2904
+ function baseValue(sde, type, name) {
2905
+ const id = sde.attributeId(name);
2906
+ return id === void 0 ? void 0 : type.attributes.get(id);
2907
+ }
2908
+ //#endregion
2909
+ //#region ../fitting/src/rules/fighters.ts
2910
+ const fighterKinds = [
2911
+ "light",
2912
+ "support",
2913
+ "heavy"
2914
+ ];
2915
+ const kindAttributes = {
2916
+ light: {
2917
+ ship: "fighterSquadronIsLight",
2918
+ structure: "fighterSquadronIsStandupLight"
2919
+ },
2920
+ support: {
2921
+ ship: "fighterSquadronIsSupport",
2922
+ structure: "fighterSquadronIsStandupSupport"
2923
+ },
2924
+ heavy: {
2925
+ ship: "fighterSquadronIsHeavy",
2926
+ structure: "fighterSquadronIsStandupHeavy"
2927
+ }
2928
+ };
2929
+ /** Which tubes a fighter squadron takes; `undefined` for what is not a fighter. */
2930
+ function fighterKind(sde, type) {
2931
+ return fighterKinds.find((kind) => baseValue(sde, type, kindAttributes[kind].ship) || baseValue(sde, type, kindAttributes[kind].structure));
2932
+ }
2933
+ /** Whether a fighter is launched from a structure. */
2934
+ function isStandupFighter(sde, type) {
2935
+ return fighterKinds.some((kind) => Boolean(baseValue(sde, type, kindAttributes[kind].structure)));
2936
+ }
2937
+ /** How many fighters make a full squadron. */
2938
+ function squadronSize(sde, type) {
2939
+ return baseValue(sde, type, "fighterSquadronMaxSize") ?? 1;
2940
+ }
2941
+ /** Whether a squadron of `type` can be launched from tube `index`, in place of what is there. */
2942
+ function tubeTakes(sde, fit, stats, type, index) {
2943
+ const kind = fighterKind(sde, type);
2944
+ if (kind === void 0 || isStandupFighter(sde, type) !== stats.structure) return false;
2945
+ if (index < 0 || index >= stats.fighterTubes.all.total) return false;
2946
+ const replaced = tubeRef(fit, index);
2947
+ const replacedType = replaced === void 0 ? void 0 : sde.type(fit.items[replaced].type_id);
2948
+ const freed = replacedType !== void 0 && fighterKind(sde, replacedType) === kind ? 1 : 0;
2949
+ const { used, total } = stats.fighterTubes[kind];
2950
+ return used - freed < total;
2951
+ }
2952
+ function tubeRef(fit, index) {
2953
+ const ref = fit.items.findIndex((item) => item.slot.type === "fighter_tube" && item.slot.index === index);
2954
+ return ref === -1 ? void 0 : ref;
2955
+ }
2956
+ //#endregion
2957
+ //#region src/primitives/FighterTube/FighterTube.module.css
2958
+ var FighterTube_module_default = {
2959
+ "empty": "Wlg6ma_empty",
2960
+ "label": "Wlg6ma_label",
2961
+ "number": "Wlg6ma_number",
2962
+ "picture": "Wlg6ma_picture",
2963
+ "remove": "Wlg6ma_remove",
2964
+ "resize": "Wlg6ma_resize",
2965
+ "ring": "Wlg6ma_ring",
2966
+ "role": "Wlg6ma_role",
2967
+ "squadron": "Wlg6ma_squadron",
2968
+ "tube": "Wlg6ma_tube"
2969
+ };
2970
+ //#endregion
2971
+ //#region src/primitives/FighterTube/FighterTube.tsx
2972
+ /** EVE's tube of the fighter bay, empty or with a squadron in it. */
2973
+ function FighterTube(t0) {
2974
+ const $ = c(54);
2975
+ let className;
2976
+ let index;
2977
+ let onRemove;
2978
+ let onResize;
2979
+ let props;
2980
+ let role;
2981
+ let t1;
2982
+ let t2;
2983
+ let t3;
2984
+ let t4;
2985
+ let typeId;
2986
+ let typeName;
2987
+ if ($[0] !== t0) {
2988
+ ({index, typeId, typeName, quantity: t1, size: t2, role, available: t3, preview: t4, onRemove, onResize, className, ...props} = t0);
2989
+ $[0] = t0;
2990
+ $[1] = className;
2991
+ $[2] = index;
2992
+ $[3] = onRemove;
2993
+ $[4] = onResize;
2994
+ $[5] = props;
2995
+ $[6] = role;
2996
+ $[7] = t1;
2997
+ $[8] = t2;
2998
+ $[9] = t3;
2999
+ $[10] = t4;
3000
+ $[11] = typeId;
3001
+ $[12] = typeName;
3002
+ } else {
3003
+ className = $[1];
3004
+ index = $[2];
3005
+ onRemove = $[3];
3006
+ onResize = $[4];
3007
+ props = $[5];
3008
+ role = $[6];
3009
+ t1 = $[7];
3010
+ t2 = $[8];
3011
+ t3 = $[9];
3012
+ t4 = $[10];
3013
+ typeId = $[11];
3014
+ typeName = $[12];
3015
+ }
3016
+ const quantity = t1 === void 0 ? 0 : t1;
3017
+ const size = t2 === void 0 ? 0 : t2;
3018
+ const available = t3 === void 0 ? true : t3;
3019
+ const preview = t4 === void 0 ? false : t4;
3020
+ const images = useImages();
3021
+ const launched = typeId !== void 0;
3022
+ const actions = launched && !preview;
3023
+ let t5;
3024
+ if ($[13] !== images) {
3025
+ t5 = (name) => `url(${images.uiTexture(name)})`;
3026
+ $[13] = images;
3027
+ $[14] = t5;
3028
+ } else t5 = $[14];
3029
+ const texture = t5;
3030
+ let t6;
3031
+ if ($[15] !== className) {
3032
+ t6 = [FighterTube_module_default.tube, className].filter(Boolean);
3033
+ $[15] = className;
3034
+ $[16] = t6;
3035
+ } else t6 = $[16];
3036
+ const t7 = t6.join(" ");
3037
+ const t8 = texture("classes/carrierbay/simulatetube3");
3038
+ const t9 = texture("classes/shipui/fighters/squadnumberflag");
3039
+ let t10;
3040
+ if ($[17] !== t8 || $[18] !== t9) {
3041
+ t10 = {
3042
+ "--tube": t8,
3043
+ "--flag": t9
3044
+ };
3045
+ $[17] = t8;
3046
+ $[18] = t9;
3047
+ $[19] = t10;
3048
+ } else t10 = $[19];
3049
+ const t11 = t10;
3050
+ const t12 = `Tube ${index + 1}${typeName === void 0 ? "" : `, ${typeName}`}`;
3051
+ const t13 = launched ? "launched" : available ? "open" : "unavailable";
3052
+ const t14 = preview || void 0;
3053
+ const t15 = index + 1;
3054
+ let t16;
3055
+ if ($[20] !== t15) {
3056
+ t16 = /* @__PURE__ */ jsx("span", {
3057
+ className: FighterTube_module_default.number,
3058
+ children: t15
3059
+ });
3060
+ $[20] = t15;
3061
+ $[21] = t16;
3062
+ } else t16 = $[21];
3063
+ let t17;
3064
+ if ($[22] !== launched || $[23] !== quantity || $[24] !== role || $[25] !== size || $[26] !== texture || $[27] !== typeId) {
3065
+ t17 = launched ? /* @__PURE__ */ jsxs("span", {
3066
+ className: FighterTube_module_default.squadron,
3067
+ style: {
3068
+ "--underlay": texture("classes/shipui/fighters/fighteritemunderlay"),
3069
+ "--overlay": texture("classes/shipui/fighters/fighteritemoverlay")
3070
+ },
3071
+ children: [
3072
+ /* @__PURE__ */ jsx("span", {
3073
+ className: FighterTube_module_default.picture,
3074
+ children: /* @__PURE__ */ jsx(TypeIcon, {
3075
+ typeId,
3076
+ size: 64,
3077
+ marker: false
3078
+ })
3079
+ }),
3080
+ /* @__PURE__ */ jsx(SquadronRing, {
3081
+ quantity,
3082
+ size
3083
+ }),
3084
+ role && /* @__PURE__ */ jsx("span", {
3085
+ className: FighterTube_module_default.role,
3086
+ children: /* @__PURE__ */ jsx(Icon, { name: role })
3087
+ })
3088
+ ]
3089
+ }) : /* @__PURE__ */ jsx("span", {
3090
+ className: FighterTube_module_default.empty,
3091
+ style: { "--texture": texture("classes/shipui/fighters/fighteritemempty_up") }
3092
+ });
3093
+ $[22] = launched;
3094
+ $[23] = quantity;
3095
+ $[24] = role;
3096
+ $[25] = size;
3097
+ $[26] = texture;
3098
+ $[27] = typeId;
3099
+ $[28] = t17;
3100
+ } else t17 = $[28];
3101
+ let t18;
3102
+ if ($[29] !== available || $[30] !== launched) {
3103
+ t18 = available && /* @__PURE__ */ jsx("span", {
3104
+ className: FighterTube_module_default.label,
3105
+ children: launched ? "Simulated" : "Open"
3106
+ });
3107
+ $[29] = available;
3108
+ $[30] = launched;
3109
+ $[31] = t18;
3110
+ } else t18 = $[31];
3111
+ let t19;
3112
+ if ($[32] !== actions || $[33] !== onResize || $[34] !== quantity || $[35] !== size || $[36] !== typeName) {
3113
+ t19 = actions && onResize && /* @__PURE__ */ jsxs("span", {
3114
+ className: FighterTube_module_default.resize,
3115
+ children: [/* @__PURE__ */ jsx("button", {
3116
+ type: "button",
3117
+ "aria-label": `One fewer ${typeName}`,
3118
+ onClick: () => onResize(quantity - 1),
3119
+ children: "−"
3120
+ }), /* @__PURE__ */ jsx("button", {
3121
+ type: "button",
3122
+ "aria-label": `One more ${typeName}`,
3123
+ disabled: quantity >= size,
3124
+ onClick: () => onResize(quantity + 1),
3125
+ children: "+"
3126
+ })]
3127
+ });
3128
+ $[32] = actions;
3129
+ $[33] = onResize;
3130
+ $[34] = quantity;
3131
+ $[35] = size;
3132
+ $[36] = typeName;
3133
+ $[37] = t19;
3134
+ } else t19 = $[37];
3135
+ let t20;
3136
+ if ($[38] !== actions || $[39] !== onRemove || $[40] !== typeName) {
3137
+ t20 = actions && onRemove && /* @__PURE__ */ jsx("button", {
3138
+ type: "button",
3139
+ className: FighterTube_module_default.remove,
3140
+ "aria-label": `Remove ${typeName}`,
3141
+ onClick: onRemove,
3142
+ children: /* @__PURE__ */ jsx(Icon, { name: "close" })
3143
+ });
3144
+ $[38] = actions;
3145
+ $[39] = onRemove;
3146
+ $[40] = typeName;
3147
+ $[41] = t20;
3148
+ } else t20 = $[41];
3149
+ let t21;
3150
+ if ($[42] !== props || $[43] !== t11 || $[44] !== t12 || $[45] !== t13 || $[46] !== t14 || $[47] !== t16 || $[48] !== t17 || $[49] !== t18 || $[50] !== t19 || $[51] !== t20 || $[52] !== t7) {
3151
+ t21 = /* @__PURE__ */ jsxs("div", {
3152
+ ...props,
3153
+ className: t7,
3154
+ style: t11,
3155
+ role: "group",
3156
+ "aria-label": t12,
3157
+ "data-state": t13,
3158
+ "data-preview": t14,
3159
+ children: [
3160
+ t16,
3161
+ t17,
3162
+ t18,
3163
+ t19,
3164
+ t20
3165
+ ]
3166
+ });
3167
+ $[42] = props;
3168
+ $[43] = t11;
3169
+ $[44] = t12;
3170
+ $[45] = t13;
3171
+ $[46] = t14;
3172
+ $[47] = t16;
3173
+ $[48] = t17;
3174
+ $[49] = t18;
3175
+ $[50] = t19;
3176
+ $[51] = t20;
3177
+ $[52] = t7;
3178
+ $[53] = t21;
3179
+ } else t21 = $[53];
3180
+ return t21;
3181
+ }
3182
+ const RING_RADIUS = 30.5;
3183
+ const RING_FROM = 225;
3184
+ const RING_SWEEP = 270;
3185
+ const RING_GAP = 4;
3186
+ /** One arc per fighter of a full squadron, lit for those in it. */
3187
+ function SquadronRing(t0) {
3188
+ const $ = c(12);
3189
+ const { quantity, size } = t0;
3190
+ const step = RING_SWEEP / Math.max(size, 1);
3191
+ const t1 = `${quantity} of ${size}`;
3192
+ let t2;
3193
+ if ($[0] !== quantity || $[1] !== size || $[2] !== step) {
3194
+ let t3;
3195
+ if ($[4] !== quantity || $[5] !== step) {
3196
+ t3 = (_, index) => {
3197
+ const from = RING_FROM - index * step - RING_GAP / 2;
3198
+ const to = from - step + RING_GAP;
3199
+ return /* @__PURE__ */ jsx("path", {
3200
+ d: arc(from, to),
3201
+ "data-lit": index < quantity || void 0
3202
+ }, index);
3203
+ };
3204
+ $[4] = quantity;
3205
+ $[5] = step;
3206
+ $[6] = t3;
3207
+ } else t3 = $[6];
3208
+ t2 = Array.from({ length: size }, t3);
3209
+ $[0] = quantity;
3210
+ $[1] = size;
3211
+ $[2] = step;
3212
+ $[3] = t2;
3213
+ } else t2 = $[3];
3214
+ let t3;
3215
+ if ($[7] !== quantity || $[8] !== size || $[9] !== t1 || $[10] !== t2) {
3216
+ t3 = /* @__PURE__ */ jsx("svg", {
3217
+ className: FighterTube_module_default.ring,
3218
+ viewBox: "-43 -43 86 86",
3219
+ role: "meter",
3220
+ "aria-label": "Fighters",
3221
+ "aria-valuemin": 0,
3222
+ "aria-valuemax": size,
3223
+ "aria-valuenow": quantity,
3224
+ "aria-valuetext": t1,
3225
+ children: t2
3226
+ });
3227
+ $[7] = quantity;
3228
+ $[8] = size;
3229
+ $[9] = t1;
3230
+ $[10] = t2;
3231
+ $[11] = t3;
3232
+ } else t3 = $[11];
3233
+ return t3;
3234
+ }
3235
+ /** Clockwise from `from` to `to`, in degrees counter-clockwise from the right. */
3236
+ function arc(from, to) {
3237
+ const point = (angle) => {
3238
+ const radians = angle * Math.PI / 180;
3239
+ return `${(RING_RADIUS * Math.cos(radians)).toFixed(2)} ${(-30.5 * Math.sin(radians)).toFixed(2)}`;
3240
+ };
3241
+ return `M ${point(from)} A ${RING_RADIUS} ${RING_RADIUS} 0 0 1 ${point(to)}`;
3242
+ }
3243
+ //#endregion
3244
+ //#region src/components/FittingWindow/FighterTubes.tsx
3245
+ /** EVE draws five, those the ship does not have faded. */
3246
+ const FIGHTER_TUBES = 5;
3247
+ const kinds = [
3248
+ {
3249
+ kind: "light",
3250
+ icon: "fighter-light",
3251
+ label: "Light Fighters"
3252
+ },
3253
+ {
3254
+ kind: "support",
3255
+ icon: "fighter-support",
3256
+ label: "Support Fighters"
3257
+ },
3258
+ {
3259
+ kind: "heavy",
3260
+ icon: "fighter-heavy",
3261
+ label: "Heavy Fighters"
3262
+ }
3263
+ ];
3264
+ /** By `fighterSquadronRole`. */
3265
+ const roles = {
3266
+ 1: "fighter-role-interceptor",
3267
+ 2: "fighter-role-attack",
3268
+ 3: "fighter-role-support",
3269
+ 4: "fighter-role-heavy-attack",
3270
+ 5: "fighter-role-bomber"
2872
3271
  };
3272
+ /** The squadrons launched by kind, and EVE's row of fighter tubes. */
3273
+ function FighterTubes() {
3274
+ const $ = c(10);
3275
+ const tubes = useFighterTubes();
3276
+ const usage = useFighterTubeUsage();
3277
+ let t0;
3278
+ if ($[0] !== usage) {
3279
+ t0 = kinds.filter((t1) => {
3280
+ const { kind } = t1;
3281
+ return usage[kind].total > 0;
3282
+ }).map((t2) => {
3283
+ const { kind: kind_0, icon, label } = t2;
3284
+ return /* @__PURE__ */ jsx(Tooltip, {
3285
+ label,
3286
+ children: /* @__PURE__ */ jsxs("span", {
3287
+ className: BayContents_module_default.kind,
3288
+ "aria-label": `${label}: ${usage[kind_0].used} of ${usage[kind_0].total}`,
3289
+ children: [
3290
+ /* @__PURE__ */ jsx(Icon, { name: icon }),
3291
+ ":",
3292
+ usage[kind_0].used,
3293
+ "/",
3294
+ usage[kind_0].total
3295
+ ]
3296
+ })
3297
+ }, kind_0);
3298
+ });
3299
+ $[0] = usage;
3300
+ $[1] = t0;
3301
+ } else t0 = $[1];
3302
+ let t1;
3303
+ if ($[2] !== t0) {
3304
+ t1 = /* @__PURE__ */ jsx("div", {
3305
+ className: BayContents_module_default.kinds,
3306
+ children: t0
3307
+ });
3308
+ $[2] = t0;
3309
+ $[3] = t1;
3310
+ } else t1 = $[3];
3311
+ let t2;
3312
+ if ($[4] !== tubes || $[5] !== usage) {
3313
+ t2 = /* @__PURE__ */ jsx("div", {
3314
+ className: BayContents_module_default.tubes,
3315
+ role: "group",
3316
+ "aria-label": "Fighter Tubes",
3317
+ children: Array.from({ length: Math.max(FIGHTER_TUBES, tubes.length) }, (_, index) => /* @__PURE__ */ jsx(LaunchTube, {
3318
+ index,
3319
+ content: tubes[index],
3320
+ available: index < usage.all.total
3321
+ }, index))
3322
+ });
3323
+ $[4] = tubes;
3324
+ $[5] = usage;
3325
+ $[6] = t2;
3326
+ } else t2 = $[6];
3327
+ let t3;
3328
+ if ($[7] !== t1 || $[8] !== t2) {
3329
+ t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
3330
+ $[7] = t1;
3331
+ $[8] = t2;
3332
+ $[9] = t3;
3333
+ } else t3 = $[9];
3334
+ return t3;
3335
+ }
3336
+ function LaunchTube(t0) {
3337
+ const $ = c(51);
3338
+ const { index, content, available } = t0;
3339
+ const store = useFitStore();
3340
+ const sde = useSde();
3341
+ const { fit, stats } = useSnapshot();
3342
+ const canFit = useCanFit();
3343
+ const { dragging, end } = useDrag();
3344
+ const { show, clear } = usePreview();
3345
+ const item = content?.item;
3346
+ const type = useType(item?.type_id);
3347
+ const ref = content?.ref;
3348
+ let t1;
3349
+ if ($[0] !== available || $[1] !== canFit || $[2] !== dragging || $[3] !== fit || $[4] !== index || $[5] !== sde || $[6] !== stats) {
3350
+ const dropped = dragging?.type === "type" ? sde.type(dragging.typeId) : void 0;
3351
+ t1 = available && dropped !== void 0 && canFit(dropped) && tubeTakes(sde, fit, stats, dropped, index) ? dropped : void 0;
3352
+ $[0] = available;
3353
+ $[1] = canFit;
3354
+ $[2] = dragging;
3355
+ $[3] = fit;
3356
+ $[4] = index;
3357
+ $[5] = sde;
3358
+ $[6] = stats;
3359
+ $[7] = t1;
3360
+ } else t1 = $[7];
3361
+ const taken = t1;
3362
+ let t2;
3363
+ if ($[8] !== index) {
3364
+ t2 = {
3365
+ type: "fighter_tube",
3366
+ index
3367
+ };
3368
+ $[8] = index;
3369
+ $[9] = t2;
3370
+ } else t2 = $[9];
3371
+ const slot = t2;
3372
+ const target = `fighter-tube-${index}`;
3373
+ const role = type && baseValue(sde, type, "fighterSquadronRole");
3374
+ const t3 = content?.preview;
3375
+ const t4 = item?.type_id;
3376
+ const t5 = type?.name;
3377
+ const t6 = item?.quantity ?? 1;
3378
+ let t7;
3379
+ if ($[10] !== sde || $[11] !== type) {
3380
+ t7 = type && squadronSize(sde, type);
3381
+ $[10] = sde;
3382
+ $[11] = type;
3383
+ $[12] = t7;
3384
+ } else t7 = $[12];
3385
+ const t8 = role === void 0 ? void 0 : roles[role];
3386
+ let t9;
3387
+ if ($[13] !== ref || $[14] !== store) {
3388
+ t9 = ref === void 0 ? void 0 : () => store.remove(ref);
3389
+ $[13] = ref;
3390
+ $[14] = store;
3391
+ $[15] = t9;
3392
+ } else t9 = $[15];
3393
+ let t10;
3394
+ if ($[16] !== ref || $[17] !== store) {
3395
+ t10 = ref === void 0 ? void 0 : (quantity) => store.setSquadronSize(ref, quantity);
3396
+ $[16] = ref;
3397
+ $[17] = store;
3398
+ $[18] = t10;
3399
+ } else t10 = $[18];
3400
+ let t11;
3401
+ if ($[19] !== show || $[20] !== slot || $[21] !== taken || $[22] !== target) {
3402
+ t11 = () => {
3403
+ if (taken) show((draft) => void draft.fit(taken.id, slot), target);
3404
+ };
3405
+ $[19] = show;
3406
+ $[20] = slot;
3407
+ $[21] = taken;
3408
+ $[22] = target;
3409
+ $[23] = t11;
3410
+ } else t11 = $[23];
3411
+ let t12;
3412
+ if ($[24] !== clear || $[25] !== target) {
3413
+ t12 = (event) => {
3414
+ if (event.currentTarget.contains(event.relatedTarget)) return;
3415
+ clear(target);
3416
+ };
3417
+ $[24] = clear;
3418
+ $[25] = target;
3419
+ $[26] = t12;
3420
+ } else t12 = $[26];
3421
+ let t13;
3422
+ if ($[27] !== taken) {
3423
+ t13 = (event_0) => {
3424
+ if (!taken) return;
3425
+ event_0.preventDefault();
3426
+ event_0.dataTransfer.dropEffect = "copy";
3427
+ };
3428
+ $[27] = taken;
3429
+ $[28] = t13;
3430
+ } else t13 = $[28];
3431
+ let t14;
3432
+ if ($[29] !== clear || $[30] !== end || $[31] !== slot || $[32] !== store || $[33] !== taken || $[34] !== target) {
3433
+ t14 = (event_1) => {
3434
+ if (!taken) return;
3435
+ event_1.preventDefault();
3436
+ clear(target);
3437
+ store.fit(taken.id, slot);
3438
+ end();
3439
+ };
3440
+ $[29] = clear;
3441
+ $[30] = end;
3442
+ $[31] = slot;
3443
+ $[32] = store;
3444
+ $[33] = taken;
3445
+ $[34] = target;
3446
+ $[35] = t14;
3447
+ } else t14 = $[35];
3448
+ let t15;
3449
+ if ($[36] !== available || $[37] !== index || $[38] !== t10 || $[39] !== t11 || $[40] !== t12 || $[41] !== t13 || $[42] !== t14 || $[43] !== t3 || $[44] !== t4 || $[45] !== t5 || $[46] !== t6 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9) {
3450
+ t15 = /* @__PURE__ */ jsx(FighterTube, {
3451
+ index,
3452
+ available,
3453
+ preview: t3,
3454
+ typeId: t4,
3455
+ typeName: t5,
3456
+ quantity: t6,
3457
+ size: t7,
3458
+ role: t8,
3459
+ onRemove: t9,
3460
+ onResize: t10,
3461
+ onDragEnter: t11,
3462
+ onDragLeave: t12,
3463
+ onDragOver: t13,
3464
+ onDrop: t14
3465
+ });
3466
+ $[36] = available;
3467
+ $[37] = index;
3468
+ $[38] = t10;
3469
+ $[39] = t11;
3470
+ $[40] = t12;
3471
+ $[41] = t13;
3472
+ $[42] = t14;
3473
+ $[43] = t3;
3474
+ $[44] = t4;
3475
+ $[45] = t5;
3476
+ $[46] = t6;
3477
+ $[47] = t7;
3478
+ $[48] = t8;
3479
+ $[49] = t9;
3480
+ $[50] = t15;
3481
+ } else t15 = $[50];
3482
+ return t15;
3483
+ }
2873
3484
  //#endregion
2874
3485
  //#region src/components/FittingWindow/BayContents.tsx
2875
3486
  const emptyText = {
2876
3487
  cargo: "No Cargo Items Simulated",
2877
- droneBay: "No Drones Simulated"
3488
+ droneBay: "No Drones Simulated",
3489
+ fighterBay: "No Fighters Simulated in Fighter Bay"
2878
3490
  };
2879
- /** EVE's list of what is in a bay, as a popover anchored to `--bay-anchor`. */
3491
+ /** EVE's list of what is in a bay, as a popover anchored to `--bay-anchor`; the fighter bay's has its tubes above. */
2880
3492
  function BayContents(t0) {
2881
- const $ = c(26);
3493
+ const $ = c(39);
2882
3494
  const { id, bay, label } = t0;
2883
3495
  const store = useFitStore();
2884
3496
  const contents = useBayContents(bay);
2885
3497
  const panel = useRef(null);
2886
3498
  const drones = bay === "droneBay";
2887
- const { stats } = useSnapshot();
3499
+ const fighters = bay === "fighterBay";
3500
+ const { fit, stats } = useSnapshot();
2888
3501
  let t1;
2889
3502
  if ($[0] !== stats.character) {
2890
3503
  t1 = stats.character.get("maxActiveDrones") ?? 0;
@@ -2892,27 +3505,51 @@ function BayContents(t0) {
2892
3505
  $[1] = t1;
2893
3506
  } else t1 = $[1];
2894
3507
  const maxActive = t1;
2895
- if (contents.length === 0) {
2896
- const t2 = emptyText[bay];
2897
- let t3;
2898
- if ($[2] !== id || $[3] !== t2) {
2899
- t3 = /* @__PURE__ */ jsx("div", {
3508
+ let t2;
3509
+ if ($[2] !== contents || $[3] !== fighters || $[4] !== fit) {
3510
+ const launched = fighters ? fit.items.flatMap(_temp$5) : [];
3511
+ t2 = [...contents.flatMap(_temp2$3), ...launched];
3512
+ $[2] = contents;
3513
+ $[3] = fighters;
3514
+ $[4] = fit;
3515
+ $[5] = t2;
3516
+ } else t2 = $[5];
3517
+ const all = t2;
3518
+ if (!fighters && contents.length === 0) {
3519
+ const t3 = emptyText[bay];
3520
+ let t4;
3521
+ if ($[6] !== id || $[7] !== t3) {
3522
+ t4 = /* @__PURE__ */ jsx("div", {
2900
3523
  id,
2901
3524
  className: BayContents_module_default.panel,
2902
3525
  popover: "auto",
2903
3526
  "data-empty": true,
2904
- children: t2
3527
+ children: t3
2905
3528
  });
2906
- $[2] = id;
2907
- $[3] = t2;
2908
- $[4] = t3;
2909
- } else t3 = $[4];
2910
- return t3;
3529
+ $[6] = id;
3530
+ $[7] = t3;
3531
+ $[8] = t4;
3532
+ } else t4 = $[8];
3533
+ return t4;
2911
3534
  }
2912
- const t2 = drones || void 0;
2913
3535
  let t3;
2914
- if ($[5] !== drones || $[6] !== maxActive || $[7] !== stats.ship) {
2915
- t3 = drones && /* @__PURE__ */ jsxs("div", {
3536
+ if ($[9] !== drones || $[10] !== fighters || $[11] !== store) {
3537
+ t3 = (typeId, quantity) => {
3538
+ if (drones) store.setDroneQuantity(typeId, quantity);
3539
+ else if (fighters) store.setFighterBayQuantity(typeId, quantity);
3540
+ else store.setCargoQuantity(typeId, quantity);
3541
+ };
3542
+ $[9] = drones;
3543
+ $[10] = fighters;
3544
+ $[11] = store;
3545
+ $[12] = t3;
3546
+ } else t3 = $[12];
3547
+ const setQuantity = t3;
3548
+ const t4 = drones || void 0;
3549
+ const t5 = fighters || void 0;
3550
+ let t6;
3551
+ if ($[13] !== drones || $[14] !== maxActive || $[15] !== stats.ship) {
3552
+ t6 = drones && /* @__PURE__ */ jsxs("div", {
2916
3553
  className: BayContents_module_default.activeDrones,
2917
3554
  children: [
2918
3555
  "Active drones: ",
@@ -2921,112 +3558,125 @@ function BayContents(t0) {
2921
3558
  maxActive
2922
3559
  ]
2923
3560
  });
2924
- $[5] = drones;
2925
- $[6] = maxActive;
2926
- $[7] = stats.ship;
2927
- $[8] = t3;
2928
- } else t3 = $[8];
2929
- let t4;
2930
- if ($[9] !== contents || $[10] !== drones || $[11] !== maxActive || $[12] !== store) {
2931
- t4 = contents.map((content) => {
2932
- const { type, quantity, refs } = content;
2933
- return /* @__PURE__ */ jsxs("li", {
2934
- className: BayContents_module_default.row,
2935
- children: [
2936
- /* @__PURE__ */ jsx(Quantity, {
2937
- name: type.name,
2938
- value: quantity,
2939
- onChange: (value) => drones ? store.setDroneQuantity(type.id, value) : store.setCargoQuantity(type.id, value)
2940
- }),
2941
- /* @__PURE__ */ jsx("span", {
2942
- className: BayContents_module_default.icon,
2943
- children: /* @__PURE__ */ jsx(TypeIcon, { typeId: type.id })
2944
- }),
2945
- /* @__PURE__ */ jsxs("span", {
2946
- className: BayContents_module_default.middle,
2947
- children: [/* @__PURE__ */ jsx("span", {
2948
- className: BayContents_module_default.name,
2949
- children: type.name
2950
- }), drones && /* @__PURE__ */ jsx(DroneSelection, {
2951
- content,
2952
- max: maxActive
2953
- })]
2954
- }),
2955
- /* @__PURE__ */ jsx("button", {
2956
- type: "button",
2957
- className: BayContents_module_default.remove,
2958
- "aria-label": `Remove ${type.name}`,
2959
- onClick: (event) => {
2960
- const row = event.currentTarget.closest("li");
2961
- const next = row.nextElementSibling ?? row.previousElementSibling;
2962
- store.remove(...refs);
2963
- if (next === null) panel.current?.hidePopover();
2964
- else next.querySelector(`.${BayContents_module_default.remove}`)?.focus();
2965
- },
2966
- children: /* @__PURE__ */ jsx(Icon, { name: "close" })
2967
- })
2968
- ]
2969
- }, type.id);
2970
- });
2971
- $[9] = contents;
2972
- $[10] = drones;
2973
- $[11] = maxActive;
2974
- $[12] = store;
2975
- $[13] = t4;
2976
- } else t4 = $[13];
2977
- let t5;
2978
- if ($[14] !== label || $[15] !== t4) {
2979
- t5 = /* @__PURE__ */ jsx("ul", {
3561
+ $[13] = drones;
3562
+ $[14] = maxActive;
3563
+ $[15] = stats.ship;
3564
+ $[16] = t6;
3565
+ } else t6 = $[16];
3566
+ let t7;
3567
+ if ($[17] !== fighters) {
3568
+ t7 = fighters && /* @__PURE__ */ jsx(FighterTubes, {});
3569
+ $[17] = fighters;
3570
+ $[18] = t7;
3571
+ } else t7 = $[18];
3572
+ let t8;
3573
+ if ($[19] !== bay || $[20] !== contents || $[21] !== drones || $[22] !== fighters || $[23] !== label || $[24] !== maxActive || $[25] !== setQuantity || $[26] !== store) {
3574
+ t8 = contents.length === 0 ? /* @__PURE__ */ jsx("div", {
3575
+ className: BayContents_module_default.none,
3576
+ children: emptyText[bay]
3577
+ }) : /* @__PURE__ */ jsx("ul", {
2980
3578
  className: BayContents_module_default.list,
2981
3579
  "aria-label": label,
2982
- children: t4
3580
+ children: contents.map((content) => {
3581
+ const { type, quantity: quantity_0, refs: refs_0 } = content;
3582
+ return /* @__PURE__ */ jsxs("li", {
3583
+ className: BayContents_module_default.row,
3584
+ children: [
3585
+ /* @__PURE__ */ jsx(Quantity, {
3586
+ name: type.name,
3587
+ value: quantity_0,
3588
+ onChange: (value) => setQuantity(type.id, value)
3589
+ }),
3590
+ /* @__PURE__ */ jsx("span", {
3591
+ className: BayContents_module_default.icon,
3592
+ children: /* @__PURE__ */ jsx(TypeIcon, { typeId: type.id })
3593
+ }),
3594
+ /* @__PURE__ */ jsxs("span", {
3595
+ className: BayContents_module_default.middle,
3596
+ children: [/* @__PURE__ */ jsx("span", {
3597
+ className: BayContents_module_default.name,
3598
+ children: type.name
3599
+ }), drones && /* @__PURE__ */ jsx(DroneSelection, {
3600
+ content,
3601
+ max: maxActive
3602
+ })]
3603
+ }),
3604
+ /* @__PURE__ */ jsx("button", {
3605
+ type: "button",
3606
+ className: BayContents_module_default.remove,
3607
+ "aria-label": `Remove ${type.name}`,
3608
+ onClick: (event) => {
3609
+ const row = event.currentTarget.closest("li");
3610
+ const next = row.nextElementSibling ?? row.previousElementSibling;
3611
+ store.remove(...refs_0);
3612
+ if (next !== null) next.querySelector(`.${BayContents_module_default.remove}`)?.focus();
3613
+ else if (!fighters) panel.current?.hidePopover();
3614
+ },
3615
+ children: /* @__PURE__ */ jsx(Icon, { name: "close" })
3616
+ })
3617
+ ]
3618
+ }, type.id);
3619
+ })
2983
3620
  });
2984
- $[14] = label;
2985
- $[15] = t4;
2986
- $[16] = t5;
2987
- } else t5 = $[16];
2988
- let t6;
2989
- if ($[17] !== contents || $[18] !== store) {
2990
- t6 = /* @__PURE__ */ jsx("button", {
3621
+ $[19] = bay;
3622
+ $[20] = contents;
3623
+ $[21] = drones;
3624
+ $[22] = fighters;
3625
+ $[23] = label;
3626
+ $[24] = maxActive;
3627
+ $[25] = setQuantity;
3628
+ $[26] = store;
3629
+ $[27] = t8;
3630
+ } else t8 = $[27];
3631
+ let t9;
3632
+ if ($[28] !== all || $[29] !== store) {
3633
+ t9 = all.length > 0 && /* @__PURE__ */ jsx("button", {
2991
3634
  type: "button",
2992
3635
  className: BayContents_module_default.removeAll,
2993
3636
  onClick: () => {
2994
- store.remove(...contents.flatMap(_temp$5));
3637
+ store.remove(...all);
2995
3638
  panel.current?.hidePopover();
2996
3639
  },
2997
3640
  children: "Remove All"
2998
3641
  });
2999
- $[17] = contents;
3000
- $[18] = store;
3001
- $[19] = t6;
3002
- } else t6 = $[19];
3003
- let t7;
3004
- if ($[20] !== id || $[21] !== t2 || $[22] !== t3 || $[23] !== t5 || $[24] !== t6) {
3005
- t7 = /* @__PURE__ */ jsxs("div", {
3642
+ $[28] = all;
3643
+ $[29] = store;
3644
+ $[30] = t9;
3645
+ } else t9 = $[30];
3646
+ let t10;
3647
+ if ($[31] !== id || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 || $[37] !== t9) {
3648
+ t10 = /* @__PURE__ */ jsxs("div", {
3006
3649
  ref: panel,
3007
3650
  id,
3008
3651
  className: BayContents_module_default.panel,
3009
3652
  popover: "auto",
3010
- "data-drones": t2,
3653
+ "data-drones": t4,
3654
+ "data-fighters": t5,
3011
3655
  children: [
3012
- t3,
3013
- t5,
3014
- t6
3656
+ t6,
3657
+ t7,
3658
+ t8,
3659
+ t9
3015
3660
  ]
3016
3661
  });
3017
- $[20] = id;
3018
- $[21] = t2;
3019
- $[22] = t3;
3020
- $[23] = t5;
3021
- $[24] = t6;
3022
- $[25] = t7;
3023
- } else t7 = $[25];
3024
- return t7;
3662
+ $[31] = id;
3663
+ $[32] = t4;
3664
+ $[33] = t5;
3665
+ $[34] = t6;
3666
+ $[35] = t7;
3667
+ $[36] = t8;
3668
+ $[37] = t9;
3669
+ $[38] = t10;
3670
+ } else t10 = $[38];
3671
+ return t10;
3025
3672
  }
3026
3673
  /** One box per drone the character can launch. */
3027
- function _temp$5(t0) {
3028
- const { refs: refs_0 } = t0;
3029
- return refs_0;
3674
+ function _temp2$3(t0) {
3675
+ const { refs } = t0;
3676
+ return refs;
3677
+ }
3678
+ function _temp$5(item, ref) {
3679
+ return item.slot.type === "fighter_tube" ? [ref] : [];
3030
3680
  }
3031
3681
  function DroneSelection(t0) {
3032
3682
  const $ = c(16);
@@ -3296,6 +3946,13 @@ var FittingWindow_module_default = {
3296
3946
  "window": "L9t91q_window"
3297
3947
  };
3298
3948
  //#endregion
3949
+ //#region src/components/FittingWindow/manageFighters.ts
3950
+ /** Opens the fighter bay of the `FittingWindow` around it. */
3951
+ const ManageFightersContext = createContext(void 0);
3952
+ function useManageFighters() {
3953
+ return useContext(ManageFightersContext);
3954
+ }
3955
+ //#endregion
3299
3956
  //#region src/components/FittingWindow/violations.ts
3300
3957
  const byRule = {
3301
3958
  skill: "skill",
@@ -3427,7 +4084,7 @@ const oneDecimal = new Intl.NumberFormat("en-US", {
3427
4084
  const SERVICE_SLOTS = 8;
3428
4085
  /** EVE's fitting window around the `FittingWheel`. */
3429
4086
  function FittingWindow(t0) {
3430
- const $ = c(38);
4087
+ const $ = c(51);
3431
4088
  const { label: t1, browser, statistics } = t0;
3432
4089
  const label = t1 === void 0 ? "Fitting Window" : t1;
3433
4090
  const [browserOpen, setBrowserOpen] = useState(true);
@@ -3436,12 +4093,22 @@ function FittingWindow(t0) {
3436
4093
  const statisticsId = useId();
3437
4094
  const browserShown = browser !== void 0 && browserOpen;
3438
4095
  const statisticsShown = statistics !== void 0 && statisticsOpen;
3439
- const { structure } = useSnapshot().stats;
3440
- const t2 = browserShown || void 0;
3441
- const t3 = statisticsShown || void 0;
3442
- let t4;
3443
- if ($[0] !== browser || $[1] !== browserId || $[2] !== browserShown) {
3444
- t4 = browser !== void 0 && /* @__PURE__ */ jsx("div", {
4096
+ const { stats } = useSnapshot();
4097
+ const { structure } = stats;
4098
+ const fighters = structure || stats.fighterBay.total > 0;
4099
+ const fighterBay = useId();
4100
+ let t2;
4101
+ if ($[0] !== fighterBay || $[1] !== fighters) {
4102
+ t2 = fighters ? () => popover(fighterBay)?.showPopover() : void 0;
4103
+ $[0] = fighterBay;
4104
+ $[1] = fighters;
4105
+ $[2] = t2;
4106
+ } else t2 = $[2];
4107
+ const t3 = browserShown || void 0;
4108
+ const t4 = statisticsShown || void 0;
4109
+ let t5;
4110
+ if ($[3] !== browser || $[4] !== browserId || $[5] !== browserShown) {
4111
+ t5 = browser !== void 0 && /* @__PURE__ */ jsx("div", {
3445
4112
  id: browserId,
3446
4113
  className: FittingWindow_module_default.browser,
3447
4114
  inert: !browserShown,
@@ -3450,32 +4117,32 @@ function FittingWindow(t0) {
3450
4117
  children: browser
3451
4118
  })
3452
4119
  });
3453
- $[0] = browser;
3454
- $[1] = browserId;
3455
- $[2] = browserShown;
3456
- $[3] = t4;
3457
- } else t4 = $[3];
3458
- let t5;
4120
+ $[3] = browser;
4121
+ $[4] = browserId;
4122
+ $[5] = browserShown;
4123
+ $[6] = t5;
4124
+ } else t5 = $[6];
3459
4125
  let t6;
3460
4126
  let t7;
3461
- if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
3462
- t5 = /* @__PURE__ */ jsx("div", {
4127
+ let t8;
4128
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
4129
+ t6 = /* @__PURE__ */ jsx("div", {
3463
4130
  className: FittingWindow_module_default.wheel,
3464
4131
  children: /* @__PURE__ */ jsx(FittingWheel, {})
3465
4132
  });
3466
- t6 = /* @__PURE__ */ jsx(FitName, {});
3467
- t7 = /* @__PURE__ */ jsx(Violations, {});
3468
- $[4] = t5;
3469
- $[5] = t6;
3470
- $[6] = t7;
4133
+ t7 = /* @__PURE__ */ jsx(FitName, {});
4134
+ t8 = /* @__PURE__ */ jsx(Violations, {});
4135
+ $[7] = t6;
4136
+ $[8] = t7;
4137
+ $[9] = t8;
3471
4138
  } else {
3472
- t5 = $[4];
3473
- t6 = $[5];
3474
- t7 = $[6];
4139
+ t6 = $[7];
4140
+ t7 = $[8];
4141
+ t8 = $[9];
3475
4142
  }
3476
- let t8;
3477
- if ($[7] !== browser || $[8] !== browserId || $[9] !== browserShown) {
3478
- t8 = browser !== void 0 && /* @__PURE__ */ jsx("div", {
4143
+ let t9;
4144
+ if ($[10] !== browser || $[11] !== browserId || $[12] !== browserShown) {
4145
+ t9 = browser !== void 0 && /* @__PURE__ */ jsx("div", {
3479
4146
  className: FittingWindow_module_default.tools,
3480
4147
  children: /* @__PURE__ */ jsx(Tooltip, {
3481
4148
  label: "Item Browser",
@@ -3490,14 +4157,14 @@ function FittingWindow(t0) {
3490
4157
  })
3491
4158
  })
3492
4159
  });
3493
- $[7] = browser;
3494
- $[8] = browserId;
3495
- $[9] = browserShown;
3496
- $[10] = t8;
3497
- } else t8 = $[10];
3498
- let t9;
3499
- if ($[11] !== statistics || $[12] !== statisticsId || $[13] !== statisticsShown) {
3500
- t9 = statistics !== void 0 && /* @__PURE__ */ jsx("div", {
4160
+ $[10] = browser;
4161
+ $[11] = browserId;
4162
+ $[12] = browserShown;
4163
+ $[13] = t9;
4164
+ } else t9 = $[13];
4165
+ let t10;
4166
+ if ($[14] !== statistics || $[15] !== statisticsId || $[16] !== statisticsShown) {
4167
+ t10 = statistics !== void 0 && /* @__PURE__ */ jsx("div", {
3501
4168
  className: FittingWindow_module_default.panels,
3502
4169
  children: /* @__PURE__ */ jsx(Tooltip, {
3503
4170
  label: "Statistics",
@@ -3512,51 +4179,70 @@ function FittingWindow(t0) {
3512
4179
  })
3513
4180
  })
3514
4181
  });
3515
- $[11] = statistics;
3516
- $[12] = statisticsId;
3517
- $[13] = statisticsShown;
3518
- $[14] = t9;
3519
- } else t9 = $[14];
3520
- let t10;
4182
+ $[14] = statistics;
4183
+ $[15] = statisticsId;
4184
+ $[16] = statisticsShown;
4185
+ $[17] = t10;
4186
+ } else t10 = $[17];
3521
4187
  let t11;
3522
- if ($[15] !== structure) {
3523
- t10 = /* @__PURE__ */ jsx("div", {
3524
- className: FittingWindow_module_default.bays,
3525
- children: structure ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Bay, {
3526
- bay: "cargo",
3527
- icon: "ammo-hold",
3528
- label: "Ammo Hold",
3529
- unlimited: true
3530
- }), /* @__PURE__ */ jsx(FighterBay, {})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Bay, {
3531
- bay: "cargo",
3532
- icon: "cargo",
3533
- label: "Cargo Hold"
3534
- }), /* @__PURE__ */ jsx(Bay, {
3535
- bay: "droneBay",
3536
- icon: "drone-bay",
3537
- label: "Drone Bay"
3538
- })] })
3539
- });
3540
- t11 = structure && /* @__PURE__ */ jsx(ServiceRack, {});
3541
- $[15] = structure;
3542
- $[16] = t10;
3543
- $[17] = t11;
3544
- } else {
3545
- t10 = $[16];
3546
- t11 = $[17];
3547
- }
3548
- let t12;
3549
4188
  if ($[18] !== structure) {
3550
- t12 = /* @__PURE__ */ jsx("div", {
3551
- className: FittingWindow_module_default.history,
3552
- children: /* @__PURE__ */ jsx(SimulationHistory, { tooltipTitle: structure })
4189
+ t11 = structure ? /* @__PURE__ */ jsx(Bay, {
4190
+ bay: "cargo",
4191
+ icon: "ammo-hold",
4192
+ label: "Ammo Hold",
4193
+ unlimited: true
4194
+ }) : /* @__PURE__ */ jsx(Bay, {
4195
+ bay: "cargo",
4196
+ icon: "cargo",
4197
+ label: "Cargo Hold"
3553
4198
  });
3554
4199
  $[18] = structure;
3555
- $[19] = t12;
3556
- } else t12 = $[19];
4200
+ $[19] = t11;
4201
+ } else t11 = $[19];
4202
+ let t12;
4203
+ if ($[20] !== fighterBay || $[21] !== fighters) {
4204
+ t12 = fighters ? /* @__PURE__ */ jsx(Bay, {
4205
+ id: fighterBay,
4206
+ bay: "fighterBay",
4207
+ icon: "fighter-bay",
4208
+ label: "Fighter Bay"
4209
+ }) : /* @__PURE__ */ jsx(Bay, {
4210
+ bay: "droneBay",
4211
+ icon: "drone-bay",
4212
+ label: "Drone Bay"
4213
+ });
4214
+ $[20] = fighterBay;
4215
+ $[21] = fighters;
4216
+ $[22] = t12;
4217
+ } else t12 = $[22];
3557
4218
  let t13;
3558
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
4219
+ if ($[23] !== t11 || $[24] !== t12) {
3559
4220
  t13 = /* @__PURE__ */ jsxs("div", {
4221
+ className: FittingWindow_module_default.bays,
4222
+ children: [t11, t12]
4223
+ });
4224
+ $[23] = t11;
4225
+ $[24] = t12;
4226
+ $[25] = t13;
4227
+ } else t13 = $[25];
4228
+ let t14;
4229
+ if ($[26] !== structure) {
4230
+ t14 = structure && /* @__PURE__ */ jsx(ServiceRack, {});
4231
+ $[26] = structure;
4232
+ $[27] = t14;
4233
+ } else t14 = $[27];
4234
+ let t15;
4235
+ if ($[28] !== structure) {
4236
+ t15 = /* @__PURE__ */ jsx("div", {
4237
+ className: FittingWindow_module_default.history,
4238
+ children: /* @__PURE__ */ jsx(SimulationHistory, { tooltipTitle: structure })
4239
+ });
4240
+ $[28] = structure;
4241
+ $[29] = t15;
4242
+ } else t15 = $[29];
4243
+ let t16;
4244
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
4245
+ t16 = /* @__PURE__ */ jsxs("div", {
3560
4246
  className: FittingWindow_module_default.resources,
3561
4247
  children: [/* @__PURE__ */ jsx(Resource, {
3562
4248
  title: "CPU",
@@ -3568,34 +4254,34 @@ function FittingWindow(t0) {
3568
4254
  output: "powerOutput"
3569
4255
  })]
3570
4256
  });
3571
- $[20] = t13;
3572
- } else t13 = $[20];
3573
- let t14;
3574
- if ($[21] !== t10 || $[22] !== t11 || $[23] !== t12 || $[24] !== t8 || $[25] !== t9) {
3575
- t14 = /* @__PURE__ */ jsxs("div", {
4257
+ $[30] = t16;
4258
+ } else t16 = $[30];
4259
+ let t17;
4260
+ if ($[31] !== t10 || $[32] !== t13 || $[33] !== t14 || $[34] !== t15 || $[35] !== t9) {
4261
+ t17 = /* @__PURE__ */ jsxs("div", {
3576
4262
  className: FittingWindow_module_default.frame,
3577
4263
  children: [
3578
- t5,
3579
4264
  t6,
3580
4265
  t7,
3581
4266
  t8,
3582
4267
  t9,
3583
4268
  t10,
3584
- t11,
3585
- t12,
3586
- t13
4269
+ t13,
4270
+ t14,
4271
+ t15,
4272
+ t16
3587
4273
  ]
3588
4274
  });
3589
- $[21] = t10;
3590
- $[22] = t11;
3591
- $[23] = t12;
3592
- $[24] = t8;
3593
- $[25] = t9;
3594
- $[26] = t14;
3595
- } else t14 = $[26];
3596
- let t15;
3597
- if ($[27] !== statistics || $[28] !== statisticsId || $[29] !== statisticsShown) {
3598
- t15 = statistics !== void 0 && /* @__PURE__ */ jsx("div", {
4275
+ $[31] = t10;
4276
+ $[32] = t13;
4277
+ $[33] = t14;
4278
+ $[34] = t15;
4279
+ $[35] = t9;
4280
+ $[36] = t17;
4281
+ } else t17 = $[36];
4282
+ let t18;
4283
+ if ($[37] !== statistics || $[38] !== statisticsId || $[39] !== statisticsShown) {
4284
+ t18 = statistics !== void 0 && /* @__PURE__ */ jsx("div", {
3599
4285
  id: statisticsId,
3600
4286
  className: FittingWindow_module_default.statistics,
3601
4287
  inert: !statisticsShown,
@@ -3604,33 +4290,47 @@ function FittingWindow(t0) {
3604
4290
  children: statistics
3605
4291
  })
3606
4292
  });
3607
- $[27] = statistics;
3608
- $[28] = statisticsId;
3609
- $[29] = statisticsShown;
3610
- $[30] = t15;
3611
- } else t15 = $[30];
3612
- let t16;
3613
- if ($[31] !== label || $[32] !== t14 || $[33] !== t15 || $[34] !== t2 || $[35] !== t3 || $[36] !== t4) {
3614
- t16 = /* @__PURE__ */ jsxs("section", {
4293
+ $[37] = statistics;
4294
+ $[38] = statisticsId;
4295
+ $[39] = statisticsShown;
4296
+ $[40] = t18;
4297
+ } else t18 = $[40];
4298
+ let t19;
4299
+ if ($[41] !== label || $[42] !== t17 || $[43] !== t18 || $[44] !== t3 || $[45] !== t4 || $[46] !== t5) {
4300
+ t19 = /* @__PURE__ */ jsxs("section", {
3615
4301
  className: FittingWindow_module_default.window,
3616
4302
  "aria-label": label,
3617
- "data-browser": t2,
3618
- "data-statistics": t3,
4303
+ "data-browser": t3,
4304
+ "data-statistics": t4,
3619
4305
  children: [
3620
- t4,
3621
- t14,
3622
- t15
4306
+ t5,
4307
+ t17,
4308
+ t18
3623
4309
  ]
3624
4310
  });
3625
- $[31] = label;
3626
- $[32] = t14;
3627
- $[33] = t15;
3628
- $[34] = t2;
3629
- $[35] = t3;
3630
- $[36] = t4;
3631
- $[37] = t16;
3632
- } else t16 = $[37];
3633
- return t16;
4311
+ $[41] = label;
4312
+ $[42] = t17;
4313
+ $[43] = t18;
4314
+ $[44] = t3;
4315
+ $[45] = t4;
4316
+ $[46] = t5;
4317
+ $[47] = t19;
4318
+ } else t19 = $[47];
4319
+ let t20;
4320
+ if ($[48] !== t19 || $[49] !== t2) {
4321
+ t20 = /* @__PURE__ */ jsx(ManageFightersContext, {
4322
+ value: t2,
4323
+ children: t19
4324
+ });
4325
+ $[48] = t19;
4326
+ $[49] = t2;
4327
+ $[50] = t20;
4328
+ } else t20 = $[50];
4329
+ return t20;
4330
+ }
4331
+ function popover(id) {
4332
+ const element = document.getElementById(id);
4333
+ return element?.matches(":popover-open") ? null : element;
3634
4334
  }
3635
4335
  function FitName() {
3636
4336
  const $ = c(4);
@@ -3842,111 +4542,94 @@ function NotImplementedButton(t0) {
3842
4542
  return t4;
3843
4543
  }
3844
4544
  function Bay(t0) {
3845
- const $ = c(24);
3846
- const { bay, icon, label, unlimited: t1 } = t0;
4545
+ const $ = c(26);
4546
+ const { bay, icon, label, unlimited: t1, id: givenId } = t0;
3847
4547
  const unlimited = t1 === void 0 ? false : t1;
3848
4548
  const { used, total } = useBayUsage(bay);
3849
- const id = useId();
3850
- const drop = useBayDrop(bay);
4549
+ const ownId = useId();
4550
+ const id = givenId ?? ownId;
3851
4551
  let t2;
3852
4552
  if ($[0] !== id) {
3853
- let t3;
3854
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
3855
- t3 = /[^\w-]/g;
3856
- $[2] = t3;
3857
- } else t3 = $[2];
3858
- t2 = id.replace(t3, "");
4553
+ t2 = () => popover(id)?.showPopover();
3859
4554
  $[0] = id;
3860
4555
  $[1] = t2;
3861
4556
  } else t2 = $[1];
3862
- const t3 = `--bay-${t2}`;
3863
- let t4;
3864
- if ($[3] !== t3) {
3865
- t4 = { "--bay-anchor": t3 };
4557
+ const drop = useBayDrop(bay, t2);
4558
+ let t3;
4559
+ if ($[2] !== id) {
4560
+ let t4;
4561
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
4562
+ t4 = /[^\w-]/g;
4563
+ $[4] = t4;
4564
+ } else t4 = $[4];
4565
+ t3 = id.replace(t4, "");
4566
+ $[2] = id;
3866
4567
  $[3] = t3;
3867
- $[4] = t4;
3868
- } else t4 = $[4];
3869
- const t5 = t4;
3870
- const t6 = !unlimited && used > total || void 0;
3871
- let t7;
3872
- if ($[5] !== drop || $[6] !== icon || $[7] !== id || $[8] !== label || $[9] !== t6 || $[10] !== total || $[11] !== used) {
3873
- t7 = /* @__PURE__ */ jsx(BayButton, {
4568
+ } else t3 = $[3];
4569
+ const t4 = `--bay-${t3}`;
4570
+ let t5;
4571
+ if ($[5] !== t4) {
4572
+ t5 = { "--bay-anchor": t4 };
4573
+ $[5] = t4;
4574
+ $[6] = t5;
4575
+ } else t5 = $[6];
4576
+ const t6 = t5;
4577
+ const t7 = !unlimited && used > total || void 0;
4578
+ let t8;
4579
+ if ($[7] !== drop || $[8] !== icon || $[9] !== id || $[10] !== label || $[11] !== t7 || $[12] !== total || $[13] !== used) {
4580
+ t8 = /* @__PURE__ */ jsx(BayButton, {
3874
4581
  icon,
3875
4582
  used,
3876
4583
  total,
3877
4584
  "aria-label": label,
3878
4585
  popoverTarget: id,
3879
- "data-over": t6,
4586
+ "data-over": t7,
3880
4587
  ...drop
3881
4588
  });
3882
- $[5] = drop;
3883
- $[6] = icon;
3884
- $[7] = id;
3885
- $[8] = label;
3886
- $[9] = t6;
3887
- $[10] = total;
3888
- $[11] = used;
3889
- $[12] = t7;
3890
- } else t7 = $[12];
3891
- let t8;
3892
- if ($[13] !== label || $[14] !== t7) {
3893
- t8 = /* @__PURE__ */ jsx(Tooltip, {
4589
+ $[7] = drop;
4590
+ $[8] = icon;
4591
+ $[9] = id;
4592
+ $[10] = label;
4593
+ $[11] = t7;
4594
+ $[12] = total;
4595
+ $[13] = used;
4596
+ $[14] = t8;
4597
+ } else t8 = $[14];
4598
+ let t9;
4599
+ if ($[15] !== label || $[16] !== t8) {
4600
+ t9 = /* @__PURE__ */ jsx(Tooltip, {
3894
4601
  label,
3895
- children: t7
4602
+ children: t8
3896
4603
  });
3897
- $[13] = label;
3898
- $[14] = t7;
3899
- $[15] = t8;
3900
- } else t8 = $[15];
3901
- let t9;
3902
- if ($[16] !== bay || $[17] !== id || $[18] !== label) {
3903
- t9 = /* @__PURE__ */ jsx(BayContents, {
4604
+ $[15] = label;
4605
+ $[16] = t8;
4606
+ $[17] = t9;
4607
+ } else t9 = $[17];
4608
+ let t10;
4609
+ if ($[18] !== bay || $[19] !== id || $[20] !== label) {
4610
+ t10 = /* @__PURE__ */ jsx(BayContents, {
3904
4611
  id,
3905
4612
  bay,
3906
4613
  label
3907
4614
  });
3908
- $[16] = bay;
3909
- $[17] = id;
3910
- $[18] = label;
3911
- $[19] = t9;
3912
- } else t9 = $[19];
3913
- let t10;
3914
- if ($[20] !== t5 || $[21] !== t8 || $[22] !== t9) {
3915
- t10 = /* @__PURE__ */ jsxs("div", {
4615
+ $[18] = bay;
4616
+ $[19] = id;
4617
+ $[20] = label;
4618
+ $[21] = t10;
4619
+ } else t10 = $[21];
4620
+ let t11;
4621
+ if ($[22] !== t10 || $[23] !== t6 || $[24] !== t9) {
4622
+ t11 = /* @__PURE__ */ jsxs("div", {
3916
4623
  className: FittingWindow_module_default.bayAnchor,
3917
- style: t5,
3918
- children: [t8, t9]
3919
- });
3920
- $[20] = t5;
3921
- $[21] = t8;
3922
- $[22] = t9;
3923
- $[23] = t10;
3924
- } else t10 = $[23];
3925
- return t10;
3926
- }
3927
- function FighterBay() {
3928
- const $ = c(4);
3929
- const { used, total } = useBayUsage("fighterBay");
3930
- const t0 = used > total || void 0;
3931
- let t1;
3932
- if ($[0] !== t0 || $[1] !== total || $[2] !== used) {
3933
- t1 = /* @__PURE__ */ jsx(Tooltip, {
3934
- label: "Fighter Bay (not implemented yet)",
3935
- children: /* @__PURE__ */ jsx(BayButton, {
3936
- icon: "drone-bay",
3937
- used,
3938
- total,
3939
- "aria-label": "Fighter Bay",
3940
- "aria-disabled": true,
3941
- "data-over": t0
3942
- })
4624
+ style: t6,
4625
+ children: [t9, t10]
3943
4626
  });
3944
- $[0] = t0;
3945
- $[1] = total;
3946
- $[2] = used;
3947
- $[3] = t1;
3948
- } else t1 = $[3];
3949
- return t1;
4627
+ $[22] = t10;
4628
+ $[23] = t6;
4629
+ $[24] = t9;
4630
+ $[25] = t11;
4631
+ } else t11 = $[25];
4632
+ return t11;
3950
4633
  }
3951
4634
  function BayButton(t0) {
3952
4635
  const $ = c(22);
@@ -4043,11 +4726,15 @@ function BayButton(t0) {
4043
4726
  }
4044
4727
  const baySlots = {
4045
4728
  cargo: { type: "cargo" },
4046
- droneBay: { type: "drone_bay" }
4729
+ droneBay: { type: "drone_bay" },
4730
+ fighterBay: { type: "fighter_bay" }
4047
4731
  };
4048
- /** Puts a type dragged onto a bay in it: anything in the cargo, drones in the drone bay. */
4049
- function useBayDrop(bay) {
4050
- const $ = c(29);
4732
+ /**
4733
+ * Puts a type dragged onto a bay in it: anything in the cargo, drones in the
4734
+ * drone bay, fighters in the fighter bay; `open` shows the fighter tubes to drop on.
4735
+ */
4736
+ function useBayDrop(bay, open) {
4737
+ const $ = c(32);
4051
4738
  const store = useFitStore();
4052
4739
  const sde = useSde();
4053
4740
  const placement = usePlacement();
@@ -4057,52 +4744,57 @@ function useBayDrop(bay) {
4057
4744
  const slot = baySlots[bay];
4058
4745
  let t0;
4059
4746
  let type;
4060
- if ($[0] !== bay || $[1] !== canFit || $[2] !== dragging || $[3] !== placement || $[4] !== sde) {
4747
+ if ($[0] !== bay || $[1] !== canFit || $[2] !== dragging || $[3] !== placement || $[4] !== sde || $[5] !== slot) {
4061
4748
  type = dragging?.type === "type" ? sde.type(dragging.typeId) : void 0;
4062
- t0 = type !== void 0 && (bay === "cargo" ? placement(type) !== void 0 : placement(type)?.type === "drone_bay" && canFit(type));
4749
+ t0 = type !== void 0 && (bay === "cargo" ? placement(type) !== void 0 : placement(type)?.type === slot.type && canFit(type));
4063
4750
  $[0] = bay;
4064
4751
  $[1] = canFit;
4065
4752
  $[2] = dragging;
4066
4753
  $[3] = placement;
4067
4754
  $[4] = sde;
4068
- $[5] = t0;
4069
- $[6] = type;
4755
+ $[5] = slot;
4756
+ $[6] = t0;
4757
+ $[7] = type;
4070
4758
  } else {
4071
- t0 = $[5];
4072
- type = $[6];
4759
+ t0 = $[6];
4760
+ type = $[7];
4073
4761
  }
4074
4762
  const taken = t0 ? type : void 0;
4075
4763
  const target = `bay-${bay}`;
4076
4764
  let t1;
4077
- if ($[7] !== show || $[8] !== slot || $[9] !== taken || $[10] !== target) {
4765
+ if ($[8] !== bay || $[9] !== open || $[10] !== show || $[11] !== slot || $[12] !== taken || $[13] !== target) {
4078
4766
  t1 = () => {
4079
- if (taken) show((draft) => void draft.fit(taken.id, slot), target);
4767
+ if (!taken) return;
4768
+ show((draft) => void draft.fit(taken.id, slot), target);
4769
+ if (bay === "fighterBay") open();
4080
4770
  };
4081
- $[7] = show;
4082
- $[8] = slot;
4083
- $[9] = taken;
4084
- $[10] = target;
4085
- $[11] = t1;
4086
- } else t1 = $[11];
4771
+ $[8] = bay;
4772
+ $[9] = open;
4773
+ $[10] = show;
4774
+ $[11] = slot;
4775
+ $[12] = taken;
4776
+ $[13] = target;
4777
+ $[14] = t1;
4778
+ } else t1 = $[14];
4087
4779
  let t2;
4088
- if ($[12] !== clear || $[13] !== target) {
4780
+ if ($[15] !== clear || $[16] !== target) {
4089
4781
  t2 = () => clear(target);
4090
- $[12] = clear;
4091
- $[13] = target;
4092
- $[14] = t2;
4093
- } else t2 = $[14];
4782
+ $[15] = clear;
4783
+ $[16] = target;
4784
+ $[17] = t2;
4785
+ } else t2 = $[17];
4094
4786
  let t3;
4095
- if ($[15] !== taken) {
4787
+ if ($[18] !== taken) {
4096
4788
  t3 = (event) => {
4097
4789
  if (!taken) return;
4098
4790
  event.preventDefault();
4099
4791
  event.dataTransfer.dropEffect = "copy";
4100
4792
  };
4101
- $[15] = taken;
4102
- $[16] = t3;
4103
- } else t3 = $[16];
4793
+ $[18] = taken;
4794
+ $[19] = t3;
4795
+ } else t3 = $[19];
4104
4796
  let t4;
4105
- if ($[17] !== clear || $[18] !== end || $[19] !== slot || $[20] !== store || $[21] !== taken || $[22] !== target) {
4797
+ if ($[20] !== clear || $[21] !== end || $[22] !== slot || $[23] !== store || $[24] !== taken || $[25] !== target) {
4106
4798
  t4 = (event_0) => {
4107
4799
  if (!taken) return;
4108
4800
  event_0.preventDefault();
@@ -4110,28 +4802,28 @@ function useBayDrop(bay) {
4110
4802
  store.fit(taken.id, slot);
4111
4803
  end();
4112
4804
  };
4113
- $[17] = clear;
4114
- $[18] = end;
4115
- $[19] = slot;
4116
- $[20] = store;
4117
- $[21] = taken;
4118
- $[22] = target;
4119
- $[23] = t4;
4120
- } else t4 = $[23];
4805
+ $[20] = clear;
4806
+ $[21] = end;
4807
+ $[22] = slot;
4808
+ $[23] = store;
4809
+ $[24] = taken;
4810
+ $[25] = target;
4811
+ $[26] = t4;
4812
+ } else t4 = $[26];
4121
4813
  let t5;
4122
- if ($[24] !== t1 || $[25] !== t2 || $[26] !== t3 || $[27] !== t4) {
4814
+ if ($[27] !== t1 || $[28] !== t2 || $[29] !== t3 || $[30] !== t4) {
4123
4815
  t5 = {
4124
4816
  onDragEnter: t1,
4125
4817
  onDragLeave: t2,
4126
4818
  onDragOver: t3,
4127
4819
  onDrop: t4
4128
4820
  };
4129
- $[24] = t1;
4130
- $[25] = t2;
4131
- $[26] = t3;
4132
- $[27] = t4;
4133
- $[28] = t5;
4134
- } else t5 = $[28];
4821
+ $[27] = t1;
4822
+ $[28] = t2;
4823
+ $[29] = t3;
4824
+ $[30] = t4;
4825
+ $[31] = t5;
4826
+ } else t5 = $[31];
4135
4827
  return t5;
4136
4828
  }
4137
4829
  function Resource(t0) {
@@ -4912,12 +5604,13 @@ const noFits = [];
4912
5604
  const SHIPS_MARKET_GROUP_ID = 4;
4913
5605
  /** The Hulls & Fits tab of the `ItemBrowser`: EVE's hulls by group and race, with the fits saved for each. */
4914
5606
  function HullsAndFits() {
4915
- const $ = c(61);
5607
+ const $ = c(65);
4916
5608
  const currentShipId = useFit().ship.type_id;
4917
5609
  const images = useImages();
4918
5610
  const store = useFitStore();
4919
5611
  const missingSkills = useMissingSkills();
4920
5612
  const { fits } = useLocalFits();
5613
+ const { start, end } = useDrag();
4921
5614
  const [search, setSearch] = useState("");
4922
5615
  const [browserFits, setBrowserFits] = useState(false);
4923
5616
  const [currentHull, setCurrentHull] = useState(false);
@@ -5090,9 +5783,9 @@ function HullsAndFits() {
5090
5783
  $[40] = t15;
5091
5784
  } else t15 = $[40];
5092
5785
  let t16;
5093
- if ($[41] !== fitsByHull || $[42] !== groups || $[43] !== images || $[44] !== shownFits || $[45] !== simulate || $[46] !== store) {
5786
+ if ($[41] !== end || $[42] !== fitsByHull || $[43] !== groups || $[44] !== images || $[45] !== shownFits || $[46] !== simulate || $[47] !== start || $[48] !== store) {
5094
5787
  let t17;
5095
- if ($[48] !== fitsByHull || $[49] !== images || $[50] !== shownFits || $[51] !== simulate || $[52] !== store) {
5788
+ if ($[50] !== end || $[51] !== fitsByHull || $[52] !== images || $[53] !== shownFits || $[54] !== simulate || $[55] !== start || $[56] !== store) {
5096
5789
  t17 = (t18) => {
5097
5790
  const { group, races } = t18;
5098
5791
  return /* @__PURE__ */ jsx(TreeGroup, {
@@ -5122,6 +5815,15 @@ function HullsAndFits() {
5122
5815
  description: shown_0.length > 0 ? /* @__PURE__ */ jsx(Counts, { browserFits: fitsByHull.get(ship_1.id)?.length ?? 0 }) : void 0,
5123
5816
  typeId: ship_1.id,
5124
5817
  after: simulateShip,
5818
+ onDragStart: (event) => {
5819
+ event.dataTransfer.effectAllowed = "copy";
5820
+ event.dataTransfer.setData("text/plain", ship_1.name);
5821
+ start({
5822
+ type: "hull",
5823
+ typeId: ship_1.id
5824
+ });
5825
+ },
5826
+ onDragEnd: end,
5125
5827
  children: () => shown_0.length === 0 ? /* @__PURE__ */ jsx(TreeLeaf, { label: "No Item" }) : shown_0.map((saved_1) => /* @__PURE__ */ jsx(TreeLeaf, {
5126
5828
  label: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
5127
5829
  className: ItemBrowser_module_default.kind,
@@ -5136,24 +5838,28 @@ function HullsAndFits() {
5136
5838
  })
5137
5839
  }, group.id);
5138
5840
  };
5139
- $[48] = fitsByHull;
5140
- $[49] = images;
5141
- $[50] = shownFits;
5142
- $[51] = simulate;
5143
- $[52] = store;
5144
- $[53] = t17;
5145
- } else t17 = $[53];
5841
+ $[50] = end;
5842
+ $[51] = fitsByHull;
5843
+ $[52] = images;
5844
+ $[53] = shownFits;
5845
+ $[54] = simulate;
5846
+ $[55] = start;
5847
+ $[56] = store;
5848
+ $[57] = t17;
5849
+ } else t17 = $[57];
5146
5850
  t16 = groups.map(t17);
5147
- $[41] = fitsByHull;
5148
- $[42] = groups;
5149
- $[43] = images;
5150
- $[44] = shownFits;
5151
- $[45] = simulate;
5152
- $[46] = store;
5153
- $[47] = t16;
5154
- } else t16 = $[47];
5851
+ $[41] = end;
5852
+ $[42] = fitsByHull;
5853
+ $[43] = groups;
5854
+ $[44] = images;
5855
+ $[45] = shownFits;
5856
+ $[46] = simulate;
5857
+ $[47] = start;
5858
+ $[48] = store;
5859
+ $[49] = t16;
5860
+ } else t16 = $[49];
5155
5861
  let t17;
5156
- if ($[54] !== collapses || $[55] !== t16) {
5862
+ if ($[58] !== collapses || $[59] !== t16) {
5157
5863
  t17 = /* @__PURE__ */ jsx("div", {
5158
5864
  className: ItemBrowser_module_default.tree,
5159
5865
  children: /* @__PURE__ */ jsx(TreeList, {
@@ -5161,22 +5867,22 @@ function HullsAndFits() {
5161
5867
  children: t16
5162
5868
  }, collapses)
5163
5869
  });
5164
- $[54] = collapses;
5165
- $[55] = t16;
5166
- $[56] = t17;
5167
- } else t17 = $[56];
5870
+ $[58] = collapses;
5871
+ $[59] = t16;
5872
+ $[60] = t17;
5873
+ } else t17 = $[60];
5168
5874
  let t18;
5169
- if ($[57] !== t15 || $[58] !== t17 || $[59] !== t7) {
5875
+ if ($[61] !== t15 || $[62] !== t17 || $[63] !== t7) {
5170
5876
  t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
5171
5877
  t7,
5172
5878
  t15,
5173
5879
  t17
5174
5880
  ] });
5175
- $[57] = t15;
5176
- $[58] = t17;
5177
- $[59] = t7;
5178
- $[60] = t18;
5179
- } else t18 = $[60];
5881
+ $[61] = t15;
5882
+ $[62] = t17;
5883
+ $[63] = t7;
5884
+ $[64] = t18;
5885
+ } else t18 = $[64];
5180
5886
  return t18;
5181
5887
  }
5182
5888
  function _temp$3(saved) {
@@ -5707,7 +6413,10 @@ function CapacitorStats() {
5707
6413
  const $ = c(37);
5708
6414
  let t0;
5709
6415
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
5710
- t0 = { format: _temp$1 };
6416
+ t0 = {
6417
+ rounding: "down",
6418
+ format: _temp$1
6419
+ };
5711
6420
  $[0] = t0;
5712
6421
  } else t0 = $[0];
5713
6422
  const depletesIn = useAttribute("capacitorDepletesIn", t0);
@@ -5717,6 +6426,7 @@ function CapacitorStats() {
5717
6426
  decimals: 1,
5718
6427
  fixed: true,
5719
6428
  grouping: false,
6429
+ rounding: "down",
5720
6430
  format: unit(" GJ")
5721
6431
  };
5722
6432
  $[1] = t1;
@@ -5724,7 +6434,10 @@ function CapacitorStats() {
5724
6434
  const capacity = useAttribute("capacitorCapacity", t1);
5725
6435
  let t2;
5726
6436
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
5727
- t2 = { format: _temp2 };
6437
+ t2 = {
6438
+ rounding: "down",
6439
+ format: _temp2
6440
+ };
5728
6441
  $[2] = t2;
5729
6442
  } else t2 = $[2];
5730
6443
  const rechargeTime = useAttribute("rechargeRate", t2);
@@ -5922,6 +6635,7 @@ function RepairRate() {
5922
6635
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
5923
6636
  t0 = {
5924
6637
  decimals: 0,
6638
+ rounding: "down",
5925
6639
  format: unit(" hp/s")
5926
6640
  };
5927
6641
  $[0] = t0;
@@ -6074,7 +6788,10 @@ function Resistance(t0) {
6074
6788
  const { layer, damage } = t0;
6075
6789
  let t1;
6076
6790
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
6077
- t1 = { decimals: 0 };
6791
+ t1 = {
6792
+ decimals: 0,
6793
+ rounding: "up"
6794
+ };
6078
6795
  $[0] = t1;
6079
6796
  } else t1 = $[0];
6080
6797
  const resonance = useAttribute(resonances[layer][damage], t1);
@@ -6110,6 +6827,7 @@ function DefenseStats() {
6110
6827
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
6111
6828
  t0 = {
6112
6829
  decimals: 0,
6830
+ rounding: "down",
6113
6831
  format: unit(" ehp")
6114
6832
  };
6115
6833
  $[0] = t0;
@@ -6119,6 +6837,7 @@ function DefenseStats() {
6119
6837
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
6120
6838
  t1 = {
6121
6839
  decimals: 0,
6840
+ rounding: "down",
6122
6841
  format: hitpoints
6123
6842
  };
6124
6843
  $[1] = t1;
@@ -6126,7 +6845,10 @@ function DefenseStats() {
6126
6845
  const shield = useAttribute("shieldCapacity", t1);
6127
6846
  let t2;
6128
6847
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
6129
- t2 = { decimals: 0 };
6848
+ t2 = {
6849
+ decimals: 0,
6850
+ rounding: "down"
6851
+ };
6130
6852
  $[2] = t2;
6131
6853
  } else t2 = $[2];
6132
6854
  const shieldRecharge = useAttribute("shieldRechargeRate", t2);
@@ -6134,6 +6856,7 @@ function DefenseStats() {
6134
6856
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
6135
6857
  t3 = {
6136
6858
  decimals: 0,
6859
+ rounding: "down",
6137
6860
  format: hitpoints
6138
6861
  };
6139
6862
  $[3] = t3;
@@ -6143,6 +6866,7 @@ function DefenseStats() {
6143
6866
  if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
6144
6867
  t4 = {
6145
6868
  decimals: 0,
6869
+ rounding: "down",
6146
6870
  format: hitpoints
6147
6871
  };
6148
6872
  $[4] = t4;
@@ -6437,24 +7161,18 @@ function DroneStats() {
6437
7161
  return t12;
6438
7162
  }
6439
7163
  //#endregion
6440
- //#region ../fitting/src/rules/attributes.ts
6441
- /** A type's value for an attribute as the SDE has it, before any effect applies. */
6442
- function baseValue(sde, type, name) {
6443
- const id = sde.attributeId(name);
6444
- return id === void 0 ? void 0 : type.attributes.get(id);
6445
- }
6446
- //#endregion
6447
7164
  //#region src/components/ShipStatistics/FighterStats.tsx
6448
7165
  function FighterStats() {
6449
- const $ = c(10);
7166
+ const $ = c(12);
6450
7167
  const sde = useSde();
6451
7168
  const { fit } = useShownSnapshot();
7169
+ const manage = useManageFighters();
6452
7170
  let full = 0;
6453
7171
  let partial = 0;
6454
7172
  for (const item of fit.items) {
6455
7173
  const type = item.slot.type === "fighter_tube" ? sde.type(item.type_id) : void 0;
6456
7174
  if (type === void 0) continue;
6457
- if ((item.quantity ?? 1) >= (baseValue(sde, type, "fighterSquadronMaxSize") ?? 1)) full = full + 1;
7175
+ if ((item.quantity ?? 1) >= squadronSize(sde, type)) full = full + 1;
6458
7176
  else partial = partial + 1;
6459
7177
  }
6460
7178
  let t0;
@@ -6480,9 +7198,14 @@ function FighterStats() {
6480
7198
  $[6] = t2;
6481
7199
  } else t2 = $[6];
6482
7200
  let t3;
6483
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
6484
- t3 = /* @__PURE__ */ jsx(Tooltip, {
6485
- label: "Manage (not implemented yet)",
7201
+ if ($[7] !== manage) {
7202
+ t3 = manage ? /* @__PURE__ */ jsx("button", {
7203
+ type: "button",
7204
+ className: ShipStatistics_module_default.manage,
7205
+ onClick: manage,
7206
+ children: "Manage"
7207
+ }) : /* @__PURE__ */ jsx(Tooltip, {
7208
+ label: "Manage (only in the fitting window)",
6486
7209
  children: /* @__PURE__ */ jsx("button", {
6487
7210
  type: "button",
6488
7211
  className: ShipStatistics_module_default.manage,
@@ -6490,10 +7213,11 @@ function FighterStats() {
6490
7213
  children: "Manage"
6491
7214
  })
6492
7215
  });
6493
- $[7] = t3;
6494
- } else t3 = $[7];
7216
+ $[7] = manage;
7217
+ $[8] = t3;
7218
+ } else t3 = $[8];
6495
7219
  let t4;
6496
- if ($[8] !== t2) {
7220
+ if ($[9] !== t2 || $[10] !== t3) {
6497
7221
  t4 = /* @__PURE__ */ jsx(StatsSection, {
6498
7222
  title: "Fighters",
6499
7223
  children: /* @__PURE__ */ jsxs("div", {
@@ -6501,47 +7225,44 @@ function FighterStats() {
6501
7225
  children: [t2, t3]
6502
7226
  })
6503
7227
  });
6504
- $[8] = t2;
6505
- $[9] = t4;
6506
- } else t4 = $[9];
7228
+ $[9] = t2;
7229
+ $[10] = t3;
7230
+ $[11] = t4;
7231
+ } else t4 = $[11];
6507
7232
  return t4;
6508
7233
  }
6509
7234
  //#endregion
6510
7235
  //#region src/components/ShipStatistics/FitPrice.tsx
6511
7236
  function FitPrice(t0) {
6512
7237
  const $ = c(5);
6513
- const { price } = t0;
6514
- const t1 = price / 1e6;
7238
+ const { price, change } = t0;
7239
+ let t1;
7240
+ if ($[0] !== price) {
7241
+ t1 = price !== void 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
7242
+ formatNumber(price / 1e6, {
7243
+ decimals: 1,
7244
+ fixed: true
7245
+ }),
7246
+ "M ISK",
7247
+ /* @__PURE__ */ jsx(Icon, { name: "price" })
7248
+ ] });
7249
+ $[0] = price;
7250
+ $[1] = t1;
7251
+ } else t1 = $[1];
6515
7252
  let t2;
6516
- if ($[0] !== t1) {
6517
- t2 = formatNumber(t1, {
6518
- decimals: 1,
6519
- fixed: true
6520
- });
6521
- $[0] = t1;
6522
- $[1] = t2;
6523
- } else t2 = $[1];
6524
- let t3;
6525
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
6526
- t3 = /* @__PURE__ */ jsx(Icon, { name: "price" });
6527
- $[2] = t3;
6528
- } else t3 = $[2];
6529
- let t4;
6530
- if ($[3] !== t2) {
6531
- t4 = /* @__PURE__ */ jsxs("div", {
7253
+ if ($[2] !== change || $[3] !== t1) {
7254
+ t2 = /* @__PURE__ */ jsx("div", {
6532
7255
  className: ShipStatistics_module_default.price,
7256
+ "data-change": change,
6533
7257
  role: "group",
6534
7258
  "aria-label": "Estimated Price",
6535
- children: [
6536
- t2,
6537
- "M ISK",
6538
- t3
6539
- ]
7259
+ children: t1
6540
7260
  });
6541
- $[3] = t2;
6542
- $[4] = t4;
6543
- } else t4 = $[4];
6544
- return t4;
7261
+ $[2] = change;
7262
+ $[3] = t1;
7263
+ $[4] = t2;
7264
+ } else t2 = $[4];
7265
+ return t2;
6545
7266
  }
6546
7267
  //#endregion
6547
7268
  //#region src/components/ShipStatistics/FuelStats.tsx
@@ -6849,6 +7570,7 @@ function TargetingStats() {
6849
7570
  if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
6850
7571
  t1 = {
6851
7572
  decimals: 0,
7573
+ rounding: "down",
6852
7574
  format: unit(" mm")
6853
7575
  };
6854
7576
  $[1] = t1;
@@ -6867,6 +7589,7 @@ function TargetingStats() {
6867
7589
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
6868
7590
  t3 = {
6869
7591
  decimals: 0,
7592
+ rounding: "up",
6870
7593
  format: unit("x")
6871
7594
  };
6872
7595
  $[3] = t3;
@@ -6981,10 +7704,11 @@ function TargetingStats() {
6981
7704
  //#region src/components/ShipStatistics/ShipStatistics.tsx
6982
7705
  /** EVE's statistics of the fit, as its fitting window shows them. */
6983
7706
  function ShipStatistics(t0) {
6984
- const $ = c(10);
7707
+ const $ = c(14);
6985
7708
  const { label: t1 } = t0;
6986
7709
  const label = t1 === void 0 ? "Statistics" : t1;
6987
- const { structure } = useSnapshot().stats;
7710
+ const { stats } = useSnapshot();
7711
+ const price = useFitPrice();
6988
7712
  let t2;
6989
7713
  let t3;
6990
7714
  let t4;
@@ -7005,7 +7729,7 @@ function ShipStatistics(t0) {
7005
7729
  t5 = $[3];
7006
7730
  }
7007
7731
  let t6;
7008
- if ($[4] !== structure) {
7732
+ if ($[4] !== stats.fighterBay || $[5] !== stats.structure) {
7009
7733
  t6 = /* @__PURE__ */ jsxs("div", {
7010
7734
  className: ShipStatistics_module_default.sections,
7011
7735
  children: [
@@ -7013,28 +7737,35 @@ function ShipStatistics(t0) {
7013
7737
  t3,
7014
7738
  t4,
7015
7739
  t5,
7016
- structure ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FighterStats, {}), /* @__PURE__ */ jsx(FuelStats, {})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(NavigationStats, {}), /* @__PURE__ */ jsx(DroneStats, {})] })
7740
+ stats.structure ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FighterStats, {}), /* @__PURE__ */ jsx(FuelStats, {})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(NavigationStats, {}), stats.fighterBay.total > 0 ? /* @__PURE__ */ jsx(FighterStats, {}) : /* @__PURE__ */ jsx(DroneStats, {})] })
7017
7741
  ]
7018
7742
  });
7019
- $[4] = structure;
7020
- $[5] = t6;
7021
- } else t6 = $[5];
7743
+ $[4] = stats.fighterBay;
7744
+ $[5] = stats.structure;
7745
+ $[6] = t6;
7746
+ } else t6 = $[6];
7022
7747
  let t7;
7023
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
7024
- t7 = /* @__PURE__ */ jsx(FitPrice, { price: 0 });
7025
- $[6] = t7;
7026
- } else t7 = $[6];
7748
+ if ($[7] !== price.change || $[8] !== price.value) {
7749
+ t7 = /* @__PURE__ */ jsx(FitPrice, {
7750
+ price: price.value,
7751
+ change: price.change
7752
+ });
7753
+ $[7] = price.change;
7754
+ $[8] = price.value;
7755
+ $[9] = t7;
7756
+ } else t7 = $[9];
7027
7757
  let t8;
7028
- if ($[7] !== label || $[8] !== t6) {
7758
+ if ($[10] !== label || $[11] !== t6 || $[12] !== t7) {
7029
7759
  t8 = /* @__PURE__ */ jsxs("section", {
7030
7760
  className: ShipStatistics_module_default.statistics,
7031
7761
  "aria-label": label,
7032
7762
  children: [t6, t7]
7033
7763
  });
7034
- $[7] = label;
7035
- $[8] = t6;
7036
- $[9] = t8;
7037
- } else t8 = $[9];
7764
+ $[10] = label;
7765
+ $[11] = t6;
7766
+ $[12] = t7;
7767
+ $[13] = t8;
7768
+ } else t8 = $[13];
7038
7769
  return t8;
7039
7770
  }
7040
7771
  //#endregion