@eveshipfit/ui-ingame 1.14.0 → 2.0.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
@@ -2,7 +2,7 @@ import './style.css';
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { Activity, Fragment, createContext, useContext, useDeferredValue, useEffect, useEffectEvent, useId, useLayoutEffect, useRef, useState } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
- import { UNIFORM, formatAttribute, formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayContents, useBayUsage, useBoosters, useBrowse, useCanFit, useChargeSearch, useChargeTree, useChargedModules, useCharges, useDamageProfiles, useDrag, useDroneRoom, useEngine, useFighterTubeUsage, useFighterTubes, useFit, useFitHistory, useFitPrice, useFitStore, useHardpoints, useHasRoom, useHullRefuses, useHullTree, useImages, useImplantSearch, useImplantTree, useImplants, useInfo, useLocalFits, useMissingSkills, useModes, useModuleSearch, useModuleTree, useMutate, usePersonalFits, usePlacement, usePreview, useRackUsage, useRefusal, useSde, useShowInfo, useShownSnapshot, useSlots, useSnapshot, useStats, useType, useTypeBonuses, useTypePrice } from "@eveshipfit/react-hooks";
5
+ import { UNIFORM, canSaveFits, formatAttribute, formatClock, formatDuration, formatNumber, useAttribute, useAttributeTooltip, useBayContents, useBayUsage, useBoosters, useBrowse, useCanFit, useCharacters, useChargeSearch, useChargeTree, useChargedModules, useCharges, useDamageProfiles, useDrag, useDroneRoom, useEngine, useFighterTubeUsage, useFighterTubes, useFit, useFitHistory, useFitPrice, useFitSaving, useFitStore, useHardpoints, useHasFit, useHasRoom, useHullRefuses, useHullTree, useImages, useImplantSearch, useImplantTree, useImplants, useInfo, useLocalFits, useMissingSkills, useModes, useModuleSearch, useModuleTree, useMutate, usePersonalFits, usePlacement, usePreview, useRackUsage, useRefusal, useSde, useShowInfo, useShownSnapshot, useSlots, useSnapshot, useSnapshotIfAny, useStats, useType, useTypeBonuses, useTypePrice } from "@eveshipfit/react-hooks";
6
6
  import { baseValue, canMutate, clampToRange, mutaplasmidsOf, mutatedDronesOf, mutationRanges, mutationRollOf, parseItemLink, parseMutationText, rollFits, rollMutation, squadronSize, tubeTakes, withMutaplasmid } from "@eveshipfit/fitting";
7
7
  // src/primitives/Dialog/Dialog.module.css
8
8
  var Dialog_module_default = {
@@ -978,7 +978,7 @@ function SlotPress(t0) {
978
978
  className,
979
979
  "aria-label": label,
980
980
  onClick: onPress,
981
- onKeyDown: _temp$24
981
+ onKeyDown: _temp$25
982
982
  });
983
983
  $[0] = className;
984
984
  $[1] = label;
@@ -987,7 +987,7 @@ function SlotPress(t0) {
987
987
  } else t1 = $[3];
988
988
  return t1;
989
989
  }
990
- function _temp$24(event) {
990
+ function _temp$25(event) {
991
991
  if (event.key !== "Enter" && event.key !== " ") return;
992
992
  event.preventDefault();
993
993
  event.currentTarget.dispatchEvent(new MouseEvent("click", {
@@ -1403,7 +1403,7 @@ function useDecoded(src) {
1403
1403
  image.decode().then(() => {
1404
1404
  decoded.add(src);
1405
1405
  setReady(src);
1406
- }, _temp$23);
1406
+ }, _temp$24);
1407
1407
  };
1408
1408
  t1 = [src];
1409
1409
  $[0] = src;
@@ -1423,7 +1423,7 @@ function useDecoded(src) {
1423
1423
  } else t2 = $[5];
1424
1424
  return t2;
1425
1425
  }
1426
- function _temp$23() {}
1426
+ function _temp$24() {}
1427
1427
  function WheelGauge(t0) {
1428
1428
  const $ = c(15);
1429
1429
  const { resource, used, total, valueText } = t0;
@@ -1898,19 +1898,19 @@ function Menu(t0) {
1898
1898
  role: "menu",
1899
1899
  tabIndex: -1,
1900
1900
  onToggle: t4,
1901
- onKeyDown: _temp$22,
1901
+ onKeyDown: _temp$23,
1902
1902
  onClick: stopped,
1903
1903
  onDoubleClick: stopped,
1904
1904
  onPointerDown: stopped,
1905
1905
  onMouseDown: stopped,
1906
- onContextMenu: _temp2$11,
1906
+ onContextMenu: _temp2$12,
1907
1907
  children: opened.entries.map((entry, index) => entry === "separator" ? /* @__PURE__ */ jsx("hr", { className: ContextMenu_module_default.separator }, index) : /* @__PURE__ */ jsxs("button", {
1908
1908
  type: "button",
1909
1909
  role: "menuitem",
1910
1910
  tabIndex: -1,
1911
1911
  disabled: entry.disabled,
1912
1912
  onClick: () => select(entry),
1913
- onPointerMove: _temp3$6,
1913
+ onPointerMove: _temp3$5,
1914
1914
  children: [/* @__PURE__ */ jsx("span", {
1915
1915
  className: ContextMenu_module_default.icon,
1916
1916
  children: entry.icon && /* @__PURE__ */ jsx(Icon, { name: entry.icon })
@@ -1923,14 +1923,14 @@ function Menu(t0) {
1923
1923
  } else t3 = $[7];
1924
1924
  return t3;
1925
1925
  }
1926
- function _temp3$6(event_2) {
1926
+ function _temp3$5(event_2) {
1927
1927
  return event_2.currentTarget.focus();
1928
1928
  }
1929
- function _temp2$11(event_1) {
1929
+ function _temp2$12(event_1) {
1930
1930
  event_1.preventDefault();
1931
1931
  event_1.stopPropagation();
1932
1932
  }
1933
- function _temp$22(event_0) {
1933
+ function _temp$23(event_0) {
1934
1934
  event_0.stopPropagation();
1935
1935
  walk(event_0);
1936
1936
  }
@@ -2828,7 +2828,7 @@ function SensorStrengths(t0) {
2828
2828
  if ($[0] !== strengths) {
2829
2829
  t4 = Symbol.for("react.early_return_sentinel");
2830
2830
  bb0: {
2831
- const shown = strengths.filter(_temp$21);
2831
+ const shown = strengths.filter(_temp$22);
2832
2832
  if (shown.length === 0) {
2833
2833
  t4 = null;
2834
2834
  break bb0;
@@ -2836,7 +2836,7 @@ function SensorStrengths(t0) {
2836
2836
  T0 = Attribute;
2837
2837
  t3 = "ECMResistance";
2838
2838
  t1 = ModuleTooltip_module_default.block;
2839
- t2 = shown.map(_temp2$10);
2839
+ t2 = shown.map(_temp2$11);
2840
2840
  }
2841
2841
  $[0] = strengths;
2842
2842
  $[1] = T0;
@@ -2876,14 +2876,14 @@ function SensorStrengths(t0) {
2876
2876
  return t6;
2877
2877
  }
2878
2878
  /** The four ECM jammer strengths, like "5.8 Gravimetric ECM Jammer Strength". */
2879
- function _temp2$10(strength) {
2879
+ function _temp2$11(strength) {
2880
2880
  return /* @__PURE__ */ jsxs("span", { children: [
2881
2881
  strength.text,
2882
2882
  " ",
2883
2883
  strength.displayName
2884
2884
  ] }, strength.name);
2885
2885
  }
2886
- function _temp$21(t0) {
2886
+ function _temp$22(t0) {
2887
2887
  const { value } = t0;
2888
2888
  return value;
2889
2889
  }
@@ -2930,14 +2930,14 @@ function Cloak(t0) {
2930
2930
  itemRef,
2931
2931
  name: "maxVelocityModifier",
2932
2932
  decimals: 0,
2933
- format: _temp$20
2933
+ format: _temp$21
2934
2934
  });
2935
2935
  $[0] = itemRef;
2936
2936
  $[1] = t1;
2937
2937
  } else t1 = $[1];
2938
2938
  return t1;
2939
2939
  }
2940
- function _temp$20(value, format) {
2940
+ function _temp$21(value, format) {
2941
2941
  return percent$1((value - 1) * 100, format);
2942
2942
  }
2943
2943
  // src/components/FittingWheel/ModuleLines/CommandBonus.tsx
@@ -3671,7 +3671,7 @@ function Resistance$1(t0) {
3671
3671
  const t1 = useLayers(itemRef);
3672
3672
  let t2;
3673
3673
  if ($[0] !== t1) {
3674
- const layers = t1.filter(_temp2$9);
3674
+ const layers = t1.filter(_temp2$10);
3675
3675
  t2 = layers.map((layer) => /* @__PURE__ */ jsx(Layer, {
3676
3676
  ...layer,
3677
3677
  withIcon: layers.length > 1
@@ -3682,11 +3682,11 @@ function Resistance$1(t0) {
3682
3682
  return t2;
3683
3683
  }
3684
3684
  /** The resistances a module gives, for every layer. */
3685
- function _temp2$9(t0) {
3685
+ function _temp2$10(t0) {
3686
3686
  const { resistances } = t0;
3687
- return resistances.some(_temp$19);
3687
+ return resistances.some(_temp$20);
3688
3688
  }
3689
- function _temp$19(t0) {
3689
+ function _temp$20(t0) {
3690
3690
  const { value } = t0;
3691
3691
  return value !== 1;
3692
3692
  }
@@ -3696,13 +3696,13 @@ function DamageControl(t0) {
3696
3696
  const t1 = useLayers(itemRef);
3697
3697
  let t2;
3698
3698
  if ($[0] !== t1) {
3699
- t2 = t1.map(_temp3$5);
3699
+ t2 = t1.map(_temp3$4);
3700
3700
  $[0] = t1;
3701
3701
  $[1] = t2;
3702
3702
  } else t2 = $[1];
3703
3703
  return t2;
3704
3704
  }
3705
- function _temp3$5(layer) {
3705
+ function _temp3$4(layer) {
3706
3706
  return /* @__PURE__ */ jsx(Layer, {
3707
3707
  ...layer,
3708
3708
  withIcon: true
@@ -3893,7 +3893,7 @@ function ResistanceBonus(t0) {
3893
3893
  t3,
3894
3894
  t4,
3895
3895
  t5
3896
- ].filter(_temp$18);
3896
+ ].filter(_temp$19);
3897
3897
  const [first] = bonuses;
3898
3898
  if (first === void 0) {
3899
3899
  t6 = null;
@@ -3928,7 +3928,7 @@ function ResistanceBonus(t0) {
3928
3928
  className: ModuleTooltip_module_default.block,
3929
3929
  children: ["Resistance Bonus:", /* @__PURE__ */ jsx("span", {
3930
3930
  className: ModuleTooltip_module_default.bonuses,
3931
- children: bonuses.map(_temp2$8)
3931
+ children: bonuses.map(_temp2$9)
3932
3932
  })]
3933
3933
  });
3934
3934
  $[7] = bonuses;
@@ -3936,14 +3936,14 @@ function ResistanceBonus(t0) {
3936
3936
  } else t7 = $[8];
3937
3937
  return t7;
3938
3938
  }
3939
- function _temp2$8(t0) {
3939
+ function _temp2$9(t0) {
3940
3940
  const { name, text } = t0;
3941
3941
  return /* @__PURE__ */ jsx(Bonus, {
3942
3942
  name,
3943
3943
  text
3944
3944
  }, name);
3945
3945
  }
3946
- function _temp$18(bonus) {
3946
+ function _temp$19(bonus) {
3947
3947
  return bonus.value;
3948
3948
  }
3949
3949
  // src/components/FittingWheel/ModuleLines/SensorBooster.tsx
@@ -4044,14 +4044,14 @@ function SignatureSuppressor(t0) {
4044
4044
  itemRef,
4045
4045
  name: "signatureSuppressorSignatureRadiusBonusPassive",
4046
4046
  decimals: 0,
4047
- format: _temp$17
4047
+ format: _temp$18
4048
4048
  });
4049
4049
  $[0] = itemRef;
4050
4050
  $[1] = t1;
4051
4051
  } else t1 = $[1];
4052
4052
  return t1;
4053
4053
  }
4054
- function _temp$17(value, format) {
4054
+ function _temp$18(value, format) {
4055
4055
  return percent$1((1 - value) * 100, format);
4056
4056
  }
4057
4057
  // src/components/FittingWheel/ModuleLines/Smartbomb.tsx
@@ -4152,7 +4152,7 @@ function StasisWebifier(props) {
4152
4152
  t0 = {
4153
4153
  of: props.itemRef,
4154
4154
  decimals: 0,
4155
- format: _temp$16
4155
+ format: _temp$17
4156
4156
  };
4157
4157
  $[0] = props.itemRef;
4158
4158
  $[1] = t0;
@@ -4182,7 +4182,7 @@ function StasisWebifier(props) {
4182
4182
  } else t3 = $[8];
4183
4183
  return t3;
4184
4184
  }
4185
- function _temp$16(value, format) {
4185
+ function _temp$17(value, format) {
4186
4186
  return percent$1(-value, format);
4187
4187
  }
4188
4188
  // src/components/FittingWheel/ModuleLines/TrackingComputer.tsx
@@ -5212,7 +5212,7 @@ function FittingAugmentations(t0) {
5212
5212
  const boosters = useBoosters();
5213
5213
  let t1;
5214
5214
  if ($[0] !== implants || $[1] !== readOnly) {
5215
- t1 = !readOnly || implants.some(_temp$15);
5215
+ t1 = !readOnly || implants.some(_temp$16);
5216
5216
  $[0] = implants;
5217
5217
  $[1] = readOnly;
5218
5218
  $[2] = t1;
@@ -5267,7 +5267,7 @@ function FittingAugmentations(t0) {
5267
5267
  } else t5 = $[15];
5268
5268
  return t5;
5269
5269
  }
5270
- function _temp$15(slot) {
5270
+ function _temp$16(slot) {
5271
5271
  return slot.item !== void 0;
5272
5272
  }
5273
5273
  function FittingAugmentation(t0) {
@@ -5719,9 +5719,9 @@ function FittingCentre() {
5719
5719
  })
5720
5720
  },
5721
5721
  "separator",
5722
- fit.items.some(_temp$14) && {
5722
+ fit.items.some(_temp$15) && {
5723
5723
  label: "Strip Fitting",
5724
- onSelect: () => store.remove(...store.getSnapshot().fit.items.flatMap(_temp2$7))
5724
+ onSelect: () => store.remove(...store.getSnapshot().fit.items.flatMap(_temp2$8))
5725
5725
  }
5726
5726
  ]);
5727
5727
  };
@@ -5813,10 +5813,10 @@ function FittingCentre() {
5813
5813
  } else t8 = $[43];
5814
5814
  return t8;
5815
5815
  }
5816
- function _temp2$7(item_0, ref) {
5816
+ function _temp2$8(item_0, ref) {
5817
5817
  return keptOnStrip.has(item_0.slot.type) ? [] : [ref];
5818
5818
  }
5819
- function _temp$14(item_1) {
5819
+ function _temp$15(item_1) {
5820
5820
  return !keptOnStrip.has(item_1.slot.type);
5821
5821
  }
5822
5822
  const copiedRacks = [
@@ -5930,7 +5930,7 @@ function FittingModes(t0) {
5930
5930
  if (modes.length === 0) return null;
5931
5931
  let t1;
5932
5932
  if ($[0] !== modes) {
5933
- t1 = modes.map(_temp3$4);
5933
+ t1 = modes.map(_temp3$3);
5934
5934
  $[0] = modes;
5935
5935
  $[1] = t1;
5936
5936
  } else t1 = $[1];
@@ -5955,7 +5955,7 @@ function FittingModes(t0) {
5955
5955
  } else t3 = $[8];
5956
5956
  return t3;
5957
5957
  }
5958
- function _temp3$4(t0) {
5958
+ function _temp3$3(t0) {
5959
5959
  const { id, name } = t0;
5960
5960
  return {
5961
5961
  typeId: id,
@@ -6139,11 +6139,20 @@ var ItemBrowser_module_default = {
6139
6139
  "info": "xFSZwa_info",
6140
6140
  "kind": "xFSZwa_kind",
6141
6141
  "menu": "xFSZwa_menu",
6142
+ "menuRule": "xFSZwa_menuRule",
6142
6143
  "panel": "xFSZwa_panel",
6144
+ "saveAnchor": "xFSZwa_saveAnchor",
6145
+ "saveArrow": "xFSZwa_saveArrow",
6146
+ "saveMain": "xFSZwa_saveMain",
6147
+ "saveMenu": "xFSZwa_saveMenu",
6148
+ "saveName": "xFSZwa_saveName",
6149
+ "saveNote": "xFSZwa_saveNote",
6150
+ "saveUpgrade": "xFSZwa_saveUpgrade",
6143
6151
  "search": "xFSZwa_search",
6144
6152
  "simulate": "xFSZwa_simulate",
6145
6153
  "tab": "xFSZwa_tab",
6146
6154
  "tabs": "xFSZwa_tabs",
6155
+ "tick": "xFSZwa_tick",
6147
6156
  "tree": "xFSZwa_tree",
6148
6157
  "unseen": "xFSZwa_unseen",
6149
6158
  "views": "xFSZwa_views"
@@ -6283,7 +6292,7 @@ function CopyForm(t0) {
6283
6292
  rows,
6284
6293
  readOnly: true,
6285
6294
  value: text,
6286
- onFocus: _temp$13
6295
+ onFocus: _temp$14
6287
6296
  });
6288
6297
  $[3] = id;
6289
6298
  $[4] = rows;
@@ -6302,7 +6311,7 @@ function CopyForm(t0) {
6302
6311
  } else t3 = $[9];
6303
6312
  return t3;
6304
6313
  }
6305
- function _temp$13(event) {
6314
+ function _temp$14(event) {
6306
6315
  return event.currentTarget.select();
6307
6316
  }
6308
6317
  // src/components/ItemInfo/anchoredCard.ts
@@ -6754,8 +6763,8 @@ function Variations(t0) {
6754
6763
  $[5] = t5;
6755
6764
  } else t5 = $[5];
6756
6765
  useEffect(t4, t5);
6757
- const fit = useFit();
6758
- const module = typeof ref === "number" ? fit.items[ref] : void 0;
6766
+ const fit = useSnapshotIfAny()?.fit;
6767
+ const module = typeof ref === "number" ? fit?.items[ref] : void 0;
6759
6768
  const charges = useCharges(fitted?.charge ? module?.type_id : void 0);
6760
6769
  let t6;
6761
6770
  if ($[6] !== anchor || $[7] !== charges || $[8] !== fitted || $[9] !== hold || $[10] !== preview || $[11] !== ref || $[12] !== refuse || $[13] !== refuses || $[14] !== release || $[15] !== show || $[16] !== store) {
@@ -6798,7 +6807,7 @@ function Variations(t0) {
6798
6807
  const swapper = t6;
6799
6808
  let t7;
6800
6809
  if ($[18] !== anchor || $[19] !== sde || $[20] !== show || $[21] !== swapper || $[22] !== target.typeId || $[23] !== variations) {
6801
- const groups = Map.groupBy(variations, _temp$12);
6810
+ const groups = Map.groupBy(variations, _temp$13);
6802
6811
  t7 = /* @__PURE__ */ jsx("ul", {
6803
6812
  className: ItemInfo_module_default.list,
6804
6813
  children: [...groups].map((t8) => {
@@ -6831,7 +6840,7 @@ function Variations(t0) {
6831
6840
  } else t7 = $[24];
6832
6841
  return t7;
6833
6842
  }
6834
- function _temp$12(type_0) {
6843
+ function _temp$13(type_0) {
6835
6844
  return type_0.metaGroupId;
6836
6845
  }
6837
6846
  function Variation(t0) {
@@ -7113,7 +7122,7 @@ function MutaplasmidPicker(t0) {
7113
7122
  tabIndex: -1,
7114
7123
  "data-active": mutaplasmid_0.id === active || void 0,
7115
7124
  onFocus: () => setActive(mutaplasmid_0.id),
7116
- onPointerMove: _temp$11,
7125
+ onPointerMove: _temp$12,
7117
7126
  onClick: () => choose(mutaplasmid_0.id),
7118
7127
  children: names[index_0]
7119
7128
  }, mutaplasmid_0.id))
@@ -7138,7 +7147,7 @@ function MutaplasmidPicker(t0) {
7138
7147
  } else t15 = $[24];
7139
7148
  return t15;
7140
7149
  }
7141
- function _temp$11(event_2) {
7150
+ function _temp$12(event_2) {
7142
7151
  return event_2.currentTarget.focus();
7143
7152
  }
7144
7153
  /** Each stat's range under one mutaplasmid, the widest one's behind it, and the roll. */
@@ -7161,7 +7170,7 @@ function RangeChart(t0) {
7161
7170
  if ($[7] !== rangesOf) {
7162
7171
  t3 = (t4) => {
7163
7172
  const { id } = t4;
7164
- return rangesOf(id).flatMap(_temp2$6);
7173
+ return rangesOf(id).flatMap(_temp2$7);
7165
7174
  };
7166
7175
  $[7] = rangesOf;
7167
7176
  $[8] = t3;
@@ -7192,7 +7201,7 @@ function RangeChart(t0) {
7192
7201
  let t7;
7193
7202
  if ($[12] !== at || $[13] !== mutaplasmids || $[14] !== names || $[15] !== rangesOf || $[16] !== roll.attributes || $[17] !== sde || $[18] !== shown) {
7194
7203
  const widest = mutaplasmids.at(-1)?.id ?? shown;
7195
- const behind = new Map(rangesOf(widest).map(_temp3$3));
7204
+ const behind = new Map(rangesOf(widest).map(_temp3$2));
7196
7205
  let t8;
7197
7206
  if ($[23] !== mutaplasmids || $[24] !== names) {
7198
7207
  t8 = (mutaplasmidId) => names[mutaplasmids.findIndex((t9) => {
@@ -7338,10 +7347,10 @@ function RangeChart(t0) {
7338
7347
  } else t14 = $[48];
7339
7348
  return t14;
7340
7349
  }
7341
- function _temp3$3(range_0) {
7350
+ function _temp3$2(range_0) {
7342
7351
  return [range_0.attributeId, range_0];
7343
7352
  }
7344
- function _temp2$6(range) {
7353
+ function _temp2$7(range) {
7345
7354
  return [ratio(range, range.min), ratio(range, range.max)];
7346
7355
  }
7347
7356
  function percent(value) {
@@ -7536,7 +7545,7 @@ function DronesCard(t0) {
7536
7545
  let t7;
7537
7546
  let t8;
7538
7547
  if ($[1] !== active || $[2] !== base || $[3] !== rolls || $[4] !== sde || $[5] !== shown || $[6] !== store || $[7] !== typeId || $[8] !== unselected) {
7539
- const all = rolls.map(_temp$10);
7548
+ const all = rolls.map(_temp$11);
7540
7549
  let t9;
7541
7550
  if ($[16] !== unselected) {
7542
7551
  t9 = (index_0) => !unselected.has(index_0);
@@ -7617,7 +7626,7 @@ function DronesCard(t0) {
7617
7626
  } else t9 = $[26];
7618
7627
  return t9;
7619
7628
  }
7620
- function _temp$10(_, index) {
7629
+ function _temp$11(_, index) {
7621
7630
  return index;
7622
7631
  }
7623
7632
  /** One drone of a row, with how it rolled the stat that matters most. */
@@ -8435,7 +8444,7 @@ function ShipBonuses(t0) {
8435
8444
  title: "Misc bonus:",
8436
8445
  bonuses: bonuses?.misc ?? []
8437
8446
  }
8438
- ].filter(_temp$9);
8447
+ ].filter(_temp$10);
8439
8448
  let t2;
8440
8449
  if ($[6] !== sde || $[7] !== typeId) {
8441
8450
  t2 = sde.type(typeId)?.name;
@@ -8471,7 +8480,7 @@ function ShipBonuses(t0) {
8471
8480
  } else t1 = $[5];
8472
8481
  return t1;
8473
8482
  }
8474
- function _temp$9(section) {
8483
+ function _temp$10(section) {
8475
8484
  return section.bonuses.length > 0;
8476
8485
  }
8477
8486
  function formatBonus(sde, bonus) {
@@ -8921,7 +8930,7 @@ function FighterTooltip(t0) {
8921
8930
  } else t7 = $[10];
8922
8931
  let t8;
8923
8932
  if ($[11] !== itemRef || $[12] !== quantity || $[13] !== type?.fighterAbilities) {
8924
- t8 = type?.fighterAbilities.filter(_temp$8).map((ability) => /* @__PURE__ */ jsx(AbilityLines, {
8933
+ t8 = type?.fighterAbilities.filter(_temp$9).map((ability) => /* @__PURE__ */ jsx(AbilityLines, {
8925
8934
  itemRef,
8926
8935
  ability,
8927
8936
  quantity
@@ -8979,7 +8988,7 @@ function FighterTooltip(t0) {
8979
8988
  } else t12 = $[26];
8980
8989
  return t12;
8981
8990
  }
8982
- function _temp$8(t0) {
8991
+ function _temp$9(t0) {
8983
8992
  const { slot } = t0;
8984
8993
  return slot !== 1;
8985
8994
  }
@@ -9352,8 +9361,8 @@ function BayContents(t0) {
9352
9361
  const maxActive = t1;
9353
9362
  let t2;
9354
9363
  if ($[2] !== contents || $[3] !== fighters || $[4] !== fit) {
9355
- const launched = fighters ? fit.items.flatMap(_temp$7) : [];
9356
- t2 = [...contents.flatMap(_temp2$5), ...launched];
9364
+ const launched = fighters ? fit.items.flatMap(_temp$8) : [];
9365
+ t2 = [...contents.flatMap(_temp2$6), ...launched];
9357
9366
  $[2] = contents;
9358
9367
  $[3] = fighters;
9359
9368
  $[4] = fit;
@@ -9560,11 +9569,11 @@ function BayContents(t0) {
9560
9569
  return t13;
9561
9570
  }
9562
9571
  /** One box per drone the character can launch. */
9563
- function _temp2$5(t0) {
9572
+ function _temp2$6(t0) {
9564
9573
  const { refs } = t0;
9565
9574
  return refs;
9566
9575
  }
9567
- function _temp$7(item, ref) {
9576
+ function _temp$8(item, ref) {
9568
9577
  return item.slot.type === "fighter_tube" ? [ref] : [];
9569
9578
  }
9570
9579
  function DroneSelection(t0) {
@@ -9994,8 +10003,9 @@ const oneDecimal = new Intl.NumberFormat("en-US", {
9994
10003
  /** EVE draws eight, those the structure does not have as a faint outline. */
9995
10004
  const SERVICE_SLOTS = 8;
9996
10005
  /** EVE's fitting window around the `FittingWheel`. */
9997
- function FittingWindow({ label = "Fitting Window", browser, statistics: givenStatistics, preview = false, placeholder }) {
9998
- const statistics = placeholder === void 0 ? givenStatistics : void 0;
10006
+ function FittingWindow({ label = "Fitting Window", browser, statistics: givenStatistics, preview = false, placeholder = "Pick a hull to start." }) {
10007
+ const hasFit = useHasFit();
10008
+ const statistics = hasFit ? givenStatistics : void 0;
9999
10009
  const [browserOpen, setBrowserOpen] = useState(true);
10000
10010
  const { request } = useBrowse();
10001
10011
  const [browsed, setBrowsed] = useState(request);
@@ -10008,131 +10018,250 @@ function FittingWindow({ label = "Fitting Window", browser, statistics: givenSta
10008
10018
  const statisticsId = useId();
10009
10019
  const browserShown = browser !== void 0 && browserOpen;
10010
10020
  const statisticsShown = statistics !== void 0 && statisticsOpen;
10011
- const { stats } = useShownSnapshot();
10012
- const { structure } = stats;
10013
- const fighters = structure || stats.fighterBay.total > 0;
10014
10021
  const fighterBay = useId();
10015
- return /* @__PURE__ */ jsx(ManageFightersContext, {
10016
- value: fighters && !preview ? () => popover(fighterBay)?.showPopover() : void 0,
10017
- children: /* @__PURE__ */ jsxs("section", {
10018
- className: FittingWindow_module_default.window,
10019
- "aria-label": label,
10020
- "data-browser": browserShown || void 0,
10021
- "data-statistics": statisticsShown || void 0,
10022
- children: [
10023
- !preview && /* @__PURE__ */ jsx(ItemInfo, {}),
10024
- !preview && /* @__PURE__ */ jsx(Mutate, {}),
10025
- browser !== void 0 && /* @__PURE__ */ jsx("div", {
10026
- id: browserId,
10027
- className: FittingWindow_module_default.browser,
10028
- inert: !browserShown,
10029
- children: /* @__PURE__ */ jsx("div", {
10030
- className: FittingWindow_module_default.slide,
10031
- children: browser
10032
- })
10033
- }),
10034
- /* @__PURE__ */ jsxs("div", {
10035
- className: FittingWindow_module_default.frame,
10036
- children: [
10037
- /* @__PURE__ */ jsx("div", {
10038
- className: FittingWindow_module_default.wheel,
10039
- children: placeholder === void 0 ? /* @__PURE__ */ jsx(FittingWheel, {
10040
- readOnly: preview,
10041
- credit: preview
10042
- }) : /* @__PURE__ */ jsx(Wheel, {
10043
- label: "Fitting",
10044
- children: /* @__PURE__ */ jsx(Placeholder, { text: placeholder })
10045
- })
10046
- }),
10047
- preview && placeholder === void 0 && /* @__PURE__ */ jsx(PreviewName, {}),
10048
- !preview && placeholder === void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FitName, {}), /* @__PURE__ */ jsx(Violations, {})] }),
10049
- !preview && browser !== void 0 && /* @__PURE__ */ jsx("div", {
10050
- className: FittingWindow_module_default.tools,
10051
- children: /* @__PURE__ */ jsx(Tooltip, {
10052
- label: "Item Browser",
10053
- children: /* @__PURE__ */ jsx("button", {
10054
- type: "button",
10055
- className: FittingWindow_module_default.tool,
10056
- "aria-label": "Item Browser",
10057
- "aria-expanded": browserShown,
10058
- "aria-controls": browserId,
10059
- onClick: () => setBrowserOpen(!browserShown),
10060
- children: /* @__PURE__ */ jsx(Icon, { name: "hardware" })
10061
- })
10062
- })
10063
- }),
10064
- !preview && statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10065
- className: FittingWindow_module_default.panels,
10066
- children: /* @__PURE__ */ jsx(Tooltip, {
10067
- label: "Statistics",
10068
- children: /* @__PURE__ */ jsx("button", {
10069
- type: "button",
10070
- className: FittingWindow_module_default.tool,
10071
- "aria-label": "Statistics",
10072
- "aria-expanded": statisticsShown,
10073
- "aria-controls": statisticsId,
10074
- onClick: () => setStatisticsOpen(!statisticsShown),
10075
- children: /* @__PURE__ */ jsx(Icon, { name: "statistics" })
10076
- })
10022
+ return /* @__PURE__ */ jsxs("section", {
10023
+ className: FittingWindow_module_default.window,
10024
+ "aria-label": label,
10025
+ "data-browser": browserShown || void 0,
10026
+ "data-statistics": statisticsShown || void 0,
10027
+ children: [
10028
+ !preview && /* @__PURE__ */ jsx(ItemInfo, {}),
10029
+ !preview && /* @__PURE__ */ jsx(Mutate, {}),
10030
+ browser !== void 0 && /* @__PURE__ */ jsx("div", {
10031
+ id: browserId,
10032
+ className: FittingWindow_module_default.browser,
10033
+ inert: !browserShown,
10034
+ children: /* @__PURE__ */ jsx("div", {
10035
+ className: FittingWindow_module_default.slide,
10036
+ children: browser
10037
+ })
10038
+ }),
10039
+ /* @__PURE__ */ jsxs("div", {
10040
+ className: FittingWindow_module_default.frame,
10041
+ children: [
10042
+ /* @__PURE__ */ jsx("div", {
10043
+ className: FittingWindow_module_default.wheel,
10044
+ children: hasFit ? /* @__PURE__ */ jsx(FittingWheel, {
10045
+ readOnly: preview,
10046
+ credit: preview
10047
+ }) : /* @__PURE__ */ jsx(Wheel, {
10048
+ label: "Fitting",
10049
+ children: /* @__PURE__ */ jsx(Placeholder, { text: placeholder })
10050
+ })
10051
+ }),
10052
+ hasFit && preview && /* @__PURE__ */ jsx(PreviewName, {}),
10053
+ hasFit && !preview && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FitName, {}), /* @__PURE__ */ jsx(Violations, {})] }),
10054
+ !preview && browser !== void 0 && /* @__PURE__ */ jsx("div", {
10055
+ className: FittingWindow_module_default.tools,
10056
+ children: /* @__PURE__ */ jsx(Tooltip, {
10057
+ label: "Item Browser",
10058
+ children: /* @__PURE__ */ jsx("button", {
10059
+ type: "button",
10060
+ className: FittingWindow_module_default.tool,
10061
+ "aria-label": "Item Browser",
10062
+ "aria-expanded": browserShown,
10063
+ "aria-controls": browserId,
10064
+ onClick: () => setBrowserOpen(!browserShown),
10065
+ children: /* @__PURE__ */ jsx(Icon, { name: "hardware" })
10077
10066
  })
10078
- }),
10079
- placeholder === void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
10080
- /* @__PURE__ */ jsxs("div", {
10081
- className: FittingWindow_module_default.bays,
10082
- children: [structure ? /* @__PURE__ */ jsx(Bay, {
10083
- bay: "cargo",
10084
- icon: "ammo-hold",
10085
- label: "Ammo Hold",
10086
- unlimited: true,
10087
- readOnly: preview
10088
- }) : /* @__PURE__ */ jsx(Bay, {
10089
- bay: "cargo",
10090
- icon: "cargo",
10091
- label: "Cargo Hold",
10092
- readOnly: preview
10093
- }), fighters ? /* @__PURE__ */ jsx(Bay, {
10094
- id: fighterBay,
10095
- bay: "fighterBay",
10096
- icon: "fighter-bay",
10097
- label: "Fighter Bay",
10098
- readOnly: preview
10099
- }) : /* @__PURE__ */ jsx(Bay, {
10100
- bay: "droneBay",
10101
- icon: "drone-bay",
10102
- label: "Drone Bay",
10103
- readOnly: preview
10104
- })]
10105
- }),
10106
- structure && /* @__PURE__ */ jsx(ServiceRack, { readOnly: preview }),
10107
- !preview && /* @__PURE__ */ jsx("div", {
10108
- className: FittingWindow_module_default.history,
10109
- children: /* @__PURE__ */ jsx(SimulationHistory, {})
10110
- }),
10111
- /* @__PURE__ */ jsxs("div", {
10112
- className: FittingWindow_module_default.resources,
10113
- children: [/* @__PURE__ */ jsx(Resource, {
10114
- title: "CPU",
10115
- free: "cpuFree",
10116
- output: "cpuOutput"
10117
- }), /* @__PURE__ */ jsx(Resource, {
10118
- title: "Power Grid",
10119
- free: "powerFree",
10120
- output: "powerOutput"
10121
- })]
10067
+ })
10068
+ }),
10069
+ !preview && statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10070
+ className: FittingWindow_module_default.panels,
10071
+ children: /* @__PURE__ */ jsx(Tooltip, {
10072
+ label: "Statistics",
10073
+ children: /* @__PURE__ */ jsx("button", {
10074
+ type: "button",
10075
+ className: FittingWindow_module_default.tool,
10076
+ "aria-label": "Statistics",
10077
+ "aria-expanded": statisticsShown,
10078
+ "aria-controls": statisticsId,
10079
+ onClick: () => setStatisticsOpen(!statisticsShown),
10080
+ children: /* @__PURE__ */ jsx(Icon, { name: "statistics" })
10122
10081
  })
10123
- ] })
10124
- ]
10125
- }),
10126
- statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10127
- id: statisticsId,
10128
- className: FittingWindow_module_default.statistics,
10129
- inert: !statisticsShown,
10130
- children: /* @__PURE__ */ jsx("div", {
10131
- className: FittingWindow_module_default.slide,
10082
+ })
10083
+ }),
10084
+ hasFit && /* @__PURE__ */ jsx(FitBays, {
10085
+ fighterBay,
10086
+ readOnly: preview
10087
+ })
10088
+ ]
10089
+ }),
10090
+ statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10091
+ id: statisticsId,
10092
+ className: FittingWindow_module_default.statistics,
10093
+ inert: !statisticsShown,
10094
+ children: /* @__PURE__ */ jsx("div", {
10095
+ className: FittingWindow_module_default.slide,
10096
+ children: /* @__PURE__ */ jsx(ManageFighters, {
10097
+ fighterBay,
10098
+ readOnly: preview,
10132
10099
  children: statistics
10133
10100
  })
10134
10101
  })
10135
- ]
10102
+ })
10103
+ ]
10104
+ });
10105
+ }
10106
+ function useFighters() {
10107
+ const $ = c(3);
10108
+ const { stats } = useShownSnapshot();
10109
+ const t0 = stats.structure || stats.fighterBay.total > 0;
10110
+ let t1;
10111
+ if ($[0] !== stats.structure || $[1] !== t0) {
10112
+ t1 = {
10113
+ structure: stats.structure,
10114
+ fighters: t0
10115
+ };
10116
+ $[0] = stats.structure;
10117
+ $[1] = t0;
10118
+ $[2] = t1;
10119
+ } else t1 = $[2];
10120
+ return t1;
10121
+ }
10122
+ function ManageFighters(t0) {
10123
+ const $ = c(7);
10124
+ const { fighterBay, readOnly, children } = t0;
10125
+ const { fighters } = useFighters();
10126
+ let t1;
10127
+ if ($[0] !== fighterBay || $[1] !== fighters || $[2] !== readOnly) {
10128
+ t1 = fighters && !readOnly ? () => popover(fighterBay)?.showPopover() : void 0;
10129
+ $[0] = fighterBay;
10130
+ $[1] = fighters;
10131
+ $[2] = readOnly;
10132
+ $[3] = t1;
10133
+ } else t1 = $[3];
10134
+ const manage = t1;
10135
+ let t2;
10136
+ if ($[4] !== children || $[5] !== manage) {
10137
+ t2 = /* @__PURE__ */ jsx(ManageFightersContext, {
10138
+ value: manage,
10139
+ children
10140
+ });
10141
+ $[4] = children;
10142
+ $[5] = manage;
10143
+ $[6] = t2;
10144
+ } else t2 = $[6];
10145
+ return t2;
10146
+ }
10147
+ function FitBays(t0) {
10148
+ const $ = c(20);
10149
+ const { fighterBay, readOnly } = t0;
10150
+ const { structure, fighters } = useFighters();
10151
+ let t1;
10152
+ if ($[0] !== readOnly || $[1] !== structure) {
10153
+ t1 = structure ? /* @__PURE__ */ jsx(Bay, {
10154
+ bay: "cargo",
10155
+ icon: "ammo-hold",
10156
+ label: "Ammo Hold",
10157
+ unlimited: true,
10158
+ readOnly
10159
+ }) : /* @__PURE__ */ jsx(Bay, {
10160
+ bay: "cargo",
10161
+ icon: "cargo",
10162
+ label: "Cargo Hold",
10163
+ readOnly
10164
+ });
10165
+ $[0] = readOnly;
10166
+ $[1] = structure;
10167
+ $[2] = t1;
10168
+ } else t1 = $[2];
10169
+ let t2;
10170
+ if ($[3] !== fighterBay || $[4] !== fighters || $[5] !== readOnly) {
10171
+ t2 = fighters ? /* @__PURE__ */ jsx(Bay, {
10172
+ id: fighterBay,
10173
+ bay: "fighterBay",
10174
+ icon: "fighter-bay",
10175
+ label: "Fighter Bay",
10176
+ readOnly
10177
+ }) : /* @__PURE__ */ jsx(Bay, {
10178
+ bay: "droneBay",
10179
+ icon: "drone-bay",
10180
+ label: "Drone Bay",
10181
+ readOnly
10182
+ });
10183
+ $[3] = fighterBay;
10184
+ $[4] = fighters;
10185
+ $[5] = readOnly;
10186
+ $[6] = t2;
10187
+ } else t2 = $[6];
10188
+ let t3;
10189
+ if ($[7] !== t1 || $[8] !== t2) {
10190
+ t3 = /* @__PURE__ */ jsxs("div", {
10191
+ className: FittingWindow_module_default.bays,
10192
+ children: [t1, t2]
10193
+ });
10194
+ $[7] = t1;
10195
+ $[8] = t2;
10196
+ $[9] = t3;
10197
+ } else t3 = $[9];
10198
+ let t4;
10199
+ if ($[10] !== readOnly || $[11] !== structure) {
10200
+ t4 = structure && /* @__PURE__ */ jsx(ServiceRack, { readOnly });
10201
+ $[10] = readOnly;
10202
+ $[11] = structure;
10203
+ $[12] = t4;
10204
+ } else t4 = $[12];
10205
+ let t5;
10206
+ if ($[13] !== readOnly) {
10207
+ t5 = !readOnly && /* @__PURE__ */ jsx("div", {
10208
+ className: FittingWindow_module_default.history,
10209
+ children: /* @__PURE__ */ jsx(SimulationHistory, {})
10210
+ });
10211
+ $[13] = readOnly;
10212
+ $[14] = t5;
10213
+ } else t5 = $[14];
10214
+ let t6;
10215
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
10216
+ t6 = /* @__PURE__ */ jsxs("div", {
10217
+ className: FittingWindow_module_default.resources,
10218
+ children: [/* @__PURE__ */ jsx(Resource, {
10219
+ title: "CPU",
10220
+ free: "cpuFree",
10221
+ output: "cpuOutput"
10222
+ }), /* @__PURE__ */ jsx(Resource, {
10223
+ title: "Power Grid",
10224
+ free: "powerFree",
10225
+ output: "powerOutput"
10226
+ })]
10227
+ });
10228
+ $[15] = t6;
10229
+ } else t6 = $[15];
10230
+ let t7;
10231
+ if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5) {
10232
+ t7 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
10233
+ t3,
10234
+ t4,
10235
+ t5,
10236
+ t6
10237
+ ] });
10238
+ $[16] = t3;
10239
+ $[17] = t4;
10240
+ $[18] = t5;
10241
+ $[19] = t7;
10242
+ } else t7 = $[19];
10243
+ return t7;
10244
+ }
10245
+ /** An empty `FittingWindow` while the fit loads; it needs only images. */
10246
+ function FittingWindowLoading({ label = "Fitting Window", text, browser = false, statistics = false }) {
10247
+ return /* @__PURE__ */ jsx("section", {
10248
+ className: FittingWindow_module_default.window,
10249
+ "aria-label": label,
10250
+ "aria-busy": true,
10251
+ "data-browser": browser || void 0,
10252
+ "data-statistics": statistics || void 0,
10253
+ children: /* @__PURE__ */ jsx("div", {
10254
+ className: FittingWindow_module_default.frame,
10255
+ children: /* @__PURE__ */ jsx("div", {
10256
+ className: FittingWindow_module_default.wheel,
10257
+ children: /* @__PURE__ */ jsx(Wheel, {
10258
+ label: "Fitting",
10259
+ children: /* @__PURE__ */ jsx("div", {
10260
+ className: FittingWindow_module_default.placeholder,
10261
+ children: /* @__PURE__ */ jsx("p", { children: text })
10262
+ })
10263
+ })
10264
+ })
10136
10265
  })
10137
10266
  });
10138
10267
  }
@@ -10294,7 +10423,7 @@ function FitName() {
10294
10423
  defaultValue: fit.name,
10295
10424
  placeholder: ship?.name,
10296
10425
  ref: input,
10297
- onFocus: _temp$6,
10426
+ onFocus: _temp$7,
10298
10427
  onBlur: (event_1) => rename(event_1.currentTarget.value),
10299
10428
  onKeyDown: (event_2) => {
10300
10429
  if (event_2.key === "Escape") event_2.currentTarget.value = fit.name ?? "";
@@ -10337,7 +10466,7 @@ function FitName() {
10337
10466
  } else t10 = $[27];
10338
10467
  return t10;
10339
10468
  }
10340
- function _temp$6(event_0) {
10469
+ function _temp$7(event_0) {
10341
10470
  return event_0.currentTarget.select();
10342
10471
  }
10343
10472
  function PreviewName() {
@@ -10409,7 +10538,7 @@ function Violations() {
10409
10538
  group: t2
10410
10539
  };
10411
10540
  const linesOf = (kind) => {
10412
- const violations = kind === "skill" ? missingSkills(stats.violations).map(_temp2$4) : stats.violations.filter((t5) => {
10541
+ const violations = kind === "skill" ? missingSkills(stats.violations).map(_temp2$5) : stats.violations.filter((t5) => {
10413
10542
  const { rule: rule_0 } = t5;
10414
10543
  return violationKind(rule_0) === kind;
10415
10544
  });
@@ -10432,7 +10561,7 @@ function Violations() {
10432
10561
  className: FittingWindow_module_default.alertTitle,
10433
10562
  children: title
10434
10563
  }),
10435
- description: lines.map(_temp3$2)
10564
+ description: lines.map(_temp3$1)
10436
10565
  })
10437
10566
  }),
10438
10567
  children: /* @__PURE__ */ jsxs("span", {
@@ -10478,13 +10607,13 @@ function Violations() {
10478
10607
  } else t5 = $[16];
10479
10608
  return t5;
10480
10609
  }
10481
- function _temp3$2(line) {
10610
+ function _temp3$1(line) {
10482
10611
  return /* @__PURE__ */ jsx("span", {
10483
10612
  className: FittingWindow_module_default.alertLine,
10484
10613
  children: line
10485
10614
  }, line);
10486
10615
  }
10487
- function _temp2$4(rule) {
10616
+ function _temp2$5(rule) {
10488
10617
  return {
10489
10618
  target: { type: "ship" },
10490
10619
  rule
@@ -11054,9 +11183,10 @@ const folders = {
11054
11183
  }
11055
11184
  };
11056
11185
  /** Previews a type on hover, fits it on double click, drags it to the wheel, shows its info and its menu; render `overlays` once. */
11057
- function useTypeActions(noHullSelected) {
11186
+ function useTypeActions() {
11058
11187
  const $ = c(57);
11059
11188
  const store = useFitStore();
11189
+ const noHullSelected = !useHasFit();
11060
11190
  const sde = useSde();
11061
11191
  const refuses = useHullRefuses();
11062
11192
  const hasRoom = useHasRoom();
@@ -11523,124 +11653,123 @@ function SearchResults(t0) {
11523
11653
  }
11524
11654
  // src/components/ItemBrowser/Charges.tsx
11525
11655
  /** The Charges tab of the `ItemBrowser`: every charge by market group, or only those a fitted module loads. */
11526
- function Charges(t0) {
11656
+ function Charges() {
11527
11657
  const $ = c(48);
11528
- const { noHullSelected } = t0;
11529
11658
  const sde = useSde();
11530
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
11659
+ const { actions, clear, overlays } = useTypeActions();
11531
11660
  const modules = useChargedModules();
11532
11661
  const [picked, setPicked] = useState();
11533
11662
  const [search, setSearch] = useState("");
11534
11663
  const [collapses, setCollapses] = useState(0);
11535
- let t1;
11664
+ let t0;
11536
11665
  if ($[0] !== modules || $[1] !== picked) {
11537
- t1 = modules.some((module) => module.id === picked) ? picked : void 0;
11666
+ t0 = modules.some((module) => module.id === picked) ? picked : void 0;
11538
11667
  $[0] = modules;
11539
11668
  $[1] = picked;
11540
- $[2] = t1;
11541
- } else t1 = $[2];
11542
- const selected = t1;
11543
- let t2;
11669
+ $[2] = t0;
11670
+ } else t0 = $[2];
11671
+ const selected = t0;
11672
+ let t1;
11544
11673
  if ($[3] !== search) {
11545
- t2 = search.trim().toLowerCase();
11674
+ t1 = search.trim().toLowerCase();
11546
11675
  $[3] = search;
11547
- $[4] = t2;
11548
- } else t2 = $[4];
11549
- const query = t2;
11550
- let t3;
11676
+ $[4] = t1;
11677
+ } else t1 = $[4];
11678
+ const query = t1;
11679
+ let t2;
11551
11680
  if ($[5] !== query || $[6] !== selected) {
11552
- t3 = selected === void 0 && query !== "" ? (type) => type.name.toLowerCase().includes(query) : void 0;
11681
+ t2 = selected === void 0 && query !== "" ? (type) => type.name.toLowerCase().includes(query) : void 0;
11553
11682
  $[5] = query;
11554
11683
  $[6] = selected;
11555
- $[7] = t3;
11556
- } else t3 = $[7];
11557
- const matches = t3;
11684
+ $[7] = t2;
11685
+ } else t2 = $[7];
11686
+ const matches = t2;
11558
11687
  const groups = useChargeTree();
11559
11688
  const found = useChargeSearch(matches);
11560
11689
  const charges = useCharges(selected);
11561
- let t4;
11690
+ let t3;
11562
11691
  if ($[8] !== charges || $[9] !== query || $[10] !== sde) {
11563
- let t5;
11692
+ let t4;
11564
11693
  if ($[12] !== query) {
11565
- t5 = (type_0) => type_0.name.toLowerCase().includes(query);
11694
+ t4 = (type_0) => type_0.name.toLowerCase().includes(query);
11566
11695
  $[12] = query;
11567
- $[13] = t5;
11568
- } else t5 = $[13];
11569
- t4 = sde.sortByMeta(charges.filter(t5));
11696
+ $[13] = t4;
11697
+ } else t4 = $[13];
11698
+ t3 = sde.sortByMeta(charges.filter(t4));
11570
11699
  $[8] = charges;
11571
11700
  $[9] = query;
11572
11701
  $[10] = sde;
11573
- $[11] = t4;
11574
- } else t4 = $[11];
11575
- const loadable = t4;
11576
- let t5;
11702
+ $[11] = t3;
11703
+ } else t3 = $[11];
11704
+ const loadable = t3;
11705
+ let t4;
11577
11706
  if ($[14] !== found || $[15] !== loadable || $[16] !== matches || $[17] !== selected) {
11578
- t5 = selected === void 0 ? matches !== void 0 && found.length === 0 : countLeaves(loadable) === 0;
11707
+ t4 = selected === void 0 ? matches !== void 0 && found.length === 0 : countLeaves(loadable) === 0;
11579
11708
  $[14] = found;
11580
11709
  $[15] = loadable;
11581
11710
  $[16] = matches;
11582
11711
  $[17] = selected;
11583
- $[18] = t5;
11584
- } else t5 = $[18];
11585
- const empty = t5;
11586
- let t6;
11712
+ $[18] = t4;
11713
+ } else t4 = $[18];
11714
+ const empty = t4;
11715
+ let t5;
11587
11716
  if ($[19] !== clear) {
11588
- t6 = (value) => {
11717
+ t5 = (value) => {
11589
11718
  clear();
11590
11719
  setSearch(value);
11591
11720
  };
11592
11721
  $[19] = clear;
11593
- $[20] = t6;
11594
- } else t6 = $[20];
11595
- let t7;
11722
+ $[20] = t5;
11723
+ } else t5 = $[20];
11724
+ let t6;
11596
11725
  if ($[21] !== collapses) {
11597
- t7 = () => setCollapses(collapses + 1);
11726
+ t6 = () => setCollapses(collapses + 1);
11598
11727
  $[21] = collapses;
11599
- $[22] = t7;
11600
- } else t7 = $[22];
11601
- let t8;
11602
- if ($[23] !== search || $[24] !== t6 || $[25] !== t7) {
11603
- t8 = /* @__PURE__ */ jsx(Search, {
11728
+ $[22] = t6;
11729
+ } else t6 = $[22];
11730
+ let t7;
11731
+ if ($[23] !== search || $[24] !== t5 || $[25] !== t6) {
11732
+ t7 = /* @__PURE__ */ jsx(Search, {
11604
11733
  value: search,
11605
- onChange: t6,
11606
- onCollapse: t7
11734
+ onChange: t5,
11735
+ onCollapse: t6
11607
11736
  });
11608
11737
  $[23] = search;
11609
- $[24] = t6;
11610
- $[25] = t7;
11611
- $[26] = t8;
11612
- } else t8 = $[26];
11613
- let t9;
11738
+ $[24] = t5;
11739
+ $[25] = t6;
11740
+ $[26] = t7;
11741
+ } else t7 = $[26];
11742
+ let t8;
11614
11743
  if ($[27] !== modules || $[28] !== selected) {
11615
- let t10;
11744
+ let t9;
11616
11745
  if ($[30] !== selected) {
11617
- t10 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
11746
+ t9 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
11618
11747
  typeId: module_0.id,
11619
11748
  label: module_0.name,
11620
11749
  pressed: selected === module_0.id,
11621
11750
  onPressedChange: (pressed) => setPicked(pressed ? module_0.id : void 0)
11622
11751
  }, module_0.id);
11623
11752
  $[30] = selected;
11624
- $[31] = t10;
11625
- } else t10 = $[31];
11626
- t9 = modules.map(t10);
11753
+ $[31] = t9;
11754
+ } else t9 = $[31];
11755
+ t8 = modules.map(t9);
11627
11756
  $[27] = modules;
11628
11757
  $[28] = selected;
11629
- $[29] = t9;
11630
- } else t9 = $[29];
11631
- let t10;
11632
- if ($[32] !== t9) {
11633
- t10 = /* @__PURE__ */ jsx("fieldset", {
11758
+ $[29] = t8;
11759
+ } else t8 = $[29];
11760
+ let t9;
11761
+ if ($[32] !== t8) {
11762
+ t9 = /* @__PURE__ */ jsx("fieldset", {
11634
11763
  className: ItemBrowser_module_default.filters,
11635
11764
  "aria-label": "Filters",
11636
- children: t9
11765
+ children: t8
11637
11766
  });
11638
- $[32] = t9;
11639
- $[33] = t10;
11640
- } else t10 = $[33];
11641
- let t11;
11767
+ $[32] = t8;
11768
+ $[33] = t9;
11769
+ } else t9 = $[33];
11770
+ let t10;
11642
11771
  if ($[34] !== actions || $[35] !== collapses || $[36] !== empty || $[37] !== found || $[38] !== groups || $[39] !== loadable || $[40] !== matches || $[41] !== selected) {
11643
- t11 = /* @__PURE__ */ jsx("div", {
11772
+ t10 = /* @__PURE__ */ jsx("div", {
11644
11773
  className: ItemBrowser_module_default.tree,
11645
11774
  children: empty ? /* @__PURE__ */ jsx("p", {
11646
11775
  className: ItemBrowser_module_default.empty,
@@ -11668,99 +11797,589 @@ function Charges(t0) {
11668
11797
  $[39] = loadable;
11669
11798
  $[40] = matches;
11670
11799
  $[41] = selected;
11671
- $[42] = t11;
11672
- } else t11 = $[42];
11673
- let t12;
11674
- if ($[43] !== overlays || $[44] !== t10 || $[45] !== t11 || $[46] !== t8) {
11675
- t12 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
11676
- t8,
11800
+ $[42] = t10;
11801
+ } else t10 = $[42];
11802
+ let t11;
11803
+ if ($[43] !== overlays || $[44] !== t10 || $[45] !== t7 || $[46] !== t9) {
11804
+ t11 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
11805
+ t7,
11806
+ t9,
11677
11807
  t10,
11678
- t11,
11679
11808
  overlays
11680
11809
  ] });
11681
11810
  $[43] = overlays;
11682
11811
  $[44] = t10;
11683
- $[45] = t11;
11684
- $[46] = t8;
11685
- $[47] = t12;
11686
- } else t12 = $[47];
11687
- return t12;
11812
+ $[45] = t7;
11813
+ $[46] = t9;
11814
+ $[47] = t11;
11815
+ } else t11 = $[47];
11816
+ return t11;
11688
11817
  }
11689
- // src/components/ItemBrowser/FitActions.tsx
11690
- /** The buttons under the `ItemBrowser`: save the fit in the browser, import one, or copy it out. */
11691
- function FitActions(t0) {
11692
- const $ = c(80);
11693
- const { noHullSelected, pasteToOpen } = t0;
11818
+ // src/components/ItemBrowser/saveFit.tsx
11819
+ const MAX_ESI_NAME = 50;
11820
+ /** Saves a fit to where saves go, asking what it needs first; render `dialog` once. */
11821
+ function useSaveFit() {
11822
+ const $ = c(68);
11694
11823
  const engine = useEngine();
11695
- const fit = useFit();
11696
- const store = useFitStore();
11697
- const { fits, save } = useLocalFits();
11698
- const menu = useId();
11699
- const [saved, flashSaved] = useFlash();
11700
- const [copied, flashCopied] = useFlash();
11701
- const [importing, setImporting] = useState();
11702
- const [naming, setNaming] = useState(false);
11703
- const [overwriting, setOverwriting] = useState();
11704
- const { copy: copyFit, dialog: copyDialog } = useCopyFit();
11824
+ let t0;
11825
+ if ($[0] !== engine) {
11826
+ t0 = (typeId) => engine.sde.type(typeId)?.name ?? String(typeId);
11827
+ $[0] = engine;
11828
+ $[1] = t0;
11829
+ } else t0 = $[1];
11830
+ const typeName = t0;
11831
+ const { characters, target, fits, pick, save: saveToTarget } = useFitSaving();
11832
+ const [asking, setAsking] = useState();
11833
+ const [notice, setNotice] = useState();
11834
+ const [saving, setSaving] = useState(false);
11705
11835
  let t1;
11706
- if ($[0] !== flashSaved || $[1] !== save || $[2] !== store) {
11707
- t1 = (named) => {
11708
- setOverwriting(void 0);
11709
- store.setName(named.name ?? "");
11710
- save(named);
11711
- flashSaved();
11836
+ if ($[2] !== saveToTarget || $[3] !== target) {
11837
+ t1 = (t2, t3) => {
11838
+ const { fit, onStart, onSaved } = t2;
11839
+ const replace = t3 === void 0 ? false : t3;
11840
+ setAsking(void 0);
11841
+ onStart?.(fit);
11842
+ if (target === void 0) {
11843
+ saveToTarget(fit);
11844
+ onSaved?.();
11845
+ return;
11846
+ }
11847
+ setSaving(true);
11848
+ saveToTarget(fit, replace).then(() => onSaved?.(), (error) => {
11849
+ console.error(error);
11850
+ setNotice("EVE did not save this fit. Please try again.");
11851
+ }).finally(() => setSaving(false));
11712
11852
  };
11713
- $[0] = flashSaved;
11714
- $[1] = save;
11715
- $[2] = store;
11716
- $[3] = t1;
11717
- } else t1 = $[3];
11718
- const saveNow = t1;
11853
+ $[2] = saveToTarget;
11854
+ $[3] = target;
11855
+ $[4] = t1;
11856
+ } else t1 = $[4];
11857
+ const finish = t1;
11719
11858
  let t2;
11720
- if ($[4] !== fits || $[5] !== saveNow) {
11721
- t2 = (named_0) => {
11722
- const existing = fits.find((one) => one.ship.type_id === named_0.ship.type_id && one.name === named_0.name);
11723
- if (existing === void 0 || JSON.stringify(existing) === JSON.stringify(named_0)) saveNow(named_0);
11724
- else setOverwriting(named_0);
11725
- };
11726
- $[4] = fits;
11727
- $[5] = saveNow;
11728
- $[6] = t2;
11729
- } else t2 = $[6];
11730
- const trySave = t2;
11859
+ if ($[5] !== engine || $[6] !== finish || $[7] !== fits || $[8] !== target) {
11860
+ t2 = (job) => {
11861
+ const existing = fits.find((one) => one.ship.type_id === job.fit.ship.type_id && one.name === job.fit.name);
11862
+ if (existing === void 0) return finish(job);
11863
+ if (target === void 0) {
11864
+ if (JSON.stringify(existing) === JSON.stringify(job.fit)) return finish(job);
11865
+ } else if (JSON.stringify(engine.saveEsiFitting(existing)) === JSON.stringify(engine.saveEsiFitting(job.fit))) {
11866
+ setAsking(void 0);
11867
+ job.onStart?.(job.fit);
11868
+ job.onSaved?.();
11869
+ return;
11870
+ }
11871
+ setAsking({
11872
+ kind: "replace",
11873
+ job
11874
+ });
11875
+ };
11876
+ $[5] = engine;
11877
+ $[6] = finish;
11878
+ $[7] = fits;
11879
+ $[8] = target;
11880
+ $[9] = t2;
11881
+ } else t2 = $[9];
11882
+ const askReplace = t2;
11731
11883
  let t3;
11884
+ if ($[10] !== askReplace || $[11] !== target || $[12] !== typeName) {
11885
+ t3 = (job_0) => {
11886
+ const modules = target === void 0 ? [] : job_0.fit.items.flatMap((t4) => {
11887
+ const { type_id, mutation } = t4;
11888
+ return mutation === void 0 ? [] : [`${typeName(type_id)} → ${typeName(mutation.base)}`];
11889
+ });
11890
+ if (modules.length > 0) setAsking({
11891
+ kind: "mutated",
11892
+ job: job_0,
11893
+ modules
11894
+ });
11895
+ else askReplace(job_0);
11896
+ };
11897
+ $[10] = askReplace;
11898
+ $[11] = target;
11899
+ $[12] = typeName;
11900
+ $[13] = t3;
11901
+ } else t3 = $[13];
11902
+ const askMutated = t3;
11732
11903
  let t4;
11733
- if ($[7] !== engine || $[8] !== noHullSelected || $[9] !== pasteToOpen || $[10] !== store) {
11734
- t3 = () => {
11735
- if (!pasteToOpen) return;
11736
- const onPaste = (event) => {
11737
- if (event.defaultPrevented) return;
11738
- const target = event.target;
11739
- if (target instanceof HTMLElement && target.isContentEditable) return;
11740
- if (target instanceof Element && target.closest("input, textarea, select, dialog")) return;
11741
- const text = event.clipboardData?.getData("text/plain").trim() ?? "";
11742
- if (text === "") return;
11743
- event.preventDefault();
11744
- const pasted = noHullSelected ? void 0 : parseMutationText(engine.sde, text);
11745
- if (pasted !== void 0) {
11746
- if (store.fitMutated(pasted) === void 0) setImporting({
11747
- text,
11748
- error: "This module does not fit on the ship"
11749
- });
11750
- return;
11751
- }
11752
- const item = engine.esi === void 0 || noHullSelected ? void 0 : parseItemLink(text);
11753
- if (item !== void 0) {
11754
- fitMutated(engine, store, item.typeId, item.itemId).catch((failure) => setImporting({
11755
- text,
11904
+ if ($[14] !== askMutated || $[15] !== engine || $[16] !== saving || $[17] !== target) {
11905
+ t4 = (fit_0, callbacks) => {
11906
+ if (saving) return;
11907
+ if (target !== void 0 && engine.saveEsiFitting(fit_0).items.length === 0) {
11908
+ setNotice("EVE can't save an empty hull. Fit a module first.");
11909
+ return;
11910
+ }
11911
+ const job_1 = {
11912
+ fit: fit_0,
11913
+ ...callbacks
11914
+ };
11915
+ if (!fit_0.name || target !== void 0 && fit_0.name.length > MAX_ESI_NAME) setAsking({
11916
+ kind: "name",
11917
+ job: job_1
11918
+ });
11919
+ else askMutated(job_1);
11920
+ };
11921
+ $[14] = askMutated;
11922
+ $[15] = engine;
11923
+ $[16] = saving;
11924
+ $[17] = target;
11925
+ $[18] = t4;
11926
+ } else t4 = $[18];
11927
+ const save = t4;
11928
+ let t5;
11929
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
11930
+ t5 = () => setAsking(void 0);
11931
+ $[19] = t5;
11932
+ } else t5 = $[19];
11933
+ const close = t5;
11934
+ const name = asking?.job.fit.name;
11935
+ const t6 = asking?.kind === "name";
11936
+ let t7;
11937
+ if ($[20] !== askMutated || $[21] !== asking || $[22] !== target) {
11938
+ t7 = asking?.kind === "name" && /* @__PURE__ */ jsx(NameForm, {
11939
+ fit: asking.job.fit,
11940
+ maxLength: target === void 0 ? void 0 : MAX_ESI_NAME,
11941
+ onCancel: close,
11942
+ onSave: (named) => askMutated({
11943
+ ...asking.job,
11944
+ fit: named
11945
+ })
11946
+ });
11947
+ $[20] = askMutated;
11948
+ $[21] = asking;
11949
+ $[22] = target;
11950
+ $[23] = t7;
11951
+ } else t7 = $[23];
11952
+ let t8;
11953
+ if ($[24] !== t6 || $[25] !== t7) {
11954
+ t8 = /* @__PURE__ */ jsx(Dialog, {
11955
+ open: t6,
11956
+ title: "Save Fit",
11957
+ onClose: close,
11958
+ children: t7
11959
+ });
11960
+ $[24] = t6;
11961
+ $[25] = t7;
11962
+ $[26] = t8;
11963
+ } else t8 = $[26];
11964
+ const t9 = asking?.kind === "mutated";
11965
+ const t10 = asking?.kind === "mutated" ? asking.modules : void 0;
11966
+ let t11;
11967
+ if ($[27] !== askReplace || $[28] !== asking) {
11968
+ t11 = () => asking && askReplace(asking.job);
11969
+ $[27] = askReplace;
11970
+ $[28] = asking;
11971
+ $[29] = t11;
11972
+ } else t11 = $[29];
11973
+ let t12;
11974
+ if ($[30] !== t10 || $[31] !== t11) {
11975
+ t12 = /* @__PURE__ */ jsx(Confirm, {
11976
+ text: "EVE can't store mutated modules. These will be saved as their normal modules:",
11977
+ list: t10,
11978
+ action: "Save anyway",
11979
+ onCancel: close,
11980
+ onConfirm: t11
11981
+ });
11982
+ $[30] = t10;
11983
+ $[31] = t11;
11984
+ $[32] = t12;
11985
+ } else t12 = $[32];
11986
+ let t13;
11987
+ if ($[33] !== t12 || $[34] !== t9) {
11988
+ t13 = /* @__PURE__ */ jsx(Dialog, {
11989
+ open: t9,
11990
+ title: "Save to EVE?",
11991
+ onClose: close,
11992
+ children: t12
11993
+ });
11994
+ $[33] = t12;
11995
+ $[34] = t9;
11996
+ $[35] = t13;
11997
+ } else t13 = $[35];
11998
+ const t14 = asking?.kind === "replace";
11999
+ const t15 = target === void 0 ? "Overwrite Fit?" : "Replace Fit?";
12000
+ const t16 = target === void 0 ? `A fit named "${name}" is already saved for this hull. Overwrite it?` : `${target.name} already has a fit named "${name}" for this hull. Replace it?`;
12001
+ const t17 = target === void 0 ? "Overwrite" : "Replace";
12002
+ let t18;
12003
+ if ($[36] !== asking || $[37] !== finish) {
12004
+ t18 = () => asking && finish(asking.job, true);
12005
+ $[36] = asking;
12006
+ $[37] = finish;
12007
+ $[38] = t18;
12008
+ } else t18 = $[38];
12009
+ let t19;
12010
+ if ($[39] !== t16 || $[40] !== t17 || $[41] !== t18) {
12011
+ t19 = /* @__PURE__ */ jsx(Confirm, {
12012
+ text: t16,
12013
+ action: t17,
12014
+ onCancel: close,
12015
+ onConfirm: t18
12016
+ });
12017
+ $[39] = t16;
12018
+ $[40] = t17;
12019
+ $[41] = t18;
12020
+ $[42] = t19;
12021
+ } else t19 = $[42];
12022
+ let t20;
12023
+ if ($[43] !== t14 || $[44] !== t15 || $[45] !== t19) {
12024
+ t20 = /* @__PURE__ */ jsx(Dialog, {
12025
+ open: t14,
12026
+ title: t15,
12027
+ onClose: close,
12028
+ children: t19
12029
+ });
12030
+ $[43] = t14;
12031
+ $[44] = t15;
12032
+ $[45] = t19;
12033
+ $[46] = t20;
12034
+ } else t20 = $[46];
12035
+ const t21 = notice !== void 0;
12036
+ let t22;
12037
+ if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
12038
+ t22 = () => setNotice(void 0);
12039
+ $[47] = t22;
12040
+ } else t22 = $[47];
12041
+ let t23;
12042
+ if ($[48] !== notice) {
12043
+ t23 = /* @__PURE__ */ jsx("p", { children: notice });
12044
+ $[48] = notice;
12045
+ $[49] = t23;
12046
+ } else t23 = $[49];
12047
+ let t24;
12048
+ if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
12049
+ t24 = /* @__PURE__ */ jsx("div", {
12050
+ className: ItemBrowser_module_default.dialogButtons,
12051
+ children: /* @__PURE__ */ jsx("button", {
12052
+ type: "button",
12053
+ className: ItemBrowser_module_default.action,
12054
+ onClick: () => setNotice(void 0),
12055
+ children: "Close"
12056
+ })
12057
+ });
12058
+ $[50] = t24;
12059
+ } else t24 = $[50];
12060
+ let t25;
12061
+ if ($[51] !== t23) {
12062
+ t25 = /* @__PURE__ */ jsxs("div", {
12063
+ className: ItemBrowser_module_default.confirm,
12064
+ children: [t23, t24]
12065
+ });
12066
+ $[51] = t23;
12067
+ $[52] = t25;
12068
+ } else t25 = $[52];
12069
+ let t26;
12070
+ if ($[53] !== t21 || $[54] !== t25) {
12071
+ t26 = /* @__PURE__ */ jsx(Dialog, {
12072
+ open: t21,
12073
+ title: "Save to EVE",
12074
+ onClose: t22,
12075
+ children: t25
12076
+ });
12077
+ $[53] = t21;
12078
+ $[54] = t25;
12079
+ $[55] = t26;
12080
+ } else t26 = $[55];
12081
+ let t27;
12082
+ if ($[56] !== t13 || $[57] !== t20 || $[58] !== t26 || $[59] !== t8) {
12083
+ t27 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
12084
+ t8,
12085
+ t13,
12086
+ t20,
12087
+ t26
12088
+ ] });
12089
+ $[56] = t13;
12090
+ $[57] = t20;
12091
+ $[58] = t26;
12092
+ $[59] = t8;
12093
+ $[60] = t27;
12094
+ } else t27 = $[60];
12095
+ let t28;
12096
+ if ($[61] !== characters || $[62] !== pick || $[63] !== save || $[64] !== saving || $[65] !== t27 || $[66] !== target) {
12097
+ t28 = {
12098
+ characters,
12099
+ target,
12100
+ pick,
12101
+ save,
12102
+ saving,
12103
+ dialog: t27
12104
+ };
12105
+ $[61] = characters;
12106
+ $[62] = pick;
12107
+ $[63] = save;
12108
+ $[64] = saving;
12109
+ $[65] = t27;
12110
+ $[66] = target;
12111
+ $[67] = t28;
12112
+ } else t28 = $[67];
12113
+ return t28;
12114
+ }
12115
+ function Confirm(t0) {
12116
+ const $ = c(16);
12117
+ const { text, list, action, onCancel, onConfirm } = t0;
12118
+ let t1;
12119
+ if ($[0] !== text) {
12120
+ t1 = /* @__PURE__ */ jsx("p", { children: text });
12121
+ $[0] = text;
12122
+ $[1] = t1;
12123
+ } else t1 = $[1];
12124
+ let t2;
12125
+ if ($[2] !== list) {
12126
+ t2 = list !== void 0 && /* @__PURE__ */ jsx("ul", { children: list.map(_temp$6) });
12127
+ $[2] = list;
12128
+ $[3] = t2;
12129
+ } else t2 = $[3];
12130
+ let t3;
12131
+ if ($[4] !== onCancel) {
12132
+ t3 = /* @__PURE__ */ jsx("button", {
12133
+ type: "button",
12134
+ className: ItemBrowser_module_default.action,
12135
+ onClick: onCancel,
12136
+ children: "Cancel"
12137
+ });
12138
+ $[4] = onCancel;
12139
+ $[5] = t3;
12140
+ } else t3 = $[5];
12141
+ let t4;
12142
+ if ($[6] !== action || $[7] !== onConfirm) {
12143
+ t4 = /* @__PURE__ */ jsx("button", {
12144
+ type: "button",
12145
+ className: ItemBrowser_module_default.action,
12146
+ onClick: onConfirm,
12147
+ children: action
12148
+ });
12149
+ $[6] = action;
12150
+ $[7] = onConfirm;
12151
+ $[8] = t4;
12152
+ } else t4 = $[8];
12153
+ let t5;
12154
+ if ($[9] !== t3 || $[10] !== t4) {
12155
+ t5 = /* @__PURE__ */ jsxs("div", {
12156
+ className: ItemBrowser_module_default.dialogButtons,
12157
+ children: [t3, t4]
12158
+ });
12159
+ $[9] = t3;
12160
+ $[10] = t4;
12161
+ $[11] = t5;
12162
+ } else t5 = $[11];
12163
+ let t6;
12164
+ if ($[12] !== t1 || $[13] !== t2 || $[14] !== t5) {
12165
+ t6 = /* @__PURE__ */ jsxs("div", {
12166
+ className: ItemBrowser_module_default.confirm,
12167
+ children: [
12168
+ t1,
12169
+ t2,
12170
+ t5
12171
+ ]
12172
+ });
12173
+ $[12] = t1;
12174
+ $[13] = t2;
12175
+ $[14] = t5;
12176
+ $[15] = t6;
12177
+ } else t6 = $[15];
12178
+ return t6;
12179
+ }
12180
+ function _temp$6(line, index) {
12181
+ return /* @__PURE__ */ jsx("li", { children: line }, index);
12182
+ }
12183
+ function NameForm(t0) {
12184
+ const $ = c(32);
12185
+ const { fit, maxLength, onCancel, onSave } = t0;
12186
+ const engine = useEngine();
12187
+ const id = useId();
12188
+ let t1;
12189
+ if ($[0] !== engine || $[1] !== fit.name || $[2] !== fit.ship) {
12190
+ t1 = () => fit.name || (engine.sde.type(fit.ship.type_id)?.name ?? "");
12191
+ $[0] = engine;
12192
+ $[1] = fit.name;
12193
+ $[2] = fit.ship;
12194
+ $[3] = t1;
12195
+ } else t1 = $[3];
12196
+ const [name, setName] = useState(t1);
12197
+ let t2;
12198
+ if ($[4] !== name) {
12199
+ t2 = name.trim();
12200
+ $[4] = name;
12201
+ $[5] = t2;
12202
+ } else t2 = $[5];
12203
+ const trimmed = t2;
12204
+ const tooLong = maxLength !== void 0 && trimmed.length > maxLength;
12205
+ let t3;
12206
+ if ($[6] !== fit || $[7] !== onSave || $[8] !== trimmed) {
12207
+ t3 = (event) => {
12208
+ event.preventDefault();
12209
+ onSave({
12210
+ ...fit,
12211
+ name: trimmed
12212
+ });
12213
+ };
12214
+ $[6] = fit;
12215
+ $[7] = onSave;
12216
+ $[8] = trimmed;
12217
+ $[9] = t3;
12218
+ } else t3 = $[9];
12219
+ let t4;
12220
+ if ($[10] !== id) {
12221
+ t4 = /* @__PURE__ */ jsx("label", {
12222
+ htmlFor: id,
12223
+ children: "Name this fit."
12224
+ });
12225
+ $[10] = id;
12226
+ $[11] = t4;
12227
+ } else t4 = $[11];
12228
+ let t5;
12229
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
12230
+ t5 = (event_1) => setName(event_1.target.value);
12231
+ $[12] = t5;
12232
+ } else t5 = $[12];
12233
+ let t6;
12234
+ if ($[13] !== id || $[14] !== name) {
12235
+ t6 = /* @__PURE__ */ jsx("input", {
12236
+ id,
12237
+ value: name,
12238
+ onFocus: _temp2$4,
12239
+ onChange: t5
12240
+ });
12241
+ $[13] = id;
12242
+ $[14] = name;
12243
+ $[15] = t6;
12244
+ } else t6 = $[15];
12245
+ let t7;
12246
+ if ($[16] !== maxLength || $[17] !== tooLong) {
12247
+ t7 = tooLong && /* @__PURE__ */ jsxs("p", {
12248
+ className: ItemBrowser_module_default.importError,
12249
+ role: "alert",
12250
+ children: [
12251
+ "EVE allows ",
12252
+ maxLength,
12253
+ " characters at most."
12254
+ ]
12255
+ });
12256
+ $[16] = maxLength;
12257
+ $[17] = tooLong;
12258
+ $[18] = t7;
12259
+ } else t7 = $[18];
12260
+ let t8;
12261
+ if ($[19] !== onCancel) {
12262
+ t8 = /* @__PURE__ */ jsx("button", {
12263
+ type: "button",
12264
+ className: ItemBrowser_module_default.action,
12265
+ onClick: onCancel,
12266
+ children: "Cancel"
12267
+ });
12268
+ $[19] = onCancel;
12269
+ $[20] = t8;
12270
+ } else t8 = $[20];
12271
+ const t9 = trimmed === "" || tooLong;
12272
+ let t10;
12273
+ if ($[21] !== t9) {
12274
+ t10 = /* @__PURE__ */ jsx("button", {
12275
+ type: "submit",
12276
+ className: ItemBrowser_module_default.action,
12277
+ disabled: t9,
12278
+ children: "Save"
12279
+ });
12280
+ $[21] = t9;
12281
+ $[22] = t10;
12282
+ } else t10 = $[22];
12283
+ let t11;
12284
+ if ($[23] !== t10 || $[24] !== t8) {
12285
+ t11 = /* @__PURE__ */ jsxs("div", {
12286
+ className: ItemBrowser_module_default.dialogButtons,
12287
+ children: [t8, t10]
12288
+ });
12289
+ $[23] = t10;
12290
+ $[24] = t8;
12291
+ $[25] = t11;
12292
+ } else t11 = $[25];
12293
+ let t12;
12294
+ if ($[26] !== t11 || $[27] !== t3 || $[28] !== t4 || $[29] !== t6 || $[30] !== t7) {
12295
+ t12 = /* @__PURE__ */ jsxs("form", {
12296
+ className: ItemBrowser_module_default.form,
12297
+ onSubmit: t3,
12298
+ children: [
12299
+ t4,
12300
+ t6,
12301
+ t7,
12302
+ t11
12303
+ ]
12304
+ });
12305
+ $[26] = t11;
12306
+ $[27] = t3;
12307
+ $[28] = t4;
12308
+ $[29] = t6;
12309
+ $[30] = t7;
12310
+ $[31] = t12;
12311
+ } else t12 = $[31];
12312
+ return t12;
12313
+ }
12314
+ function _temp2$4(event_0) {
12315
+ return event_0.currentTarget.select();
12316
+ }
12317
+ // src/components/ItemBrowser/FitActions.tsx
12318
+ /** The buttons under the `ItemBrowser`: save the fit in the browser, import one, or copy it out. */
12319
+ function FitActions(t0) {
12320
+ const $ = c(55);
12321
+ const { pasteToOpen } = t0;
12322
+ const engine = useEngine();
12323
+ const store = useFitStore();
12324
+ const noHullSelected = !useHasFit();
12325
+ const menu = useId();
12326
+ const [saved, flashSaved] = useFlash();
12327
+ const [copied, flashCopied] = useFlash();
12328
+ const [importing, setImporting] = useState();
12329
+ const { copy: copyFit, dialog: copyDialog } = useCopyFit();
12330
+ const saver = useSaveFit();
12331
+ const [savedTo, setSavedTo] = useState("");
12332
+ let t1;
12333
+ if ($[0] !== flashSaved || $[1] !== saver || $[2] !== store) {
12334
+ t1 = () => {
12335
+ const where = saver.target?.name ?? "browser";
12336
+ saver.save(store.getSnapshot().fit, {
12337
+ onStart: (named) => store.setName(named.name ?? ""),
12338
+ onSaved: () => {
12339
+ setSavedTo(where);
12340
+ flashSaved();
12341
+ }
12342
+ });
12343
+ };
12344
+ $[0] = flashSaved;
12345
+ $[1] = saver;
12346
+ $[2] = store;
12347
+ $[3] = t1;
12348
+ } else t1 = $[3];
12349
+ const saveCurrent = t1;
12350
+ let t2;
12351
+ let t3;
12352
+ if ($[4] !== engine || $[5] !== noHullSelected || $[6] !== pasteToOpen || $[7] !== store) {
12353
+ t2 = () => {
12354
+ if (!pasteToOpen) return;
12355
+ const onPaste = (event) => {
12356
+ if (event.defaultPrevented) return;
12357
+ const target = event.target;
12358
+ if (target instanceof HTMLElement && target.isContentEditable) return;
12359
+ if (target instanceof Element && target.closest("input, textarea, select, dialog")) return;
12360
+ const text = event.clipboardData?.getData("text/plain").trim() ?? "";
12361
+ if (text === "") return;
12362
+ event.preventDefault();
12363
+ const pasted = noHullSelected ? void 0 : parseMutationText(engine.sde, text);
12364
+ if (pasted !== void 0) {
12365
+ if (store.fitMutated(pasted) === void 0) setImporting({
12366
+ text,
12367
+ error: "This module does not fit on the ship"
12368
+ });
12369
+ return;
12370
+ }
12371
+ const item = engine.esi === void 0 || noHullSelected ? void 0 : parseItemLink(text);
12372
+ if (item !== void 0) {
12373
+ fitMutated(engine, store, item.typeId, item.itemId).catch((failure) => setImporting({
12374
+ text,
11756
12375
  error: failure instanceof Error ? failure.message : String(failure)
11757
12376
  }));
11758
12377
  return;
11759
12378
  }
11760
12379
  try {
11761
12380
  store.replace(engine.loadText(text, store.character));
11762
- } catch (t5) {
11763
- const failure_0 = t5;
12381
+ } catch (t4) {
12382
+ const failure_0 = t4;
11764
12383
  setImporting({
11765
12384
  text,
11766
12385
  error: failure_0 instanceof Error ? failure_0.message : String(failure_0)
@@ -11770,416 +12389,427 @@ function FitActions(t0) {
11770
12389
  document.addEventListener("paste", onPaste);
11771
12390
  return () => document.removeEventListener("paste", onPaste);
11772
12391
  };
11773
- t4 = [
12392
+ t3 = [
11774
12393
  engine,
11775
12394
  store,
11776
12395
  pasteToOpen,
11777
12396
  noHullSelected
11778
12397
  ];
11779
- $[7] = engine;
11780
- $[8] = noHullSelected;
11781
- $[9] = pasteToOpen;
11782
- $[10] = store;
11783
- $[11] = t3;
11784
- $[12] = t4;
12398
+ $[4] = engine;
12399
+ $[5] = noHullSelected;
12400
+ $[6] = pasteToOpen;
12401
+ $[7] = store;
12402
+ $[8] = t2;
12403
+ $[9] = t3;
11785
12404
  } else {
11786
- t3 = $[11];
11787
- t4 = $[12];
12405
+ t2 = $[8];
12406
+ t3 = $[9];
11788
12407
  }
11789
- useEffect(t3, t4);
11790
- let t5;
11791
- if ($[13] !== copyFit || $[14] !== fit || $[15] !== flashCopied || $[16] !== menu) {
11792
- t5 = (format) => {
12408
+ useEffect(t2, t3);
12409
+ let t4;
12410
+ if ($[10] !== copyFit || $[11] !== flashCopied || $[12] !== menu || $[13] !== store) {
12411
+ t4 = (format) => {
11793
12412
  document.getElementById(menu)?.hidePopover();
11794
- copyFit(fit, format, flashCopied);
12413
+ copyFit(store.getSnapshot().fit, format, flashCopied);
11795
12414
  };
11796
- $[13] = copyFit;
11797
- $[14] = fit;
11798
- $[15] = flashCopied;
11799
- $[16] = menu;
11800
- $[17] = t5;
11801
- } else t5 = $[17];
11802
- const copy = t5;
11803
- let t6;
11804
- if ($[18] !== fit || $[19] !== trySave) {
11805
- t6 = () => fit.name ? trySave(fit) : setNaming(true);
11806
- $[18] = fit;
11807
- $[19] = trySave;
11808
- $[20] = t6;
11809
- } else t6 = $[20];
11810
- const t7 = saved ? "Saved" : "Save";
11811
- let t8;
11812
- if ($[21] !== noHullSelected || $[22] !== t6 || $[23] !== t7) {
11813
- t8 = /* @__PURE__ */ jsx("button", {
12415
+ $[10] = copyFit;
12416
+ $[11] = flashCopied;
12417
+ $[12] = menu;
12418
+ $[13] = store;
12419
+ $[14] = t4;
12420
+ } else t4 = $[14];
12421
+ const copy = t4;
12422
+ let t5;
12423
+ if ($[15] !== noHullSelected || $[16] !== saveCurrent || $[17] !== saved || $[18] !== savedTo || $[19] !== saver) {
12424
+ t5 = saver.characters === void 0 ? /* @__PURE__ */ jsx("button", {
11814
12425
  type: "button",
11815
12426
  className: ItemBrowser_module_default.action,
11816
12427
  disabled: noHullSelected,
11817
- onClick: t6,
11818
- children: t7
12428
+ onClick: saveCurrent,
12429
+ children: saved ? "Saved" : "Save"
12430
+ }) : /* @__PURE__ */ jsx(SaveSplit, {
12431
+ saver,
12432
+ savedTo: saved ? savedTo : void 0,
12433
+ disabled: noHullSelected,
12434
+ onSave: saveCurrent
11819
12435
  });
11820
- $[21] = noHullSelected;
11821
- $[22] = t6;
11822
- $[23] = t7;
11823
- $[24] = t8;
11824
- } else t8 = $[24];
11825
- let t9;
11826
- if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
11827
- t9 = /* @__PURE__ */ jsx("button", {
12436
+ $[15] = noHullSelected;
12437
+ $[16] = saveCurrent;
12438
+ $[17] = saved;
12439
+ $[18] = savedTo;
12440
+ $[19] = saver;
12441
+ $[20] = t5;
12442
+ } else t5 = $[20];
12443
+ let t6;
12444
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
12445
+ t6 = /* @__PURE__ */ jsx("button", {
11828
12446
  type: "button",
11829
12447
  className: ItemBrowser_module_default.action,
11830
12448
  onClick: () => setImporting({ text: "" }),
11831
12449
  children: "Import…"
11832
12450
  });
11833
- $[25] = t9;
11834
- } else t9 = $[25];
11835
- const t10 = copied ? "Copied" : "Copy";
11836
- const t11 = copied ? "checkmark" : "export";
11837
- let t12;
11838
- if ($[26] !== t11) {
11839
- t12 = /* @__PURE__ */ jsx(Icon, { name: t11 });
11840
- $[26] = t11;
11841
- $[27] = t12;
11842
- } else t12 = $[27];
11843
- let t13;
11844
- if ($[28] !== menu || $[29] !== noHullSelected || $[30] !== t12) {
11845
- t13 = /* @__PURE__ */ jsx("button", {
12451
+ $[21] = t6;
12452
+ } else t6 = $[21];
12453
+ const t7 = copied ? "Copied" : "Copy";
12454
+ const t8 = copied ? "checkmark" : "export";
12455
+ let t9;
12456
+ if ($[22] !== t8) {
12457
+ t9 = /* @__PURE__ */ jsx(Icon, { name: t8 });
12458
+ $[22] = t8;
12459
+ $[23] = t9;
12460
+ } else t9 = $[23];
12461
+ let t10;
12462
+ if ($[24] !== menu || $[25] !== noHullSelected || $[26] !== t9) {
12463
+ t10 = /* @__PURE__ */ jsx("button", {
11846
12464
  type: "button",
11847
12465
  className: `${ItemBrowser_module_default.action} ${ItemBrowser_module_default.copy}`,
11848
12466
  "aria-label": "Copy",
11849
12467
  popoverTarget: menu,
11850
12468
  disabled: noHullSelected,
11851
- children: t12
12469
+ children: t9
11852
12470
  });
11853
- $[28] = menu;
11854
- $[29] = noHullSelected;
11855
- $[30] = t12;
11856
- $[31] = t13;
11857
- } else t13 = $[31];
11858
- let t14;
11859
- if ($[32] !== t10 || $[33] !== t13) {
11860
- t14 = /* @__PURE__ */ jsx("span", {
12471
+ $[24] = menu;
12472
+ $[25] = noHullSelected;
12473
+ $[26] = t9;
12474
+ $[27] = t10;
12475
+ } else t10 = $[27];
12476
+ let t11;
12477
+ if ($[28] !== t10 || $[29] !== t7) {
12478
+ t11 = /* @__PURE__ */ jsx("span", {
11861
12479
  className: ItemBrowser_module_default.copyAnchor,
11862
12480
  children: /* @__PURE__ */ jsx(Tooltip, {
11863
- label: t10,
11864
- children: t13
12481
+ label: t7,
12482
+ children: t10
11865
12483
  })
11866
12484
  });
11867
- $[32] = t10;
11868
- $[33] = t13;
11869
- $[34] = t14;
11870
- } else t14 = $[34];
11871
- let t15;
11872
- if ($[35] !== copy) {
11873
- t15 = /* @__PURE__ */ jsx("button", {
12485
+ $[28] = t10;
12486
+ $[29] = t7;
12487
+ $[30] = t11;
12488
+ } else t11 = $[30];
12489
+ let t12;
12490
+ if ($[31] !== copy) {
12491
+ t12 = /* @__PURE__ */ jsx("button", {
11874
12492
  type: "button",
11875
12493
  role: "menuitem",
11876
12494
  onClick: () => copy("eft"),
11877
12495
  children: "Copy as EFT"
11878
12496
  });
11879
- $[35] = copy;
11880
- $[36] = t15;
11881
- } else t15 = $[36];
11882
- let t16;
11883
- if ($[37] !== copy) {
11884
- t16 = /* @__PURE__ */ jsx("button", {
12497
+ $[31] = copy;
12498
+ $[32] = t12;
12499
+ } else t12 = $[32];
12500
+ let t13;
12501
+ if ($[33] !== copy) {
12502
+ t13 = /* @__PURE__ */ jsx("button", {
11885
12503
  type: "button",
11886
12504
  role: "menuitem",
11887
12505
  onClick: () => copy("esf"),
11888
12506
  children: "Copy as esf/1"
11889
12507
  });
11890
- $[37] = copy;
11891
- $[38] = t16;
11892
- } else t16 = $[38];
11893
- let t17;
11894
- if ($[39] !== menu || $[40] !== t15 || $[41] !== t16) {
11895
- t17 = /* @__PURE__ */ jsxs("div", {
12508
+ $[33] = copy;
12509
+ $[34] = t13;
12510
+ } else t13 = $[34];
12511
+ let t14;
12512
+ if ($[35] !== menu || $[36] !== t12 || $[37] !== t13) {
12513
+ t14 = /* @__PURE__ */ jsxs("div", {
11896
12514
  id: menu,
11897
12515
  className: ItemBrowser_module_default.menu,
11898
12516
  popover: "auto",
11899
12517
  role: "menu",
11900
- children: [t15, t16]
12518
+ children: [t12, t13]
11901
12519
  });
11902
- $[39] = menu;
11903
- $[40] = t15;
11904
- $[41] = t16;
11905
- $[42] = t17;
11906
- } else t17 = $[42];
12520
+ $[35] = menu;
12521
+ $[36] = t12;
12522
+ $[37] = t13;
12523
+ $[38] = t14;
12524
+ } else t14 = $[38];
12525
+ const t15 = importing !== void 0;
12526
+ let t16;
12527
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
12528
+ t16 = () => setImporting(void 0);
12529
+ $[39] = t16;
12530
+ } else t16 = $[39];
12531
+ let t17;
12532
+ if ($[40] !== importing) {
12533
+ t17 = importing ?? { text: "" };
12534
+ $[40] = importing;
12535
+ $[41] = t17;
12536
+ } else t17 = $[41];
11907
12537
  let t18;
11908
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
11909
- t18 = () => setNaming(false);
11910
- $[43] = t18;
11911
- } else t18 = $[43];
12538
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
12539
+ t18 = () => setImporting(void 0);
12540
+ $[42] = t18;
12541
+ } else t18 = $[42];
11912
12542
  let t19;
11913
- if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
11914
- t19 = () => setNaming(false);
11915
- $[44] = t19;
11916
- } else t19 = $[44];
11917
- let t20;
11918
- if ($[45] !== trySave) {
11919
- t20 = /* @__PURE__ */ jsx(NameForm, {
11920
- onCancel: t19,
11921
- onSave: (named_1) => {
11922
- setNaming(false);
11923
- trySave(named_1);
11924
- }
11925
- });
11926
- $[45] = trySave;
11927
- $[46] = t20;
11928
- } else t20 = $[46];
11929
- let t21;
11930
- if ($[47] !== naming || $[48] !== t20) {
11931
- t21 = /* @__PURE__ */ jsx(Dialog, {
11932
- open: naming,
11933
- title: "Save Fit",
11934
- onClose: t18,
11935
- children: t20
11936
- });
11937
- $[47] = naming;
11938
- $[48] = t20;
11939
- $[49] = t21;
11940
- } else t21 = $[49];
11941
- const t22 = overwriting !== void 0;
11942
- let t23;
11943
- if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
11944
- t23 = () => setOverwriting(void 0);
11945
- $[50] = t23;
11946
- } else t23 = $[50];
11947
- const t24 = overwriting?.name;
11948
- let t25;
11949
- if ($[51] !== t24) {
11950
- t25 = /* @__PURE__ */ jsxs("p", { children: [
11951
- "A fit named \"",
11952
- t24,
11953
- "\" is already saved for this hull. Overwrite it?"
11954
- ] });
11955
- $[51] = t24;
11956
- $[52] = t25;
11957
- } else t25 = $[52];
11958
- let t26;
11959
- if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
11960
- t26 = /* @__PURE__ */ jsx("button", {
11961
- type: "button",
11962
- className: ItemBrowser_module_default.action,
11963
- onClick: () => setOverwriting(void 0),
11964
- children: "Cancel"
11965
- });
11966
- $[53] = t26;
11967
- } else t26 = $[53];
11968
- let t27;
11969
- if ($[54] !== overwriting || $[55] !== saveNow) {
11970
- t27 = /* @__PURE__ */ jsxs("div", {
11971
- className: ItemBrowser_module_default.dialogButtons,
11972
- children: [t26, /* @__PURE__ */ jsx("button", {
11973
- type: "button",
11974
- className: ItemBrowser_module_default.action,
11975
- onClick: () => overwriting && saveNow(overwriting),
11976
- children: "Overwrite"
11977
- })]
11978
- });
11979
- $[54] = overwriting;
11980
- $[55] = saveNow;
11981
- $[56] = t27;
11982
- } else t27 = $[56];
11983
- let t28;
11984
- if ($[57] !== t25 || $[58] !== t27) {
11985
- t28 = /* @__PURE__ */ jsxs("div", {
11986
- className: ItemBrowser_module_default.confirm,
11987
- children: [t25, t27]
11988
- });
11989
- $[57] = t25;
11990
- $[58] = t27;
11991
- $[59] = t28;
11992
- } else t28 = $[59];
11993
- let t29;
11994
- if ($[60] !== t22 || $[61] !== t28) {
11995
- t29 = /* @__PURE__ */ jsx(Dialog, {
11996
- open: t22,
11997
- title: "Overwrite Fit?",
11998
- onClose: t23,
11999
- children: t28
12000
- });
12001
- $[60] = t22;
12002
- $[61] = t28;
12003
- $[62] = t29;
12004
- } else t29 = $[62];
12005
- const t30 = importing !== void 0;
12006
- let t31;
12007
- if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
12008
- t31 = () => setImporting(void 0);
12009
- $[63] = t31;
12010
- } else t31 = $[63];
12011
- let t32;
12012
- if ($[64] !== importing) {
12013
- t32 = importing ?? { text: "" };
12014
- $[64] = importing;
12015
- $[65] = t32;
12016
- } else t32 = $[65];
12017
- let t33;
12018
- if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
12019
- t33 = () => setImporting(void 0);
12020
- $[66] = t33;
12021
- } else t33 = $[66];
12022
- let t34;
12023
- if ($[67] !== t32) {
12024
- t34 = /* @__PURE__ */ jsx(ImportForm, {
12025
- draft: t32,
12026
- onDone: t33
12027
- });
12028
- $[67] = t32;
12029
- $[68] = t34;
12030
- } else t34 = $[68];
12031
- let t35;
12032
- if ($[69] !== t30 || $[70] !== t34) {
12033
- t35 = /* @__PURE__ */ jsx(Dialog, {
12034
- open: t30,
12543
+ if ($[43] !== t17) {
12544
+ t19 = /* @__PURE__ */ jsx(ImportForm, {
12545
+ draft: t17,
12546
+ onDone: t18
12547
+ });
12548
+ $[43] = t17;
12549
+ $[44] = t19;
12550
+ } else t19 = $[44];
12551
+ let t20;
12552
+ if ($[45] !== t15 || $[46] !== t19) {
12553
+ t20 = /* @__PURE__ */ jsx(Dialog, {
12554
+ open: t15,
12035
12555
  title: "Import Fit",
12036
- onClose: t31,
12037
- children: t34
12556
+ onClose: t16,
12557
+ children: t19
12038
12558
  });
12039
- $[69] = t30;
12040
- $[70] = t34;
12041
- $[71] = t35;
12042
- } else t35 = $[71];
12043
- let t36;
12044
- if ($[72] !== copyDialog || $[73] !== t14 || $[74] !== t17 || $[75] !== t21 || $[76] !== t29 || $[77] !== t35 || $[78] !== t8) {
12045
- t36 = /* @__PURE__ */ jsxs("div", {
12559
+ $[45] = t15;
12560
+ $[46] = t19;
12561
+ $[47] = t20;
12562
+ } else t20 = $[47];
12563
+ let t21;
12564
+ if ($[48] !== copyDialog || $[49] !== saver.dialog || $[50] !== t11 || $[51] !== t14 || $[52] !== t20 || $[53] !== t5) {
12565
+ t21 = /* @__PURE__ */ jsxs("div", {
12046
12566
  className: ItemBrowser_module_default.actions,
12047
12567
  children: [
12048
- t8,
12049
- t9,
12568
+ t5,
12569
+ t6,
12570
+ t11,
12050
12571
  t14,
12051
- t17,
12052
- t21,
12053
- t29,
12054
- t35,
12055
- copyDialog
12572
+ t20,
12573
+ copyDialog,
12574
+ saver.dialog
12056
12575
  ]
12057
12576
  });
12058
- $[72] = copyDialog;
12059
- $[73] = t14;
12060
- $[74] = t17;
12061
- $[75] = t21;
12062
- $[76] = t29;
12063
- $[77] = t35;
12064
- $[78] = t8;
12065
- $[79] = t36;
12066
- } else t36 = $[79];
12067
- return t36;
12577
+ $[48] = copyDialog;
12578
+ $[49] = saver.dialog;
12579
+ $[50] = t11;
12580
+ $[51] = t14;
12581
+ $[52] = t20;
12582
+ $[53] = t5;
12583
+ $[54] = t21;
12584
+ } else t21 = $[54];
12585
+ return t21;
12068
12586
  }
12069
- function NameForm(t0) {
12070
- const $ = c(27);
12071
- const { onCancel, onSave } = t0;
12072
- const engine = useEngine();
12073
- const fit = useFit();
12074
- const id = useId();
12075
- let t1;
12076
- if ($[0] !== engine.sde || $[1] !== fit.ship.type_id) {
12077
- t1 = () => engine.sde.type(fit.ship.type_id)?.name ?? "";
12078
- $[0] = engine.sde;
12079
- $[1] = fit.ship.type_id;
12080
- $[2] = t1;
12081
- } else t1 = $[2];
12082
- const [name, setName] = useState(t1);
12587
+ function SaveSplit(t0) {
12588
+ const $ = c(53);
12589
+ const { saver: t1, savedTo, disabled, onSave } = t0;
12590
+ const { characters, target, pick, saving } = t1;
12591
+ const menu = useId();
12592
+ const { current, login } = useCharacters();
12593
+ const where = target?.name ?? "browser";
12083
12594
  let t2;
12084
- if ($[3] !== fit || $[4] !== name || $[5] !== onSave) {
12085
- t2 = (event) => {
12086
- event.preventDefault();
12087
- onSave({
12088
- ...fit,
12089
- name: name.trim()
12090
- });
12091
- };
12092
- $[3] = fit;
12093
- $[4] = name;
12094
- $[5] = onSave;
12095
- $[6] = t2;
12096
- } else t2 = $[6];
12595
+ if ($[0] !== menu) {
12596
+ t2 = () => document.getElementById(menu)?.hidePopover();
12597
+ $[0] = menu;
12598
+ $[1] = t2;
12599
+ } else t2 = $[1];
12600
+ const close = t2;
12097
12601
  let t3;
12098
- if ($[7] !== id) {
12099
- t3 = /* @__PURE__ */ jsx("label", {
12100
- htmlFor: id,
12101
- children: "Name this fit."
12102
- });
12103
- $[7] = id;
12104
- $[8] = t3;
12105
- } else t3 = $[8];
12602
+ if ($[2] !== close || $[3] !== pick) {
12603
+ t3 = (owner) => {
12604
+ pick(owner);
12605
+ close();
12606
+ };
12607
+ $[2] = close;
12608
+ $[3] = pick;
12609
+ $[4] = t3;
12610
+ } else t3 = $[4];
12611
+ const choose = t3;
12106
12612
  let t4;
12107
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
12108
- t4 = (event_1) => setName(event_1.target.value);
12109
- $[9] = t4;
12110
- } else t4 = $[9];
12613
+ if ($[5] !== close || $[6] !== login) {
12614
+ t4 = (canSave) => {
12615
+ close();
12616
+ login?.(canSave);
12617
+ };
12618
+ $[5] = close;
12619
+ $[6] = login;
12620
+ $[7] = t4;
12621
+ } else t4 = $[7];
12622
+ const logIn = t4;
12111
12623
  let t5;
12112
- if ($[10] !== id || $[11] !== name) {
12113
- t5 = /* @__PURE__ */ jsx("input", {
12114
- id,
12115
- value: name,
12116
- onFocus: _temp$5,
12117
- onChange: t4
12118
- });
12119
- $[10] = id;
12120
- $[11] = name;
12624
+ if ($[8] !== choose || $[9] !== current || $[10] !== logIn || $[11] !== target?.id) {
12625
+ t5 = (character) => {
12626
+ const writable = canSaveFits(character);
12627
+ return /* @__PURE__ */ jsxs("button", {
12628
+ type: "button",
12629
+ role: writable ? "menuitemradio" : "menuitem",
12630
+ "aria-checked": writable ? character.id === target?.id : void 0,
12631
+ "data-off": !writable || void 0,
12632
+ onClick: writable ? () => choose(character.id) : () => logIn(character.status !== "expired" || character.canWriteFits),
12633
+ children: [
12634
+ /* @__PURE__ */ jsx("span", {
12635
+ className: ItemBrowser_module_default.tick,
12636
+ children: character.id === target?.id && "✓"
12637
+ }),
12638
+ /* @__PURE__ */ jsx(Icon, { name: "fits-personal" }),
12639
+ /* @__PURE__ */ jsx("span", {
12640
+ className: ItemBrowser_module_default.saveName,
12641
+ children: character.name
12642
+ }),
12643
+ !writable && /* @__PURE__ */ jsx("span", {
12644
+ className: ItemBrowser_module_default.saveUpgrade,
12645
+ children: character.status === "expired" ? "Log in again" : "Allow saving"
12646
+ }),
12647
+ writable && String(character.id) === current && /* @__PURE__ */ jsx("span", {
12648
+ className: ItemBrowser_module_default.saveNote,
12649
+ children: "flying now"
12650
+ })
12651
+ ]
12652
+ }, character.id);
12653
+ };
12654
+ $[8] = choose;
12655
+ $[9] = current;
12656
+ $[10] = logIn;
12657
+ $[11] = target?.id;
12121
12658
  $[12] = t5;
12122
12659
  } else t5 = $[12];
12123
- let t6;
12124
- if ($[13] !== onCancel) {
12125
- t6 = /* @__PURE__ */ jsx("button", {
12660
+ const row = t5;
12661
+ const t6 = saving || void 0;
12662
+ const t7 = target === void 0 ? "fits-browser" : "fits-personal";
12663
+ let t8;
12664
+ if ($[13] !== t7) {
12665
+ t8 = /* @__PURE__ */ jsx(Icon, { name: t7 });
12666
+ $[13] = t7;
12667
+ $[14] = t8;
12668
+ } else t8 = $[14];
12669
+ const t9 = savedTo === void 0 ? `Save to ${where}` : `Saved to ${savedTo} ✓`;
12670
+ let t10;
12671
+ if ($[15] !== t9) {
12672
+ t10 = /* @__PURE__ */ jsx("span", {
12673
+ className: ItemBrowser_module_default.saveName,
12674
+ children: t9
12675
+ });
12676
+ $[15] = t9;
12677
+ $[16] = t10;
12678
+ } else t10 = $[16];
12679
+ let t11;
12680
+ if ($[17] !== disabled || $[18] !== onSave || $[19] !== t10 || $[20] !== t6 || $[21] !== t8) {
12681
+ t11 = /* @__PURE__ */ jsxs("button", {
12126
12682
  type: "button",
12127
- className: ItemBrowser_module_default.action,
12128
- onClick: onCancel,
12129
- children: "Cancel"
12683
+ className: `${ItemBrowser_module_default.action} ${ItemBrowser_module_default.saveMain}`,
12684
+ disabled,
12685
+ "aria-disabled": t6,
12686
+ onClick: onSave,
12687
+ children: [t8, t10]
12688
+ });
12689
+ $[17] = disabled;
12690
+ $[18] = onSave;
12691
+ $[19] = t10;
12692
+ $[20] = t6;
12693
+ $[21] = t8;
12694
+ $[22] = t11;
12695
+ } else t11 = $[22];
12696
+ let t12;
12697
+ if ($[23] !== menu) {
12698
+ t12 = /* @__PURE__ */ jsx("button", {
12699
+ type: "button",
12700
+ className: `${ItemBrowser_module_default.action} ${ItemBrowser_module_default.saveArrow}`,
12701
+ "aria-label": "Where to save",
12702
+ popoverTarget: menu
12130
12703
  });
12131
- $[13] = onCancel;
12132
- $[14] = t6;
12133
- } else t6 = $[14];
12134
- let t7;
12135
- if ($[15] !== name) {
12136
- t7 = name.trim();
12137
- $[15] = name;
12138
- $[16] = t7;
12139
- } else t7 = $[16];
12140
- const t8 = t7 === "";
12141
- let t9;
12142
- if ($[17] !== t8) {
12143
- t9 = /* @__PURE__ */ jsx("button", {
12144
- type: "submit",
12145
- className: ItemBrowser_module_default.action,
12146
- disabled: t8,
12147
- children: "Save"
12704
+ $[23] = menu;
12705
+ $[24] = t12;
12706
+ } else t12 = $[24];
12707
+ let t13;
12708
+ if ($[25] !== t11 || $[26] !== t12) {
12709
+ t13 = /* @__PURE__ */ jsxs("span", {
12710
+ className: ItemBrowser_module_default.saveAnchor,
12711
+ children: [t11, t12]
12148
12712
  });
12149
- $[17] = t8;
12150
- $[18] = t9;
12151
- } else t9 = $[18];
12152
- let t10;
12153
- if ($[19] !== t6 || $[20] !== t9) {
12154
- t10 = /* @__PURE__ */ jsxs("div", {
12155
- className: ItemBrowser_module_default.dialogButtons,
12156
- children: [t6, t9]
12713
+ $[25] = t11;
12714
+ $[26] = t12;
12715
+ $[27] = t13;
12716
+ } else t13 = $[27];
12717
+ const t14 = target === void 0;
12718
+ let t15;
12719
+ if ($[28] !== choose) {
12720
+ t15 = () => choose("browser");
12721
+ $[28] = choose;
12722
+ $[29] = t15;
12723
+ } else t15 = $[29];
12724
+ const t16 = target === void 0 && "✓";
12725
+ let t17;
12726
+ if ($[30] !== t16) {
12727
+ t17 = /* @__PURE__ */ jsx("span", {
12728
+ className: ItemBrowser_module_default.tick,
12729
+ children: t16
12157
12730
  });
12158
- $[19] = t6;
12159
- $[20] = t9;
12160
- $[21] = t10;
12161
- } else t10 = $[21];
12162
- let t11;
12163
- if ($[22] !== t10 || $[23] !== t2 || $[24] !== t3 || $[25] !== t5) {
12164
- t11 = /* @__PURE__ */ jsxs("form", {
12165
- className: ItemBrowser_module_default.form,
12166
- onSubmit: t2,
12731
+ $[30] = t16;
12732
+ $[31] = t17;
12733
+ } else t17 = $[31];
12734
+ let t18;
12735
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
12736
+ t18 = /* @__PURE__ */ jsx(Icon, { name: "fits-browser" });
12737
+ $[32] = t18;
12738
+ } else t18 = $[32];
12739
+ let t19;
12740
+ if ($[33] !== t14 || $[34] !== t15 || $[35] !== t17) {
12741
+ t19 = /* @__PURE__ */ jsxs("button", {
12742
+ type: "button",
12743
+ role: "menuitemradio",
12744
+ "aria-checked": t14,
12745
+ onClick: t15,
12167
12746
  children: [
12168
- t3,
12169
- t5,
12170
- t10
12747
+ t17,
12748
+ t18,
12749
+ "This browser"
12171
12750
  ]
12172
12751
  });
12173
- $[22] = t10;
12174
- $[23] = t2;
12175
- $[24] = t3;
12176
- $[25] = t5;
12177
- $[26] = t11;
12178
- } else t11 = $[26];
12179
- return t11;
12180
- }
12181
- function _temp$5(event_0) {
12182
- return event_0.currentTarget.select();
12752
+ $[33] = t14;
12753
+ $[34] = t15;
12754
+ $[35] = t17;
12755
+ $[36] = t19;
12756
+ } else t19 = $[36];
12757
+ let t20;
12758
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
12759
+ t20 = /* @__PURE__ */ jsx("hr", { className: ItemBrowser_module_default.menuRule });
12760
+ $[37] = t20;
12761
+ } else t20 = $[37];
12762
+ let t21;
12763
+ if ($[38] !== characters || $[39] !== row) {
12764
+ t21 = characters?.map(row);
12765
+ $[38] = characters;
12766
+ $[39] = row;
12767
+ $[40] = t21;
12768
+ } else t21 = $[40];
12769
+ let t22;
12770
+ if ($[41] !== characters?.length || $[42] !== logIn || $[43] !== login) {
12771
+ t22 = characters?.length === 0 && login && /* @__PURE__ */ jsxs("button", {
12772
+ type: "button",
12773
+ role: "menuitem",
12774
+ onClick: () => logIn(true),
12775
+ children: [/* @__PURE__ */ jsx("span", { className: ItemBrowser_module_default.tick }), /* @__PURE__ */ jsx("span", {
12776
+ className: ItemBrowser_module_default.saveUpgrade,
12777
+ children: "Log in and allow saving"
12778
+ })]
12779
+ });
12780
+ $[41] = characters?.length;
12781
+ $[42] = logIn;
12782
+ $[43] = login;
12783
+ $[44] = t22;
12784
+ } else t22 = $[44];
12785
+ let t23;
12786
+ if ($[45] !== menu || $[46] !== t19 || $[47] !== t21 || $[48] !== t22) {
12787
+ t23 = /* @__PURE__ */ jsxs("div", {
12788
+ id: menu,
12789
+ className: `${ItemBrowser_module_default.menu} ${ItemBrowser_module_default.saveMenu}`,
12790
+ popover: "auto",
12791
+ role: "menu",
12792
+ children: [
12793
+ t19,
12794
+ t20,
12795
+ t21,
12796
+ t22
12797
+ ]
12798
+ });
12799
+ $[45] = menu;
12800
+ $[46] = t19;
12801
+ $[47] = t21;
12802
+ $[48] = t22;
12803
+ $[49] = t23;
12804
+ } else t23 = $[49];
12805
+ let t24;
12806
+ if ($[50] !== t13 || $[51] !== t23) {
12807
+ t24 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t13, t23] });
12808
+ $[50] = t13;
12809
+ $[51] = t23;
12810
+ $[52] = t24;
12811
+ } else t24 = $[52];
12812
+ return t24;
12183
12813
  }
12184
12814
  function ImportForm(t0) {
12185
12815
  const $ = c(33);
@@ -12194,7 +12824,7 @@ function ImportForm(t0) {
12194
12824
  if ($[0] !== draft.text) {
12195
12825
  t1 = () => {
12196
12826
  if (draft.text !== "") return;
12197
- Promise.resolve().then(_temp2$3).then((clipboard) => setText((typed) => typed || clipboard), _temp3$1);
12827
+ Promise.resolve().then(_temp$5).then((clipboard) => setText((typed) => typed || clipboard), _temp2$3);
12198
12828
  };
12199
12829
  t2 = [draft.text];
12200
12830
  $[0] = draft.text;
@@ -12333,8 +12963,8 @@ function ImportForm(t0) {
12333
12963
  return t14;
12334
12964
  }
12335
12965
  /** Fits a mutated item from the game in the first free slot of its rack, rolled as it is. */
12336
- function _temp3$1() {}
12337
- function _temp2$3() {
12966
+ function _temp2$3() {}
12967
+ function _temp$5() {
12338
12968
  return navigator.clipboard.readText();
12339
12969
  }
12340
12970
  async function fitMutated(engine, store, typeId, itemId) {
@@ -12345,10 +12975,10 @@ async function fitMutated(engine, store, typeId, itemId) {
12345
12975
  const noFits = [];
12346
12976
  const SHIPS_MARKET_GROUP_ID = 4;
12347
12977
  /** The Hulls & Fits tab of the `ItemBrowser`: EVE's hulls by group and race, with the fits saved for each. */
12348
- function HullsAndFits(t0) {
12349
- const $ = c(103);
12350
- const { noHullSelected } = t0;
12351
- const fitShipId = useFit().ship.type_id;
12978
+ function HullsAndFits() {
12979
+ const $ = c(115);
12980
+ const fitShipId = useSnapshotIfAny()?.fit.ship.type_id;
12981
+ const noHullSelected = fitShipId === void 0;
12352
12982
  const images = useImages();
12353
12983
  const store = useFitStore();
12354
12984
  const missingSkills = useMissingSkills();
@@ -12356,7 +12986,9 @@ function HullsAndFits(t0) {
12356
12986
  const { show: showInfo } = useShowInfo();
12357
12987
  const { open, menu } = useContextMenu();
12358
12988
  const { copy, dialog: copyDialog } = useCopyFit();
12989
+ const { target: saveTarget, save: saveFit, dialog: saveDialog } = useSaveFit();
12359
12990
  const [deleting, setDeleting] = useState();
12991
+ const [deleteFailed, setDeleteFailed] = useState(false);
12360
12992
  const personal = usePersonalFits();
12361
12993
  const { start, end } = useDrag();
12362
12994
  const [search, setSearch] = useState("");
@@ -12365,56 +12997,56 @@ function HullsAndFits(t0) {
12365
12997
  const [currentHull, setCurrentHull] = useState(false);
12366
12998
  const [flyable, setFlyable] = useState(false);
12367
12999
  const [collapses, setCollapses] = useState(0);
12368
- let t1;
13000
+ let t0;
12369
13001
  if ($[0] !== search) {
12370
- t1 = search.trim().toLowerCase();
13002
+ t0 = search.trim().toLowerCase();
12371
13003
  $[0] = search;
12372
- $[1] = t1;
12373
- } else t1 = $[1];
12374
- const query = t1;
13004
+ $[1] = t0;
13005
+ } else t0 = $[1];
13006
+ const query = t0;
12375
13007
  const anySource = browserFits || personalFits;
12376
13008
  const currentShipId = currentHull && !noHullSelected ? fitShipId : void 0;
12377
- let t2;
13009
+ let t1;
12378
13010
  if ($[2] !== query) {
12379
- t2 = (name) => (name ?? "").toLowerCase().includes(query);
13011
+ t1 = (name) => (name ?? "").toLowerCase().includes(query);
12380
13012
  $[2] = query;
12381
- $[3] = t2;
12382
- } else t2 = $[3];
12383
- const matches = t2;
12384
- let t3;
13013
+ $[3] = t1;
13014
+ } else t1 = $[3];
13015
+ const matches = t1;
13016
+ let t2;
12385
13017
  if ($[4] !== anySource || $[5] !== browserFits || $[6] !== fits || $[7] !== personal.fits || $[8] !== personalFits) {
12386
13018
  const listed = [...!anySource || browserFits ? fits.map(_temp$4) : [], ...!anySource || personalFits ? personal.fits.map(_temp2$2) : []].toSorted(_temp3);
12387
- t3 = Map.groupBy(listed, _temp4);
13019
+ t2 = Map.groupBy(listed, _temp4);
12388
13020
  $[4] = anySource;
12389
13021
  $[5] = browserFits;
12390
13022
  $[6] = fits;
12391
13023
  $[7] = personal.fits;
12392
13024
  $[8] = personalFits;
12393
- $[9] = t3;
12394
- } else t3 = $[9];
12395
- const fitsByHull = t3;
12396
- let t4;
13025
+ $[9] = t2;
13026
+ } else t2 = $[9];
13027
+ const fitsByHull = t2;
13028
+ let t3;
12397
13029
  if ($[10] !== fits) {
12398
- t4 = Map.groupBy(fits, _temp5);
13030
+ t3 = Map.groupBy(fits, _temp5);
12399
13031
  $[10] = fits;
12400
- $[11] = t4;
12401
- } else t4 = $[11];
12402
- let t5;
13032
+ $[11] = t3;
13033
+ } else t3 = $[11];
13034
+ let t4;
12403
13035
  if ($[12] !== personal.fits) {
12404
- t5 = Map.groupBy(personal.fits, _temp6);
13036
+ t4 = Map.groupBy(personal.fits, _temp6);
12405
13037
  $[12] = personal.fits;
12406
- $[13] = t5;
12407
- } else t5 = $[13];
12408
- let t6;
13038
+ $[13] = t4;
13039
+ } else t4 = $[13];
13040
+ let t5;
12409
13041
  if ($[14] !== fitsByHull || $[15] !== flyable || $[16] !== matches || $[17] !== missingSkills) {
12410
- t6 = (ship) => {
13042
+ t5 = (ship) => {
12411
13043
  const saved = fitsByHull.get(ship.id) ?? noFits;
12412
- const kept = flyable ? saved.filter((t7) => {
12413
- const { fit: fit_4 } = t7;
13044
+ const kept = flyable ? saved.filter((t6) => {
13045
+ const { fit: fit_4 } = t6;
12414
13046
  return missingSkills(fit_4).length === 0;
12415
13047
  }) : saved;
12416
- return matches(ship.name) ? kept : kept.filter((t8) => {
12417
- const { fit: fit_5 } = t8;
13048
+ return matches(ship.name) ? kept : kept.filter((t7) => {
13049
+ const { fit: fit_5 } = t7;
12418
13050
  return matches(fit_5.name);
12419
13051
  });
12420
13052
  };
@@ -12422,30 +13054,30 @@ function HullsAndFits(t0) {
12422
13054
  $[15] = flyable;
12423
13055
  $[16] = matches;
12424
13056
  $[17] = missingSkills;
12425
- $[18] = t6;
12426
- } else t6 = $[18];
12427
- let t7;
12428
- if ($[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
12429
- t7 = {
12430
- browserByHull: t4,
12431
- personalByHull: t5,
12432
- shownFits: t6
13057
+ $[18] = t5;
13058
+ } else t5 = $[18];
13059
+ let t6;
13060
+ if ($[19] !== t3 || $[20] !== t4 || $[21] !== t5) {
13061
+ t6 = {
13062
+ browserByHull: t3,
13063
+ personalByHull: t4,
13064
+ shownFits: t5
12433
13065
  };
12434
- $[19] = t4;
12435
- $[20] = t5;
12436
- $[21] = t6;
12437
- $[22] = t7;
12438
- } else t7 = $[22];
12439
- const { browserByHull, personalByHull, shownFits } = t7;
12440
- let t8;
13066
+ $[19] = t3;
13067
+ $[20] = t4;
13068
+ $[21] = t5;
13069
+ $[22] = t6;
13070
+ } else t6 = $[22];
13071
+ const { browserByHull, personalByHull, shownFits } = t6;
13072
+ let t7;
12441
13073
  bb0: {
12442
13074
  if (query === "" && !currentHull && !anySource && !flyable) {
12443
- t8 = void 0;
13075
+ t7 = void 0;
12444
13076
  break bb0;
12445
13077
  }
12446
- let t9;
13078
+ let t8;
12447
13079
  if ($[23] !== anySource || $[24] !== currentHull || $[25] !== currentShipId || $[26] !== flyable || $[27] !== missingSkills || $[28] !== query || $[29] !== shownFits) {
12448
- t9 = (ship_0) => {
13080
+ t8 = (ship_0) => {
12449
13081
  if (currentShipId !== void 0 && ship_0.id !== currentShipId) return false;
12450
13082
  if (flyable && missingSkills([ship_0.id]).length > 0) return false;
12451
13083
  const shown = shownFits(ship_0);
@@ -12459,24 +13091,24 @@ function HullsAndFits(t0) {
12459
13091
  $[27] = missingSkills;
12460
13092
  $[28] = query;
12461
13093
  $[29] = shownFits;
12462
- $[30] = t9;
12463
- } else t9 = $[30];
12464
- t8 = t9;
13094
+ $[30] = t8;
13095
+ } else t8 = $[30];
13096
+ t7 = t8;
12465
13097
  }
12466
- const groups = useHullTree(t8);
12467
- let t9;
13098
+ const groups = useHullTree(t7);
13099
+ let t8;
12468
13100
  if ($[31] !== store) {
12469
- t9 = (shipTypeId) => store.replace({
13101
+ t8 = (shipTypeId) => store.replace({
12470
13102
  ship: { type_id: shipTypeId },
12471
13103
  items: []
12472
13104
  });
12473
13105
  $[31] = store;
12474
- $[32] = t9;
12475
- } else t9 = $[32];
12476
- const simulate = t9;
12477
- let t10;
13106
+ $[32] = t8;
13107
+ } else t8 = $[32];
13108
+ const simulate = t8;
13109
+ let t9;
12478
13110
  if ($[33] !== open || $[34] !== showInfo || $[35] !== simulate) {
12479
- t10 = (event, ship_1) => {
13111
+ t9 = (event, ship_1) => {
12480
13112
  const anchor = event.currentTarget;
12481
13113
  open(event, [
12482
13114
  {
@@ -12497,19 +13129,23 @@ function HullsAndFits(t0) {
12497
13129
  $[33] = open;
12498
13130
  $[34] = showInfo;
12499
13131
  $[35] = simulate;
12500
- $[36] = t10;
12501
- } else t10 = $[36];
12502
- const hullMenu = t10;
12503
- let t11;
12504
- if ($[37] !== copy || $[38] !== open || $[39] !== store) {
12505
- t11 = (event_0, t12) => {
12506
- const { fit: fit_6, kind } = t12;
13132
+ $[36] = t9;
13133
+ } else t9 = $[36];
13134
+ const hullMenu = t9;
13135
+ let t10;
13136
+ if ($[37] !== copy || $[38] !== open || $[39] !== personal.remove || $[40] !== saveFit || $[41] !== saveTarget || $[42] !== store) {
13137
+ t10 = (event_0, t11) => {
13138
+ const { fit: fit_6, kind } = t11;
12507
13139
  open(event_0, [
12508
13140
  {
12509
13141
  label: "Simulate Fitting",
12510
13142
  onSelect: () => store.replace(fit_6)
12511
13143
  },
12512
13144
  "separator",
13145
+ kind === "fits-browser" && saveTarget !== void 0 && {
13146
+ label: `Save to ${saveTarget.name}`,
13147
+ onSelect: () => saveFit(fit_6)
13148
+ },
12513
13149
  {
12514
13150
  label: "Copy as EFT",
12515
13151
  onSelect: () => copy(fit_6, "eft")
@@ -12519,150 +13155,156 @@ function HullsAndFits(t0) {
12519
13155
  onSelect: () => copy(fit_6, "esf")
12520
13156
  },
12521
13157
  "separator",
12522
- kind === "fits-browser" && {
13158
+ (kind === "fits-browser" || personal.remove !== void 0) && {
12523
13159
  label: "Delete Fitting",
12524
- onSelect: () => setDeleting(fit_6)
13160
+ onSelect: () => setDeleting({
13161
+ fit: fit_6,
13162
+ kind
13163
+ })
12525
13164
  }
12526
13165
  ]);
12527
13166
  };
12528
13167
  $[37] = copy;
12529
13168
  $[38] = open;
12530
- $[39] = store;
12531
- $[40] = t11;
12532
- } else t11 = $[40];
12533
- const fitMenu = t11;
13169
+ $[39] = personal.remove;
13170
+ $[40] = saveFit;
13171
+ $[41] = saveTarget;
13172
+ $[42] = store;
13173
+ $[43] = t10;
13174
+ } else t10 = $[43];
13175
+ const fitMenu = t10;
13176
+ let t11;
13177
+ if ($[44] !== collapses) {
13178
+ t11 = () => setCollapses(collapses + 1);
13179
+ $[44] = collapses;
13180
+ $[45] = t11;
13181
+ } else t11 = $[45];
12534
13182
  let t12;
12535
- if ($[41] !== collapses) {
12536
- t12 = () => setCollapses(collapses + 1);
12537
- $[41] = collapses;
12538
- $[42] = t12;
12539
- } else t12 = $[42];
12540
- let t13;
12541
- if ($[43] !== search || $[44] !== t12) {
12542
- t13 = /* @__PURE__ */ jsx(Search, {
13183
+ if ($[46] !== search || $[47] !== t11) {
13184
+ t12 = /* @__PURE__ */ jsx(Search, {
12543
13185
  value: search,
12544
13186
  onChange: setSearch,
12545
- onCollapse: t12
13187
+ onCollapse: t11
12546
13188
  });
12547
- $[43] = search;
12548
- $[44] = t12;
12549
- $[45] = t13;
12550
- } else t13 = $[45];
12551
- let t14;
12552
- if ($[46] !== browserFits) {
12553
- t14 = /* @__PURE__ */ jsx(FilterToggle, {
13189
+ $[46] = search;
13190
+ $[47] = t11;
13191
+ $[48] = t12;
13192
+ } else t12 = $[48];
13193
+ let t13;
13194
+ if ($[49] !== browserFits) {
13195
+ t13 = /* @__PURE__ */ jsx(FilterToggle, {
12554
13196
  icon: "fits-browser",
12555
13197
  label: "Browser Fittings",
12556
13198
  pressed: browserFits,
12557
13199
  onPressedChange: setBrowserFits
12558
13200
  });
12559
- $[46] = browserFits;
12560
- $[47] = t14;
12561
- } else t14 = $[47];
12562
- let t15;
12563
- if ($[48] !== personalFits) {
12564
- t15 = /* @__PURE__ */ jsx(FilterToggle, {
13201
+ $[49] = browserFits;
13202
+ $[50] = t13;
13203
+ } else t13 = $[50];
13204
+ let t14;
13205
+ if ($[51] !== personalFits) {
13206
+ t14 = /* @__PURE__ */ jsx(FilterToggle, {
12565
13207
  icon: "fits-personal",
12566
13208
  label: "Personal Fittings",
12567
13209
  pressed: personalFits,
12568
13210
  onPressedChange: setPersonalFits
12569
13211
  });
12570
- $[48] = personalFits;
12571
- $[49] = t15;
12572
- } else t15 = $[49];
13212
+ $[51] = personalFits;
13213
+ $[52] = t14;
13214
+ } else t14 = $[52];
13215
+ let t15;
12573
13216
  let t16;
12574
13217
  let t17;
12575
- let t18;
12576
- if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
12577
- t16 = /* @__PURE__ */ jsx(FilterToggle, {
13218
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
13219
+ t15 = /* @__PURE__ */ jsx(FilterToggle, {
12578
13220
  icon: "fits-corporation",
12579
13221
  label: "Corporation Fittings"
12580
13222
  });
12581
- t17 = /* @__PURE__ */ jsx(FilterToggle, {
13223
+ t16 = /* @__PURE__ */ jsx(FilterToggle, {
12582
13224
  icon: "fits-alliance",
12583
13225
  label: "Alliance Fittings"
12584
13226
  });
12585
- t18 = /* @__PURE__ */ jsx(FilterToggle, {
13227
+ t17 = /* @__PURE__ */ jsx(FilterToggle, {
12586
13228
  icon: "fits-community",
12587
13229
  label: "Community Fittings"
12588
13230
  });
12589
- $[50] = t16;
12590
- $[51] = t17;
12591
- $[52] = t18;
13231
+ $[53] = t15;
13232
+ $[54] = t16;
13233
+ $[55] = t17;
12592
13234
  } else {
12593
- t16 = $[50];
12594
- t17 = $[51];
12595
- t18 = $[52];
13235
+ t15 = $[53];
13236
+ t16 = $[54];
13237
+ t17 = $[55];
12596
13238
  }
12597
- let t19;
12598
- if ($[53] !== currentHull || $[54] !== noHullSelected) {
12599
- t19 = /* @__PURE__ */ jsx(FilterToggle, {
13239
+ let t18;
13240
+ if ($[56] !== currentHull || $[57] !== noHullSelected) {
13241
+ t18 = /* @__PURE__ */ jsx(FilterToggle, {
12600
13242
  icon: "current-hull",
12601
13243
  label: "Current Hull",
12602
13244
  pressed: currentHull,
12603
13245
  disabled: noHullSelected,
12604
13246
  onPressedChange: setCurrentHull
12605
13247
  });
12606
- $[53] = currentHull;
12607
- $[54] = noHullSelected;
12608
- $[55] = t19;
12609
- } else t19 = $[55];
12610
- let t20;
12611
- if ($[56] !== flyable) {
12612
- t20 = /* @__PURE__ */ jsx(FilterToggle, {
13248
+ $[56] = currentHull;
13249
+ $[57] = noHullSelected;
13250
+ $[58] = t18;
13251
+ } else t18 = $[58];
13252
+ let t19;
13253
+ if ($[59] !== flyable) {
13254
+ t19 = /* @__PURE__ */ jsx(FilterToggle, {
12613
13255
  icon: "skills",
12614
13256
  label: "Skills",
12615
13257
  pressed: flyable,
12616
13258
  onPressedChange: setFlyable
12617
13259
  });
12618
- $[56] = flyable;
12619
- $[57] = t20;
12620
- } else t20 = $[57];
12621
- let t21;
12622
- if ($[58] !== t14 || $[59] !== t15 || $[60] !== t19 || $[61] !== t20) {
12623
- t21 = /* @__PURE__ */ jsxs("fieldset", {
13260
+ $[59] = flyable;
13261
+ $[60] = t19;
13262
+ } else t19 = $[60];
13263
+ let t20;
13264
+ if ($[61] !== t13 || $[62] !== t14 || $[63] !== t18 || $[64] !== t19) {
13265
+ t20 = /* @__PURE__ */ jsxs("fieldset", {
12624
13266
  className: ItemBrowser_module_default.filters,
12625
13267
  "aria-label": "Filters",
12626
13268
  children: [
13269
+ t13,
12627
13270
  t14,
12628
13271
  t15,
12629
13272
  t16,
12630
13273
  t17,
12631
13274
  t18,
12632
- t19,
12633
- t20
13275
+ t19
12634
13276
  ]
12635
13277
  });
12636
- $[58] = t14;
12637
- $[59] = t15;
12638
- $[60] = t19;
12639
- $[61] = t20;
12640
- $[62] = t21;
12641
- } else t21 = $[62];
12642
- let t22;
12643
- if ($[63] !== groups.length || $[64] !== personal.character || $[65] !== personalFits) {
12644
- t22 = personalFits && personal.character?.canReadFits !== true ? /* @__PURE__ */ jsx("p", {
13278
+ $[61] = t13;
13279
+ $[62] = t14;
13280
+ $[63] = t18;
13281
+ $[64] = t19;
13282
+ $[65] = t20;
13283
+ } else t20 = $[65];
13284
+ let t21;
13285
+ if ($[66] !== groups.length || $[67] !== personal.character || $[68] !== personalFits) {
13286
+ t21 = personalFits && personal.character?.canReadFits !== true ? /* @__PURE__ */ jsx("p", {
12645
13287
  className: ItemBrowser_module_default.empty,
12646
13288
  children: personal.character === void 0 ? "Log in or pick a character with the Character button" : "Log in again with the Character button to see fittings"
12647
13289
  }) : groups.length === 0 ? /* @__PURE__ */ jsx("p", {
12648
13290
  className: ItemBrowser_module_default.empty,
12649
13291
  children: "No hulls found"
12650
13292
  }) : null;
12651
- $[63] = groups.length;
12652
- $[64] = personal.character;
12653
- $[65] = personalFits;
12654
- $[66] = t22;
12655
- } else t22 = $[66];
12656
- let t23;
12657
- if ($[67] !== browserByHull || $[68] !== collapses || $[69] !== end || $[70] !== fitMenu || $[71] !== groups || $[72] !== hullMenu || $[73] !== images || $[74] !== personalByHull || $[75] !== shownFits || $[76] !== simulate || $[77] !== start || $[78] !== store) {
12658
- t23 = groups.length > 0 && /* @__PURE__ */ jsx(TreeList, {
13293
+ $[66] = groups.length;
13294
+ $[67] = personal.character;
13295
+ $[68] = personalFits;
13296
+ $[69] = t21;
13297
+ } else t21 = $[69];
13298
+ let t22;
13299
+ if ($[70] !== browserByHull || $[71] !== collapses || $[72] !== end || $[73] !== fitMenu || $[74] !== groups || $[75] !== hullMenu || $[76] !== images || $[77] !== personalByHull || $[78] !== shownFits || $[79] !== simulate || $[80] !== start || $[81] !== store) {
13300
+ t22 = groups.length > 0 && /* @__PURE__ */ jsx(TreeList, {
12659
13301
  label: "Hulls",
12660
- children: groups.map((t24) => {
12661
- const { group, races } = t24;
13302
+ children: groups.map((t23) => {
13303
+ const { group, races } = t23;
12662
13304
  return /* @__PURE__ */ jsx(TreeGroup, {
12663
13305
  label: group.name,
12664
- children: () => races.map((t25) => {
12665
- const { race, factionId, ships } = t25;
13306
+ children: () => races.map((t24) => {
13307
+ const { race, factionId, ships } = t24;
12666
13308
  return /* @__PURE__ */ jsx(TreeGroup, {
12667
13309
  label: `${raceName(race)} [${ships.length}]`,
12668
13310
  icon: factionId === void 0 ? images.marketGroupIcon(SHIPS_MARKET_GROUP_ID) : images.factionIcon(factionId),
@@ -12720,116 +13362,167 @@ function HullsAndFits(t0) {
12720
13362
  }, group.id);
12721
13363
  })
12722
13364
  }, collapses);
12723
- $[67] = browserByHull;
12724
- $[68] = collapses;
12725
- $[69] = end;
12726
- $[70] = fitMenu;
12727
- $[71] = groups;
12728
- $[72] = hullMenu;
12729
- $[73] = images;
12730
- $[74] = personalByHull;
12731
- $[75] = shownFits;
12732
- $[76] = simulate;
12733
- $[77] = start;
12734
- $[78] = store;
12735
- $[79] = t23;
12736
- } else t23 = $[79];
12737
- let t24;
12738
- if ($[80] !== t22 || $[81] !== t23) {
12739
- t24 = /* @__PURE__ */ jsxs("div", {
13365
+ $[70] = browserByHull;
13366
+ $[71] = collapses;
13367
+ $[72] = end;
13368
+ $[73] = fitMenu;
13369
+ $[74] = groups;
13370
+ $[75] = hullMenu;
13371
+ $[76] = images;
13372
+ $[77] = personalByHull;
13373
+ $[78] = shownFits;
13374
+ $[79] = simulate;
13375
+ $[80] = start;
13376
+ $[81] = store;
13377
+ $[82] = t22;
13378
+ } else t22 = $[82];
13379
+ let t23;
13380
+ if ($[83] !== t21 || $[84] !== t22) {
13381
+ t23 = /* @__PURE__ */ jsxs("div", {
12740
13382
  className: ItemBrowser_module_default.tree,
12741
- children: [t22, t23]
13383
+ children: [t21, t22]
12742
13384
  });
12743
- $[80] = t22;
12744
- $[81] = t23;
12745
- $[82] = t24;
12746
- } else t24 = $[82];
12747
- const t25 = deleting !== void 0;
12748
- let t26;
12749
- if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
12750
- t26 = () => setDeleting(void 0);
12751
- $[83] = t26;
12752
- } else t26 = $[83];
12753
- const t27 = deleting?.name || "Unnamed";
13385
+ $[83] = t21;
13386
+ $[84] = t22;
13387
+ $[85] = t23;
13388
+ } else t23 = $[85];
13389
+ const t24 = deleting !== void 0;
13390
+ let t25;
13391
+ if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
13392
+ t25 = () => setDeleting(void 0);
13393
+ $[86] = t25;
13394
+ } else t25 = $[86];
13395
+ const t26 = deleting?.fit.name || "Unnamed";
13396
+ const t27 = deleting?.kind === "fits-personal" ? `${personal.character?.name} in EVE` : "this browser";
12754
13397
  let t28;
12755
- if ($[84] !== t27) {
13398
+ if ($[87] !== t26 || $[88] !== t27) {
12756
13399
  t28 = /* @__PURE__ */ jsxs("p", { children: [
12757
13400
  "Delete the fit \"",
13401
+ t26,
13402
+ "\" from",
13403
+ " ",
12758
13404
  t27,
12759
- "\" from this browser?"
13405
+ "?"
12760
13406
  ] });
12761
- $[84] = t27;
12762
- $[85] = t28;
12763
- } else t28 = $[85];
13407
+ $[87] = t26;
13408
+ $[88] = t27;
13409
+ $[89] = t28;
13410
+ } else t28 = $[89];
12764
13411
  let t29;
12765
- if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
13412
+ if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
12766
13413
  t29 = /* @__PURE__ */ jsx("button", {
12767
13414
  type: "button",
12768
13415
  className: ItemBrowser_module_default.action,
12769
13416
  onClick: () => setDeleting(void 0),
12770
13417
  children: "Cancel"
12771
13418
  });
12772
- $[86] = t29;
12773
- } else t29 = $[86];
13419
+ $[90] = t29;
13420
+ } else t29 = $[90];
12774
13421
  let t30;
12775
- if ($[87] !== deleting || $[88] !== remove) {
13422
+ if ($[91] !== deleting || $[92] !== personal || $[93] !== remove) {
12776
13423
  t30 = /* @__PURE__ */ jsxs("div", {
12777
13424
  className: ItemBrowser_module_default.dialogButtons,
12778
13425
  children: [t29, /* @__PURE__ */ jsx("button", {
12779
13426
  type: "button",
12780
13427
  className: ItemBrowser_module_default.action,
12781
13428
  onClick: () => {
12782
- if (deleting) remove(deleting);
13429
+ if (deleting?.kind === "fits-browser") remove(deleting.fit);
13430
+ else if (deleting) personal.remove?.(deleting.fit).catch((error) => {
13431
+ console.error(error);
13432
+ setDeleteFailed(true);
13433
+ });
12783
13434
  setDeleting(void 0);
12784
13435
  },
12785
13436
  children: "Delete"
12786
13437
  })]
12787
13438
  });
12788
- $[87] = deleting;
12789
- $[88] = remove;
12790
- $[89] = t30;
12791
- } else t30 = $[89];
13439
+ $[91] = deleting;
13440
+ $[92] = personal;
13441
+ $[93] = remove;
13442
+ $[94] = t30;
13443
+ } else t30 = $[94];
12792
13444
  let t31;
12793
- if ($[90] !== t28 || $[91] !== t30) {
13445
+ if ($[95] !== t28 || $[96] !== t30) {
12794
13446
  t31 = /* @__PURE__ */ jsxs("div", {
12795
13447
  className: ItemBrowser_module_default.confirm,
12796
13448
  children: [t28, t30]
12797
13449
  });
12798
- $[90] = t28;
12799
- $[91] = t30;
12800
- $[92] = t31;
12801
- } else t31 = $[92];
13450
+ $[95] = t28;
13451
+ $[96] = t30;
13452
+ $[97] = t31;
13453
+ } else t31 = $[97];
12802
13454
  let t32;
12803
- if ($[93] !== t25 || $[94] !== t31) {
13455
+ if ($[98] !== t24 || $[99] !== t31) {
12804
13456
  t32 = /* @__PURE__ */ jsx(Dialog, {
12805
- open: t25,
13457
+ open: t24,
12806
13458
  title: "Delete Fitting?",
12807
- onClose: t26,
13459
+ onClose: t25,
12808
13460
  children: t31
12809
13461
  });
12810
- $[93] = t25;
12811
- $[94] = t31;
12812
- $[95] = t32;
12813
- } else t32 = $[95];
13462
+ $[98] = t24;
13463
+ $[99] = t31;
13464
+ $[100] = t32;
13465
+ } else t32 = $[100];
12814
13466
  let t33;
12815
- if ($[96] !== copyDialog || $[97] !== menu || $[98] !== t13 || $[99] !== t21 || $[100] !== t24 || $[101] !== t32) {
12816
- t33 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
12817
- t13,
12818
- t21,
12819
- t24,
13467
+ if ($[101] === Symbol.for("react.memo_cache_sentinel")) {
13468
+ t33 = () => setDeleteFailed(false);
13469
+ $[101] = t33;
13470
+ } else t33 = $[101];
13471
+ let t34;
13472
+ if ($[102] === Symbol.for("react.memo_cache_sentinel")) {
13473
+ t34 = /* @__PURE__ */ jsx("p", { children: "EVE did not delete this fit. Please try again." });
13474
+ $[102] = t34;
13475
+ } else t34 = $[102];
13476
+ let t35;
13477
+ if ($[103] === Symbol.for("react.memo_cache_sentinel")) {
13478
+ t35 = /* @__PURE__ */ jsxs("div", {
13479
+ className: ItemBrowser_module_default.confirm,
13480
+ children: [t34, /* @__PURE__ */ jsx("div", {
13481
+ className: ItemBrowser_module_default.dialogButtons,
13482
+ children: /* @__PURE__ */ jsx("button", {
13483
+ type: "button",
13484
+ className: ItemBrowser_module_default.action,
13485
+ onClick: () => setDeleteFailed(false),
13486
+ children: "Close"
13487
+ })
13488
+ })]
13489
+ });
13490
+ $[103] = t35;
13491
+ } else t35 = $[103];
13492
+ let t36;
13493
+ if ($[104] !== deleteFailed) {
13494
+ t36 = /* @__PURE__ */ jsx(Dialog, {
13495
+ open: deleteFailed,
13496
+ title: "Delete Fitting",
13497
+ onClose: t33,
13498
+ children: t35
13499
+ });
13500
+ $[104] = deleteFailed;
13501
+ $[105] = t36;
13502
+ } else t36 = $[105];
13503
+ let t37;
13504
+ if ($[106] !== copyDialog || $[107] !== menu || $[108] !== saveDialog || $[109] !== t12 || $[110] !== t20 || $[111] !== t23 || $[112] !== t32 || $[113] !== t36) {
13505
+ t37 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13506
+ t12,
13507
+ t20,
13508
+ t23,
12820
13509
  menu,
12821
13510
  copyDialog,
12822
- t32
13511
+ saveDialog,
13512
+ t32,
13513
+ t36
12823
13514
  ] });
12824
- $[96] = copyDialog;
12825
- $[97] = menu;
12826
- $[98] = t13;
12827
- $[99] = t21;
12828
- $[100] = t24;
12829
- $[101] = t32;
12830
- $[102] = t33;
12831
- } else t33 = $[102];
12832
- return t33;
13515
+ $[106] = copyDialog;
13516
+ $[107] = menu;
13517
+ $[108] = saveDialog;
13518
+ $[109] = t12;
13519
+ $[110] = t20;
13520
+ $[111] = t23;
13521
+ $[112] = t32;
13522
+ $[113] = t36;
13523
+ $[114] = t37;
13524
+ } else t37 = $[114];
13525
+ return t37;
12833
13526
  }
12834
13527
  function _temp6(fit_3) {
12835
13528
  return fit_3.ship.type_id;
@@ -13026,10 +13719,9 @@ const kindLabels = {
13026
13719
  booster: "Booster"
13027
13720
  };
13028
13721
  /** The Implants tab of the `ItemBrowser`: implants and boosters by market group or by slot. */
13029
- function Implants(t0) {
13722
+ function Implants() {
13030
13723
  const $ = c(61);
13031
- const { noHullSelected } = t0;
13032
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
13724
+ const { actions, clear, overlays } = useTypeActions();
13033
13725
  const placement = usePlacement();
13034
13726
  const missingSkills = useMissingSkills();
13035
13727
  const [search, setSearch] = useState("");
@@ -13053,22 +13745,22 @@ function Implants(t0) {
13053
13745
  setCollapses(collapses + 1);
13054
13746
  }
13055
13747
  }
13056
- let t1;
13748
+ let t0;
13057
13749
  if ($[0] !== search) {
13058
- t1 = search.trim().toLowerCase();
13750
+ t0 = search.trim().toLowerCase();
13059
13751
  $[0] = search;
13060
- $[1] = t1;
13061
- } else t1 = $[1];
13062
- const query = t1;
13063
- let t2;
13752
+ $[1] = t0;
13753
+ } else t0 = $[1];
13754
+ const query = t0;
13755
+ let t1;
13064
13756
  bb0: {
13065
13757
  if (query === "" && kinds.size === 0 && !flyable) {
13066
- t2 = void 0;
13758
+ t1 = void 0;
13067
13759
  break bb0;
13068
13760
  }
13069
- let t3;
13761
+ let t2;
13070
13762
  if ($[2] !== flyable || $[3] !== kinds || $[4] !== missingSkills || $[5] !== placement || $[6] !== query) {
13071
- t3 = (type) => {
13763
+ t2 = (type) => {
13072
13764
  if (kinds.size > 0) {
13073
13765
  const place = placement(type)?.type;
13074
13766
  if (place !== "implant" && place !== "booster") return false;
@@ -13082,75 +13774,75 @@ function Implants(t0) {
13082
13774
  $[4] = missingSkills;
13083
13775
  $[5] = placement;
13084
13776
  $[6] = query;
13085
- $[7] = t3;
13086
- } else t3 = $[7];
13087
- t2 = t3;
13777
+ $[7] = t2;
13778
+ } else t2 = $[7];
13779
+ t1 = t2;
13088
13780
  }
13089
- const keep = t2;
13781
+ const keep = t1;
13090
13782
  const tree = useImplantTree(view === "slot" || query === "" ? keep : void 0);
13091
13783
  const found = useImplantSearch(view === "market" && query !== "" ? keep : void 0);
13092
- let t3;
13784
+ let t2;
13093
13785
  if ($[8] !== placement || $[9] !== tree || $[10] !== view) {
13094
- t3 = view === "slot" ? slotGroups(tree, placement) : [];
13786
+ t2 = view === "slot" ? slotGroups(tree, placement) : [];
13095
13787
  $[8] = placement;
13096
13788
  $[9] = tree;
13097
13789
  $[10] = view;
13098
- $[11] = t3;
13099
- } else t3 = $[11];
13100
- const slots = t3;
13790
+ $[11] = t2;
13791
+ } else t2 = $[11];
13792
+ const slots = t2;
13101
13793
  const empty = view === "slot" ? slots.length === 0 : query === "" ? tree.length === 0 : found.length === 0;
13102
13794
  const treeRef = useRef(null);
13103
13795
  const scrolledTo = useRef(opened);
13796
+ let t3;
13104
13797
  let t4;
13105
- let t5;
13106
13798
  if ($[12] !== opened) {
13107
- t4 = () => {
13799
+ t3 = () => {
13108
13800
  if (scrolledTo.current === opened) return;
13109
13801
  scrolledTo.current = opened;
13110
13802
  treeRef.current?.querySelector("[aria-expanded=true]")?.scrollIntoView({ block: "start" });
13111
13803
  };
13112
- t5 = [opened];
13804
+ t4 = [opened];
13113
13805
  $[12] = opened;
13114
- $[13] = t4;
13115
- $[14] = t5;
13806
+ $[13] = t3;
13807
+ $[14] = t4;
13116
13808
  } else {
13117
- t4 = $[13];
13118
- t5 = $[14];
13809
+ t3 = $[13];
13810
+ t4 = $[14];
13119
13811
  }
13120
- useEffect(t4, t5);
13121
- let t6;
13812
+ useEffect(t3, t4);
13813
+ let t5;
13122
13814
  if ($[15] !== kinds) {
13123
- t6 = (kind, pressed) => {
13815
+ t5 = (kind, pressed) => {
13124
13816
  const next = new Set(kinds);
13125
13817
  if (pressed) next.add(kind);
13126
13818
  else next.delete(kind);
13127
13819
  setKinds(next);
13128
13820
  };
13129
13821
  $[15] = kinds;
13130
- $[16] = t6;
13131
- } else t6 = $[16];
13132
- const toggleKind = t6;
13133
- let t7;
13822
+ $[16] = t5;
13823
+ } else t5 = $[16];
13824
+ const toggleKind = t5;
13825
+ let t6;
13134
13826
  if ($[17] !== clear) {
13135
- t7 = (value) => {
13827
+ t6 = (value) => {
13136
13828
  clear();
13137
13829
  setSearch(value);
13138
13830
  };
13139
13831
  $[17] = clear;
13140
- $[18] = t7;
13141
- } else t7 = $[18];
13142
- let t8;
13832
+ $[18] = t6;
13833
+ } else t6 = $[18];
13834
+ let t7;
13143
13835
  if ($[19] !== collapses) {
13144
- t8 = () => {
13836
+ t7 = () => {
13145
13837
  setOpened(void 0);
13146
13838
  setCollapses(collapses + 1);
13147
13839
  };
13148
13840
  $[19] = collapses;
13149
- $[20] = t8;
13150
- } else t8 = $[20];
13151
- let t9;
13841
+ $[20] = t7;
13842
+ } else t7 = $[20];
13843
+ let t8;
13152
13844
  if ($[21] !== view) {
13153
- t9 = views.map((each) => /* @__PURE__ */ jsx(Tooltip, {
13845
+ t8 = views.map((each) => /* @__PURE__ */ jsx(Tooltip, {
13154
13846
  label: each.label,
13155
13847
  children: /* @__PURE__ */ jsx("button", {
13156
13848
  type: "button",
@@ -13165,96 +13857,96 @@ function Implants(t0) {
13165
13857
  })
13166
13858
  }, each.view));
13167
13859
  $[21] = view;
13168
- $[22] = t9;
13169
- } else t9 = $[22];
13170
- let t10;
13171
- if ($[23] !== t9) {
13172
- t10 = /* @__PURE__ */ jsx("fieldset", {
13860
+ $[22] = t8;
13861
+ } else t8 = $[22];
13862
+ let t9;
13863
+ if ($[23] !== t8) {
13864
+ t9 = /* @__PURE__ */ jsx("fieldset", {
13173
13865
  className: ItemBrowser_module_default.views,
13174
13866
  "aria-label": "View",
13175
- children: t9
13867
+ children: t8
13176
13868
  });
13177
- $[23] = t9;
13178
- $[24] = t10;
13179
- } else t10 = $[24];
13180
- let t11;
13181
- if ($[25] !== search || $[26] !== t10 || $[27] !== t7 || $[28] !== t8) {
13182
- t11 = /* @__PURE__ */ jsx(Search, {
13869
+ $[23] = t8;
13870
+ $[24] = t9;
13871
+ } else t9 = $[24];
13872
+ let t10;
13873
+ if ($[25] !== search || $[26] !== t6 || $[27] !== t7 || $[28] !== t9) {
13874
+ t10 = /* @__PURE__ */ jsx(Search, {
13183
13875
  value: search,
13184
- onChange: t7,
13185
- onCollapse: t8,
13186
- after: t10
13876
+ onChange: t6,
13877
+ onCollapse: t7,
13878
+ after: t9
13187
13879
  });
13188
13880
  $[25] = search;
13189
- $[26] = t10;
13881
+ $[26] = t6;
13190
13882
  $[27] = t7;
13191
- $[28] = t8;
13192
- $[29] = t11;
13193
- } else t11 = $[29];
13194
- let t12;
13883
+ $[28] = t9;
13884
+ $[29] = t10;
13885
+ } else t10 = $[29];
13886
+ let t11;
13195
13887
  if ($[30] !== kinds) {
13196
- t12 = kinds.has("implant");
13888
+ t11 = kinds.has("implant");
13197
13889
  $[30] = kinds;
13198
- $[31] = t12;
13199
- } else t12 = $[31];
13200
- let t13;
13201
- if ($[32] !== t12 || $[33] !== toggleKind) {
13202
- t13 = /* @__PURE__ */ jsx(KindToggle, {
13890
+ $[31] = t11;
13891
+ } else t11 = $[31];
13892
+ let t12;
13893
+ if ($[32] !== t11 || $[33] !== toggleKind) {
13894
+ t12 = /* @__PURE__ */ jsx(KindToggle, {
13203
13895
  kind: "implant",
13204
- pressed: t12,
13896
+ pressed: t11,
13205
13897
  onPressedChange: toggleKind
13206
13898
  });
13207
- $[32] = t12;
13899
+ $[32] = t11;
13208
13900
  $[33] = toggleKind;
13209
- $[34] = t13;
13210
- } else t13 = $[34];
13211
- let t14;
13901
+ $[34] = t12;
13902
+ } else t12 = $[34];
13903
+ let t13;
13212
13904
  if ($[35] !== kinds) {
13213
- t14 = kinds.has("booster");
13905
+ t13 = kinds.has("booster");
13214
13906
  $[35] = kinds;
13215
- $[36] = t14;
13216
- } else t14 = $[36];
13217
- let t15;
13218
- if ($[37] !== t14 || $[38] !== toggleKind) {
13219
- t15 = /* @__PURE__ */ jsx(KindToggle, {
13907
+ $[36] = t13;
13908
+ } else t13 = $[36];
13909
+ let t14;
13910
+ if ($[37] !== t13 || $[38] !== toggleKind) {
13911
+ t14 = /* @__PURE__ */ jsx(KindToggle, {
13220
13912
  kind: "booster",
13221
- pressed: t14,
13913
+ pressed: t13,
13222
13914
  onPressedChange: toggleKind
13223
13915
  });
13224
- $[37] = t14;
13916
+ $[37] = t13;
13225
13917
  $[38] = toggleKind;
13226
- $[39] = t15;
13227
- } else t15 = $[39];
13228
- let t16;
13918
+ $[39] = t14;
13919
+ } else t14 = $[39];
13920
+ let t15;
13229
13921
  if ($[40] !== flyable) {
13230
- t16 = /* @__PURE__ */ jsx(FilterToggle, {
13922
+ t15 = /* @__PURE__ */ jsx(FilterToggle, {
13231
13923
  icon: "skills",
13232
13924
  label: "Skills",
13233
13925
  pressed: flyable,
13234
13926
  onPressedChange: setFlyable
13235
13927
  });
13236
13928
  $[40] = flyable;
13237
- $[41] = t16;
13238
- } else t16 = $[41];
13239
- let t17;
13240
- if ($[42] !== t13 || $[43] !== t15 || $[44] !== t16) {
13241
- t17 = /* @__PURE__ */ jsxs("fieldset", {
13929
+ $[41] = t15;
13930
+ } else t15 = $[41];
13931
+ let t16;
13932
+ if ($[42] !== t12 || $[43] !== t14 || $[44] !== t15) {
13933
+ t16 = /* @__PURE__ */ jsxs("fieldset", {
13242
13934
  className: ItemBrowser_module_default.filters,
13243
13935
  "aria-label": "Filters",
13244
13936
  children: [
13245
- t13,
13246
- t15,
13247
- t16
13937
+ t12,
13938
+ t14,
13939
+ t15
13248
13940
  ]
13249
13941
  });
13250
- $[42] = t13;
13251
- $[43] = t15;
13252
- $[44] = t16;
13253
- $[45] = t17;
13254
- } else t17 = $[45];
13255
- let t18;
13942
+ $[42] = t12;
13943
+ $[43] = t14;
13944
+ $[44] = t15;
13945
+ $[45] = t16;
13946
+ } else t16 = $[45];
13947
+ let t17;
13256
13948
  if ($[46] !== actions || $[47] !== collapses || $[48] !== empty || $[49] !== found || $[50] !== opened || $[51] !== query || $[52] !== slots || $[53] !== tree || $[54] !== view) {
13257
- t18 = /* @__PURE__ */ jsx("div", {
13949
+ t17 = /* @__PURE__ */ jsx("div", {
13258
13950
  ref: treeRef,
13259
13951
  className: ItemBrowser_module_default.tree,
13260
13952
  children: empty ? /* @__PURE__ */ jsx("p", {
@@ -13285,23 +13977,23 @@ function Implants(t0) {
13285
13977
  $[52] = slots;
13286
13978
  $[53] = tree;
13287
13979
  $[54] = view;
13288
- $[55] = t18;
13289
- } else t18 = $[55];
13290
- let t19;
13291
- if ($[56] !== overlays || $[57] !== t11 || $[58] !== t17 || $[59] !== t18) {
13292
- t19 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13293
- t11,
13980
+ $[55] = t17;
13981
+ } else t17 = $[55];
13982
+ let t18;
13983
+ if ($[56] !== overlays || $[57] !== t10 || $[58] !== t16 || $[59] !== t17) {
13984
+ t18 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13985
+ t10,
13986
+ t16,
13294
13987
  t17,
13295
- t18,
13296
13988
  overlays
13297
13989
  ] });
13298
13990
  $[56] = overlays;
13299
- $[57] = t11;
13300
- $[58] = t17;
13301
- $[59] = t18;
13302
- $[60] = t19;
13303
- } else t19 = $[60];
13304
- return t19;
13991
+ $[57] = t10;
13992
+ $[58] = t16;
13993
+ $[59] = t17;
13994
+ $[60] = t18;
13995
+ } else t18 = $[60];
13996
+ return t18;
13305
13997
  }
13306
13998
  function _temp$3() {
13307
13999
  return /* @__PURE__ */ new Set();
@@ -13436,24 +14128,25 @@ const slotFilters = [
13436
14128
  }
13437
14129
  ];
13438
14130
  /** The Modules tab of the `ItemBrowser`: what goes on a ship, by market group. */
13439
- function Modules(t0) {
14131
+ function Modules() {
13440
14132
  const $ = c(52);
13441
- const { noHullSelected } = t0;
13442
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
14133
+ const { actions, clear, overlays } = useTypeActions();
13443
14134
  const placement = usePlacement();
13444
14135
  const canFit = useCanFit();
13445
14136
  const missingSkills = useMissingSkills();
13446
- const services = useSnapshot().stats.slots.service.total > 0;
13447
- let t1;
14137
+ const snapshot = useSnapshotIfAny();
14138
+ const noHullSelected = snapshot === void 0;
14139
+ const services = (snapshot?.stats.slots.service.total ?? 0) > 0;
14140
+ let t0;
13448
14141
  if ($[0] !== services) {
13449
- t1 = (t2) => {
13450
- const { filter } = t2;
14142
+ t0 = (t1) => {
14143
+ const { filter } = t1;
13451
14144
  return services || filter !== "service";
13452
14145
  };
13453
14146
  $[0] = services;
13454
- $[1] = t1;
13455
- } else t1 = $[1];
13456
- const shownFilters = slotFilters.filter(t1);
14147
+ $[1] = t0;
14148
+ } else t0 = $[1];
14149
+ const shownFilters = slotFilters.filter(t0);
13457
14150
  const [search, setSearch] = useState("");
13458
14151
  const [slots, setSlots] = useState(_temp$2);
13459
14152
  const [hullRestrictions, setHullRestrictions] = useState(false);
@@ -13464,8 +14157,8 @@ function Modules(t0) {
13464
14157
  if (request !== browsed) {
13465
14158
  setBrowsed(request);
13466
14159
  const target = request?.target;
13467
- const filter_0 = typeof target === "string" ? slotFilters.find((t2) => {
13468
- const { places } = t2;
14160
+ const filter_0 = typeof target === "string" ? slotFilters.find((t1) => {
14161
+ const { places } = t1;
13469
14162
  return places.includes(target);
13470
14163
  })?.filter : void 0;
13471
14164
  if (filter_0 !== void 0) {
@@ -13473,33 +14166,33 @@ function Modules(t0) {
13473
14166
  setHullRestrictions(true);
13474
14167
  }
13475
14168
  }
13476
- let t2;
14169
+ let t1;
13477
14170
  if ($[2] !== search) {
13478
- t2 = search.trim().toLowerCase();
14171
+ t1 = search.trim().toLowerCase();
13479
14172
  $[2] = search;
13480
- $[3] = t2;
13481
- } else t2 = $[3];
13482
- const query = t2;
13483
- let t3;
14173
+ $[3] = t1;
14174
+ } else t1 = $[3];
14175
+ const query = t1;
14176
+ let t2;
13484
14177
  bb0: {
13485
- let t4;
14178
+ let t3;
13486
14179
  if ($[4] !== services || $[5] !== slots) {
13487
- t4 = new Set(slotFilters.filter((t5) => {
13488
- const { filter: filter_1 } = t5;
14180
+ t3 = new Set(slotFilters.filter((t4) => {
14181
+ const { filter: filter_1 } = t4;
13489
14182
  return slots.has(filter_1) && (services || filter_1 !== "service");
13490
14183
  }).flatMap(_temp2$1));
13491
14184
  $[4] = services;
13492
14185
  $[5] = slots;
13493
- $[6] = t4;
13494
- } else t4 = $[6];
13495
- const places_0 = t4;
14186
+ $[6] = t3;
14187
+ } else t3 = $[6];
14188
+ const places_0 = t3;
13496
14189
  if (query === "" && places_0.size === 0 && !hullRestrictions && !flyable) {
13497
- t3 = void 0;
14190
+ t2 = void 0;
13498
14191
  break bb0;
13499
14192
  }
13500
- let t5;
14193
+ let t4;
13501
14194
  if ($[7] !== canFit || $[8] !== flyable || $[9] !== hullRestrictions || $[10] !== missingSkills || $[11] !== noHullSelected || $[12] !== placement || $[13] !== places_0 || $[14] !== query) {
13502
- t5 = (type) => {
14195
+ t4 = (type) => {
13503
14196
  if (places_0.size > 0) {
13504
14197
  const place = placement(type)?.type;
13505
14198
  if (place === void 0 || !places_0.has(place)) return false;
@@ -13516,59 +14209,59 @@ function Modules(t0) {
13516
14209
  $[12] = placement;
13517
14210
  $[13] = places_0;
13518
14211
  $[14] = query;
13519
- $[15] = t5;
13520
- } else t5 = $[15];
13521
- t3 = t5;
14212
+ $[15] = t4;
14213
+ } else t4 = $[15];
14214
+ t2 = t4;
13522
14215
  }
13523
- const keep = t3;
14216
+ const keep = t2;
13524
14217
  const tree = useModuleTree(query === "" ? keep : void 0);
13525
14218
  const found = useModuleSearch(query === "" ? void 0 : keep);
13526
14219
  const groups = query === "" ? tree : found;
13527
- let t4;
14220
+ let t3;
13528
14221
  if ($[16] !== slots) {
13529
- t4 = (filter_2, pressed) => {
14222
+ t3 = (filter_2, pressed) => {
13530
14223
  const next = new Set(slots);
13531
14224
  if (pressed) next.add(filter_2);
13532
14225
  else next.delete(filter_2);
13533
14226
  setSlots(next);
13534
14227
  };
13535
14228
  $[16] = slots;
13536
- $[17] = t4;
13537
- } else t4 = $[17];
13538
- const toggleSlot = t4;
13539
- let t5;
14229
+ $[17] = t3;
14230
+ } else t3 = $[17];
14231
+ const toggleSlot = t3;
14232
+ let t4;
13540
14233
  if ($[18] !== clear) {
13541
- t5 = (value) => {
14234
+ t4 = (value) => {
13542
14235
  clear();
13543
14236
  setSearch(value);
13544
14237
  };
13545
14238
  $[18] = clear;
13546
- $[19] = t5;
13547
- } else t5 = $[19];
13548
- let t6;
14239
+ $[19] = t4;
14240
+ } else t4 = $[19];
14241
+ let t5;
13549
14242
  if ($[20] !== collapses) {
13550
- t6 = () => setCollapses(collapses + 1);
14243
+ t5 = () => setCollapses(collapses + 1);
13551
14244
  $[20] = collapses;
13552
- $[21] = t6;
13553
- } else t6 = $[21];
13554
- let t7;
13555
- if ($[22] !== search || $[23] !== t5 || $[24] !== t6) {
13556
- t7 = /* @__PURE__ */ jsx(Search, {
14245
+ $[21] = t5;
14246
+ } else t5 = $[21];
14247
+ let t6;
14248
+ if ($[22] !== search || $[23] !== t4 || $[24] !== t5) {
14249
+ t6 = /* @__PURE__ */ jsx(Search, {
13557
14250
  value: search,
13558
- onChange: t5,
13559
- onCollapse: t6
14251
+ onChange: t4,
14252
+ onCollapse: t5
13560
14253
  });
13561
14254
  $[22] = search;
13562
- $[23] = t5;
13563
- $[24] = t6;
13564
- $[25] = t7;
13565
- } else t7 = $[25];
13566
- const t8 = ItemBrowser_module_default;
13567
- const t9 = "Filters";
13568
- let t10;
14255
+ $[23] = t4;
14256
+ $[24] = t5;
14257
+ $[25] = t6;
14258
+ } else t6 = $[25];
14259
+ const t7 = ItemBrowser_module_default;
14260
+ const t8 = "Filters";
14261
+ let t9;
13569
14262
  if ($[26] !== slots || $[27] !== toggleSlot) {
13570
- t10 = (t11) => {
13571
- const { filter: filter_3, icon, label } = t11;
14263
+ t9 = (t10) => {
14264
+ const { filter: filter_3, icon, label } = t10;
13572
14265
  return /* @__PURE__ */ jsx(FilterToggle, {
13573
14266
  icon,
13574
14267
  label,
@@ -13578,12 +14271,12 @@ function Modules(t0) {
13578
14271
  };
13579
14272
  $[26] = slots;
13580
14273
  $[27] = toggleSlot;
13581
- $[28] = t10;
13582
- } else t10 = $[28];
13583
- const t11 = shownFilters.map(t10);
13584
- let t12;
14274
+ $[28] = t9;
14275
+ } else t9 = $[28];
14276
+ const t10 = shownFilters.map(t9);
14277
+ let t11;
13585
14278
  if ($[29] !== hullRestrictions || $[30] !== noHullSelected || $[31] !== setHullRestrictions) {
13586
- t12 = /* @__PURE__ */ jsx(FilterToggle, {
14279
+ t11 = /* @__PURE__ */ jsx(FilterToggle, {
13587
14280
  icon: "filter-hull-restrictions",
13588
14281
  label: "Hull Restrictions",
13589
14282
  pressed: hullRestrictions,
@@ -13593,19 +14286,19 @@ function Modules(t0) {
13593
14286
  $[29] = hullRestrictions;
13594
14287
  $[30] = noHullSelected;
13595
14288
  $[31] = setHullRestrictions;
13596
- $[32] = t12;
13597
- } else t12 = $[32];
13598
- let t13;
14289
+ $[32] = t11;
14290
+ } else t11 = $[32];
14291
+ let t12;
13599
14292
  if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
13600
- t13 = /* @__PURE__ */ jsx(FilterToggle, {
14293
+ t12 = /* @__PURE__ */ jsx(FilterToggle, {
13601
14294
  icon: "filter-resources",
13602
14295
  label: "Resources"
13603
14296
  });
13604
- $[33] = t13;
13605
- } else t13 = $[33];
13606
- let t14;
14297
+ $[33] = t12;
14298
+ } else t12 = $[33];
14299
+ let t13;
13607
14300
  if ($[34] !== flyable || $[35] !== setFlyable) {
13608
- t14 = /* @__PURE__ */ jsx(FilterToggle, {
14301
+ t13 = /* @__PURE__ */ jsx(FilterToggle, {
13609
14302
  icon: "skills",
13610
14303
  label: "Skills",
13611
14304
  pressed: flyable,
@@ -13613,29 +14306,29 @@ function Modules(t0) {
13613
14306
  });
13614
14307
  $[34] = flyable;
13615
14308
  $[35] = setFlyable;
13616
- $[36] = t14;
13617
- } else t14 = $[36];
13618
- let t15;
13619
- if ($[37] !== t11 || $[38] !== t12 || $[39] !== t14 || $[40] !== t8.filters) {
13620
- t15 = /* @__PURE__ */ jsxs("fieldset", {
13621
- className: t8.filters,
13622
- "aria-label": t9,
14309
+ $[36] = t13;
14310
+ } else t13 = $[36];
14311
+ let t14;
14312
+ if ($[37] !== t10 || $[38] !== t11 || $[39] !== t13 || $[40] !== t7.filters) {
14313
+ t14 = /* @__PURE__ */ jsxs("fieldset", {
14314
+ className: t7.filters,
14315
+ "aria-label": t8,
13623
14316
  children: [
14317
+ t10,
13624
14318
  t11,
13625
14319
  t12,
13626
- t13,
13627
- t14
14320
+ t13
13628
14321
  ]
13629
14322
  });
13630
- $[37] = t11;
13631
- $[38] = t12;
13632
- $[39] = t14;
13633
- $[40] = t8.filters;
13634
- $[41] = t15;
13635
- } else t15 = $[41];
13636
- let t16;
14323
+ $[37] = t10;
14324
+ $[38] = t11;
14325
+ $[39] = t13;
14326
+ $[40] = t7.filters;
14327
+ $[41] = t14;
14328
+ } else t14 = $[41];
14329
+ let t15;
13637
14330
  if ($[42] !== actions || $[43] !== collapses || $[44] !== groups || $[45] !== query) {
13638
- t16 = /* @__PURE__ */ jsx("div", {
14331
+ t15 = /* @__PURE__ */ jsx("div", {
13639
14332
  className: ItemBrowser_module_default.tree,
13640
14333
  children: groups.length === 0 ? /* @__PURE__ */ jsx("p", {
13641
14334
  className: ItemBrowser_module_default.empty,
@@ -13655,23 +14348,23 @@ function Modules(t0) {
13655
14348
  $[43] = collapses;
13656
14349
  $[44] = groups;
13657
14350
  $[45] = query;
13658
- $[46] = t16;
13659
- } else t16 = $[46];
13660
- let t17;
13661
- if ($[47] !== overlays || $[48] !== t15 || $[49] !== t16 || $[50] !== t7) {
13662
- t17 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13663
- t7,
14351
+ $[46] = t15;
14352
+ } else t15 = $[46];
14353
+ let t16;
14354
+ if ($[47] !== overlays || $[48] !== t14 || $[49] !== t15 || $[50] !== t6) {
14355
+ t16 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
14356
+ t6,
14357
+ t14,
13664
14358
  t15,
13665
- t16,
13666
14359
  overlays
13667
14360
  ] });
13668
14361
  $[47] = overlays;
13669
- $[48] = t15;
13670
- $[49] = t16;
13671
- $[50] = t7;
13672
- $[51] = t17;
13673
- } else t17 = $[51];
13674
- return t17;
14362
+ $[48] = t14;
14363
+ $[49] = t15;
14364
+ $[50] = t6;
14365
+ $[51] = t16;
14366
+ } else t16 = $[51];
14367
+ return t16;
13675
14368
  }
13676
14369
  function _temp2$1(slot) {
13677
14370
  return slot.places;
@@ -13681,7 +14374,7 @@ function _temp$2() {
13681
14374
  }
13682
14375
  // src/components/ItemBrowser/ItemBrowser.tsx
13683
14376
  /** EVE's browser of hulls and fits, modules, charges, and implants, left of the fitting wheel. */
13684
- function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOpen = false }) {
14377
+ function ItemBrowser({ label = "Item Browser", pasteToOpen = false }) {
13685
14378
  const [tab, setTab] = useState("hulls");
13686
14379
  const { request } = useBrowse();
13687
14380
  const [browsed, setBrowsed] = useState(request);
@@ -13695,22 +14388,22 @@ function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOp
13695
14388
  {
13696
14389
  tab: "hulls",
13697
14390
  label: "Hulls & Fits",
13698
- panel: /* @__PURE__ */ jsx(HullsAndFits, { noHullSelected })
14391
+ panel: /* @__PURE__ */ jsx(HullsAndFits, {})
13699
14392
  },
13700
14393
  {
13701
14394
  tab: "modules",
13702
14395
  label: "Modules",
13703
- panel: /* @__PURE__ */ jsx(Modules, { noHullSelected })
14396
+ panel: /* @__PURE__ */ jsx(Modules, {})
13704
14397
  },
13705
14398
  {
13706
14399
  tab: "charges",
13707
14400
  label: "Charges",
13708
- panel: /* @__PURE__ */ jsx(Charges, { noHullSelected })
14401
+ panel: /* @__PURE__ */ jsx(Charges, {})
13709
14402
  },
13710
14403
  {
13711
14404
  tab: "implants",
13712
14405
  label: "Implants",
13713
- panel: /* @__PURE__ */ jsx(Implants, { noHullSelected })
14406
+ panel: /* @__PURE__ */ jsx(Implants, {})
13714
14407
  }
13715
14408
  ];
13716
14409
  return /* @__PURE__ */ jsxs("section", {
@@ -13759,10 +14452,7 @@ function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOp
13759
14452
  children: "Loading…"
13760
14453
  })
13761
14454
  }, each_0.tab)),
13762
- /* @__PURE__ */ jsx(FitActions, {
13763
- noHullSelected,
13764
- pasteToOpen
13765
- })
14455
+ /* @__PURE__ */ jsx(FitActions, { pasteToOpen })
13766
14456
  ]
13767
14457
  });
13768
14458
  }
@@ -15714,4 +16404,4 @@ function ShipStatistics({ label = "Statistics" }) {
15714
16404
  })]
15715
16405
  });
15716
16406
  }
15717
- export { CapacitorRing, CapacitorStats, DefenseStats, Dialog, DroneStats, FilterToggle, FitPrice, FittingWheel, FittingWindow, HistoryBar, Icon, ItemBrowser, NavigationStats, OffenseStats, RepairRate, ResistanceBar, Resistances, ShipStatistics, Stat, StatsSection, TargetingStats, Tooltip, TooltipText, TreeGroup, TreeLeaf, TreeList, TypeIcon, Wheel, WheelGauge, WheelHardpoints, WheelHull, WheelLink, WheelRackMarker, WheelSlot, iconNames, rackSize, slotAngle };
16407
+ export { CapacitorRing, CapacitorStats, DefenseStats, Dialog, DroneStats, FilterToggle, FitPrice, FittingWheel, FittingWindow, FittingWindowLoading, HistoryBar, Icon, ItemBrowser, NavigationStats, OffenseStats, RepairRate, ResistanceBar, Resistances, ShipStatistics, Stat, StatsSection, TargetingStats, Tooltip, TooltipText, TreeGroup, TreeLeaf, TreeList, TypeIcon, Wheel, WheelGauge, WheelHardpoints, WheelHull, WheelLink, WheelRackMarker, WheelSlot, iconNames, rackSize, slotAngle };