@eveshipfit/ui-ingame 1.15.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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, 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, 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 = {
@@ -6763,8 +6763,8 @@ function Variations(t0) {
6763
6763
  $[5] = t5;
6764
6764
  } else t5 = $[5];
6765
6765
  useEffect(t4, t5);
6766
- const fit = useFit();
6767
- 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;
6768
6768
  const charges = useCharges(fitted?.charge ? module?.type_id : void 0);
6769
6769
  let t6;
6770
6770
  if ($[6] !== anchor || $[7] !== charges || $[8] !== fitted || $[9] !== hold || $[10] !== preview || $[11] !== ref || $[12] !== refuse || $[13] !== refuses || $[14] !== release || $[15] !== show || $[16] !== store) {
@@ -10003,8 +10003,9 @@ const oneDecimal = new Intl.NumberFormat("en-US", {
10003
10003
  /** EVE draws eight, those the structure does not have as a faint outline. */
10004
10004
  const SERVICE_SLOTS = 8;
10005
10005
  /** EVE's fitting window around the `FittingWheel`. */
10006
- function FittingWindow({ label = "Fitting Window", browser, statistics: givenStatistics, preview = false, placeholder }) {
10007
- 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;
10008
10009
  const [browserOpen, setBrowserOpen] = useState(true);
10009
10010
  const { request } = useBrowse();
10010
10011
  const [browsed, setBrowsed] = useState(request);
@@ -10017,131 +10018,250 @@ function FittingWindow({ label = "Fitting Window", browser, statistics: givenSta
10017
10018
  const statisticsId = useId();
10018
10019
  const browserShown = browser !== void 0 && browserOpen;
10019
10020
  const statisticsShown = statistics !== void 0 && statisticsOpen;
10020
- const { stats } = useShownSnapshot();
10021
- const { structure } = stats;
10022
- const fighters = structure || stats.fighterBay.total > 0;
10023
10021
  const fighterBay = useId();
10024
- return /* @__PURE__ */ jsx(ManageFightersContext, {
10025
- value: fighters && !preview ? () => popover(fighterBay)?.showPopover() : void 0,
10026
- children: /* @__PURE__ */ jsxs("section", {
10027
- className: FittingWindow_module_default.window,
10028
- "aria-label": label,
10029
- "data-browser": browserShown || void 0,
10030
- "data-statistics": statisticsShown || void 0,
10031
- children: [
10032
- !preview && /* @__PURE__ */ jsx(ItemInfo, {}),
10033
- !preview && /* @__PURE__ */ jsx(Mutate, {}),
10034
- browser !== void 0 && /* @__PURE__ */ jsx("div", {
10035
- id: browserId,
10036
- className: FittingWindow_module_default.browser,
10037
- inert: !browserShown,
10038
- children: /* @__PURE__ */ jsx("div", {
10039
- className: FittingWindow_module_default.slide,
10040
- children: browser
10041
- })
10042
- }),
10043
- /* @__PURE__ */ jsxs("div", {
10044
- className: FittingWindow_module_default.frame,
10045
- children: [
10046
- /* @__PURE__ */ jsx("div", {
10047
- className: FittingWindow_module_default.wheel,
10048
- children: placeholder === void 0 ? /* @__PURE__ */ jsx(FittingWheel, {
10049
- readOnly: preview,
10050
- credit: preview
10051
- }) : /* @__PURE__ */ jsx(Wheel, {
10052
- label: "Fitting",
10053
- children: /* @__PURE__ */ jsx(Placeholder, { text: placeholder })
10054
- })
10055
- }),
10056
- preview && placeholder === void 0 && /* @__PURE__ */ jsx(PreviewName, {}),
10057
- !preview && placeholder === void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FitName, {}), /* @__PURE__ */ jsx(Violations, {})] }),
10058
- !preview && browser !== void 0 && /* @__PURE__ */ jsx("div", {
10059
- className: FittingWindow_module_default.tools,
10060
- children: /* @__PURE__ */ jsx(Tooltip, {
10061
- label: "Item Browser",
10062
- children: /* @__PURE__ */ jsx("button", {
10063
- type: "button",
10064
- className: FittingWindow_module_default.tool,
10065
- "aria-label": "Item Browser",
10066
- "aria-expanded": browserShown,
10067
- "aria-controls": browserId,
10068
- onClick: () => setBrowserOpen(!browserShown),
10069
- children: /* @__PURE__ */ jsx(Icon, { name: "hardware" })
10070
- })
10071
- })
10072
- }),
10073
- !preview && statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10074
- className: FittingWindow_module_default.panels,
10075
- children: /* @__PURE__ */ jsx(Tooltip, {
10076
- label: "Statistics",
10077
- children: /* @__PURE__ */ jsx("button", {
10078
- type: "button",
10079
- className: FittingWindow_module_default.tool,
10080
- "aria-label": "Statistics",
10081
- "aria-expanded": statisticsShown,
10082
- "aria-controls": statisticsId,
10083
- onClick: () => setStatisticsOpen(!statisticsShown),
10084
- children: /* @__PURE__ */ jsx(Icon, { name: "statistics" })
10085
- })
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" })
10086
10066
  })
10087
- }),
10088
- placeholder === void 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
10089
- /* @__PURE__ */ jsxs("div", {
10090
- className: FittingWindow_module_default.bays,
10091
- children: [structure ? /* @__PURE__ */ jsx(Bay, {
10092
- bay: "cargo",
10093
- icon: "ammo-hold",
10094
- label: "Ammo Hold",
10095
- unlimited: true,
10096
- readOnly: preview
10097
- }) : /* @__PURE__ */ jsx(Bay, {
10098
- bay: "cargo",
10099
- icon: "cargo",
10100
- label: "Cargo Hold",
10101
- readOnly: preview
10102
- }), fighters ? /* @__PURE__ */ jsx(Bay, {
10103
- id: fighterBay,
10104
- bay: "fighterBay",
10105
- icon: "fighter-bay",
10106
- label: "Fighter Bay",
10107
- readOnly: preview
10108
- }) : /* @__PURE__ */ jsx(Bay, {
10109
- bay: "droneBay",
10110
- icon: "drone-bay",
10111
- label: "Drone Bay",
10112
- readOnly: preview
10113
- })]
10114
- }),
10115
- structure && /* @__PURE__ */ jsx(ServiceRack, { readOnly: preview }),
10116
- !preview && /* @__PURE__ */ jsx("div", {
10117
- className: FittingWindow_module_default.history,
10118
- children: /* @__PURE__ */ jsx(SimulationHistory, {})
10119
- }),
10120
- /* @__PURE__ */ jsxs("div", {
10121
- className: FittingWindow_module_default.resources,
10122
- children: [/* @__PURE__ */ jsx(Resource, {
10123
- title: "CPU",
10124
- free: "cpuFree",
10125
- output: "cpuOutput"
10126
- }), /* @__PURE__ */ jsx(Resource, {
10127
- title: "Power Grid",
10128
- free: "powerFree",
10129
- output: "powerOutput"
10130
- })]
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" })
10131
10081
  })
10132
- ] })
10133
- ]
10134
- }),
10135
- statistics !== void 0 && /* @__PURE__ */ jsx("div", {
10136
- id: statisticsId,
10137
- className: FittingWindow_module_default.statistics,
10138
- inert: !statisticsShown,
10139
- children: /* @__PURE__ */ jsx("div", {
10140
- 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,
10141
10099
  children: statistics
10142
10100
  })
10143
10101
  })
10144
- ]
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
+ })
10145
10265
  })
10146
10266
  });
10147
10267
  }
@@ -11063,9 +11183,10 @@ const folders = {
11063
11183
  }
11064
11184
  };
11065
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. */
11066
- function useTypeActions(noHullSelected) {
11186
+ function useTypeActions() {
11067
11187
  const $ = c(57);
11068
11188
  const store = useFitStore();
11189
+ const noHullSelected = !useHasFit();
11069
11190
  const sde = useSde();
11070
11191
  const refuses = useHullRefuses();
11071
11192
  const hasRoom = useHasRoom();
@@ -11532,124 +11653,123 @@ function SearchResults(t0) {
11532
11653
  }
11533
11654
  // src/components/ItemBrowser/Charges.tsx
11534
11655
  /** The Charges tab of the `ItemBrowser`: every charge by market group, or only those a fitted module loads. */
11535
- function Charges(t0) {
11656
+ function Charges() {
11536
11657
  const $ = c(48);
11537
- const { noHullSelected } = t0;
11538
11658
  const sde = useSde();
11539
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
11659
+ const { actions, clear, overlays } = useTypeActions();
11540
11660
  const modules = useChargedModules();
11541
11661
  const [picked, setPicked] = useState();
11542
11662
  const [search, setSearch] = useState("");
11543
11663
  const [collapses, setCollapses] = useState(0);
11544
- let t1;
11664
+ let t0;
11545
11665
  if ($[0] !== modules || $[1] !== picked) {
11546
- t1 = modules.some((module) => module.id === picked) ? picked : void 0;
11666
+ t0 = modules.some((module) => module.id === picked) ? picked : void 0;
11547
11667
  $[0] = modules;
11548
11668
  $[1] = picked;
11549
- $[2] = t1;
11550
- } else t1 = $[2];
11551
- const selected = t1;
11552
- let t2;
11669
+ $[2] = t0;
11670
+ } else t0 = $[2];
11671
+ const selected = t0;
11672
+ let t1;
11553
11673
  if ($[3] !== search) {
11554
- t2 = search.trim().toLowerCase();
11674
+ t1 = search.trim().toLowerCase();
11555
11675
  $[3] = search;
11556
- $[4] = t2;
11557
- } else t2 = $[4];
11558
- const query = t2;
11559
- let t3;
11676
+ $[4] = t1;
11677
+ } else t1 = $[4];
11678
+ const query = t1;
11679
+ let t2;
11560
11680
  if ($[5] !== query || $[6] !== selected) {
11561
- 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;
11562
11682
  $[5] = query;
11563
11683
  $[6] = selected;
11564
- $[7] = t3;
11565
- } else t3 = $[7];
11566
- const matches = t3;
11684
+ $[7] = t2;
11685
+ } else t2 = $[7];
11686
+ const matches = t2;
11567
11687
  const groups = useChargeTree();
11568
11688
  const found = useChargeSearch(matches);
11569
11689
  const charges = useCharges(selected);
11570
- let t4;
11690
+ let t3;
11571
11691
  if ($[8] !== charges || $[9] !== query || $[10] !== sde) {
11572
- let t5;
11692
+ let t4;
11573
11693
  if ($[12] !== query) {
11574
- t5 = (type_0) => type_0.name.toLowerCase().includes(query);
11694
+ t4 = (type_0) => type_0.name.toLowerCase().includes(query);
11575
11695
  $[12] = query;
11576
- $[13] = t5;
11577
- } else t5 = $[13];
11578
- t4 = sde.sortByMeta(charges.filter(t5));
11696
+ $[13] = t4;
11697
+ } else t4 = $[13];
11698
+ t3 = sde.sortByMeta(charges.filter(t4));
11579
11699
  $[8] = charges;
11580
11700
  $[9] = query;
11581
11701
  $[10] = sde;
11582
- $[11] = t4;
11583
- } else t4 = $[11];
11584
- const loadable = t4;
11585
- let t5;
11702
+ $[11] = t3;
11703
+ } else t3 = $[11];
11704
+ const loadable = t3;
11705
+ let t4;
11586
11706
  if ($[14] !== found || $[15] !== loadable || $[16] !== matches || $[17] !== selected) {
11587
- 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;
11588
11708
  $[14] = found;
11589
11709
  $[15] = loadable;
11590
11710
  $[16] = matches;
11591
11711
  $[17] = selected;
11592
- $[18] = t5;
11593
- } else t5 = $[18];
11594
- const empty = t5;
11595
- let t6;
11712
+ $[18] = t4;
11713
+ } else t4 = $[18];
11714
+ const empty = t4;
11715
+ let t5;
11596
11716
  if ($[19] !== clear) {
11597
- t6 = (value) => {
11717
+ t5 = (value) => {
11598
11718
  clear();
11599
11719
  setSearch(value);
11600
11720
  };
11601
11721
  $[19] = clear;
11602
- $[20] = t6;
11603
- } else t6 = $[20];
11604
- let t7;
11722
+ $[20] = t5;
11723
+ } else t5 = $[20];
11724
+ let t6;
11605
11725
  if ($[21] !== collapses) {
11606
- t7 = () => setCollapses(collapses + 1);
11726
+ t6 = () => setCollapses(collapses + 1);
11607
11727
  $[21] = collapses;
11608
- $[22] = t7;
11609
- } else t7 = $[22];
11610
- let t8;
11611
- if ($[23] !== search || $[24] !== t6 || $[25] !== t7) {
11612
- 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, {
11613
11733
  value: search,
11614
- onChange: t6,
11615
- onCollapse: t7
11734
+ onChange: t5,
11735
+ onCollapse: t6
11616
11736
  });
11617
11737
  $[23] = search;
11618
- $[24] = t6;
11619
- $[25] = t7;
11620
- $[26] = t8;
11621
- } else t8 = $[26];
11622
- let t9;
11738
+ $[24] = t5;
11739
+ $[25] = t6;
11740
+ $[26] = t7;
11741
+ } else t7 = $[26];
11742
+ let t8;
11623
11743
  if ($[27] !== modules || $[28] !== selected) {
11624
- let t10;
11744
+ let t9;
11625
11745
  if ($[30] !== selected) {
11626
- t10 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
11746
+ t9 = (module_0) => /* @__PURE__ */ jsx(FilterToggle, {
11627
11747
  typeId: module_0.id,
11628
11748
  label: module_0.name,
11629
11749
  pressed: selected === module_0.id,
11630
11750
  onPressedChange: (pressed) => setPicked(pressed ? module_0.id : void 0)
11631
11751
  }, module_0.id);
11632
11752
  $[30] = selected;
11633
- $[31] = t10;
11634
- } else t10 = $[31];
11635
- t9 = modules.map(t10);
11753
+ $[31] = t9;
11754
+ } else t9 = $[31];
11755
+ t8 = modules.map(t9);
11636
11756
  $[27] = modules;
11637
11757
  $[28] = selected;
11638
- $[29] = t9;
11639
- } else t9 = $[29];
11640
- let t10;
11641
- if ($[32] !== t9) {
11642
- t10 = /* @__PURE__ */ jsx("fieldset", {
11758
+ $[29] = t8;
11759
+ } else t8 = $[29];
11760
+ let t9;
11761
+ if ($[32] !== t8) {
11762
+ t9 = /* @__PURE__ */ jsx("fieldset", {
11643
11763
  className: ItemBrowser_module_default.filters,
11644
11764
  "aria-label": "Filters",
11645
- children: t9
11765
+ children: t8
11646
11766
  });
11647
- $[32] = t9;
11648
- $[33] = t10;
11649
- } else t10 = $[33];
11650
- let t11;
11767
+ $[32] = t8;
11768
+ $[33] = t9;
11769
+ } else t9 = $[33];
11770
+ let t10;
11651
11771
  if ($[34] !== actions || $[35] !== collapses || $[36] !== empty || $[37] !== found || $[38] !== groups || $[39] !== loadable || $[40] !== matches || $[41] !== selected) {
11652
- t11 = /* @__PURE__ */ jsx("div", {
11772
+ t10 = /* @__PURE__ */ jsx("div", {
11653
11773
  className: ItemBrowser_module_default.tree,
11654
11774
  children: empty ? /* @__PURE__ */ jsx("p", {
11655
11775
  className: ItemBrowser_module_default.empty,
@@ -11677,23 +11797,23 @@ function Charges(t0) {
11677
11797
  $[39] = loadable;
11678
11798
  $[40] = matches;
11679
11799
  $[41] = selected;
11680
- $[42] = t11;
11681
- } else t11 = $[42];
11682
- let t12;
11683
- if ($[43] !== overlays || $[44] !== t10 || $[45] !== t11 || $[46] !== t8) {
11684
- t12 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
11685
- 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,
11686
11807
  t10,
11687
- t11,
11688
11808
  overlays
11689
11809
  ] });
11690
11810
  $[43] = overlays;
11691
11811
  $[44] = t10;
11692
- $[45] = t11;
11693
- $[46] = t8;
11694
- $[47] = t12;
11695
- } else t12 = $[47];
11696
- return t12;
11812
+ $[45] = t7;
11813
+ $[46] = t9;
11814
+ $[47] = t11;
11815
+ } else t11 = $[47];
11816
+ return t11;
11697
11817
  }
11698
11818
  // src/components/ItemBrowser/saveFit.tsx
11699
11819
  const MAX_ESI_NAME = 50;
@@ -12197,11 +12317,11 @@ function _temp2$4(event_0) {
12197
12317
  // src/components/ItemBrowser/FitActions.tsx
12198
12318
  /** The buttons under the `ItemBrowser`: save the fit in the browser, import one, or copy it out. */
12199
12319
  function FitActions(t0) {
12200
- const $ = c(56);
12201
- const { noHullSelected, pasteToOpen } = t0;
12320
+ const $ = c(55);
12321
+ const { pasteToOpen } = t0;
12202
12322
  const engine = useEngine();
12203
- const fit = useFit();
12204
12323
  const store = useFitStore();
12324
+ const noHullSelected = !useHasFit();
12205
12325
  const menu = useId();
12206
12326
  const [saved, flashSaved] = useFlash();
12207
12327
  const [copied, flashCopied] = useFlash();
@@ -12210,10 +12330,10 @@ function FitActions(t0) {
12210
12330
  const saver = useSaveFit();
12211
12331
  const [savedTo, setSavedTo] = useState("");
12212
12332
  let t1;
12213
- if ($[0] !== fit || $[1] !== flashSaved || $[2] !== saver || $[3] !== store) {
12333
+ if ($[0] !== flashSaved || $[1] !== saver || $[2] !== store) {
12214
12334
  t1 = () => {
12215
12335
  const where = saver.target?.name ?? "browser";
12216
- saver.save(fit, {
12336
+ saver.save(store.getSnapshot().fit, {
12217
12337
  onStart: (named) => store.setName(named.name ?? ""),
12218
12338
  onSaved: () => {
12219
12339
  setSavedTo(where);
@@ -12221,16 +12341,15 @@ function FitActions(t0) {
12221
12341
  }
12222
12342
  });
12223
12343
  };
12224
- $[0] = fit;
12225
- $[1] = flashSaved;
12226
- $[2] = saver;
12227
- $[3] = store;
12228
- $[4] = t1;
12229
- } else t1 = $[4];
12344
+ $[0] = flashSaved;
12345
+ $[1] = saver;
12346
+ $[2] = store;
12347
+ $[3] = t1;
12348
+ } else t1 = $[3];
12230
12349
  const saveCurrent = t1;
12231
12350
  let t2;
12232
12351
  let t3;
12233
- if ($[5] !== engine || $[6] !== noHullSelected || $[7] !== pasteToOpen || $[8] !== store) {
12352
+ if ($[4] !== engine || $[5] !== noHullSelected || $[6] !== pasteToOpen || $[7] !== store) {
12234
12353
  t2 = () => {
12235
12354
  if (!pasteToOpen) return;
12236
12355
  const onPaste = (event) => {
@@ -12276,32 +12395,32 @@ function FitActions(t0) {
12276
12395
  pasteToOpen,
12277
12396
  noHullSelected
12278
12397
  ];
12279
- $[5] = engine;
12280
- $[6] = noHullSelected;
12281
- $[7] = pasteToOpen;
12282
- $[8] = store;
12283
- $[9] = t2;
12284
- $[10] = t3;
12398
+ $[4] = engine;
12399
+ $[5] = noHullSelected;
12400
+ $[6] = pasteToOpen;
12401
+ $[7] = store;
12402
+ $[8] = t2;
12403
+ $[9] = t3;
12285
12404
  } else {
12286
- t2 = $[9];
12287
- t3 = $[10];
12405
+ t2 = $[8];
12406
+ t3 = $[9];
12288
12407
  }
12289
12408
  useEffect(t2, t3);
12290
12409
  let t4;
12291
- if ($[11] !== copyFit || $[12] !== fit || $[13] !== flashCopied || $[14] !== menu) {
12410
+ if ($[10] !== copyFit || $[11] !== flashCopied || $[12] !== menu || $[13] !== store) {
12292
12411
  t4 = (format) => {
12293
12412
  document.getElementById(menu)?.hidePopover();
12294
- copyFit(fit, format, flashCopied);
12413
+ copyFit(store.getSnapshot().fit, format, flashCopied);
12295
12414
  };
12296
- $[11] = copyFit;
12297
- $[12] = fit;
12298
- $[13] = flashCopied;
12299
- $[14] = menu;
12300
- $[15] = t4;
12301
- } else t4 = $[15];
12415
+ $[10] = copyFit;
12416
+ $[11] = flashCopied;
12417
+ $[12] = menu;
12418
+ $[13] = store;
12419
+ $[14] = t4;
12420
+ } else t4 = $[14];
12302
12421
  const copy = t4;
12303
12422
  let t5;
12304
- if ($[16] !== noHullSelected || $[17] !== saveCurrent || $[18] !== saved || $[19] !== savedTo || $[20] !== saver) {
12423
+ if ($[15] !== noHullSelected || $[16] !== saveCurrent || $[17] !== saved || $[18] !== savedTo || $[19] !== saver) {
12305
12424
  t5 = saver.characters === void 0 ? /* @__PURE__ */ jsx("button", {
12306
12425
  type: "button",
12307
12426
  className: ItemBrowser_module_default.action,
@@ -12314,33 +12433,33 @@ function FitActions(t0) {
12314
12433
  disabled: noHullSelected,
12315
12434
  onSave: saveCurrent
12316
12435
  });
12317
- $[16] = noHullSelected;
12318
- $[17] = saveCurrent;
12319
- $[18] = saved;
12320
- $[19] = savedTo;
12321
- $[20] = saver;
12322
- $[21] = t5;
12323
- } else t5 = $[21];
12436
+ $[15] = noHullSelected;
12437
+ $[16] = saveCurrent;
12438
+ $[17] = saved;
12439
+ $[18] = savedTo;
12440
+ $[19] = saver;
12441
+ $[20] = t5;
12442
+ } else t5 = $[20];
12324
12443
  let t6;
12325
- if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
12444
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
12326
12445
  t6 = /* @__PURE__ */ jsx("button", {
12327
12446
  type: "button",
12328
12447
  className: ItemBrowser_module_default.action,
12329
12448
  onClick: () => setImporting({ text: "" }),
12330
12449
  children: "Import…"
12331
12450
  });
12332
- $[22] = t6;
12333
- } else t6 = $[22];
12451
+ $[21] = t6;
12452
+ } else t6 = $[21];
12334
12453
  const t7 = copied ? "Copied" : "Copy";
12335
12454
  const t8 = copied ? "checkmark" : "export";
12336
12455
  let t9;
12337
- if ($[23] !== t8) {
12456
+ if ($[22] !== t8) {
12338
12457
  t9 = /* @__PURE__ */ jsx(Icon, { name: t8 });
12339
- $[23] = t8;
12340
- $[24] = t9;
12341
- } else t9 = $[24];
12458
+ $[22] = t8;
12459
+ $[23] = t9;
12460
+ } else t9 = $[23];
12342
12461
  let t10;
12343
- if ($[25] !== menu || $[26] !== noHullSelected || $[27] !== t9) {
12462
+ if ($[24] !== menu || $[25] !== noHullSelected || $[26] !== t9) {
12344
12463
  t10 = /* @__PURE__ */ jsx("button", {
12345
12464
  type: "button",
12346
12465
  className: `${ItemBrowser_module_default.action} ${ItemBrowser_module_default.copy}`,
@@ -12349,13 +12468,13 @@ function FitActions(t0) {
12349
12468
  disabled: noHullSelected,
12350
12469
  children: t9
12351
12470
  });
12352
- $[25] = menu;
12353
- $[26] = noHullSelected;
12354
- $[27] = t9;
12355
- $[28] = t10;
12356
- } else t10 = $[28];
12471
+ $[24] = menu;
12472
+ $[25] = noHullSelected;
12473
+ $[26] = t9;
12474
+ $[27] = t10;
12475
+ } else t10 = $[27];
12357
12476
  let t11;
12358
- if ($[29] !== t10 || $[30] !== t7) {
12477
+ if ($[28] !== t10 || $[29] !== t7) {
12359
12478
  t11 = /* @__PURE__ */ jsx("span", {
12360
12479
  className: ItemBrowser_module_default.copyAnchor,
12361
12480
  children: /* @__PURE__ */ jsx(Tooltip, {
@@ -12363,34 +12482,34 @@ function FitActions(t0) {
12363
12482
  children: t10
12364
12483
  })
12365
12484
  });
12366
- $[29] = t10;
12367
- $[30] = t7;
12368
- $[31] = t11;
12369
- } else t11 = $[31];
12485
+ $[28] = t10;
12486
+ $[29] = t7;
12487
+ $[30] = t11;
12488
+ } else t11 = $[30];
12370
12489
  let t12;
12371
- if ($[32] !== copy) {
12490
+ if ($[31] !== copy) {
12372
12491
  t12 = /* @__PURE__ */ jsx("button", {
12373
12492
  type: "button",
12374
12493
  role: "menuitem",
12375
12494
  onClick: () => copy("eft"),
12376
12495
  children: "Copy as EFT"
12377
12496
  });
12378
- $[32] = copy;
12379
- $[33] = t12;
12380
- } else t12 = $[33];
12497
+ $[31] = copy;
12498
+ $[32] = t12;
12499
+ } else t12 = $[32];
12381
12500
  let t13;
12382
- if ($[34] !== copy) {
12501
+ if ($[33] !== copy) {
12383
12502
  t13 = /* @__PURE__ */ jsx("button", {
12384
12503
  type: "button",
12385
12504
  role: "menuitem",
12386
12505
  onClick: () => copy("esf"),
12387
12506
  children: "Copy as esf/1"
12388
12507
  });
12389
- $[34] = copy;
12390
- $[35] = t13;
12391
- } else t13 = $[35];
12508
+ $[33] = copy;
12509
+ $[34] = t13;
12510
+ } else t13 = $[34];
12392
12511
  let t14;
12393
- if ($[36] !== menu || $[37] !== t12 || $[38] !== t13) {
12512
+ if ($[35] !== menu || $[36] !== t12 || $[37] !== t13) {
12394
12513
  t14 = /* @__PURE__ */ jsxs("div", {
12395
12514
  id: menu,
12396
12515
  className: ItemBrowser_module_default.menu,
@@ -12398,51 +12517,51 @@ function FitActions(t0) {
12398
12517
  role: "menu",
12399
12518
  children: [t12, t13]
12400
12519
  });
12401
- $[36] = menu;
12402
- $[37] = t12;
12403
- $[38] = t13;
12404
- $[39] = t14;
12405
- } else t14 = $[39];
12520
+ $[35] = menu;
12521
+ $[36] = t12;
12522
+ $[37] = t13;
12523
+ $[38] = t14;
12524
+ } else t14 = $[38];
12406
12525
  const t15 = importing !== void 0;
12407
12526
  let t16;
12408
- if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
12527
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
12409
12528
  t16 = () => setImporting(void 0);
12410
- $[40] = t16;
12411
- } else t16 = $[40];
12529
+ $[39] = t16;
12530
+ } else t16 = $[39];
12412
12531
  let t17;
12413
- if ($[41] !== importing) {
12532
+ if ($[40] !== importing) {
12414
12533
  t17 = importing ?? { text: "" };
12415
- $[41] = importing;
12416
- $[42] = t17;
12417
- } else t17 = $[42];
12534
+ $[40] = importing;
12535
+ $[41] = t17;
12536
+ } else t17 = $[41];
12418
12537
  let t18;
12419
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
12538
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
12420
12539
  t18 = () => setImporting(void 0);
12421
- $[43] = t18;
12422
- } else t18 = $[43];
12540
+ $[42] = t18;
12541
+ } else t18 = $[42];
12423
12542
  let t19;
12424
- if ($[44] !== t17) {
12543
+ if ($[43] !== t17) {
12425
12544
  t19 = /* @__PURE__ */ jsx(ImportForm, {
12426
12545
  draft: t17,
12427
12546
  onDone: t18
12428
12547
  });
12429
- $[44] = t17;
12430
- $[45] = t19;
12431
- } else t19 = $[45];
12548
+ $[43] = t17;
12549
+ $[44] = t19;
12550
+ } else t19 = $[44];
12432
12551
  let t20;
12433
- if ($[46] !== t15 || $[47] !== t19) {
12552
+ if ($[45] !== t15 || $[46] !== t19) {
12434
12553
  t20 = /* @__PURE__ */ jsx(Dialog, {
12435
12554
  open: t15,
12436
12555
  title: "Import Fit",
12437
12556
  onClose: t16,
12438
12557
  children: t19
12439
12558
  });
12440
- $[46] = t15;
12441
- $[47] = t19;
12442
- $[48] = t20;
12443
- } else t20 = $[48];
12559
+ $[45] = t15;
12560
+ $[46] = t19;
12561
+ $[47] = t20;
12562
+ } else t20 = $[47];
12444
12563
  let t21;
12445
- if ($[49] !== copyDialog || $[50] !== saver.dialog || $[51] !== t11 || $[52] !== t14 || $[53] !== t20 || $[54] !== t5) {
12564
+ if ($[48] !== copyDialog || $[49] !== saver.dialog || $[50] !== t11 || $[51] !== t14 || $[52] !== t20 || $[53] !== t5) {
12446
12565
  t21 = /* @__PURE__ */ jsxs("div", {
12447
12566
  className: ItemBrowser_module_default.actions,
12448
12567
  children: [
@@ -12455,14 +12574,14 @@ function FitActions(t0) {
12455
12574
  saver.dialog
12456
12575
  ]
12457
12576
  });
12458
- $[49] = copyDialog;
12459
- $[50] = saver.dialog;
12460
- $[51] = t11;
12461
- $[52] = t14;
12462
- $[53] = t20;
12463
- $[54] = t5;
12464
- $[55] = t21;
12465
- } else t21 = $[55];
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];
12466
12585
  return t21;
12467
12586
  }
12468
12587
  function SaveSplit(t0) {
@@ -12856,10 +12975,10 @@ async function fitMutated(engine, store, typeId, itemId) {
12856
12975
  const noFits = [];
12857
12976
  const SHIPS_MARKET_GROUP_ID = 4;
12858
12977
  /** The Hulls & Fits tab of the `ItemBrowser`: EVE's hulls by group and race, with the fits saved for each. */
12859
- function HullsAndFits(t0) {
12978
+ function HullsAndFits() {
12860
12979
  const $ = c(115);
12861
- const { noHullSelected } = t0;
12862
- const fitShipId = useFit().ship.type_id;
12980
+ const fitShipId = useSnapshotIfAny()?.fit.ship.type_id;
12981
+ const noHullSelected = fitShipId === void 0;
12863
12982
  const images = useImages();
12864
12983
  const store = useFitStore();
12865
12984
  const missingSkills = useMissingSkills();
@@ -12878,56 +12997,56 @@ function HullsAndFits(t0) {
12878
12997
  const [currentHull, setCurrentHull] = useState(false);
12879
12998
  const [flyable, setFlyable] = useState(false);
12880
12999
  const [collapses, setCollapses] = useState(0);
12881
- let t1;
13000
+ let t0;
12882
13001
  if ($[0] !== search) {
12883
- t1 = search.trim().toLowerCase();
13002
+ t0 = search.trim().toLowerCase();
12884
13003
  $[0] = search;
12885
- $[1] = t1;
12886
- } else t1 = $[1];
12887
- const query = t1;
13004
+ $[1] = t0;
13005
+ } else t0 = $[1];
13006
+ const query = t0;
12888
13007
  const anySource = browserFits || personalFits;
12889
13008
  const currentShipId = currentHull && !noHullSelected ? fitShipId : void 0;
12890
- let t2;
13009
+ let t1;
12891
13010
  if ($[2] !== query) {
12892
- t2 = (name) => (name ?? "").toLowerCase().includes(query);
13011
+ t1 = (name) => (name ?? "").toLowerCase().includes(query);
12893
13012
  $[2] = query;
12894
- $[3] = t2;
12895
- } else t2 = $[3];
12896
- const matches = t2;
12897
- let t3;
13013
+ $[3] = t1;
13014
+ } else t1 = $[3];
13015
+ const matches = t1;
13016
+ let t2;
12898
13017
  if ($[4] !== anySource || $[5] !== browserFits || $[6] !== fits || $[7] !== personal.fits || $[8] !== personalFits) {
12899
13018
  const listed = [...!anySource || browserFits ? fits.map(_temp$4) : [], ...!anySource || personalFits ? personal.fits.map(_temp2$2) : []].toSorted(_temp3);
12900
- t3 = Map.groupBy(listed, _temp4);
13019
+ t2 = Map.groupBy(listed, _temp4);
12901
13020
  $[4] = anySource;
12902
13021
  $[5] = browserFits;
12903
13022
  $[6] = fits;
12904
13023
  $[7] = personal.fits;
12905
13024
  $[8] = personalFits;
12906
- $[9] = t3;
12907
- } else t3 = $[9];
12908
- const fitsByHull = t3;
12909
- let t4;
13025
+ $[9] = t2;
13026
+ } else t2 = $[9];
13027
+ const fitsByHull = t2;
13028
+ let t3;
12910
13029
  if ($[10] !== fits) {
12911
- t4 = Map.groupBy(fits, _temp5);
13030
+ t3 = Map.groupBy(fits, _temp5);
12912
13031
  $[10] = fits;
12913
- $[11] = t4;
12914
- } else t4 = $[11];
12915
- let t5;
13032
+ $[11] = t3;
13033
+ } else t3 = $[11];
13034
+ let t4;
12916
13035
  if ($[12] !== personal.fits) {
12917
- t5 = Map.groupBy(personal.fits, _temp6);
13036
+ t4 = Map.groupBy(personal.fits, _temp6);
12918
13037
  $[12] = personal.fits;
12919
- $[13] = t5;
12920
- } else t5 = $[13];
12921
- let t6;
13038
+ $[13] = t4;
13039
+ } else t4 = $[13];
13040
+ let t5;
12922
13041
  if ($[14] !== fitsByHull || $[15] !== flyable || $[16] !== matches || $[17] !== missingSkills) {
12923
- t6 = (ship) => {
13042
+ t5 = (ship) => {
12924
13043
  const saved = fitsByHull.get(ship.id) ?? noFits;
12925
- const kept = flyable ? saved.filter((t7) => {
12926
- const { fit: fit_4 } = t7;
13044
+ const kept = flyable ? saved.filter((t6) => {
13045
+ const { fit: fit_4 } = t6;
12927
13046
  return missingSkills(fit_4).length === 0;
12928
13047
  }) : saved;
12929
- return matches(ship.name) ? kept : kept.filter((t8) => {
12930
- const { fit: fit_5 } = t8;
13048
+ return matches(ship.name) ? kept : kept.filter((t7) => {
13049
+ const { fit: fit_5 } = t7;
12931
13050
  return matches(fit_5.name);
12932
13051
  });
12933
13052
  };
@@ -12935,30 +13054,30 @@ function HullsAndFits(t0) {
12935
13054
  $[15] = flyable;
12936
13055
  $[16] = matches;
12937
13056
  $[17] = missingSkills;
12938
- $[18] = t6;
12939
- } else t6 = $[18];
12940
- let t7;
12941
- if ($[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
12942
- t7 = {
12943
- browserByHull: t4,
12944
- personalByHull: t5,
12945
- 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
12946
13065
  };
12947
- $[19] = t4;
12948
- $[20] = t5;
12949
- $[21] = t6;
12950
- $[22] = t7;
12951
- } else t7 = $[22];
12952
- const { browserByHull, personalByHull, shownFits } = t7;
12953
- 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;
12954
13073
  bb0: {
12955
13074
  if (query === "" && !currentHull && !anySource && !flyable) {
12956
- t8 = void 0;
13075
+ t7 = void 0;
12957
13076
  break bb0;
12958
13077
  }
12959
- let t9;
13078
+ let t8;
12960
13079
  if ($[23] !== anySource || $[24] !== currentHull || $[25] !== currentShipId || $[26] !== flyable || $[27] !== missingSkills || $[28] !== query || $[29] !== shownFits) {
12961
- t9 = (ship_0) => {
13080
+ t8 = (ship_0) => {
12962
13081
  if (currentShipId !== void 0 && ship_0.id !== currentShipId) return false;
12963
13082
  if (flyable && missingSkills([ship_0.id]).length > 0) return false;
12964
13083
  const shown = shownFits(ship_0);
@@ -12972,24 +13091,24 @@ function HullsAndFits(t0) {
12972
13091
  $[27] = missingSkills;
12973
13092
  $[28] = query;
12974
13093
  $[29] = shownFits;
12975
- $[30] = t9;
12976
- } else t9 = $[30];
12977
- t8 = t9;
13094
+ $[30] = t8;
13095
+ } else t8 = $[30];
13096
+ t7 = t8;
12978
13097
  }
12979
- const groups = useHullTree(t8);
12980
- let t9;
13098
+ const groups = useHullTree(t7);
13099
+ let t8;
12981
13100
  if ($[31] !== store) {
12982
- t9 = (shipTypeId) => store.replace({
13101
+ t8 = (shipTypeId) => store.replace({
12983
13102
  ship: { type_id: shipTypeId },
12984
13103
  items: []
12985
13104
  });
12986
13105
  $[31] = store;
12987
- $[32] = t9;
12988
- } else t9 = $[32];
12989
- const simulate = t9;
12990
- let t10;
13106
+ $[32] = t8;
13107
+ } else t8 = $[32];
13108
+ const simulate = t8;
13109
+ let t9;
12991
13110
  if ($[33] !== open || $[34] !== showInfo || $[35] !== simulate) {
12992
- t10 = (event, ship_1) => {
13111
+ t9 = (event, ship_1) => {
12993
13112
  const anchor = event.currentTarget;
12994
13113
  open(event, [
12995
13114
  {
@@ -13010,13 +13129,13 @@ function HullsAndFits(t0) {
13010
13129
  $[33] = open;
13011
13130
  $[34] = showInfo;
13012
13131
  $[35] = simulate;
13013
- $[36] = t10;
13014
- } else t10 = $[36];
13015
- const hullMenu = t10;
13016
- let t11;
13132
+ $[36] = t9;
13133
+ } else t9 = $[36];
13134
+ const hullMenu = t9;
13135
+ let t10;
13017
13136
  if ($[37] !== copy || $[38] !== open || $[39] !== personal.remove || $[40] !== saveFit || $[41] !== saveTarget || $[42] !== store) {
13018
- t11 = (event_0, t12) => {
13019
- const { fit: fit_6, kind } = t12;
13137
+ t10 = (event_0, t11) => {
13138
+ const { fit: fit_6, kind } = t11;
13020
13139
  open(event_0, [
13021
13140
  {
13022
13141
  label: "Simulate Fitting",
@@ -13051,75 +13170,75 @@ function HullsAndFits(t0) {
13051
13170
  $[40] = saveFit;
13052
13171
  $[41] = saveTarget;
13053
13172
  $[42] = store;
13054
- $[43] = t11;
13055
- } else t11 = $[43];
13056
- const fitMenu = t11;
13057
- let t12;
13173
+ $[43] = t10;
13174
+ } else t10 = $[43];
13175
+ const fitMenu = t10;
13176
+ let t11;
13058
13177
  if ($[44] !== collapses) {
13059
- t12 = () => setCollapses(collapses + 1);
13178
+ t11 = () => setCollapses(collapses + 1);
13060
13179
  $[44] = collapses;
13061
- $[45] = t12;
13062
- } else t12 = $[45];
13063
- let t13;
13064
- if ($[46] !== search || $[47] !== t12) {
13065
- t13 = /* @__PURE__ */ jsx(Search, {
13180
+ $[45] = t11;
13181
+ } else t11 = $[45];
13182
+ let t12;
13183
+ if ($[46] !== search || $[47] !== t11) {
13184
+ t12 = /* @__PURE__ */ jsx(Search, {
13066
13185
  value: search,
13067
13186
  onChange: setSearch,
13068
- onCollapse: t12
13187
+ onCollapse: t11
13069
13188
  });
13070
13189
  $[46] = search;
13071
- $[47] = t12;
13072
- $[48] = t13;
13073
- } else t13 = $[48];
13074
- let t14;
13190
+ $[47] = t11;
13191
+ $[48] = t12;
13192
+ } else t12 = $[48];
13193
+ let t13;
13075
13194
  if ($[49] !== browserFits) {
13076
- t14 = /* @__PURE__ */ jsx(FilterToggle, {
13195
+ t13 = /* @__PURE__ */ jsx(FilterToggle, {
13077
13196
  icon: "fits-browser",
13078
13197
  label: "Browser Fittings",
13079
13198
  pressed: browserFits,
13080
13199
  onPressedChange: setBrowserFits
13081
13200
  });
13082
13201
  $[49] = browserFits;
13083
- $[50] = t14;
13084
- } else t14 = $[50];
13085
- let t15;
13202
+ $[50] = t13;
13203
+ } else t13 = $[50];
13204
+ let t14;
13086
13205
  if ($[51] !== personalFits) {
13087
- t15 = /* @__PURE__ */ jsx(FilterToggle, {
13206
+ t14 = /* @__PURE__ */ jsx(FilterToggle, {
13088
13207
  icon: "fits-personal",
13089
13208
  label: "Personal Fittings",
13090
13209
  pressed: personalFits,
13091
13210
  onPressedChange: setPersonalFits
13092
13211
  });
13093
13212
  $[51] = personalFits;
13094
- $[52] = t15;
13095
- } else t15 = $[52];
13213
+ $[52] = t14;
13214
+ } else t14 = $[52];
13215
+ let t15;
13096
13216
  let t16;
13097
13217
  let t17;
13098
- let t18;
13099
13218
  if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
13100
- t16 = /* @__PURE__ */ jsx(FilterToggle, {
13219
+ t15 = /* @__PURE__ */ jsx(FilterToggle, {
13101
13220
  icon: "fits-corporation",
13102
13221
  label: "Corporation Fittings"
13103
13222
  });
13104
- t17 = /* @__PURE__ */ jsx(FilterToggle, {
13223
+ t16 = /* @__PURE__ */ jsx(FilterToggle, {
13105
13224
  icon: "fits-alliance",
13106
13225
  label: "Alliance Fittings"
13107
13226
  });
13108
- t18 = /* @__PURE__ */ jsx(FilterToggle, {
13227
+ t17 = /* @__PURE__ */ jsx(FilterToggle, {
13109
13228
  icon: "fits-community",
13110
13229
  label: "Community Fittings"
13111
13230
  });
13112
- $[53] = t16;
13113
- $[54] = t17;
13114
- $[55] = t18;
13231
+ $[53] = t15;
13232
+ $[54] = t16;
13233
+ $[55] = t17;
13115
13234
  } else {
13116
- t16 = $[53];
13117
- t17 = $[54];
13118
- t18 = $[55];
13235
+ t15 = $[53];
13236
+ t16 = $[54];
13237
+ t17 = $[55];
13119
13238
  }
13120
- let t19;
13239
+ let t18;
13121
13240
  if ($[56] !== currentHull || $[57] !== noHullSelected) {
13122
- t19 = /* @__PURE__ */ jsx(FilterToggle, {
13241
+ t18 = /* @__PURE__ */ jsx(FilterToggle, {
13123
13242
  icon: "current-hull",
13124
13243
  label: "Current Hull",
13125
13244
  pressed: currentHull,
@@ -13128,43 +13247,43 @@ function HullsAndFits(t0) {
13128
13247
  });
13129
13248
  $[56] = currentHull;
13130
13249
  $[57] = noHullSelected;
13131
- $[58] = t19;
13132
- } else t19 = $[58];
13133
- let t20;
13250
+ $[58] = t18;
13251
+ } else t18 = $[58];
13252
+ let t19;
13134
13253
  if ($[59] !== flyable) {
13135
- t20 = /* @__PURE__ */ jsx(FilterToggle, {
13254
+ t19 = /* @__PURE__ */ jsx(FilterToggle, {
13136
13255
  icon: "skills",
13137
13256
  label: "Skills",
13138
13257
  pressed: flyable,
13139
13258
  onPressedChange: setFlyable
13140
13259
  });
13141
13260
  $[59] = flyable;
13142
- $[60] = t20;
13143
- } else t20 = $[60];
13144
- let t21;
13145
- if ($[61] !== t14 || $[62] !== t15 || $[63] !== t19 || $[64] !== t20) {
13146
- t21 = /* @__PURE__ */ jsxs("fieldset", {
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", {
13147
13266
  className: ItemBrowser_module_default.filters,
13148
13267
  "aria-label": "Filters",
13149
13268
  children: [
13269
+ t13,
13150
13270
  t14,
13151
13271
  t15,
13152
13272
  t16,
13153
13273
  t17,
13154
13274
  t18,
13155
- t19,
13156
- t20
13275
+ t19
13157
13276
  ]
13158
13277
  });
13159
- $[61] = t14;
13160
- $[62] = t15;
13161
- $[63] = t19;
13162
- $[64] = t20;
13163
- $[65] = t21;
13164
- } else t21 = $[65];
13165
- let t22;
13278
+ $[61] = t13;
13279
+ $[62] = t14;
13280
+ $[63] = t18;
13281
+ $[64] = t19;
13282
+ $[65] = t20;
13283
+ } else t20 = $[65];
13284
+ let t21;
13166
13285
  if ($[66] !== groups.length || $[67] !== personal.character || $[68] !== personalFits) {
13167
- t22 = personalFits && personal.character?.canReadFits !== true ? /* @__PURE__ */ jsx("p", {
13286
+ t21 = personalFits && personal.character?.canReadFits !== true ? /* @__PURE__ */ jsx("p", {
13168
13287
  className: ItemBrowser_module_default.empty,
13169
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"
13170
13289
  }) : groups.length === 0 ? /* @__PURE__ */ jsx("p", {
@@ -13174,18 +13293,18 @@ function HullsAndFits(t0) {
13174
13293
  $[66] = groups.length;
13175
13294
  $[67] = personal.character;
13176
13295
  $[68] = personalFits;
13177
- $[69] = t22;
13178
- } else t22 = $[69];
13179
- let t23;
13296
+ $[69] = t21;
13297
+ } else t21 = $[69];
13298
+ let t22;
13180
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) {
13181
- t23 = groups.length > 0 && /* @__PURE__ */ jsx(TreeList, {
13300
+ t22 = groups.length > 0 && /* @__PURE__ */ jsx(TreeList, {
13182
13301
  label: "Hulls",
13183
- children: groups.map((t24) => {
13184
- const { group, races } = t24;
13302
+ children: groups.map((t23) => {
13303
+ const { group, races } = t23;
13185
13304
  return /* @__PURE__ */ jsx(TreeGroup, {
13186
13305
  label: group.name,
13187
- children: () => races.map((t25) => {
13188
- const { race, factionId, ships } = t25;
13306
+ children: () => races.map((t24) => {
13307
+ const { race, factionId, ships } = t24;
13189
13308
  return /* @__PURE__ */ jsx(TreeGroup, {
13190
13309
  label: `${raceName(race)} [${ships.length}]`,
13191
13310
  icon: factionId === void 0 ? images.marketGroupIcon(SHIPS_MARKET_GROUP_ID) : images.factionIcon(factionId),
@@ -13255,55 +13374,55 @@ function HullsAndFits(t0) {
13255
13374
  $[79] = simulate;
13256
13375
  $[80] = start;
13257
13376
  $[81] = store;
13258
- $[82] = t23;
13259
- } else t23 = $[82];
13260
- let t24;
13261
- if ($[83] !== t22 || $[84] !== t23) {
13262
- t24 = /* @__PURE__ */ jsxs("div", {
13377
+ $[82] = t22;
13378
+ } else t22 = $[82];
13379
+ let t23;
13380
+ if ($[83] !== t21 || $[84] !== t22) {
13381
+ t23 = /* @__PURE__ */ jsxs("div", {
13263
13382
  className: ItemBrowser_module_default.tree,
13264
- children: [t22, t23]
13383
+ children: [t21, t22]
13265
13384
  });
13266
- $[83] = t22;
13267
- $[84] = t23;
13268
- $[85] = t24;
13269
- } else t24 = $[85];
13270
- const t25 = deleting !== void 0;
13271
- let t26;
13385
+ $[83] = t21;
13386
+ $[84] = t22;
13387
+ $[85] = t23;
13388
+ } else t23 = $[85];
13389
+ const t24 = deleting !== void 0;
13390
+ let t25;
13272
13391
  if ($[86] === Symbol.for("react.memo_cache_sentinel")) {
13273
- t26 = () => setDeleting(void 0);
13274
- $[86] = t26;
13275
- } else t26 = $[86];
13276
- const t27 = deleting?.fit.name || "Unnamed";
13277
- const t28 = deleting?.kind === "fits-personal" ? `${personal.character?.name} in EVE` : "this browser";
13278
- let t29;
13279
- if ($[87] !== t27 || $[88] !== t28) {
13280
- t29 = /* @__PURE__ */ jsxs("p", { children: [
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";
13397
+ let t28;
13398
+ if ($[87] !== t26 || $[88] !== t27) {
13399
+ t28 = /* @__PURE__ */ jsxs("p", { children: [
13281
13400
  "Delete the fit \"",
13282
- t27,
13401
+ t26,
13283
13402
  "\" from",
13284
13403
  " ",
13285
- t28,
13404
+ t27,
13286
13405
  "?"
13287
13406
  ] });
13288
- $[87] = t27;
13289
- $[88] = t28;
13290
- $[89] = t29;
13291
- } else t29 = $[89];
13292
- let t30;
13407
+ $[87] = t26;
13408
+ $[88] = t27;
13409
+ $[89] = t28;
13410
+ } else t28 = $[89];
13411
+ let t29;
13293
13412
  if ($[90] === Symbol.for("react.memo_cache_sentinel")) {
13294
- t30 = /* @__PURE__ */ jsx("button", {
13413
+ t29 = /* @__PURE__ */ jsx("button", {
13295
13414
  type: "button",
13296
13415
  className: ItemBrowser_module_default.action,
13297
13416
  onClick: () => setDeleting(void 0),
13298
13417
  children: "Cancel"
13299
13418
  });
13300
- $[90] = t30;
13301
- } else t30 = $[90];
13302
- let t31;
13419
+ $[90] = t29;
13420
+ } else t29 = $[90];
13421
+ let t30;
13303
13422
  if ($[91] !== deleting || $[92] !== personal || $[93] !== remove) {
13304
- t31 = /* @__PURE__ */ jsxs("div", {
13423
+ t30 = /* @__PURE__ */ jsxs("div", {
13305
13424
  className: ItemBrowser_module_default.dialogButtons,
13306
- children: [t30, /* @__PURE__ */ jsx("button", {
13425
+ children: [t29, /* @__PURE__ */ jsx("button", {
13307
13426
  type: "button",
13308
13427
  className: ItemBrowser_module_default.action,
13309
13428
  onClick: () => {
@@ -13320,45 +13439,45 @@ function HullsAndFits(t0) {
13320
13439
  $[91] = deleting;
13321
13440
  $[92] = personal;
13322
13441
  $[93] = remove;
13323
- $[94] = t31;
13324
- } else t31 = $[94];
13325
- let t32;
13326
- if ($[95] !== t29 || $[96] !== t31) {
13327
- t32 = /* @__PURE__ */ jsxs("div", {
13442
+ $[94] = t30;
13443
+ } else t30 = $[94];
13444
+ let t31;
13445
+ if ($[95] !== t28 || $[96] !== t30) {
13446
+ t31 = /* @__PURE__ */ jsxs("div", {
13328
13447
  className: ItemBrowser_module_default.confirm,
13329
- children: [t29, t31]
13448
+ children: [t28, t30]
13330
13449
  });
13331
- $[95] = t29;
13332
- $[96] = t31;
13333
- $[97] = t32;
13334
- } else t32 = $[97];
13335
- let t33;
13336
- if ($[98] !== t25 || $[99] !== t32) {
13337
- t33 = /* @__PURE__ */ jsx(Dialog, {
13338
- open: t25,
13450
+ $[95] = t28;
13451
+ $[96] = t30;
13452
+ $[97] = t31;
13453
+ } else t31 = $[97];
13454
+ let t32;
13455
+ if ($[98] !== t24 || $[99] !== t31) {
13456
+ t32 = /* @__PURE__ */ jsx(Dialog, {
13457
+ open: t24,
13339
13458
  title: "Delete Fitting?",
13340
- onClose: t26,
13341
- children: t32
13459
+ onClose: t25,
13460
+ children: t31
13342
13461
  });
13343
- $[98] = t25;
13344
- $[99] = t32;
13345
- $[100] = t33;
13346
- } else t33 = $[100];
13347
- let t34;
13462
+ $[98] = t24;
13463
+ $[99] = t31;
13464
+ $[100] = t32;
13465
+ } else t32 = $[100];
13466
+ let t33;
13348
13467
  if ($[101] === Symbol.for("react.memo_cache_sentinel")) {
13349
- t34 = () => setDeleteFailed(false);
13350
- $[101] = t34;
13351
- } else t34 = $[101];
13352
- let t35;
13468
+ t33 = () => setDeleteFailed(false);
13469
+ $[101] = t33;
13470
+ } else t33 = $[101];
13471
+ let t34;
13353
13472
  if ($[102] === Symbol.for("react.memo_cache_sentinel")) {
13354
- t35 = /* @__PURE__ */ jsx("p", { children: "EVE did not delete this fit. Please try again." });
13355
- $[102] = t35;
13356
- } else t35 = $[102];
13357
- let t36;
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;
13358
13477
  if ($[103] === Symbol.for("react.memo_cache_sentinel")) {
13359
- t36 = /* @__PURE__ */ jsxs("div", {
13478
+ t35 = /* @__PURE__ */ jsxs("div", {
13360
13479
  className: ItemBrowser_module_default.confirm,
13361
- children: [t35, /* @__PURE__ */ jsx("div", {
13480
+ children: [t34, /* @__PURE__ */ jsx("div", {
13362
13481
  className: ItemBrowser_module_default.dialogButtons,
13363
13482
  children: /* @__PURE__ */ jsx("button", {
13364
13483
  type: "button",
@@ -13368,42 +13487,42 @@ function HullsAndFits(t0) {
13368
13487
  })
13369
13488
  })]
13370
13489
  });
13371
- $[103] = t36;
13372
- } else t36 = $[103];
13373
- let t37;
13490
+ $[103] = t35;
13491
+ } else t35 = $[103];
13492
+ let t36;
13374
13493
  if ($[104] !== deleteFailed) {
13375
- t37 = /* @__PURE__ */ jsx(Dialog, {
13494
+ t36 = /* @__PURE__ */ jsx(Dialog, {
13376
13495
  open: deleteFailed,
13377
13496
  title: "Delete Fitting",
13378
- onClose: t34,
13379
- children: t36
13497
+ onClose: t33,
13498
+ children: t35
13380
13499
  });
13381
13500
  $[104] = deleteFailed;
13382
- $[105] = t37;
13383
- } else t37 = $[105];
13384
- let t38;
13385
- if ($[106] !== copyDialog || $[107] !== menu || $[108] !== saveDialog || $[109] !== t13 || $[110] !== t21 || $[111] !== t24 || $[112] !== t33 || $[113] !== t37) {
13386
- t38 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
13387
- t13,
13388
- t21,
13389
- t24,
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,
13390
13509
  menu,
13391
13510
  copyDialog,
13392
13511
  saveDialog,
13393
- t33,
13394
- t37
13512
+ t32,
13513
+ t36
13395
13514
  ] });
13396
13515
  $[106] = copyDialog;
13397
13516
  $[107] = menu;
13398
13517
  $[108] = saveDialog;
13399
- $[109] = t13;
13400
- $[110] = t21;
13401
- $[111] = t24;
13402
- $[112] = t33;
13403
- $[113] = t37;
13404
- $[114] = t38;
13405
- } else t38 = $[114];
13406
- return t38;
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;
13407
13526
  }
13408
13527
  function _temp6(fit_3) {
13409
13528
  return fit_3.ship.type_id;
@@ -13602,8 +13721,8 @@ const kindLabels = {
13602
13721
  /** The Implants tab of the `ItemBrowser`: implants and boosters by market group or by slot. */
13603
13722
  function Implants(t0) {
13604
13723
  const $ = c(61);
13605
- const { noHullSelected } = t0;
13606
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
13724
+ const { handled } = t0;
13725
+ const { actions, clear, overlays } = useTypeActions();
13607
13726
  const placement = usePlacement();
13608
13727
  const missingSkills = useMissingSkills();
13609
13728
  const [search, setSearch] = useState("");
@@ -13613,7 +13732,7 @@ function Implants(t0) {
13613
13732
  const [collapses, setCollapses] = useState(0);
13614
13733
  const [opened, setOpened] = useState();
13615
13734
  const { request } = useBrowse();
13616
- const [browsed, setBrowsed] = useState(request);
13735
+ const [browsed, setBrowsed] = useState(handled);
13617
13736
  if (request !== browsed) {
13618
13737
  setBrowsed(request);
13619
13738
  const target = request?.target;
@@ -14012,12 +14131,14 @@ const slotFilters = [
14012
14131
  /** The Modules tab of the `ItemBrowser`: what goes on a ship, by market group. */
14013
14132
  function Modules(t0) {
14014
14133
  const $ = c(52);
14015
- const { noHullSelected } = t0;
14016
- const { actions, clear, overlays } = useTypeActions(noHullSelected);
14134
+ const { handled } = t0;
14135
+ const { actions, clear, overlays } = useTypeActions();
14017
14136
  const placement = usePlacement();
14018
14137
  const canFit = useCanFit();
14019
14138
  const missingSkills = useMissingSkills();
14020
- const services = useSnapshot().stats.slots.service.total > 0;
14139
+ const snapshot = useSnapshotIfAny();
14140
+ const noHullSelected = snapshot === void 0;
14141
+ const services = (snapshot?.stats.slots.service.total ?? 0) > 0;
14021
14142
  let t1;
14022
14143
  if ($[0] !== services) {
14023
14144
  t1 = (t2) => {
@@ -14034,7 +14155,7 @@ function Modules(t0) {
14034
14155
  const [flyable, setFlyable] = useState(false);
14035
14156
  const [collapses, setCollapses] = useState(0);
14036
14157
  const { request } = useBrowse();
14037
- const [browsed, setBrowsed] = useState(request);
14158
+ const [browsed, setBrowsed] = useState(handled);
14038
14159
  if (request !== browsed) {
14039
14160
  setBrowsed(request);
14040
14161
  const target = request?.target;
@@ -14254,37 +14375,41 @@ function _temp$2() {
14254
14375
  return /* @__PURE__ */ new Set();
14255
14376
  }
14256
14377
  // src/components/ItemBrowser/ItemBrowser.tsx
14378
+ const NO_TABS = /* @__PURE__ */ new Set();
14257
14379
  /** EVE's browser of hulls and fits, modules, charges, and implants, left of the fitting wheel. */
14258
- function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOpen = false }) {
14380
+ function ItemBrowser({ label = "Item Browser", pasteToOpen = false }) {
14259
14381
  const [tab, setTab] = useState("hulls");
14382
+ const [opened, setOpened] = useState(() => /* @__PURE__ */ new Set([tab]));
14383
+ if (!opened.has(tab)) setOpened(/* @__PURE__ */ new Set([...opened, tab]));
14384
+ const rendered = useDeferredValue(opened, NO_TABS);
14260
14385
  const { request } = useBrowse();
14261
14386
  const [browsed, setBrowsed] = useState(request);
14387
+ const [handled] = useState(request);
14262
14388
  if (request !== browsed) {
14263
14389
  setBrowsed(request);
14264
14390
  if (request !== void 0) setTab(typeof request.target === "string" ? "modules" : "implants");
14265
14391
  }
14266
14392
  const id = useId();
14267
- const ready = useDeferredValue(true, false);
14268
14393
  const tabs = [
14269
14394
  {
14270
14395
  tab: "hulls",
14271
14396
  label: "Hulls & Fits",
14272
- panel: /* @__PURE__ */ jsx(HullsAndFits, { noHullSelected })
14397
+ panel: /* @__PURE__ */ jsx(HullsAndFits, {})
14273
14398
  },
14274
14399
  {
14275
14400
  tab: "modules",
14276
14401
  label: "Modules",
14277
- panel: /* @__PURE__ */ jsx(Modules, { noHullSelected })
14402
+ panel: /* @__PURE__ */ jsx(Modules, { handled })
14278
14403
  },
14279
14404
  {
14280
14405
  tab: "charges",
14281
14406
  label: "Charges",
14282
- panel: /* @__PURE__ */ jsx(Charges, { noHullSelected })
14407
+ panel: /* @__PURE__ */ jsx(Charges, {})
14283
14408
  },
14284
14409
  {
14285
14410
  tab: "implants",
14286
14411
  label: "Implants",
14287
- panel: /* @__PURE__ */ jsx(Implants, { noHullSelected })
14412
+ panel: /* @__PURE__ */ jsx(Implants, { handled })
14288
14413
  }
14289
14414
  ];
14290
14415
  return /* @__PURE__ */ jsxs("section", {
@@ -14325,7 +14450,7 @@ function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOp
14325
14450
  search.focus();
14326
14451
  }
14327
14452
  },
14328
- children: ready ? /* @__PURE__ */ jsx(Activity, {
14453
+ children: rendered.has(each_0.tab) ? /* @__PURE__ */ jsx(Activity, {
14329
14454
  mode: tab === each_0.tab ? "visible" : "hidden",
14330
14455
  children: each_0.panel
14331
14456
  }) : /* @__PURE__ */ jsx("p", {
@@ -14333,10 +14458,7 @@ function ItemBrowser({ label = "Item Browser", noHullSelected = false, pasteToOp
14333
14458
  children: "Loading…"
14334
14459
  })
14335
14460
  }, each_0.tab)),
14336
- /* @__PURE__ */ jsx(FitActions, {
14337
- noHullSelected,
14338
- pasteToOpen
14339
- })
14461
+ /* @__PURE__ */ jsx(FitActions, { pasteToOpen })
14340
14462
  ]
14341
14463
  });
14342
14464
  }
@@ -16288,4 +16410,4 @@ function ShipStatistics({ label = "Statistics" }) {
16288
16410
  })]
16289
16411
  });
16290
16412
  }
16291
- 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 };
16413
+ 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 };