@elite-dangerous-almanac/core 0.1.7 → 0.2.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.
Files changed (274) hide show
  1. package/PROVENANCE/i18n/SOURCES.md +2 -2
  2. package/PROVENANCE/ships/SOURCES.md +29 -9
  3. package/README.md +54 -40
  4. package/dist/astro/galaxy-grid.js +1 -1
  5. package/dist/astro/index.d.ts +1 -1
  6. package/dist/astro/index.js +1 -1
  7. package/dist/astro/naming-region-origins.d.ts +1 -1
  8. package/dist/astro/naming-region-origins.js +1 -1
  9. package/dist/astro/nebulae.d.ts +2 -2
  10. package/dist/astro/permit-locks.d.ts +2 -1
  11. package/dist/astro/permit-locks.js +1 -1
  12. package/dist/astro/procedural-system.d.ts +2 -1
  13. package/dist/astro/procedural-system.js +1 -1
  14. package/dist/astro/sector-name.d.ts +2 -1
  15. package/dist/astro/sector-name.js +1 -1
  16. package/dist/astro/system-address.d.ts +1 -1
  17. package/dist/astro/system-name.d.ts +14 -9
  18. package/dist/astro/system-name.js +1 -1
  19. package/dist/chunk-2W5MW376.js +1 -0
  20. package/dist/chunk-2W5MW376.js.map +1 -0
  21. package/dist/{chunk-VZZUNSDF.js → chunk-4KJ7CR74.js} +1 -1
  22. package/dist/{chunk-VZZUNSDF.js.map → chunk-4KJ7CR74.js.map} +1 -1
  23. package/dist/{chunk-6EUVIZAS.js → chunk-4QYTVSNR.js} +1 -1
  24. package/dist/{chunk-EKQCVCMK.js → chunk-5ZVYRX6Z.js} +1 -1
  25. package/dist/{chunk-EKQCVCMK.js.map → chunk-5ZVYRX6Z.js.map} +1 -1
  26. package/dist/chunk-6GJHUWMO.js +1 -0
  27. package/dist/chunk-6GJHUWMO.js.map +1 -0
  28. package/dist/chunk-6L56LWTT.js +1 -0
  29. package/dist/chunk-6L56LWTT.js.map +1 -0
  30. package/dist/{chunk-GQ5GX5TB.js → chunk-6O4NRRSB.js} +1 -1
  31. package/dist/chunk-6O4NRRSB.js.map +1 -0
  32. package/dist/{chunk-WNGQ3IAM.js → chunk-6UNAD74Z.js} +1 -1
  33. package/dist/{chunk-WNGQ3IAM.js.map → chunk-6UNAD74Z.js.map} +1 -1
  34. package/dist/{chunk-JPBMRJFC.js → chunk-77I24V6B.js} +1 -1
  35. package/dist/chunk-77I24V6B.js.map +1 -0
  36. package/dist/chunk-7ATBEOVC.js +1 -0
  37. package/dist/chunk-7ATBEOVC.js.map +1 -0
  38. package/dist/chunk-7TQ2X6Q3.js +1 -0
  39. package/dist/chunk-7TQ2X6Q3.js.map +1 -0
  40. package/dist/{chunk-6EPYVBAX.js → chunk-A6OINYNP.js} +1 -1
  41. package/dist/{chunk-Q3QCLNVG.js → chunk-AYAKU4YA.js} +1 -1
  42. package/dist/chunk-AYAKU4YA.js.map +1 -0
  43. package/dist/chunk-B7EYTZRK.js +1 -0
  44. package/dist/chunk-B7EYTZRK.js.map +1 -0
  45. package/dist/{chunk-EBAHNZ36.js → chunk-CIULJH3G.js} +1 -1
  46. package/dist/{chunk-EBAHNZ36.js.map → chunk-CIULJH3G.js.map} +1 -1
  47. package/dist/{chunk-SNADUQSJ.js → chunk-CJK2IBI2.js} +1 -1
  48. package/dist/{chunk-SNADUQSJ.js.map → chunk-CJK2IBI2.js.map} +1 -1
  49. package/dist/{chunk-DYPOL3CI.js → chunk-CJQ37JII.js} +1 -1
  50. package/dist/chunk-CJQ37JII.js.map +1 -0
  51. package/dist/chunk-D6YEHR5S.js +1 -0
  52. package/dist/chunk-D6YEHR5S.js.map +1 -0
  53. package/dist/{chunk-Z6XMXMVI.js → chunk-DBDCOHI4.js} +1 -1
  54. package/dist/chunk-DBDCOHI4.js.map +1 -0
  55. package/dist/{chunk-AFVYCQWL.js → chunk-DCB4COCL.js} +1 -1
  56. package/dist/{chunk-AFVYCQWL.js.map → chunk-DCB4COCL.js.map} +1 -1
  57. package/dist/{chunk-CJWFY6OX.js → chunk-DSMLYA2M.js} +1 -1
  58. package/dist/{chunk-CJWFY6OX.js.map → chunk-DSMLYA2M.js.map} +1 -1
  59. package/dist/{chunk-UXBCLFGU.js → chunk-DWRNXUAX.js} +1 -1
  60. package/dist/{chunk-UXBCLFGU.js.map → chunk-DWRNXUAX.js.map} +1 -1
  61. package/dist/{chunk-UHSNB5SV.js → chunk-EVJ32UF3.js} +1 -1
  62. package/dist/{chunk-UHSNB5SV.js.map → chunk-EVJ32UF3.js.map} +1 -1
  63. package/dist/chunk-EVW4Z4CB.js +1 -0
  64. package/dist/chunk-EVW4Z4CB.js.map +1 -0
  65. package/dist/{chunk-4S6WB7QR.js → chunk-FF2X4K5P.js} +1 -1
  66. package/dist/chunk-FF2X4K5P.js.map +1 -0
  67. package/dist/chunk-FYVPZBXN.js +1 -0
  68. package/dist/chunk-FYVPZBXN.js.map +1 -0
  69. package/dist/{chunk-QTZPA2FR.js → chunk-GLWPSVFV.js} +1 -1
  70. package/dist/chunk-GLWPSVFV.js.map +1 -0
  71. package/dist/chunk-GZYPQIO2.js +1 -0
  72. package/dist/chunk-GZYPQIO2.js.map +1 -0
  73. package/dist/chunk-H47K3UWG.js +1 -0
  74. package/dist/chunk-H47K3UWG.js.map +1 -0
  75. package/dist/chunk-JGOAQLYW.js +1 -0
  76. package/dist/chunk-JGOAQLYW.js.map +1 -0
  77. package/dist/{chunk-JWWYAMGD.js → chunk-MGRDB2BZ.js} +1 -1
  78. package/dist/{chunk-JWWYAMGD.js.map → chunk-MGRDB2BZ.js.map} +1 -1
  79. package/dist/{chunk-MKGJPVPS.js → chunk-MRTTQYT5.js} +1 -1
  80. package/dist/{chunk-MKGJPVPS.js.map → chunk-MRTTQYT5.js.map} +1 -1
  81. package/dist/chunk-MTJ4MS7W.js +1 -0
  82. package/dist/chunk-MTJ4MS7W.js.map +1 -0
  83. package/dist/chunk-NIURLW2F.js +1 -0
  84. package/dist/chunk-NIURLW2F.js.map +1 -0
  85. package/dist/chunk-OLKNYGGT.js +1 -0
  86. package/dist/chunk-OLKNYGGT.js.map +1 -0
  87. package/dist/{chunk-UXFMVZAY.js → chunk-OVUHQEH5.js} +1 -1
  88. package/dist/{chunk-UXFMVZAY.js.map → chunk-OVUHQEH5.js.map} +1 -1
  89. package/dist/chunk-OYFMHDYT.js +1 -0
  90. package/dist/chunk-OYFMHDYT.js.map +1 -0
  91. package/dist/chunk-OYR5HUQZ.js +1 -0
  92. package/dist/chunk-OYR5HUQZ.js.map +1 -0
  93. package/dist/{chunk-LLHGSBPI.js → chunk-PA5EITW5.js} +1 -1
  94. package/dist/{chunk-LLHGSBPI.js.map → chunk-PA5EITW5.js.map} +1 -1
  95. package/dist/chunk-PL75RTA2.js +1 -0
  96. package/dist/{chunk-2VPVZELZ.js.map → chunk-PL75RTA2.js.map} +1 -1
  97. package/dist/chunk-PY5L6WC5.js +1 -0
  98. package/dist/chunk-PY5L6WC5.js.map +1 -0
  99. package/dist/{chunk-W6EPHHTS.js → chunk-Q2L75GSI.js} +1 -1
  100. package/dist/chunk-Q2L75GSI.js.map +1 -0
  101. package/dist/chunk-QJ7GB6FF.js +1 -0
  102. package/dist/chunk-QJ7GB6FF.js.map +1 -0
  103. package/dist/chunk-QTAMQ6ME.js +1 -0
  104. package/dist/chunk-QTAMQ6ME.js.map +1 -0
  105. package/dist/{chunk-VDVFJXX5.js → chunk-QY3L5BKN.js} +1 -1
  106. package/dist/{chunk-FMPRCYKY.js → chunk-RRYBSAPX.js} +1 -1
  107. package/dist/chunk-RRYBSAPX.js.map +1 -0
  108. package/dist/{chunk-J42ZXLBL.js → chunk-T62GO4AA.js} +1 -1
  109. package/dist/chunk-T62GO4AA.js.map +1 -0
  110. package/dist/{chunk-E3BRVGJJ.js → chunk-TBZJIQ5P.js} +1 -1
  111. package/dist/{chunk-E3BRVGJJ.js.map → chunk-TBZJIQ5P.js.map} +1 -1
  112. package/dist/chunk-V3AEUBHV.js +1 -0
  113. package/dist/chunk-V3AEUBHV.js.map +1 -0
  114. package/dist/chunk-VYDQHPY2.js +1 -0
  115. package/dist/chunk-VYDQHPY2.js.map +1 -0
  116. package/dist/chunk-XUHAPOM6.js +1 -0
  117. package/dist/chunk-XUHAPOM6.js.map +1 -0
  118. package/dist/chunk-Y6KJJMIM.js +1 -0
  119. package/dist/chunk-Y6KJJMIM.js.map +1 -0
  120. package/dist/chunk-YXPZ7QQB.js +1 -0
  121. package/dist/chunk-YXPZ7QQB.js.map +1 -0
  122. package/dist/{chunk-Y6UZWNP4.js → chunk-ZCEAPJDH.js} +1 -1
  123. package/dist/{chunk-Y6UZWNP4.js.map → chunk-ZCEAPJDH.js.map} +1 -1
  124. package/dist/commodities/commodities.d.ts +20 -10
  125. package/dist/commodities/commodities.js +1 -1
  126. package/dist/commodities/index.d.ts +15 -4
  127. package/dist/commodities/index.js +1 -1
  128. package/dist/equipment/index.js +1 -1
  129. package/dist/equipment/modification-costs.d.ts +2 -1
  130. package/dist/equipment/modification-costs.js.map +1 -1
  131. package/dist/equipment/modification-journal.js +1 -1
  132. package/dist/equipment/modifications.d.ts +2 -1
  133. package/dist/equipment/modifications.js +1 -1
  134. package/dist/equipment/suits.d.ts +6 -3
  135. package/dist/equipment/suits.js +1 -1
  136. package/dist/equipment/upgrade-costs.d.ts +8 -4
  137. package/dist/equipment/upgrade-costs.js +1 -1
  138. package/dist/equipment/upgrade-costs.js.map +1 -1
  139. package/dist/equipment/weapons.d.ts +13 -5
  140. package/dist/equipment/weapons.js +1 -1
  141. package/dist/i18n/blueprints.d.ts +6 -6
  142. package/dist/i18n/blueprints.js +1 -1
  143. package/dist/i18n/diagnostics.d.ts +1 -13
  144. package/dist/i18n/engineering-groups.d.ts +1 -0
  145. package/dist/i18n/engineering-groups.js +1 -1
  146. package/dist/i18n/experimental-effect-descriptions.d.ts +4 -3
  147. package/dist/i18n/experimental-effect-descriptions.js +1 -1
  148. package/dist/i18n/experimental-effects.d.ts +5 -4
  149. package/dist/i18n/experimental-effects.js +1 -1
  150. package/dist/i18n/index.d.ts +1 -13
  151. package/dist/i18n/index.js +1 -1
  152. package/dist/i18n/pre-engineered.d.ts +7 -6
  153. package/dist/i18n/pre-engineered.js +1 -1
  154. package/dist/materials/index.d.ts +16 -4
  155. package/dist/materials/index.js +1 -1
  156. package/dist/materials/materials.d.ts +36 -19
  157. package/dist/materials/materials.js +1 -1
  158. package/dist/materials/micro-resources.d.ts +18 -7
  159. package/dist/materials/micro-resources.js +1 -1
  160. package/dist/ships/armour.d.ts +20 -4
  161. package/dist/ships/armour.js +1 -1
  162. package/dist/ships/blueprint-costs.d.ts +20 -17
  163. package/dist/ships/blueprint-costs.js +1 -1
  164. package/dist/ships/blueprint-journal.d.ts +9 -8
  165. package/dist/ships/blueprint-journal.js +1 -1
  166. package/dist/ships/blueprints.d.ts +14 -12
  167. package/dist/ships/blueprints.js +1 -1
  168. package/dist/ships/build-metrics.d.ts +1061 -0
  169. package/dist/ships/build-metrics.js +1 -0
  170. package/dist/ships/build-metrics.js.map +1 -0
  171. package/dist/ships/distributor.d.ts +10 -3
  172. package/dist/ships/distributor.js +1 -1
  173. package/dist/ships/engineering-options.d.ts +8 -6
  174. package/dist/ships/engineering-options.js +1 -1
  175. package/dist/ships/engineering.d.ts +2 -16
  176. package/dist/ships/engineering.js +1 -1
  177. package/dist/ships/experimental-effect-costs.d.ts +5 -5
  178. package/dist/ships/experimental-effect-costs.js +1 -1
  179. package/dist/ships/experimental-effects.d.ts +9 -8
  180. package/dist/ships/experimental-effects.js +1 -1
  181. package/dist/ships/heat.d.ts +7 -2
  182. package/dist/ships/heat.js +1 -1
  183. package/dist/ships/index.d.ts +34 -22
  184. package/dist/ships/index.js +1 -1
  185. package/dist/ships/jump-range.d.ts +10 -3
  186. package/dist/ships/jump-range.js +1 -1
  187. package/dist/ships/loadout-calculations.d.ts +1 -1
  188. package/dist/ships/loadout-calculations.js +1 -1
  189. package/dist/ships/mobility-capacitor.d.ts +90 -0
  190. package/dist/ships/mobility-capacitor.js +1 -0
  191. package/dist/ships/mobility-capacitor.js.map +1 -0
  192. package/dist/ships/mobility.d.ts +41 -17
  193. package/dist/ships/mobility.js +1 -1
  194. package/dist/ships/modules-all.js +1 -1
  195. package/dist/ships/modules-core.js +1 -1
  196. package/dist/ships/modules.d.ts +27 -1
  197. package/dist/ships/modules.js +1 -1
  198. package/dist/ships/power.d.ts +12 -5
  199. package/dist/ships/power.js +1 -1
  200. package/dist/ships/pre-engineered-stats.d.ts +10 -8
  201. package/dist/ships/pre-engineered-stats.js +1 -1
  202. package/dist/ships/pre-engineered.d.ts +6 -6
  203. package/dist/ships/pre-engineered.js +1 -1
  204. package/dist/ships/resistances.d.ts +2 -2
  205. package/dist/ships/resistances.js +1 -1
  206. package/dist/ships/shield-capacitor.d.ts +133 -0
  207. package/dist/ships/shield-capacitor.js +1 -0
  208. package/dist/ships/shield-capacitor.js.map +1 -0
  209. package/dist/ships/shield-recovery.d.ts +16 -2
  210. package/dist/ships/shield-recovery.js +1 -1
  211. package/dist/ships/shields.d.ts +86 -28
  212. package/dist/ships/shields.js +1 -1
  213. package/dist/ships/ship-loadout.d.ts +100 -671
  214. package/dist/ships/ship-loadout.js +1 -1
  215. package/dist/ships/ships.d.ts +7 -6
  216. package/dist/ships/ships.js +1 -1
  217. package/dist/ships/slef.d.ts +11 -9
  218. package/dist/ships/slef.js +1 -1
  219. package/dist/ships/source-purchase.d.ts +2 -1
  220. package/dist/ships/source-purchase.js +1 -1
  221. package/dist/ships/weapons-capacitor.d.ts +10 -3
  222. package/dist/ships/weapons-capacitor.js +1 -1
  223. package/dist/ships/weapons.d.ts +22 -6
  224. package/dist/ships/weapons.js +1 -1
  225. package/dist/{system-address-DYsN1qOT.d.ts → system-address-cyJaeZIS.d.ts} +2 -1
  226. package/package.json +17 -2
  227. package/dist/chunk-24INI4U7.js +0 -1
  228. package/dist/chunk-24INI4U7.js.map +0 -1
  229. package/dist/chunk-2FHHMYDC.js +0 -1
  230. package/dist/chunk-2FHHMYDC.js.map +0 -1
  231. package/dist/chunk-2TW4ZBI3.js +0 -1
  232. package/dist/chunk-2TW4ZBI3.js.map +0 -1
  233. package/dist/chunk-2VPVZELZ.js +0 -1
  234. package/dist/chunk-4S6WB7QR.js.map +0 -1
  235. package/dist/chunk-DVL5RBKX.js +0 -1
  236. package/dist/chunk-DVL5RBKX.js.map +0 -1
  237. package/dist/chunk-DYPOL3CI.js.map +0 -1
  238. package/dist/chunk-EXVCRIDP.js +0 -1
  239. package/dist/chunk-EXVCRIDP.js.map +0 -1
  240. package/dist/chunk-FGXWVFN6.js +0 -1
  241. package/dist/chunk-FGXWVFN6.js.map +0 -1
  242. package/dist/chunk-FMPRCYKY.js.map +0 -1
  243. package/dist/chunk-G3265B27.js +0 -1
  244. package/dist/chunk-G3265B27.js.map +0 -1
  245. package/dist/chunk-GQ5GX5TB.js.map +0 -1
  246. package/dist/chunk-IOJXLDJN.js +0 -1
  247. package/dist/chunk-IOJXLDJN.js.map +0 -1
  248. package/dist/chunk-IYU4WLFM.js +0 -1
  249. package/dist/chunk-IYU4WLFM.js.map +0 -1
  250. package/dist/chunk-J42ZXLBL.js.map +0 -1
  251. package/dist/chunk-JPBMRJFC.js.map +0 -1
  252. package/dist/chunk-LJI7VXJD.js +0 -1
  253. package/dist/chunk-LJI7VXJD.js.map +0 -1
  254. package/dist/chunk-OCND33TO.js +0 -1
  255. package/dist/chunk-OCND33TO.js.map +0 -1
  256. package/dist/chunk-P2QOL63K.js +0 -1
  257. package/dist/chunk-P2QOL63K.js.map +0 -1
  258. package/dist/chunk-Q3QCLNVG.js.map +0 -1
  259. package/dist/chunk-QTZPA2FR.js.map +0 -1
  260. package/dist/chunk-RLUS76LZ.js +0 -1
  261. package/dist/chunk-RLUS76LZ.js.map +0 -1
  262. package/dist/chunk-TEOJCBSG.js +0 -1
  263. package/dist/chunk-TEOJCBSG.js.map +0 -1
  264. package/dist/chunk-TMMGS6TC.js +0 -1
  265. package/dist/chunk-TMMGS6TC.js.map +0 -1
  266. package/dist/chunk-W6EPHHTS.js.map +0 -1
  267. package/dist/chunk-Z6XMXMVI.js.map +0 -1
  268. package/dist/chunk-ZNCXENNB.js +0 -1
  269. package/dist/chunk-ZNCXENNB.js.map +0 -1
  270. package/dist/chunk-ZZT2PQZ5.js +0 -1
  271. package/dist/chunk-ZZT2PQZ5.js.map +0 -1
  272. /package/dist/{chunk-6EUVIZAS.js.map → chunk-4QYTVSNR.js.map} +0 -0
  273. /package/dist/{chunk-6EPYVBAX.js.map → chunk-A6OINYNP.js.map} +0 -0
  274. /package/dist/{chunk-VDVFJXX5.js.map → chunk-QY3L5BKN.js.map} +0 -0
@@ -0,0 +1 @@
1
+ import{sourcePurchaseFromLoadout,getSourceModuleValue}from"./chunk-NIURLW2F.js";import{getShipBySymbol,getShipByName,getShipSlots}from"./chunk-6UNAD74Z.js";import{fixedSlotReason,validateLoadout}from"./chunk-B4ZSTOM4.js";import{calculateModuleLimits}from"./chunk-KPETDYQX.js";import{getDefaultLoadout}from"./chunk-GRIK3EDH.js";import{publishLoadoutInternals,effectiveModule}from"./chunk-VYDQHPY2.js";import{parseSlef,toSlef,stringifySlef,getLoadoutModifier}from"./chunk-OVUHQEH5.js";import{isNonOutfittingSlot,isBuiltInHullModule,cloneLoadoutModule,identifyPreEngineeredVariant,cloneModuleStats,availableBlueprintsFor,availableExperimentalsFor,ownKeyIn,FITTED_ITEM,blueprintAvailableFor,blueprintRoutesFor,experimentalAvailableFor,primitiveEngineeringInputsFor,missingBaseLabels,journalModifiersFor,getPreEngineeredStats,getPreEngineeredJournalModifiers,getPreEngineeredModifiers,ordinaryEngineeringProof,unresolvedModifiers,matchingKeyIn,isCargoHatchSlot,isFinalGuardianWeaponEngineering,orderBySlotLayout}from"./chunk-GZYPQIO2.js";import{getPreEngineeredVariants}from"./chunk-PL75RTA2.js";import{builtInModuleBySymbol}from"./chunk-PA5EITW5.js";import{ALL_MODULES}from"./chunk-QY3L5BKN.js";import{singleJumpRange}from"./chunk-6O4NRRSB.js";import{calculateUnladenMass,calculateCargoCapacity,calculateFuelCapacity}from"./chunk-DCB4COCL.js";import{getExperimentalEffect}from"./chunk-77I24V6B.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{baseStats,computeModifiers,labelsForDamageType,scaleForLabel}from"./chunk-CJQ37JII.js";import{resolveBlueprintForModule}from"./chunk-OLKNYGGT.js";import{getExperimentalsForModule}from"./chunk-GLWPSVFV.js";import{getBlueprintGrade}from"./chunk-AYAKU4YA.js";import{loadoutSlotName}from"./chunk-KAA4VOOB.js";import{parseSlotName,enumerateSlots,SLOT_RESTRICTION_LABELS}from"./chunk-RAO35XDF.js";import{normalizeKey,CATALOGUE_KEY}from"./chunk-BKWLI44T.js";import{truncate,describeValue,requireString,requireStringIfPresent}from"./chunk-PKWVG2JY.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var MILITARY_PREFIXES=["int_hullreinforcement","int_metaalloyhullreinforcement","int_modulereinforcement","int_shieldcellbank","int_guardianhullreinforcement","int_guardianmodulereinforcement","int_guardianshieldreinforcement"];var MINING_PREFIXES=["hpt_mininglaser","hpt_mining_abrblstr","hpt_mining_seismchrgwarhd","hpt_mining_subsurfdispmisle","hpt_human_extraction","hpt_miningtoolv2"];var CARGO_PREFIXES=["int_cargorack","int_largecargorack","int_corrosionproofcargorack","int_fueltank"];var RESTRICTED_SLOT_PREFIXES={mining:MINING_PREFIXES,military:MILITARY_PREFIXES,cargo:CARGO_PREFIXES,limpetController:["int_dronecontrol","int_multidronecontrol"],vesselHangar:["int_fighterbay"],passenger:["int_passengercabin","int_mkii_passengercabin"],planetaryApproachSuite:["int_planetapproachsuite"]};var problem=(constraint,message,params)=>({constraint:constraint,message:message,...params===void 0?{}:{params:params}});function restrictionProblem(slot,symbol){const restriction=slot.restriction;if(!restriction)return null;if(RESTRICTED_SLOT_PREFIXES[restriction].some(prefix=>symbol.startsWith(prefix))){return null}return problem("restrictedMount",`slot only takes ${SLOT_RESTRICTION_LABELS[restriction]}`,{restriction:restriction})}function moduleSlotProblem(slot,module){const required=module.restrictedToSlot;if(!required||slot.restriction===required)return null;return problem("restrictedMount",`module only fits a mount that takes ${SLOT_RESTRICTION_LABELS[required]}`,{restriction:required})}function moduleFitProblem(shipSymbol,slot,module){if(slot.kind==="cargoHatch"){return problem("immutableSlot","the cargoHatch slot cannot be changed")}if(slot.kind==="armour"){const hull=getShipBySymbol(shipSymbol);if(module.slot!=="armour"||module.ship===void 0){return problem("armourRequired","not a ship armour module")}if(!hull||module.ship.toLowerCase()!==hull.name.toLowerCase()){const armourHull=getShipByName(module.ship);return problem("wrongHullArmour",`armour belongs to ${truncate(module.ship)}, not ${truncate(hull?.name??shipSymbol)}`,{armourShipName:module.ship,...armourHull===null?{}:{armourShipSymbol:armourHull.symbol},shipSymbol:shipSymbol,...hull===null?{}:{shipName:hull.name}})}return null}const restricted=module.restrictedToShips;if(restricted&&!restricted.some(symbol2=>symbol2.toLowerCase()===shipSymbol.toLowerCase())){const allowedShipNames=restricted.map(symbol2=>{const hull=getShipBySymbol(symbol2);return hull?.name??symbol2});const labels=restricted.map((symbol2,index)=>{const name=allowedShipNames[index];return name===symbol2?symbol2:`${name} (${symbol2})`});return problem("restrictedHull",`module is restricted to ${truncate(labels.join(", "))}`,{allowedShipNames:allowedShipNames,allowedShipSymbols:[...restricted],shipSymbol:shipSymbol})}const wrongMount=moduleSlotProblem(slot,module);if(wrongMount)return wrongMount;const symbol=module.symbol.toLowerCase();const moduleSlot=module.slot;switch(slot.kind){case"core":if(moduleSlot!==slot.core){return problem("wrongCoreType",`not a ${slot.core} module`,{requiredCore:slot.core,moduleSlot:moduleSlot??"none"})}break;case"hardpoint":{if(module.category!=="hardpoint"){return problem("hardpointRequired","not a hardpoint weapon")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}case"utility":if(module.category!=="utility"){return problem("utilityRequired","not a utility module")}return null;case"optional":{const isFuelTank=moduleSlot==="fuelTank";if(module.category!=="internal"&&!isFuelTank){return problem("optionalInternalRequired","not an optional-internal module")}if(moduleSlot&&!isFuelTank){return problem("coreModuleInOptionalSlot","a core module only fits its core slot")}const restricted2=restrictionProblem(slot,symbol);if(restricted2)return restricted2;break}}return module.class>slot.size?problem("oversized",`module size ${truncate(module.class)} exceeds slot size ${slot.size}`,{moduleClass:module.class,slotSize:slot.size}):null}function moduleFitError(shipSymbol,slot,module){return moduleFitProblem(shipSymbol,slot,module)?.message??null}var REBUY_FRACTION=.05;function exportLoadoutEvent(input,options){const fromSource=options.credits==="source";const source=fromSource?input.sourcePurchase:null;const totals=source!==null&&!input.sourceTotalsVoided&&sourceTotalsHold(input.modules,source)?source:null;const hullValue=fromSource?source?.hullValue??null:input.retailHullValue;const modulesValue=fromSource?totals?.modulesValue??null:computedModulesValue(input.modules,input.statsFor);const rebuy=fromSource?totals?.rebuy??null:hullValue===null||modulesValue===null?null:Math.trunc((hullValue+modulesValue)*REBUY_FRACTION);return{Ship:input.shipSymbol.toLowerCase(),...input.shipName===void 0?{}:{ShipName:input.shipName},...input.shipIdent===void 0?{}:{ShipIdent:input.shipIdent},...hullValue===null?{}:{HullValue:hullValue},...modulesValue===null?{}:{ModulesValue:modulesValue},UnladenMass:input.unladenMass,CargoCapacity:input.cargoCapacity,...input.maxJumpRange===null?{}:{MaxJumpRange:input.maxJumpRange},FuelCapacity:{Main:input.fuelCapacity.main,Reserve:input.fuelCapacity.reserve},...rebuy===null?{}:{Rebuy:rebuy},Modules:exportModules(input,options,fromSource)}}function exportModules(input,options,fromSource){const ordered=options.moduleOrder==="slots"?slotOrderedModules(input.modules,input.layout):[...input.modules.values()];return ordered.map(module=>{const on=module.On??(options.explicitPower?true:void 0);const priority=module.Priority??(options.explicitPower?0:void 0);const value=fromSource?sourceModuleValue(module,input.sourcePurchase):moduleValue(module,input.statsFor);return{Slot:module.Slot,Item:module.Item.toLowerCase(),...on===void 0?{}:{On:on},...priority===void 0?{}:{Priority:priority},...module.Health===void 0?{}:{Health:module.Health},...typeof value==="number"?{Value:value}:{},...module.Engineering===void 0?{}:{Engineering:cloneLoadoutModule(module).Engineering}}})}function slotOrderedModules(modules,layout){return orderBySlotLayout([...modules.values()],layout,module=>module.Slot)}function computedModulesValue(modules,statsFor){let sum=0;for(const module of modules.values()){const value=moduleValue(module,statsFor);if(value==="unknown")return null;if(value!=="free")sum+=value}return sum}function moduleValue(module,statsFor){const stats=statsFor(module);if(stats!==null)return stats.cost??"unknown";return isNonOutfittingSlot(module.Slot)||isBuiltInHullModule(module)?"free":"unknown"}var SOURCE_ITEM="ShipLoadout: sourcePurchase moduleValues[].item";function sourceModuleValue(module,source){const entry=source===null?null:getSourceModuleValue(source,module.Slot);if(entry===null)return"unknown";return normalizeKey(entry.item,SOURCE_ITEM)===normalizeKey(module.Item,FITTED_ITEM)?entry.value:"unknown"}function sourceTotalsHold(modules,source){for(const entry of source.moduleValues){const key=matchingKeyIn(modules,entry.slot);const fitted=key===null?void 0:modules.get(key);if(!fitted)return false;if(isCargoHatchSlot(entry.slot)&&entry.value===0)continue;if(normalizeKey(fitted.Item,FITTED_ITEM)!==normalizeKey(entry.item,SOURCE_ITEM)){return false}}return true}function captureLoadoutEvent(event){const modules=event.Modules;const shipName=event.ShipName;const shipIdent=event.ShipIdent;const hullValue=event.HullValue;const modulesValue=event.ModulesValue;const rebuy=event.Rebuy;const unladenMass=event.UnladenMass;const cargoCapacity=event.CargoCapacity;const fuelCapacity=event.FuelCapacity;return{Ship:event.Ship,Modules:Array.isArray(modules)?captureEach(modules,captureModule):modules,...shipName===void 0?{}:{ShipName:shipName},...shipIdent===void 0?{}:{ShipIdent:shipIdent},...hullValue===void 0?{}:{HullValue:hullValue},...modulesValue===void 0?{}:{ModulesValue:modulesValue},...rebuy===void 0?{}:{Rebuy:rebuy},...unladenMass===void 0?{}:{UnladenMass:unladenMass},...cargoCapacity===void 0?{}:{CargoCapacity:cargoCapacity},...fuelCapacity===void 0?{}:{FuelCapacity:{...fuelCapacity}}}}function captureEach(values,capture){const captured=[];const{length:length}=values;for(let index=0;index<length;index++)captured.push(capture(values[index]));return captured}function captureModule(module){if(module===null||typeof module!=="object")return module;const on=module.On;const priority=module.Priority;const health=module.Health;const value=module.Value;const engineering=module.Engineering;return{Slot:module.Slot,Item:module.Item,...on===void 0?{}:{On:on},...priority===void 0?{}:{Priority:priority},...health===void 0?{}:{Health:health},...value===void 0?{}:{Value:value},...engineering===void 0?{}:{Engineering:captureEngineering(engineering)}}}function captureEngineering(engineering){if(engineering===null||typeof engineering!=="object")return engineering;const experimental=engineering.ExperimentalEffect;const experimentalLocalised=engineering.ExperimentalEffect_Localised;const modifiers=engineering.Modifiers;return{BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:engineering.Quality,...experimental===void 0?{}:{ExperimentalEffect:experimental},...experimentalLocalised===void 0?{}:{ExperimentalEffect_Localised:experimentalLocalised},...modifiers===void 0?{}:{Modifiers:Array.isArray(modifiers)?captureEach(modifiers,modifier=>modifier!==null&&typeof modifier==="object"?{...modifier}:modifier):modifiers}}}function hullLayout(shipSymbol){const slots=getShipSlots(shipSymbol);return slots?enumerateSlots(slots):[]}function fixedMountRejects(shipSymbol,layout,slot,stats){const mount=layout.find(candidate=>candidate.key.toLowerCase()===slot.toLowerCase());return mount!==void 0&&moduleFitProblem(shipSymbol,mount,stats)!==null}function normalizeLoadoutEvent(rawEvent){const event=captureLoadoutEvent(rawEvent);requireString(event.Ship,"ShipLoadout.fromLoadout: event.Ship");if(!Array.isArray(event.Modules)){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules must be an array, received ${describeValue(event.Modules)}`)}const modules=/* @__PURE__ */new Map;const slots=/* @__PURE__ */new Set;for(const module of event.Modules){if(module===null||typeof module!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: event.Modules[] must hold module objects, received ${describeValue(module)}`)}requireString(module.Slot,"ShipLoadout.fromLoadout: module.Slot");requireString(module.Item,"ShipLoadout.fromLoadout: module.Item");if(module.Engineering!==void 0){if(module.Engineering===null||typeof module.Engineering!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering must be an object, received ${describeValue(module.Engineering)}`)}requireStringIfPresent(module.Engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");requireStringIfPresent(module.Engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");if(module.Engineering.Modifiers!==void 0&&!Array.isArray(module.Engineering.Modifiers)){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers must be an array, received ${describeValue(module.Engineering.Modifiers)}`)}for(const[index,modifier]of(module.Engineering.Modifiers??[]).entries()){if(modifier===null||typeof modifier!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}] must be an object, received ${describeValue(modifier)}`)}requireString(modifier.Label,`ShipLoadout.fromLoadout: module.Engineering.Modifiers[${index}].Label`)}}const normalizedSlot=module.Slot.toLowerCase();if(slots.has(normalizedSlot)){throw new TypeError(`ShipLoadout.fromLoadout: duplicate slot "${truncate(module.Slot)}"`)}slots.add(normalizedSlot);modules.set(module.Slot,cloneLoadoutModule(module))}const top={};if(event.ShipName!==void 0)top.ShipName=event.ShipName;if(event.ShipIdent!==void 0)top.ShipIdent=event.ShipIdent;if(event.HullValue!==void 0)top.HullValue=event.HullValue;if(event.ModulesValue!==void 0)top.ModulesValue=event.ModulesValue;if(event.Rebuy!==void 0)top.Rebuy=event.Rebuy;if(event.UnladenMass!==void 0)top.UnladenMass=event.UnladenMass;if(event.CargoCapacity!==void 0)top.CargoCapacity=event.CargoCapacity;if(event.FuelCapacity!==void 0)top.FuelCapacity={...event.FuelCapacity};let invalidatesAggregates=false;const outcomes=[];const defaults=getDefaultLoadout(event.Ship)?.modules??[];let layout;for(const[slot,module]of modules){if(isNonOutfittingSlot(slot)||isBuiltInHullModule(module))continue;const stats=builtInModuleBySymbol(module.Item,"ShipLoadout.fromLoadout: module.Item");const slotKind=parseSlotName(slot)?.kind;const fallback=slotKind==="core"||slotKind==="armour"||slotKind==="cargoHatch"?defaults.find(candidate=>candidate.slot.toLowerCase()===slot.toLowerCase()):void 0;const rejected=fallback!==void 0&&(stats===null||slotKind==="cargoHatch"||fixedMountRejects(event.Ship,layout??=hullLayout(event.Ship),slot,stats));if(stats!==null&&!rejected)continue;if(fallback){modules.set(slot,{Slot:slot,Item:fallback.symbol,...module.On===void 0?{}:{On:module.On},...module.Priority===void 0?{}:{Priority:module.Priority},...module.Health===void 0?{}:{Health:module.Health}});outcomes.push({action:"defaulted",slot:slot,sourceSymbol:module.Item,replacementSymbol:fallback.symbol})}else{modules.delete(slot);outcomes.push({action:"emptied",slot:slot,sourceSymbol:module.Item})}invalidatesAggregates=true}for(const fallback of defaults){const slotKind=parseSlotName(fallback.slot)?.kind;if(slotKind!=="core"&&slotKind!=="armour"&&slotKind!=="cargoHatch"||matchingKeyIn(modules,fallback.slot)!==null){continue}const slot=ownKeyIn(modules,fallback.slot);modules.set(slot,{Slot:slot,Item:fallback.symbol});outcomes.push({action:"defaulted",slot:slot,sourceSymbol:null,replacementSymbol:fallback.symbol});if(slotKind==="core")invalidatesAggregates=true}if(invalidatesAggregates){delete top.ModulesValue;delete top.Rebuy;delete top.UnladenMass;delete top.CargoCapacity;delete top.FuelCapacity}const moduleStats=/* @__PURE__ */new Map;const primitiveModifiers=/* @__PURE__ */new Map;for(const module of modules.values()){const engineering=module.Engineering;const variant=identifyPreEngineeredVariant(module);const catalogueVariantStats=variant?getPreEngineeredStats(variant):null;let variantStats=catalogueVariantStats;const retainsBakedExperimental=variant?.experimentalEffectSymbol!==void 0&&typeof engineering?.ExperimentalEffect==="string"&&variant.experimentalEffectSymbol.trim().toLowerCase()===engineering.ExperimentalEffect.trim().toLowerCase();if(variant&&catalogueVariantStats&&!catalogueVariantStats.engineeringLocked&&!retainsBakedExperimental){const{experimentalEffectSymbol:originalExperimental,...withoutExperimental}=variant;const currentExperimental=engineering?.ExperimentalEffect;const currentVariant=typeof currentExperimental==="string"?{...withoutExperimental,experimentalEffectSymbol:currentExperimental}:withoutExperimental;variantStats=getPreEngineeredStats(withoutExperimental);primitiveModifiers.set(module.Slot,[...engineering?.Modifiers??[],...getPreEngineeredModifiers(currentVariant)])}if(variantStats)moduleStats.set(module.Slot,cloneModuleStats(variantStats));const guardianFinal=typeof engineering?.BlueprintName==="string"&&isFinalGuardianWeaponEngineering(module.Item,engineering.BlueprintName);if(variantStats?.engineeringLocked||typeof engineering?.BlueprintName!=="string"||!guardianFinal){continue}const normalizedBlueprint=normalizeKey(engineering.BlueprintName,"ShipLoadout.fromLoadout: module.Engineering.BlueprintName");const normalizedExperimental=normalizeKey(engineering.ExperimentalEffect,"ShipLoadout.fromLoadout: module.Engineering.ExperimentalEffect");const variants=getPreEngineeredVariants(module.Item);const exact=variants.find(candidate=>candidate.engineeringLocked===true&&candidate.blueprintSymbol.toLowerCase()===normalizedBlueprint&&candidate.grade===engineering.Level&&candidate.experimentalEffectSymbol?.toLowerCase()===normalizedExperimental);const guardianBase=variants.find(candidate=>candidate.engineeringLocked===true&&candidate.blueprintSymbol.toLowerCase()===normalizedBlueprint&&candidate.grade===engineering.Level&&candidate.experimentalEffectSymbol===void 0);const stats=exact?getPreEngineeredStats(exact):guardianBase&&engineering.ExperimentalEffect!==void 0?getPreEngineeredStats({...guardianBase,experimentalEffectSymbol:engineering.ExperimentalEffect}):builtInModuleBySymbol(module.Item,"ShipLoadout.fromLoadout: module.Item");if(stats){moduleStats.set(module.Slot,cloneModuleStats({...stats,engineeringLocked:true}))}}return{shipSymbol:event.Ship,modules:modules,moduleStats:moduleStats,primitiveModifiers:primitiveModifiers,top:top,sourcePurchase:sourcePurchaseFromLoadout(event),outcomes:deepFreeze(outcomes)}}var SLOT_KEY="ShipLoadout: slotKey";var FITTED_SLOT="ShipLoadout: fitted module Slot";var LoadoutEditError=class extends TypeError{code;constraint;params;constructor(message,code,params,constraint){super(message);this.code=code;this.params=deepFreeze(structuredClone(params));if(constraint!==void 0)this.constraint=constraint}};var experimentalEffectUnsupported=(code,params)=>deepFreeze({kind:"unsupported",code:code,params:params});var engineeringNormalizationUnsupported=(code,params)=>deepFreeze({kind:"unsupported",code:code,params:params});var AGGREGATE_STATS=["mass","cargoCapacity","fuelCapacity"];var ShipLoadout=class _ShipLoadout{#ship;#shipSymbol;#modules;#moduleStats;#primitiveModifiers;#top;#sourcePurchase;#importOutcomes;#slotCache=/* @__PURE__ */new Map;#layoutCache;constructor(ship,shipSymbol,modules,top,sourcePurchase=null,moduleStats=/* @__PURE__ */new Map,primitiveModifiers=/* @__PURE__ */new Map,importOutcomes=deepFreeze([])){this.#ship=ship;this.#shipSymbol=shipSymbol;this.#modules=modules;this.#top=top;this.#sourcePurchase=sourcePurchase;this.#moduleStats=moduleStats;this.#primitiveModifiers=primitiveModifiers;this.#importOutcomes=importOutcomes;publishLoadoutInternals(this,{ship:ship,modules:()=>[...this.#modules.values()],effectiveModules:()=>this.#modulesForEffectiveStats(),effectiveModule:module=>this.#moduleForEffectiveStats(module),statsFor:module=>this.#statsFor(module),layout:()=>this.#layout(),resolveDrive:()=>this.#resolveDrive(),frameShiftDriveModule:()=>this.#frameShiftDrive()?.module,calculationModules:()=>this.#calculationModules(),statedMainFuel:()=>this.#top.FuelCapacity?.Main})}static fromSlef(input,index=0){const entries=parseSlef(input);const entry=entries[index];if(!entry){throw new TypeError(`ShipLoadout.fromSlef: no entry at index ${truncate(index)} (have ${entries.length})`)}const imported=normalizeLoadoutEvent(entry.data);const ship=getShipBySymbol(imported.shipSymbol);if(!ship){throw new TypeError(`ShipLoadout.fromSlef: unknown hull "${truncate(imported.shipSymbol)}"`)}return _ShipLoadout.#fromImported(imported,ship)}static fromLoadout(event){if(event===null||typeof event!=="object"){throw new TypeError(`ShipLoadout.fromLoadout: event must be a Loadout event, received ${describeValue(event)}`)}const imported=normalizeLoadoutEvent(event);const ship=getShipBySymbol(imported.shipSymbol);if(!ship){throw new TypeError(`ShipLoadout.fromLoadout: unknown hull "${truncate(imported.shipSymbol)}"`)}return _ShipLoadout.#fromImported(imported,ship)}static#fromImported(imported,ship){return new _ShipLoadout(ship,imported.shipSymbol,imported.modules,imported.top,imported.sourcePurchase,imported.moduleStats,imported.primitiveModifiers,imported.outcomes)}static empty(shipSymbol){const requested=requireString(shipSymbol,"ShipLoadout.empty: shipSymbol");const ship=getShipBySymbol(requested);if(!ship){throw new TypeError(`ShipLoadout.empty: no slot layout for hull "${truncate(shipSymbol)}"`)}const fitted=(getDefaultLoadout(ship.symbol)?.modules??[]).filter(module=>{const parsed=parseSlotName(module.slot);return parsed!==null&&fixedSlotReason(parsed)!==null});return new _ShipLoadout(ship,ship.symbol,new Map(fitted.map(module=>[module.slot,{Slot:module.slot,Item:module.symbol}])),{})}static default(shipSymbol){const requested=requireString(shipSymbol,"ShipLoadout.default: shipSymbol");const ship=getShipBySymbol(requested);if(!ship){throw new TypeError(`ShipLoadout.default: no default loadout for hull "${truncate(shipSymbol)}"`)}const loadout=getDefaultLoadout(ship.symbol);return new _ShipLoadout(ship,loadout.symbol,new Map(loadout.modules.map(module=>[module.slot,{Slot:module.slot,Item:module.symbol}])),{})}get shipSymbol(){return this.#shipSymbol}get shipName(){return this.#top.ShipName??null}get shipIdent(){return this.#top.ShipIdent??null}get unladenMass(){return this.#top.UnladenMass??this.#computedUnladenMass()}#computedUnladenMass(){return calculateUnladenMass(this.#ship.hullMass,this.#calculationModules())}get fuelCapacity(){const cap=this.#top.FuelCapacity;if(cap?.Main!==void 0&&cap.Reserve!==void 0){return Object.freeze({main:cap.Main,reserve:cap.Reserve})}const computed=this.#computedFuelCapacity();return Object.freeze({main:cap?.Main??computed.main,reserve:cap?.Reserve??computed.reserve})}get cargoCapacity(){return this.#top.CargoCapacity??this.#computedCargoCapacity()}#computedCargoCapacity(){return calculateCargoCapacity(this.#calculationModules())}#computedFuelCapacity(){return calculateFuelCapacity(this.#ship.reserveFuelCapacity,this.#calculationModules())}get hullValue(){return this.#top.HullValue??null}get modulesValue(){return this.#top.ModulesValue??null}get rebuy(){return this.#top.Rebuy??null}get sourcePurchase(){return this.#sourcePurchase}get importOutcomes(){return this.#importOutcomes}validation(){const slots=this.#layout();const byKey=new Map(slots.map(slot=>[normalizeKey(slot.key,CATALOGUE_KEY),slot]));const modules=[...this.#modules.values()].map(module=>{const stats=this.#statsFor(module);const slot=byKey.get(normalizeKey(module.Slot,FITTED_SLOT));const builtIn=stats===null&&isNonOutfittingSlot(module.Slot)||isBuiltInHullModule(module);const fitProblem=stats&&slot&&!builtIn?moduleFitProblem(this.#shipSymbol,slot,stats):null;return{slot:module.Slot,symbol:module.Item,requiresKnownSlot:!builtIn,fitError:fitProblem?.message??null,...fitProblem===null?{}:{fitConstraint:fitProblem.constraint},...fitProblem?.params===void 0?{}:{fitParams:fitProblem.params},...stats?.exclusionGroup===void 0?{}:{exclusionGroup:stats.exclusionGroup},...stats?.limitGroup===void 0?{}:{limitGroup:stats.limitGroup},...stats?.limitIncrease===void 0?{}:{limitIncrease:stats.limitIncrease}}});return validateLoadout({shipSymbol:this.#shipSymbol,slots:slots,modules:modules})}slots(kind){const cached=this.#slotCache.get(kind);if(cached!==void 0)return cached;const slots=kind===void 0?this.#layout():this.#layout().filter(slot=>slot.kind===kind);const currentLimits=this.#moduleLimits();const value=deepFreeze(slots.map(slot=>{const stats=this.#moduleStatsAt(slot.key);const fixedReason=fixedSlotReason(slot);const immovableReason=fixedReason!==null?fixedReason:stats?.limitIncrease!==void 0&&this.#moduleLimitRegression(slot.key,null,currentLimits,stats)!==null?"moduleLimit":null;return{...slot,name:loadoutSlotName(slot),module:this.fittedModuleAt(slot.key),removable:immovableReason===null,...immovableReason===null?{}:{immovableReason:immovableReason}}}));this.#slotCache.set(kind,value);return value}fittedModuleAt(slotKey){const module=this.#fittedModuleFor(slotKey);if(!module)return null;const raw=cloneLoadoutModule(module);const stats=this.#statsFor(module);const effective=effectiveModule(this.#moduleForEffectiveStats(module),stats);return deepFreeze({slot:module.Slot,symbol:raw.Item,on:raw.On,priority:raw.Priority,health:raw.Health,value:raw.Value,engineering:raw.Engineering,raw:raw,stats:stats===null?null:cloneModuleStats(stats),effectiveStats:effective===null?null:cloneModuleStats(effective),ammunition:ammunitionCapacity(effective),preEngineeredVariant:identifyPreEngineeredVariant(raw)})}fittedModules(){return deepFreeze([...this.#modules.keys()].flatMap(key=>{const fitted=this.fittedModuleAt(key);return fitted===null?[]:[fitted]}))}availableBlueprints(slotKey){const module=this.#fittedModuleFor(slotKey);return deepFreeze(module?availableBlueprintsFor(module.Item,this.#statsFor(module)):[])}availableExperimentalEffects(slotKey){const module=this.#fittedModuleFor(slotKey);return deepFreeze(module?availableExperimentalsFor(module.Item,this.#statsFor(module)):[])}modulesForSlot(slotKey){const slot=this.#requireSlot(slotKey);const occupied=new Set([...this.#modules.values()].flatMap(fitted=>{if(normalizeKey(fitted.Slot,FITTED_SLOT)===normalizeKey(slot.key,CATALOGUE_KEY))return[];const group=this.#statsFor(fitted)?.exclusionGroup;return group===void 0?[]:[group]}));const currentLimits=this.#moduleLimits();const currentStats=this.#moduleStatsAt(slot.key);return ALL_MODULES.filter(module=>moduleFitError(this.#shipSymbol,slot,module)===null&&(module.exclusionGroup===void 0||!occupied.has(module.exclusionGroup))&&this.#moduleLimitRegression(slot.key,module,currentLimits,currentStats)===null)}repairFixedMount(slotKey){const requested=requireString(slotKey,SLOT_KEY);const wanted=normalizeKey(requested,SLOT_KEY);const slot=this.#requireSlot(requested);const fittedKey=this.#fittedKey(requested);const resultSlot=fittedKey??requested;const canonicalKey=slot.key;if(fixedSlotReason(slot)===null){return deepFreeze({status:"refused",slot:resultSlot,reason:"notFixedMount"})}const current=this.#fittedModuleFor(requested);const currentStats=current?this.#statsFor(current):null;const valid=current!==void 0&&currentStats!==null&&(slot.kind==="cargoHatch"?isBuiltInHullModule(current):moduleFitProblem(this.#shipSymbol,slot,currentStats)===null);if(valid){return deepFreeze({status:"unchanged",slot:current.Slot,symbol:current.Item})}const defaultModule=getDefaultLoadout(this.#shipSymbol)?.modules.find(module=>normalizeKey(module.slot,CATALOGUE_KEY)===wanted);if(!defaultModule){return deepFreeze({status:"defaultUnavailable",slot:resultSlot})}const ownKey=ownKeyIn(this.#modules,canonicalKey);const replacement={Slot:ownKey,Item:defaultModule.symbol,...current?.On===void 0?{}:{On:current.On},...current?.Priority===void 0?{}:{Priority:current.Priority},...current?.Health===void 0?{}:{Health:current.Health}};const replacementStats=builtInModuleBySymbol(defaultModule.symbol,"ShipLoadout.repairFixedMount")??(isBuiltInHullModule(replacement)?builtInModuleBySymbol("ModularCargoBayDoor","ShipLoadout.repairFixedMount"):null);if(!replacementStats){return deepFreeze({status:"defaultUnavailable",slot:resultSlot,symbol:defaultModule.symbol})}this.#replaceModule(ownKey,replacement,replacementStats);return deepFreeze({status:"repaired",slot:ownKey,symbol:defaultModule.symbol})}setModule(slotKey,module){const slot=this.#requireSlot(slotKey);if(module===null||module===void 0){throw new TypeError(`ShipLoadout.setModule: no module supplied for "${truncate(slotKey)}" (did the module lookup return undefined?)`)}if(typeof module.symbol!=="string"){throw new TypeError(`ShipLoadout.setModule: module for "${truncate(slotKey)}" must be an outfitting module, received ${describeValue(module)}`)}module=cloneModuleStats(module);const catalogued=builtInModuleBySymbol(module.symbol,FITTED_ITEM);if(catalogued===null){throw new TypeError(`ShipLoadout.setModule: no module is catalogued as "${truncate(module.symbol)}"`)}for(const field of AGGREGATE_STATS){const stated=module[field];if(stated===void 0){if(catalogued[field]===void 0)continue;throw new TypeError(`ShipLoadout.setModule: the supplied record for "${truncate(module.symbol)}" has no ${field}`)}if(typeof stated!=="number"||!Number.isFinite(stated)){throw new TypeError(`ShipLoadout.setModule: the supplied record for "${truncate(module.symbol)}" states a ${field} of ${describeValue(stated)}`)}}const problem2=moduleFitProblem(this.#shipSymbol,slot,module);if(problem2){if(problem2.constraint==="immutableSlot"){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem2.message}`,"immutableSlot",{slot:slot.key})}throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${problem2.message}`,"incompatibleModule",{...problem2.params,slot:slot.key,symbol:module.symbol,constraint:problem2.constraint},problem2.constraint)}if(module.exclusionGroup!==void 0){const conflict=[...this.#modules.values()].find(fitted=>normalizeKey(fitted.Slot,FITTED_SLOT)!==normalizeKey(slot.key,CATALOGUE_KEY)&&this.#statsFor(fitted)?.exclusionGroup===module.exclusionGroup);if(conflict){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${module.exclusionGroup} is limited to one per ship (already fitted in ${truncate(conflict.Slot)})`,"duplicateExclusiveModule",{exclusionGroup:module.exclusionGroup,slot:slot.key,symbol:module.symbol,previousSlot:conflict.Slot,previousSymbol:conflict.Item})}}const limitProblem=this.#moduleLimitRegression(slot.key,module);if(limitProblem!==null){throw new LoadoutEditError(`ShipLoadout.setModule: ${truncate(module.symbol)} → ${truncate(slotKey)}: ${limitProblem.group} would have ${limitProblem.count} modules but the ship allows ${limitProblem.limit}`,"moduleLimitExceeded",{group:limitProblem.group,count:limitProblem.count,limit:limitProblem.limit,slot:slot.key,symbol:module.symbol})}const key=this.#fittedKey(slotKey)??slot.key;this.#replaceModule(key,{Slot:key,Item:module.symbol},module);return this}removeModule(slotKey){const wanted=normalizeKey(slotKey,SLOT_KEY);if(wanted==="cargohatch"){throw new LoadoutEditError("ShipLoadout.removeModule: the cargoHatch slot cannot be changed","immutableSlot",{slot:"CargoHatch"})}const parsed=parseSlotName(slotKey);const slot=this.#layout().find(candidate=>normalizeKey(candidate.key,CATALOGUE_KEY)===wanted);if(parsed!==null&&fixedSlotReason(parsed)==="requiredSlot"){const fittedKey=this.#fittedKey(slotKey);const key2=slot?.key??fittedKey??slotKey;throw new LoadoutEditError(`ShipLoadout.removeModule: the ${truncate(key2)} slot is required and cannot be emptied`,"requiredSlot",{slot:key2})}const key=this.#fittedKey(slotKey);if(key!==null){const limitProblem=this.#moduleLimitRegression(key,null);if(limitProblem!==null){const fitted=this.#modules.get(key);throw new LoadoutEditError(`ShipLoadout.removeModule: ${truncate(slotKey)}: ${limitProblem.group} would have ${limitProblem.count} modules but the ship allows ${limitProblem.limit}`,"moduleLimitExceeded",{group:limitProblem.group,count:limitProblem.count,limit:limitProblem.limit,slot:key,...fitted===void 0?{}:{symbol:fitted.Item}})}this.#replaceModule(key,null)}return this}applyBlueprint(slotKey,blueprintSymbol,options){requireString(blueprintSymbol,"ShipLoadout.applyBlueprint: blueprintSymbol");if(options===null||typeof options!=="object"){throw new TypeError(`ShipLoadout.applyBlueprint: options must be an object with a grade, received ${describeValue(options)}`)}const wantedGrade=options.grade;const wantedQuality=options.quality;const wantedExperimental=options.experimentalEffectSymbol??void 0;requireStringIfPresent(wantedExperimental,"ShipLoadout.applyBlueprint: options.experimentalEffectSymbol");const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout.applyBlueprint: slot "${truncate(slotKey)}" is empty`)}const fittedStats=this.#statsFor(module);if(!fittedStats){throw new TypeError(`ShipLoadout.applyBlueprint: no stats for module "${truncate(module.Item)}"`)}const recipe=resolveBlueprintForModule(module.Item,blueprintSymbol);const named=recipe===blueprintSymbol?`"${truncate(blueprintSymbol)}"`:`"${truncate(blueprintSymbol)}" (${truncate(recipe)} on this module)`;const written=blueprintSymbol.trim().toLowerCase();const resolved=recipe.trim().toLowerCase();if(getPreEngineeredVariants(module.Item).some(variant=>variant.acquisition==="eventReward"&&(variant.blueprintSymbol.toLowerCase()===written||variant.blueprintSymbol.toLowerCase()===resolved))){throw new TypeError(`ShipLoadout.applyBlueprint: ${named} is a fixed pre-engineered identity, not a craftable blueprint; use setPreEngineeredVariant to fit its fixed article`)}if(!Number.isInteger(wantedGrade)||wantedGrade<1||wantedGrade>5){throw new RangeError(`ShipLoadout.applyBlueprint: no blueprint ${named} grade ${truncate(wantedGrade)}`)}const grade=getBlueprintGrade(recipe,wantedGrade);if(!grade){throw new RangeError(`ShipLoadout.applyBlueprint: no blueprint ${named} grade ${truncate(wantedGrade)}`)}let experimental;if(wantedExperimental!==void 0){experimental=getExperimentalEffect(wantedExperimental);if(!experimental){throw new RangeError(`ShipLoadout.applyBlueprint: unknown experimental effect "${truncate(wantedExperimental)}"`)}}const quality=wantedQuality??1;if(!Number.isFinite(quality)||quality<0||quality>1){throw new RangeError(`ShipLoadout.applyBlueprint: quality must be a finite number in [0, 1]`)}if(fittedStats.engineeringLocked){throw new TypeError(`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is a final pre-engineered article and accepts no further engineering`)}if(!blueprintAvailableFor(module.Item,blueprintSymbol)){const offered=[...blueprintRoutesFor(module.Item)].map(([blueprint,route])=>`${blueprint} (${route})`);throw new TypeError(offered.length>0?`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is not offered blueprint ${named}; available candidates are ${offered.join(", ")}`:`ShipLoadout.applyBlueprint: no registry lists an engineering menu for module "${truncate(module.Item)}"`)}if(wantedExperimental!==void 0&&!experimentalAvailableFor(module.Item,wantedExperimental)){const offered=getExperimentalsForModule(module.Item);throw new TypeError(`ShipLoadout.applyBlueprint: module "${truncate(module.Item)}" is not offered experimental effect "${truncate(wantedExperimental)}"; it takes ${offered.length>0?offered.join(", "):"no experimental effect"}`)}const stats=this.#engineeringBaseStats(module)??fittedStats;const base=baseStats(stats);const canonical=primitiveEngineeringInputsFor(stats,grade,experimental);const missing=missingBaseLabels(stats,base,canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){throw new TypeError(`ShipLoadout.applyBlueprint: cannot compute ${named} for module "${truncate(module.Item)}"; missing base stats for ${missing.join(", ")}`)}const damageDistribution=experimental?.damageDistribution??grade.damageDistribution;const primitiveModifiers=computeModifiers(base,canonical.grade,quality,canonical.experimental);const modifiers=journalModifiersFor(stats,primitiveModifiers);if(damageDistribution){for(const type of["kinetic","thermal","explosive","absolute"]){const value=damageDistribution[type];if(value===void 0)continue;const label=labelsForDamageType(type)[0];if(label===void 0)continue;const damageModifier={Label:label,Value:value*scaleForLabel(label),OriginalValue:(stats.damageDistribution?.[type]??0)*scaleForLabel(label)};modifiers.push(damageModifier);primitiveModifiers.push(damageModifier)}}const engineering={BlueprintName:blueprintSymbol,Level:wantedGrade,Quality:quality,...wantedExperimental!==void 0?{ExperimentalEffect:wantedExperimental}:{},Modifiers:modifiers};this.#replaceModule(module.Slot,{...module,Engineering:engineering},stats,primitiveModifiers);return this}setExperimentalEffect(slotKey,experimental){if(experimental!==null){requireString(experimental,"ShipLoadout.setExperimentalEffect: experimental")}const wanted=experimental;const module=this.#fittedModuleFor(slotKey);if(!module)return experimentalEffectUnsupported("emptySlot",{slot:slotKey});const stats=this.#statsFor(module);if(!stats){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const engineering=module.Engineering;if(!engineering){return experimentalEffectUnsupported("notEngineered",{slot:module.Slot,symbol:module.Item})}if(stats.engineeringLocked){return experimentalEffectUnsupported("finalArticle",{slot:module.Slot,symbol:module.Item})}const previous=engineering.ExperimentalEffect??null;if(previous===null&&wanted===null||previous!==null&&wanted!==null&&previous.trim().toLowerCase()===wanted.trim().toLowerCase()){return deepFreeze({kind:"unchanged",experimentalEffectSymbol:previous})}const variant=identifyPreEngineeredVariant(module);let effect;if(wanted!==null){effect=getExperimentalEffect(wanted);if(!effect){return experimentalEffectUnsupported("unknownExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:wanted})}const restoresBakedEffect=variant?.experimentalEffectSymbol!==void 0&&variant.experimentalEffectSymbol.trim().toLowerCase()===wanted.trim().toLowerCase();if(!experimentalAvailableFor(module.Item,wanted)&&!restoresBakedEffect){return experimentalEffectUnsupported("unsupportedExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:wanted})}}if(variant&&variant.acquisition!=="mercenary"){const stock=this.#engineeringBaseStats(module);if(!stock){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const missing=missingBaseLabels(stock,baseStats(stock),[],effect?.modifiers);if(missing.length>0){return experimentalEffectUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}const{experimentalEffectSymbol:originalEffect,...withoutEffect}=variant;const adjusted=wanted===null?withoutEffect:{...withoutEffect,experimentalEffectSymbol:wanted};const resolved=getPreEngineeredStats(withoutEffect);if(!resolved){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const replacement={BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:engineering.Quality,...wanted===null?{}:{ExperimentalEffect:wanted},Modifiers:getPreEngineeredJournalModifiers(adjusted)};this.#replaceModule(module.Slot,{...module,Engineering:replacement},cloneModuleStats(resolved),getPreEngineeredModifiers(adjusted))}else{const blueprint=engineering.BlueprintName;const grade=engineering.Level;const quality=engineering.Quality;if(typeof blueprint!=="string"||!Number.isInteger(grade)||grade<1||grade>5){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const currentEffect=previous===null?void 0:getExperimentalEffect(previous)??null;if(ordinaryEngineeringProof(module.Item,engineering,currentEffect)==="unproven"){return experimentalEffectUnsupported("unidentifiedPreEngineeredVariant",{slot:module.Slot,symbol:module.Item,blueprint:blueprint})}const recipe=resolveBlueprintForModule(module.Item,blueprint);const blueprintGrade=getBlueprintGrade(recipe,grade);if(!blueprintGrade||!blueprintAvailableFor(module.Item,blueprint)||!Number.isFinite(quality)||quality<0||quality>1){return experimentalEffectUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item,blueprint:blueprint,grade:grade})}const base=this.#engineeringBaseStats(module)??stats;const canonical=primitiveEngineeringInputsFor(base,blueprintGrade,effect);const missing=missingBaseLabels(base,baseStats(base),canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){return experimentalEffectUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}this.applyBlueprint(module.Slot,blueprint,{grade:grade,quality:quality,...wanted===null?{}:{experimentalEffectSymbol:wanted}})}return deepFreeze({kind:"updated",previousExperimentalEffectSymbol:previous,experimentalEffectSymbol:wanted})}completeEngineeringGrade(slotKey){const module=this.#fittedModuleFor(slotKey);if(!module)return engineeringNormalizationUnsupported("emptySlot",{slot:slotKey});const stats=this.#statsFor(module);if(!stats){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const engineering=module.Engineering;if(!engineering){return engineeringNormalizationUnsupported("notEngineered",{slot:module.Slot,symbol:module.Item})}if(stats.engineeringLocked){return engineeringNormalizationUnsupported("finalArticle",{slot:module.Slot,symbol:module.Item})}if(engineering.Quality===1&&engineering.Modifiers!==void 0){return deepFreeze({kind:"unchanged"})}const previousQuality=engineering.Quality;if(!Number.isFinite(previousQuality)||previousQuality<0||previousQuality>1){return engineeringNormalizationUnsupported("invalidQuality",{slot:module.Slot,symbol:module.Item})}const experimental=engineering.ExperimentalEffect??null;const effect=experimental===null?void 0:getExperimentalEffect(experimental)??void 0;if(experimental!==null&&!effect){return engineeringNormalizationUnsupported("unknownExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:experimental})}const blueprint=engineering.BlueprintName;const grade=engineering.Level;if(typeof blueprint!=="string"||!Number.isInteger(grade)||grade<1||grade>5){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const variant=identifyPreEngineeredVariant(module);const restoresBakedEffect=variant?.experimentalEffectSymbol!==void 0&&variant.experimentalEffectSymbol.trim().toLowerCase()===experimental?.trim().toLowerCase();if(experimental!==null&&!experimentalAvailableFor(module.Item,experimental)&&!restoresBakedEffect){return engineeringNormalizationUnsupported("unsupportedExperimentalEffect",{slot:module.Slot,symbol:module.Item,experimental:experimental})}if(variant&&variant.acquisition!=="mercenary"){const stock=this.#engineeringBaseStats(module);if(!stock){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const missing=missingBaseLabels(stock,baseStats(stock),[],effect?.modifiers);if(missing.length>0){return engineeringNormalizationUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}const{experimentalEffectSymbol:originalEffect,...withoutEffect}=variant;const adjusted=experimental===null?withoutEffect:{...withoutEffect,experimentalEffectSymbol:experimental};const resolved=getPreEngineeredStats(withoutEffect);if(!resolved){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item})}const replacement={BlueprintName:engineering.BlueprintName,Level:engineering.Level,Quality:1,...experimental===null?{}:{ExperimentalEffect:experimental},Modifiers:getPreEngineeredJournalModifiers(adjusted)};this.#replaceModule(module.Slot,{...module,Engineering:replacement},cloneModuleStats(resolved),getPreEngineeredModifiers(adjusted))}else{const proof=ordinaryEngineeringProof(module.Item,engineering,effect);if(proof==="unproven"||proof==="proven"&&!blueprintAvailableFor(module.Item,blueprint)){return engineeringNormalizationUnsupported("unidentifiedPreEngineeredVariant",{slot:module.Slot,symbol:module.Item,blueprint:blueprint})}const recipe=resolveBlueprintForModule(module.Item,blueprint);const blueprintGrade=getBlueprintGrade(recipe,grade);if(!blueprintGrade||!blueprintAvailableFor(module.Item,blueprint)){return engineeringNormalizationUnsupported("unsupportedEngineering",{slot:module.Slot,symbol:module.Item,blueprint:blueprint,grade:grade})}const base=this.#engineeringBaseStats(module)??stats;const canonical=primitiveEngineeringInputsFor(base,blueprintGrade,effect);const missing=missingBaseLabels(base,baseStats(base),canonical.grade.features,canonical.experimental?.modifiers);if(missing.length>0){return engineeringNormalizationUnsupported("unresolvedModifiers",{slot:module.Slot,symbol:module.Item,labels:missing})}this.applyBlueprint(module.Slot,blueprint,{grade:grade,quality:1,...experimental===null?{}:{experimentalEffectSymbol:experimental}})}return deepFreeze({kind:"normalized",previousQuality:previousQuality,quality:1})}setPreEngineeredVariant(slotKey,variant){if(variant===null||typeof variant!=="object"){throw new TypeError(`ShipLoadout.setPreEngineeredVariant: variant must be a pre-engineered variant, received ${describeValue(variant)}`)}requireString(variant.symbol,"ShipLoadout.setPreEngineeredVariant: variant.symbol");requireString(variant.blueprintSymbol,"ShipLoadout.setPreEngineeredVariant: variant.blueprintSymbol");requireString(variant.acquisition,"ShipLoadout.setPreEngineeredVariant: variant.acquisition");requireStringIfPresent(variant.experimentalEffectSymbol,"ShipLoadout.setPreEngineeredVariant: variant.experimentalEffectSymbol");const known=getPreEngineeredVariants(variant.symbol).find(candidate=>candidate.blueprintSymbol.toLowerCase()===variant.blueprintSymbol.toLowerCase()&&candidate.grade===variant.grade&&(candidate.experimentalEffectSymbol?.toLowerCase()??"")===(variant.experimentalEffectSymbol?.toLowerCase()??"")&&candidate.acquisition===variant.acquisition);if(!known){throw new RangeError(`ShipLoadout.setPreEngineeredVariant: no catalogued variant "${truncate(variant.blueprintSymbol)}" for module "${truncate(variant.symbol)}"`)}const stats=getPreEngineeredStats(known);const unresolved=unresolvedModifiers(known);if(unresolved.length>0){throw new TypeError(`ShipLoadout.setPreEngineeredVariant: cannot resolve "${truncate(variant.blueprintSymbol)}" for module "${truncate(variant.symbol)}"; missing base stats for ${unresolved.join(", ")}`)}this.setModule(slotKey,stats);const module=this.#fittedModuleFor(slotKey);const engineering={BlueprintName:known.blueprintSymbol,Level:known.grade,Quality:1,...known.experimentalEffectSymbol===void 0?{}:{ExperimentalEffect:known.experimentalEffectSymbol},...known.modifiers?.length?{Modifiers:getPreEngineeredJournalModifiers(known)}:{}};this.#replaceModule(module.Slot,{...module,Engineering:engineering},cloneModuleStats(stats),getPreEngineeredModifiers(known));return this}clearEngineering(slotKey){const module=this.#fittedModuleFor(slotKey);if(module&&this.#statsFor(module)?.engineeringLocked){throw new TypeError(`ShipLoadout.clearEngineering: module "${truncate(module.Item)}" is a final pre-engineered article and its engineering cannot be removed`)}if(module?.Engineering){const baseStats2=this.#engineeringBaseStats(module);const bare={Slot:module.Slot,Item:module.Item};if(module.On!==void 0)bare.On=module.On;if(module.Priority!==void 0){bare.Priority=module.Priority}if(module.Health!==void 0)bare.Health=module.Health;if(module.Value!==void 0)bare.Value=module.Value;this.#replaceModule(module.Slot,bare,baseStats2??void 0)}return this}setModuleEnabled(slotKey,on){this.#patchModule(slotKey,{On:on});return this}setModulePriority(slotKey,priority){if(!Number.isInteger(priority)||priority<0||priority>4){throw new RangeError(`ShipLoadout: power priority must be an integer 0-4, got ${truncate(priority)}`)}this.#patchModule(slotKey,{Priority:priority});return this}#patchModule(slotKey,patch){const module=this.#fittedModuleFor(slotKey);if(!module){throw new RangeError(`ShipLoadout: slot "${truncate(slotKey)}" is empty`)}this.#modules.set(module.Slot,cloneLoadoutModule({...module,...patch}));this.#slotCache.clear()}toLoadoutEvent(options={}){const unladenMass=this.#computedUnladenMass();const cargoCapacity=this.#computedCargoCapacity();const fuel=this.#computedFuelCapacity();const maxJumpRange=this.#exportableJumpRange(unladenMass);return exportLoadoutEvent({shipSymbol:this.#shipSymbol,...this.#top.ShipName===void 0?{}:{shipName:this.#top.ShipName},...this.#top.ShipIdent===void 0?{}:{shipIdent:this.#top.ShipIdent},modules:this.#modules,layout:this.#layout(),sourcePurchase:this.#sourcePurchase,retailHullValue:this.#ship.hullCost,unladenMass:unladenMass,cargoCapacity:cargoCapacity,fuelCapacity:fuel,maxJumpRange:maxJumpRange,sourceTotalsVoided:this.#importOutcomes.some(outcome=>outcome.sourceSymbol===null&&parseSlotName(outcome.slot)?.kind==="core"),statsFor:module=>this.#statsFor(module)},options)}toSlef(options){return toSlef(this.toLoadoutEvent(options),options.header)}toSlefString(options){return stringifySlef(this.toSlef(options),{indent:options.indent??0})}#exportableJumpRange(unladenMass){let drive;try{drive=this.#resolveDrive()}catch{return null}if(drive===null)return null;const tank=this.#computedFuelCapacity();return singleJumpRange(unladenMass,Math.min(tank.main,drive.maxFuel),drive)}#layout(){if(this.#layoutCache===void 0){this.#layoutCache=Object.freeze(enumerateSlots(this.#ship))}return this.#layoutCache}#requireSlot(slotKey){const wanted=normalizeKey(slotKey,SLOT_KEY);const slot=this.#layout().find(s=>normalizeKey(s.key,CATALOGUE_KEY)===wanted);if(!slot){throw new RangeError(`ShipLoadout: hull "${truncate(this.#shipSymbol)}" has no slot "${truncate(slotKey)}"`)}return slot}#fittedKey(slotKey){return matchingKeyIn(this.#modules,normalizeKey(slotKey,SLOT_KEY))}#fittedModuleFor(slotKey){const key=this.#fittedKey(slotKey);return key===null?void 0:this.#modules.get(key)}#calculationModules(){return[...this.#modules.values()].map(module=>({mass:this.#moduleMass(module),cargoCapacity:this.#moduleCapacity(module,"CargoCapacity","cargoCapacity"),fuelCapacity:this.#moduleCapacity(module,"FuelCapacity","fuelCapacity")}))}#moduleLimits(){const entries=[...this.#modules.values()].flatMap(module=>{const stats=this.#statsFor(module);return stats===null?[]:[stats]});return calculateModuleLimits(entries)}#moduleStatsAt(slotKey){const fitted=this.#fittedModuleFor(slotKey);return fitted===void 0?null:this.#statsFor(fitted)}#engineeringBaseStats(module){const fitted=this.#statsFor(module);if(!module.Engineering||identifyPreEngineeredVariant(module)===null)return fitted;const stock=builtInModuleBySymbol(module.Item,FITTED_ITEM);if(!stock)return fitted;return fitted?.engineeringLocked?cloneModuleStats({...stock,engineeringLocked:true}):stock}#moduleForEffectiveStats(module){const modifiers=this.#primitiveModifiers.get(module.Slot);if(modifiers===void 0||module.Engineering===void 0)return module;return{...module,Engineering:{...module.Engineering,Modifiers:modifiers}}}#modulesForEffectiveStats(){return[...this.#modules.values()].map(module=>this.#moduleForEffectiveStats(module))}#moduleLimitRegression(slotKey,replacement,current=this.#moduleLimits(),previous=this.#moduleStatsAt(slotKey)){if(previous?.limitGroup===void 0&&previous?.limitIncrease===void 0&&replacement?.limitGroup===void 0&&replacement?.limitIncrease===void 0){return null}for(const usage of current){const count=usage.count-Number(previous?.limitGroup===usage.group)+Number(replacement?.limitGroup===usage.group);const increase=usage.increase-(previous?.limitIncrease?.group===usage.group?previous.limitIncrease.amount:0)+(replacement?.limitIncrease?.group===usage.group?replacement.limitIncrease.amount:0);const limit=usage.baseLimit+increase;const excess=Math.max(0,count-limit);if(excess>usage.excess){return{...usage,increase:increase,limit:limit,count:count,excess:excess}}}return null}#replaceModule(slotKey,replacement,replacementStats,primitiveModifiers){const previous=this.#modules.get(slotKey)??null;this.#adjustImportedFigures(previous,replacement,replacementStats);if(replacement===null){this.#modules.delete(slotKey);this.#moduleStats.delete(slotKey);this.#primitiveModifiers.delete(slotKey)}else{this.#modules.set(slotKey,cloneLoadoutModule(replacement));if(replacementStats!==void 0)this.#moduleStats.set(slotKey,replacementStats);if(primitiveModifiers===void 0)this.#primitiveModifiers.delete(slotKey);else this.#primitiveModifiers.set(slotKey,primitiveModifiers)}this.#slotCache.clear()}#adjustImportedFigures(previous,next,nextStats){if(this.#top.UnladenMass!==void 0){this.#top.UnladenMass+=this.#moduleMass(next,nextStats)-this.#moduleMass(previous)}if(this.#top.CargoCapacity!==void 0){this.#top.CargoCapacity+=this.#moduleCapacity(next,"CargoCapacity","cargoCapacity",nextStats)-this.#moduleCapacity(previous,"CargoCapacity","cargoCapacity")}if(this.#top.FuelCapacity?.Main!==void 0){const reserve=this.#top.FuelCapacity.Reserve;this.#top.FuelCapacity={Main:this.#top.FuelCapacity.Main+this.#moduleCapacity(next,"FuelCapacity","fuelCapacity",nextStats)-this.#moduleCapacity(previous,"FuelCapacity","fuelCapacity"),...reserve===void 0?{}:{Reserve:reserve}}}if(normalizeKey(previous?.Item,FITTED_ITEM)===normalizeKey(next?.Item,FITTED_ITEM)){return}if(previous!==null&&isCargoHatchSlot(previous.Slot)||next!==null&&isCargoHatchSlot(next.Slot)){return}delete this.#top.ModulesValue;delete this.#top.Rebuy}#moduleMass(module,statsOverride){if(module===null)return 0;if(isCargoHatchSlot(module.Slot))return 0;const modified=getLoadoutModifier(module,"Mass");if(modified!==null)return modified;return(statsOverride??this.#statsFor(module))?.mass??0}#moduleCapacity(module,modifierLabel,field,statsOverride){if(module===null)return 0;if(isCargoHatchSlot(module.Slot))return 0;const modified=getLoadoutModifier(module,modifierLabel);if(modified!==null)return modified;return(statsOverride??this.#statsFor(module))?.[field]??0}#frameShiftDrive(){for(const m of this.#modules.values()){const stats=this.#statsFor(m);if(stats?.slot==="frameShiftDrive")return{module:m,stats:stats}}return void 0}#resolveDrive(){const fsd=this.#frameShiftDrive();if(!fsd)return null;const{module:fsdModule,stats:base}=fsd;if(base.fuelMul===void 0||base.fuelPower===void 0){throw new TypeError(`ShipLoadout: the fitted record for frame shift drive "${truncate(fsdModule.Item)}" has no jump constants`)}const optMass=getLoadoutModifier(fsdModule,"FSDOptimalMass")??base.optMass;const maxFuel=getLoadoutModifier(fsdModule,"MaxFuelPerJump")??base.maxFuel;if(optMass===void 0||maxFuel===void 0){const missing=[...optMass===void 0?["optMass"]:[],...maxFuel===void 0?["maxFuel"]:[]];throw new TypeError(`ShipLoadout: the fitted record for frame shift drive "${truncate(fsdModule.Item)}" has no ${missing.join(" or ")}`)}return{optMass:optMass,maxFuel:maxFuel,fuelMul:base.fuelMul,fuelPower:base.fuelPower,jumpBoost:this.#resolveJumpBoost()}}#resolveJumpBoost(){for(const m of this.#modules.values()){const stats=this.#statsFor(m);if(stats?.engineeringGroup!=="fsdBoosters"&&(stats?.jumpBoost===void 0||stats.jumpBoost===0)){continue}if(m.On===false)continue;if(stats?.jumpBoost===void 0){throw new TypeError(`ShipLoadout: the fitted record for FSD booster "${truncate(m.Item)}" has no jumpBoost`)}return stats.jumpBoost}return 0}#statsFor(module){if(module===null)return null;const stats=this.#moduleStats.get(module.Slot)??builtInModuleBySymbol(module.Item,FITTED_ITEM);if(stats)return stats;return isBuiltInHullModule(module)?builtInModuleBySymbol("ModularCargoBayDoor","ShipLoadout: built-in module"):null}};export{LoadoutEditError,ShipLoadout};//# sourceMappingURL=chunk-OYFMHDYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/internal/loadout-fitting.ts","../src/ships/internal/loadout-export.ts","../src/ships/internal/loadout-import.ts","../src/ships/ship-loadout.ts"],"names":["sourcePurchaseFromLoadout","getSourceModuleValue","getShipBySymbol","getShipByName","getShipSlots","fixedSlotReason","validateLoadout","calculateModuleLimits","getDefaultLoadout","publishLoadoutInternals","effectiveModule","parseSlef","toSlef","stringifySlef","getLoadoutModifier","isNonOutfittingSlot","isBuiltInHullModule","cloneLoadoutModule","identifyPreEngineeredVariant","cloneModuleStats","availableBlueprintsFor","availableExperimentalsFor","ownKeyIn","FITTED_ITEM","blueprintAvailableFor","blueprintRoutesFor","experimentalAvailableFor","primitiveEngineeringInputsFor","missingBaseLabels","journalModifiersFor","getPreEngineeredStats","getPreEngineeredJournalModifiers","getPreEngineeredModifiers","ordinaryEngineeringProof","unresolvedModifiers","matchingKeyIn","isCargoHatchSlot","isFinalGuardianWeaponEngineering","orderBySlotLayout","getPreEngineeredVariants","builtInModuleBySymbol","ALL_MODULES","singleJumpRange","calculateUnladenMass","calculateCargoCapacity","calculateFuelCapacity","getExperimentalEffect","ammunitionCapacity","baseStats","computeModifiers","labelsForDamageType","scaleForLabel","resolveBlueprintForModule","getExperimentalsForModule","getBlueprintGrade","loadoutSlotName","parseSlotName","enumerateSlots","SLOT_RESTRICTION_LABELS","normalizeKey","CATALOGUE_KEY","truncate","describeValue","requireString","requireStringIfPresent","deepFreeze","MILITARY_PREFIXES","MINING_PREFIXES","CARGO_PREFIXES","RESTRICTED_SLOT_PREFIXES","mining","military","cargo","limpetController","vesselHangar","passenger","planetaryApproachSuite","problem","constraint","message","params","restrictionProblem","slot","symbol","restriction","some","prefix","startsWith","moduleSlotProblem","module","required","restrictedToSlot","moduleFitProblem","shipSymbol","kind","hull","ship","toLowerCase","name","armourHull","armourShipName","armourShipSymbol","shipName","restricted","restrictedToShips","allowedShipNames","map","labels","index","join","allowedShipSymbols","wrongMount","moduleSlot","core","requiredCore","category","isFuelTank","class","size","moduleClass","slotSize","moduleFitError","REBUY_FRACTION","exportLoadoutEvent","input","options","fromSource","credits","source","sourcePurchase","totals","sourceTotalsVoided","sourceTotalsHold","modules","hullValue","retailHullValue","modulesValue","computedModulesValue","statsFor","rebuy","Math","trunc","Ship","ShipName","shipIdent","ShipIdent","HullValue","ModulesValue","UnladenMass","unladenMass","CargoCapacity","cargoCapacity","maxJumpRange","MaxJumpRange","FuelCapacity","Main","fuelCapacity","main","Reserve","reserve","Rebuy","Modules","exportModules","ordered","moduleOrder","slotOrderedModules","layout","values","on","On","explicitPower","priority","Priority","value","sourceModuleValue","moduleValue","Slot","Item","Health","Value","Engineering","sum","stats","cost","SOURCE_ITEM","entry","item","moduleValues","key","fitted","get","captureLoadoutEvent","event","Array","isArray","captureEach","captureModule","capture","captured","length","push","health","engineering","captureEngineering","experimental","ExperimentalEffect","experimentalLocalised","ExperimentalEffect_Localised","modifiers","Modifiers","BlueprintName","Level","Quality","modifier","hullLayout","slots","fixedMountRejects","mount","find","candidate","normalizeLoadoutEvent","rawEvent","TypeError","Map","Set","entries","Label","normalizedSlot","has","add","set","top","invalidatesAggregates","outcomes","defaults","slotKind","fallback","rejected","action","sourceSymbol","replacementSymbol","delete","moduleStats","primitiveModifiers","variant","catalogueVariantStats","variantStats","retainsBakedExperimental","experimentalEffectSymbol","trim","engineeringLocked","originalExperimental","withoutExperimental","currentExperimental","currentVariant","guardianFinal","normalizedBlueprint","normalizedExperimental","variants","exact","blueprintSymbol","grade","guardianBase","SLOT_KEY","FITTED_SLOT","LoadoutEditError","code","constructor","super","this","structuredClone","experimentalEffectUnsupported","engineeringNormalizationUnsupported","AGGREGATE_STATS","ShipLoadout","_ShipLoadout","importOutcomes","slotCache","layoutCache","effectiveModules","modulesForEffectiveStats","moduleForEffectiveStats","resolveDrive","frameShiftDriveModule","frameShiftDrive","calculationModules","statedMainFuel","fromSlef","imported","data","fromImported","fromLoadout","empty","requested","filter","parsed","loadout","computedUnladenMass","hullMass","cap","Object","freeze","computed","computedFuelCapacity","computedCargoCapacity","reserveFuelCapacity","validation","byKey","builtIn","fitProblem","requiresKnownSlot","fitError","fitConstraint","fitParams","exclusionGroup","limitGroup","limitIncrease","cached","currentLimits","moduleLimits","moduleStatsAt","fixedReason","immovableReason","moduleLimitRegression","fittedModuleAt","removable","slotKey","fittedModuleFor","raw","effective","effectiveStats","ammunition","preEngineeredVariant","fittedModules","keys","flatMap","availableBlueprints","availableExperimentalEffects","modulesForSlot","requireSlot","occupied","group","currentStats","repairFixedMount","wanted","fittedKey","resultSlot","canonicalKey","status","reason","current","valid","defaultModule","ownKey","replacement","replacementStats","replaceModule","setModule","catalogued","field","stated","Number","isFinite","conflict","previousSlot","previousSymbol","limitProblem","count","limit","removeModule","applyBlueprint","wantedGrade","wantedQuality","quality","wantedExperimental","RangeError","fittedStats","recipe","named","written","resolved","acquisition","isInteger","offered","blueprint","route","engineeringBaseStats","base","canonical","missing","features","damageDistribution","type","label","damageModifier","OriginalValue","setExperimentalEffect","previous","effect","restoresBakedEffect","stock","originalEffect","withoutEffect","adjusted","currentEffect","blueprintGrade","previousExperimentalEffectSymbol","completeEngineeringGrade","previousQuality","proof","setPreEngineeredVariant","known","unresolved","clearEngineering","bare","setModuleEnabled","patchModule","setModulePriority","patch","clear","toLoadoutEvent","fuel","exportableJumpRange","hullCost","outcome","header","toSlefString","indent","drive","tank","min","maxFuel","s","mass","moduleMass","moduleCapacity","usage","increase","amount","baseLimit","excess","max","adjustImportedFigures","next","nextStats","statsOverride","modified","modifierLabel","m","fsd","fsdModule","fuelMul","fuelPower","optMass","jumpBoost","resolveJumpBoost","engineeringGroup"],"mappings":"O,k/DASA,IAAMkE,kBAAuC,CACzC,wBACA,iCACA,0BACA,qBACA,gCACA,kCACA,mCAUJ,IAAMC,gBAAqC,CACvC,kBACA,sBACA,4BACA,8BACA,uBACA,oBAOJ,IAAMC,eAAoC,CACtC,gBACA,qBACA,8BACA,gBAUJ,IAAMC,yBAAuE,CACzEC,OAAQH,gBACRI,SAAUL,kBACVM,MAAOJ,eAEPK,iBAAkB,CAAC,mBAAoB,yBAEvCC,aAAc,CAAC,kBAEfC,UAAW,CAAC,qBAAsB,2BAElCC,uBAAwB,CAAC,4BAU7B,IAAMC,QAAU,CACZC,WACAC,QACAC,UAAA,CACsBF,sBAAYC,mBAAaC,cAAW,EAAY,CAAA,EAAK,CAAEA,iBAEjF,SAASC,mBAAmBC,KAAiBC,QACzC,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AtB,gBACAoB,QAAShE,KAAKgE,QACdC,UAAWjE,KAAKiE,UAChBE,UAAWzL,MAAK0L,mBAExB,CAGA,iBAAAA,GACI,IAAA,MAAWP,KAAKnL,MAAKxI,QAASkC,SAAU,CACpC,MAAMe,MAAQuF,MAAKnI,SAAUsT,GAO7B,GACI1Q,OAAOkR,mBAAqB,gBAC3BlR,OAAOgR,iBAAc,GAAahR,MAAMgR,YAAc,GACzD,CACE,QACJ,CACA,GAAIN,EAAEvR,KAAO,MAAO,SACpB,GAAIa,OAAOgR,iBAAc,EAAW,CAChC,MAAM,IAAIxO,UACN,mDAAmDjK,SAASmY,EAAE/Q,0BAEtE,CACA,OAAOK,MAAMgR,SACjB,CACA,OAAO,CACX,CAGA,SAAA5T,CAAUjD,QACN,GAAIA,SAAW,KAAM,OAAO,KAC5B,MAAM6F,MACFuF,MAAK3B,YAAapD,IAAIrG,OAAOuF,OAASxI,sBAAsBiD,OAAOwF,KAAM1J,aAC7E,GAAI+J,MAAO,OAAOA,MAIlB,OAAOtK,oBAAoByE,QACrBjD,sBAAsB,sBAAuB,gCAC7C,IACV,UACJiO,iBAAAS"}
@@ -0,0 +1 @@
1
+ import{ALL_MATERIALS}from"./chunk-V4C6FIE2.js";import{findInKeyIndex,findByKey,filterByKey,createKeyIndex}from"./chunk-BKWLI44T.js";import{describeValue}from"./chunk-PKWVG2JY.js";var MaterialGrade=/* @__PURE__ */(MaterialGrade2=>{MaterialGrade2[MaterialGrade2["VeryCommon"]=1]="VeryCommon";MaterialGrade2[MaterialGrade2["Common"]=2]="Common";MaterialGrade2[MaterialGrade2["Standard"]=3]="Standard";MaterialGrade2[MaterialGrade2["Rare"]=4]="Rare";MaterialGrade2[MaterialGrade2["VeryRare"]=5]="VeryRare";return MaterialGrade2})(MaterialGrade||{});var MaterialLine=/* @__PURE__ */(MaterialLine2=>{MaterialLine2["Carbon"]="Carbon";MaterialLine2["Phosphorus"]="Phosphorus";MaterialLine2["Sulphur"]="Sulphur";MaterialLine2["Iron"]="Iron";MaterialLine2["Nickel"]="Nickel";MaterialLine2["Rhenium"]="Rhenium";MaterialLine2["Lead"]="Lead";MaterialLine2["Chemical"]="Chemical";MaterialLine2["Thermic"]="Thermic";MaterialLine2["Heat"]="Heat";MaterialLine2["Conductive"]="Conductive";MaterialLine2["MechanicalComponents"]="Mechanical Components";MaterialLine2["Capacitors"]="Capacitors";MaterialLine2["Shielding"]="Shielding";MaterialLine2["Composite"]="Composite";MaterialLine2["Crystals"]="Crystals";MaterialLine2["Alloys"]="Alloys";MaterialLine2["EmissionData"]="Emission Data";MaterialLine2["WakeScans"]="Wake Scans";MaterialLine2["ShieldData"]="Shield Data";MaterialLine2["EncryptionFiles"]="Encryption Files";MaterialLine2["DataArchives"]="Data Archives";MaterialLine2["EncodedFirmware"]="Encoded Firmware";MaterialLine2["Guardian"]="Guardian";MaterialLine2["Thargoid"]="Thargoid";return MaterialLine2})(MaterialLine||{});var MATERIALS_BY_SYMBOL=/* @__PURE__ */createKeyIndex(ALL_MATERIALS,"symbol");var MATERIALS_BY_NAME=/* @__PURE__ */createKeyIndex(ALL_MATERIALS,"name");var MATERIALS_BY_ELEMENT=/* @__PURE__ */createKeyIndex(ALL_MATERIALS,"elementSymbol");function getMaterialBySymbol(symbol,materials=ALL_MATERIALS){return materials===ALL_MATERIALS?findInKeyIndex(MATERIALS_BY_SYMBOL,symbol,"getMaterialBySymbol: symbol"):findByKey(materials,"symbol",symbol,"getMaterialBySymbol: symbol")}function getMaterialByName(name,materials=ALL_MATERIALS){return materials===ALL_MATERIALS?findInKeyIndex(MATERIALS_BY_NAME,name,"getMaterialByName: name"):findByKey(materials,"name",name,"getMaterialByName: name")}function getMaterialByElementSymbol(elementSymbol,materials=ALL_MATERIALS){return materials===ALL_MATERIALS?findInKeyIndex(MATERIALS_BY_ELEMENT,elementSymbol,"getMaterialByElementSymbol: elementSymbol"):findByKey(materials,"elementSymbol",elementSymbol,"getMaterialByElementSymbol: elementSymbol")}function materialsByGrade(grade){if(grade==null)return[];if(typeof grade!=="number"){throw new TypeError(`materialsByGrade: grade must be a number, received ${describeValue(grade)}`)}return ALL_MATERIALS.filter(material=>material.grade===grade)}function materialsInLine(line){return filterByKey(ALL_MATERIALS,"line",line,"materialsInLine: line")}function materialsInCategory(category){return filterByKey(ALL_MATERIALS,"category",category,"materialsInCategory: category")}export{MaterialGrade,MaterialLine,getMaterialByElementSymbol,getMaterialByName,getMaterialBySymbol,materialsByGrade,materialsInCategory,materialsInLine};//# sourceMappingURL=chunk-OYR5HUQZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/materials/materials.ts"],"names":["ALL_MATERIALS","findInKeyIndex","findByKey","filterByKey","createKeyIndex","describeValue","MaterialGrade","MaterialLine","MATERIALS_BY_SYMBOL","MATERIALS_BY_NAME","MATERIALS_BY_ELEMENT","getMaterialBySymbol","symbol","materials","getMaterialByName","name","getMaterialByElementSymbol","elementSymbol","materialsByGrade","grade","TypeError","filter","material","materialsInLine","line","materialsInCategory","category"],"mappings":"O,4KAgFO,IAAKM,6BAAA,CAAAA,iBAERA,eAAAA,eAAA,cAAa,GAAb,aAEAA,eAAAA,eAAA,UAAS,GAAT,SAEAA,eAAAA,eAAA,YAAW,GAAX,WAEAA,eAAAA,eAAA,QAAO,GAAP,OAEAA,eAAAA,eAAA,YAAW,GAAX,WAVQ,OAAAA,cAAA,EAAA,CAAAA,eAAA,CAAA,GAuBL,IAAKC,4BAAA,CAAAA,gBAERA,cAAA,UAAS,SAETA,cAAA,cAAa,aAEbA,cAAA,WAAU,UAEVA,cAAA,QAAO,OAEPA,cAAA,UAAS,SAETA,cAAA,WAAU,UAEVA,cAAA,QAAO,OAEPA,cAAA,YAAW,WAEXA,cAAA,WAAU,UAEVA,cAAA,QAAO,OAEPA,cAAA,cAAa,aAEbA,cAAA,wBAAuB,wBAEvBA,cAAA,cAAa,aAEbA,cAAA,aAAY,YAEZA,cAAA,aAAY,YAEZA,cAAA,YAAW,WAEXA,cAAA,UA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Y_SYMBOL=/* @__PURE__ */createKeyIndex(ALL_MODULES,"symbol");function builtInModuleBySymbol(symbol,label){return findInKeyIndex(MODULES_BY_SYMBOL,symbol,label)}function getModuleBySymbol(symbol,modules=ALL_MODULES){return modules===ALL_MODULES?builtInModuleBySymbol(symbol,"getModuleBySymbol: symbol"):findByKey(modules,"symbol",symbol,"getModuleBySymbol: symbol")}function getModulesByName(name,modules=ALL_MODULES){return filterByKey(modules,"name",name,"getModulesByName: name")}function getBulkheadsForShip(ship,modules=ALL_MODULES){return filterByKey(modules,"ship",ship,"getBulkheadsForShip: ship")}export{builtInModuleBySymbol,getBulkheadsForShip,getModuleBySymbol,getModulesByName};//# sourceMappingURL=chunk-LLHGSBPI.js.map
1
+ import{ALL_MODULES}from"./chunk-QY3L5BKN.js";import{findInKeyIndex,findByKey,filterByKey,createKeyIndex}from"./chunk-BKWLI44T.js";var MODULES_BY_SYMBOL=/* @__PURE__ */createKeyIndex(ALL_MODULES,"symbol");function builtInModuleBySymbol(symbol,label){return findInKeyIndex(MODULES_BY_SYMBOL,symbol,label)}function getModuleBySymbol(symbol,modules=ALL_MODULES){return modules===ALL_MODULES?builtInModuleBySymbol(symbol,"getModuleBySymbol: symbol"):findByKey(modules,"symbol",symbol,"getModuleBySymbol: symbol")}function getModulesByName(name,modules=ALL_MODULES){return filterByKey(modules,"name",name,"getModulesByName: name")}function getBulkheadsForShip(ship,modules=ALL_MODULES){return filterByKey(modules,"ship",ship,"getBulkheadsForShip: ship")}export{builtInModuleBySymbol,getBulkheadsForShip,getModuleBySymbol,getModulesByName};//# sourceMappingURL=chunk-PA5EITW5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ships/internal/module-symbol-index.ts","../src/ships/modules.ts"],"names":["ALL_MODULES","findInKeyIndex","findByKey","filterByKey","createKeyIndex","MODULES_BY_SYMBOL","builtInModuleBySymbol","symbol","label","getModuleBySymbol","modules","getModulesByName","name","getBulkheadsForShip","ship"],"mappings":"O,2HAMA,IAAMK,iCAAoCD,eAAeJ,YAAa,UAS/D,SAASM,sBAAsBC,OAAgBC,OAClD,OAAOP,eAAeI,kBAAmBE,OAAQC,MACrD,CCszBO,SAASC,kBACZF,OACAG,QAAuCV,aAEvC,OAAOU,UAAYV,YACbM,sBAAsBC,OAAQ,6BAC9BL,UAAUQ,QAAS,SAAUH,OAAQ,4BAC/C,CAoBO,SAASI,iBACZC,KACAF,QAAuCV,aAEvC,OAAOG,YAAYO,QAAS,OAAQE,KAAM,yBAC9C,CA8BO,SAASC,oBACZC,KACAJ,QAAuCV,aAEvC,OAAOG,YAAYO,QAAS,OAAQI,KAAM,4BAC9C,QAAAR,sBAAAO,oBAAAJ,kBAAAE"}
1
+ {"version":3,"sources":["../src/ships/internal/module-symbol-index.ts","../src/ships/modules.ts"],"names":["ALL_MODULES","findInKeyIndex","findByKey","filterByKey","createKeyIndex","MODULES_BY_SYMBOL","builtInModuleBySymbol","symbol","label","getModuleBySymbol","modules","getModulesByName","name","getBulkheadsForShip","ship"],"mappings":"O,2HAMA,IAAMK,iCAAoCD,eAAeJ,YAAa,UAS/D,SAASM,sBAAsBC,OAAgBC,OAClD,OAAOP,eAAeI,kBAAmBE,OAAQC,MACrD,CCg1BO,SAASC,kBACZF,OACAG,QAAuCV,aAEvC,OAAOU,UAAYV,YACbM,sBAAsBC,OAAQ,6BAC9BL,UAAUQ,QAAS,SAAUH,OAAQ,4BAC/C,CAoBO,SAASI,iBACZC,KACAF,QAAuCV,aAEvC,OAAOG,YAAYO,QAAS,OAAQE,KAAM,yBAC9C,CA8BO,SAASC,oBACZC,KACAJ,QAAuCV,aAEvC,OAAOG,YAAYO,QAAS,OAAQI,KAAM,4BAC9C,QAAAR,sBAAAO,oBAAAJ,kBAAAE"}
@@ -0,0 +1 @@
1
+ import{filterByKey}from"./chunk-BKWLI44T.js";import{requireStringIfPresent}from"./chunk-PKWVG2JY.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var pre_engineered_default=[{symbol:"Hpt_Mining_AbrBlstr_Fixed_Small",name:"Far-Reaching Abrasion Blaster",blueprintSymbol:"AbrasionBlaster_FarReaching",grade:1,acquisition:"mercenary",mercCoinCost:400},{symbol:"Hpt_CausticMissile_Fixed_Medium",name:"High-Yield Enzyme Missile Rack",blueprintSymbol:"EnzymeMissileRack_HighYield",grade:1,acquisition:"mercenary",mercCoinCost:850},{symbol:"Hpt_Slugshot_Gimbal_Small",name:"Double Screaming Fragment Cannon",blueprintSymbol:"FragmentCannonSmall_DoubleScreaming",grade:1,acquisition:"mercenary",mercCoinCost:800},{symbol:"Hpt_Slugshot_Gimbal_Large",name:"Double Screaming Fragment Cannon",blueprintSymbol:"FragmentCannonLarge_DoubleScreaming",grade:1,acquisition:"mercenary",mercCoinCost:950},{symbol:"Hpt_MiningLaser_Fixed_Small",name:"Long Range Mining Laser",blueprintSymbol:"MiningLaser_LongRange",grade:1,acquisition:"mercenary",mercCoinCost:450},{symbol:"Hpt_MultiCannon_Fixed_Medium",name:"Rapid Phase Multi-Cannon",blueprintSymbol:"MultiCannon_Rapid",grade:1,acquisition:"mercenary",mercCoinCost:850},{symbol:"Hpt_Railgun_Fixed_Medium",name:"Enduring Feedback Rail Gun",blueprintSymbol:"RailGun_LongShot",grade:1,acquisition:"mercenary",mercCoinCost:950},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Drag Seeker Missile Rack",blueprintSymbol:"SeekerMissileRack_Drag",grade:1,acquisition:"mercenary",mercCoinCost:800},{symbol:"Hpt_BasicMissileRack_Fixed_Large",name:"Drag Seeker Missile Rack",blueprintSymbol:"SeekerMissileRack_Drag",grade:1,acquisition:"mercenary",mercCoinCost:900},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Lightweight Thermal Seeker Missile Rack",blueprintSymbol:"SeekerMissileRack_LightWeightThermal",grade:1,acquisition:"mercenary",mercCoinCost:800},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Lockdown Seeker Missile Rack",blueprintSymbol:"SeekerMissileRackMedium_Lockdown",grade:1,acquisition:"mercenary",mercCoinCost:800},{symbol:"Hpt_BasicMissileRack_Fixed_Large",name:"Lockdown Seeker Missile Rack",blueprintSymbol:"SeekerMissileRackLarge_Lockdown",grade:1,acquisition:"mercenary",mercCoinCost:900},{symbol:"Int_CargoRack_Size5_Class1",name:"Extended Cargo Rack",blueprintSymbol:"CargoRackS5C1_Extended",grade:1,acquisition:"mercenary",mercCoinCost:550},{symbol:"Int_CargoRack_Size6_Class1",name:"Extended Cargo Rack",blueprintSymbol:"CargoRackS6C1_Extended",grade:1,acquisition:"mercenary",mercCoinCost:550},{symbol:"Int_DetailedSurfaceScanner_Tiny",name:"Long Range Detailed Surface Scanner",blueprintSymbol:"DetailedSurfaceScanner_LongRange",grade:1,acquisition:"mercenary",mercCoinCost:350},{symbol:"Int_ModuleReinforcement_Size5_Class2",name:"Heavy Duty Module Reinforcement Package",blueprintSymbol:"ModuleReinforcement_HeavyDuty",grade:1,acquisition:"mercenary",mercCoinCost:450},{symbol:"Int_PowerDistributor_Size3_Class2",name:"Support Focused Power Distributor",blueprintSymbol:"PowerDistributorS3C2_SupportFocused",grade:1,acquisition:"mercenary",mercCoinCost:300},{symbol:"Int_PowerDistributor_Size3_Class5",name:"Support Focused Power Distributor",blueprintSymbol:"PowerDistributorS3C5_SupportFocused",grade:1,acquisition:"mercenary",mercCoinCost:350},{symbol:"Int_PowerDistributor_Size4_Class2",name:"Support Focused Power Distributor",blueprintSymbol:"PowerDistributorS4C2_SupportFocused",grade:1,acquisition:"mercenary",mercCoinCost:400},{symbol:"Int_PowerDistributor_Size4_Class5",name:"Support Focused Power Distributor",blueprintSymbol:"PowerDistributorS4C5_SupportFocused",grade:1,acquisition:"mercenary",mercCoinCost:450},{symbol:"Int_PowerDistributor_Size5_Class5",name:"Balanced Power Distributor",blueprintSymbol:"PowerDistributor_Balanced",grade:1,acquisition:"mercenary",mercCoinCost:500},{symbol:"Int_PowerDistributor_Size6_Class5",name:"Support Focused Power Distributor",blueprintSymbol:"PowerDistributorS6C5_SupportFocused",grade:1,acquisition:"mercenary",mercCoinCost:550},{symbol:"Hpt_Mining_AbrBlstr_Fixed_Small",name:"Abrasion Blaster",blueprintSymbol:"Weapon_LongRange",grade:5,acquisition:"communityGoal",modifiers:[{label:"DistributorDraw",method:"multiplicative",value:-.5},{label:"FalloffRange",method:"multiplicative",value:4},{label:"Integrity",method:"multiplicative",value:-.5},{label:"MaximumRange",method:"multiplicative",value:4},{label:"PowerDraw",method:"multiplicative",value:-.5},{label:"ThermalLoad",method:"multiplicative",value:-.5}]},{symbol:"Hpt_CausticMissile_Fixed_Medium",name:"Enzyme Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"communityGoal",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:.75},{label:"AmmoMaximum",method:"multiplicative",value:.25},{label:"Damage",method:"multiplicative",value:.5},{label:"Mass",method:"multiplicative",value:.6},{label:"PowerDraw",method:"multiplicative",value:.2}]},{symbol:"Hpt_Slugshot_Gimbal_Small",name:"Fragment Cannon",blueprintSymbol:"Weapon_DoubleShot",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_screening_shell",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1.6667},{label:"AmmoMaximum",method:"multiplicative",value:.67776},{label:"BurstInterval",method:"multiplicative",value:-.06},{label:"BurstSize",method:"overwrite",value:2},{label:"Mass",method:"multiplicative",value:.6},{label:"MaximumRange",method:"multiplicative",value:-.1},{label:"PowerDraw",method:"multiplicative",value:.2}]},{symbol:"Hpt_Slugshot_Gimbal_Large",name:"Fragment Cannon",blueprintSymbol:"Weapon_DoubleShot",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_screening_shell",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1.6667},{label:"AmmoMaximum",method:"multiplicative",value:.67776},{label:"BurstInterval",method:"multiplicative",value:-.06},{label:"BurstSize",method:"overwrite",value:2},{label:"Mass",method:"multiplicative",value:.6},{label:"MaximumRange",method:"multiplicative",value:-.1},{label:"PowerDraw",method:"multiplicative",value:.2}]},{symbol:"Hpt_Guardian_ShardCannon_Fixed_Medium",name:"Guardian Shard Cannon",blueprintSymbol:"Weapon_LongRange",grade:5,acquisition:"communityGoal",engineeringLocked:true,modifiers:[{label:"ArmourPenetration",method:"multiplicative",value:1.02},{label:"DistributorDraw",method:"multiplicative",value:5.05},{label:"Jitter",method:"additive",value:-3.5},{label:"Mass",method:"multiplicative",value:.5},{label:"MaximumRange",method:"multiplicative",value:4},{label:"PowerDraw",method:"multiplicative",value:1.3},{label:"ShotSpeed",method:"overwrite",value:1258.89},{label:"ThermalLoad",method:"multiplicative",value:15.5}]},{symbol:"Hpt_MultiCannon_Fixed_Medium",name:"Multi-Cannon",blueprintSymbol:"Weapon_RapidFire",grade:1,acquisition:"communityGoal",experimentalEffectSymbol:"special_phasing_sequence",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:3},{label:"AmmoMaximum",method:"overwrite",value:6400},{label:"BurstInterval",method:"overwrite",value:.1},{label:"FalloffRange",method:"multiplicative",value:-.1},{label:"Jitter",method:"additive",value:3},{label:"MaximumRange",method:"multiplicative",value:-.5},{label:"RoundsPerShot",method:"additive",value:2}]},{symbol:"Hpt_Railgun_Fixed_Medium",name:"Rail Gun",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_feedback_cascade_cooled",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"BurstInterval",method:"multiplicative",value:-.61145},{label:"FalloffRange",method:"multiplicative",value:5},{label:"Mass",method:"multiplicative",value:.9},{label:"MaximumRange",method:"multiplicative",value:1},{label:"PowerDraw",method:"multiplicative",value:.65},{label:"ReloadTime",method:"multiplicative",value:.25}]},{symbol:"Hpt_Railgun_Fixed_Medium_Burst",name:"Imperial Hammer Rail Gun",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_super_penetrator",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"BurstInterval",method:"multiplicative",value:-.2635},{label:"Damage",method:"multiplicative",value:-.2},{label:"Mass",method:"multiplicative",value:.7},{label:"PowerDraw",method:"multiplicative",value:.25}]},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Seeker Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:1,acquisition:"communityGoal",experimentalEffectSymbol:"special_drag_munitions",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:2},{label:"AmmoMaximum",method:"multiplicative",value:2},{label:"BurstInterval",method:"multiplicative",value:-.2},{label:"DistributorDraw",method:"overwrite",value:.34},{label:"Mass",method:"multiplicative",value:1.5},{label:"PowerDraw",method:"multiplicative",value:.25}]},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Seeker Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_fsd_interrupt",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"ArmourPenetration",method:"multiplicative",value:.4},{label:"BurstInterval",method:"multiplicative",value:-.1},{label:"Damage",method:"multiplicative",value:.35},{label:"Integrity",method:"multiplicative",value:1},{label:"Mass",method:"multiplicative",value:1.2},{label:"PowerDraw",method:"multiplicative",value:.3},{label:"ThermalLoad",method:"multiplicative",value:-.1}]},{symbol:"Hpt_BasicMissileRack_Fixed_Large",name:"Seeker Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"communityGoal",experimentalEffectSymbol:"special_fsd_interrupt",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"ArmourPenetration",method:"multiplicative",value:.4},{label:"BurstInterval",method:"multiplicative",value:-.1},{label:"Damage",method:"multiplicative",value:.35},{label:"Integrity",method:"multiplicative",value:1},{label:"Mass",method:"multiplicative",value:1.2},{label:"PowerDraw",method:"multiplicative",value:.3},{label:"ThermalLoad",method:"multiplicative",value:-.1}]},{symbol:"Hpt_ElectronicCountermeasure_Tiny",name:"Electronic Countermeasure",blueprintSymbol:"Misc_LightWeight",grade:5,acquisition:"communityGoal",modifiers:[{label:"Integrity",method:"multiplicative",value:1},{label:"Mass",method:"multiplicative",value:-.85},{label:"PowerDraw",method:"multiplicative",value:1}]},{symbol:"Hpt_CrimeScanner_Size0_Class5",name:"Kill Warrant Scanner",blueprintSymbol:"Sensor_FastScan",grade:5,acquisition:"communityGoal",modifiers:[{label:"Integrity",method:"multiplicative",value:-.5},{label:"MaxAngle",method:"multiplicative",value:-.3},{label:"PowerDraw",method:"multiplicative",value:.5},{label:"ScannerRange",method:"multiplicative",value:.65},{label:"ScannerTimeToScan",method:"multiplicative",value:-.8}]},{symbol:"Hpt_CrimeScanner_Size0_Class3",name:"Kill Warrant Scanner",blueprintSymbol:"Sensor_FastScan",grade:5,acquisition:"communityGoal",modifiers:[{label:"Integrity",method:"multiplicative",value:-.5},{label:"MaxAngle",method:"multiplicative",value:-.3},{label:"PowerDraw",method:"multiplicative",value:.5},{label:"ScannerRange",method:"multiplicative",value:.65},{label:"ScannerTimeToScan",method:"multiplicative",value:-.8}]},{symbol:"Hpt_PlasmaPointDefence_Turret_Tiny",name:"Point Defence",blueprintSymbol:"Misc_LightWeight",grade:5,acquisition:"communityGoal",modifiers:[{label:"Integrity",method:"multiplicative",value:-.5},{label:"Mass",method:"multiplicative",value:-.85},{label:"MaximumRange",method:"multiplicative",value:1},{label:"ThermalLoad",method:"multiplicative",value:.05}]},{symbol:"Int_PowerDistributor_Size3_Class5",name:"Power Distributor",blueprintSymbol:"PowerDistributor_PrioritySystems",grade:5,acquisition:"communityGoal",modifiers:[{label:"EnginesCapacity",method:"multiplicative",value:.45},{label:"EnginesRecharge",method:"multiplicative",value:.4},{label:"SystemsCapacity",method:"multiplicative",value:.45},{label:"SystemsRecharge",method:"multiplicative",value:.4},{label:"WeaponsCapacity",method:"multiplicative",value:-.25},{label:"WeaponsRecharge",method:"multiplicative",value:-.2}]},{symbol:"Int_PowerDistributor_Size3_Class2",name:"Power Distributor",blueprintSymbol:"PowerDistributor_PrioritySystems",grade:5,acquisition:"communityGoal",modifiers:[{label:"EnginesCapacity",method:"multiplicative",value:.45},{label:"EnginesRecharge",method:"multiplicative",value:.4},{label:"SystemsCapacity",method:"multiplicative",value:.45},{label:"SystemsRecharge",method:"multiplicative",value:.4},{label:"WeaponsCapacity",method:"multiplicative",value:-.25},{label:"WeaponsRecharge",method:"multiplicative",value:-.2}]},{symbol:"Int_PowerDistributor_Size4_Class5",name:"Power Distributor",blueprintSymbol:"PowerDistributor_PrioritySystems",grade:5,acquisition:"communityGoal",modifiers:[{label:"EnginesCapacity",method:"multiplicative",value:.45},{label:"EnginesRecharge",method:"multiplicative",value:.4},{label:"SystemsCapacity",method:"multiplicative",value:.45},{label:"SystemsRecharge",method:"multiplicative",value:.4},{label:"WeaponsCapacity",method:"multiplicative",value:-.25},{label:"WeaponsRecharge",method:"multiplicative",value:-.2}]},{symbol:"Int_PowerDistributor_Size4_Class2",name:"Power Distributor",blueprintSymbol:"PowerDistributor_PrioritySystems",grade:5,acquisition:"communityGoal",modifiers:[{label:"EnginesCapacity",method:"multiplicative",value:.45},{label:"EnginesRecharge",method:"multiplicative",value:.4},{label:"SystemsCapacity",method:"multiplicative",value:.45},{label:"SystemsRecharge",method:"multiplicative",value:.4},{label:"WeaponsCapacity",method:"multiplicative",value:-.25},{label:"WeaponsRecharge",method:"multiplicative",value:-.2}]},{symbol:"Int_PowerDistributor_Size6_Class5",name:"Power Distributor",blueprintSymbol:"PowerDistributor_PrioritySystems",grade:5,acquisition:"communityGoal",modifiers:[{label:"EnginesCapacity",method:"multiplicative",value:.45},{label:"EnginesRecharge",method:"multiplicative",value:.4},{label:"SystemsCapacity",method:"multiplicative",value:.45},{label:"SystemsRecharge",method:"multiplicative",value:.4},{label:"WeaponsCapacity",method:"multiplicative",value:-.25},{label:"WeaponsRecharge",method:"multiplicative",value:-.2}]},{symbol:"Int_Powerplant_Size3_Class5",name:"Power Plant",blueprintSymbol:"PowerPlant_Armoured",grade:5,acquisition:"communityGoal",modifiers:[{label:"HeatEfficiency",method:"multiplicative",value:.13},{label:"Integrity",method:"multiplicative",value:.95},{label:"Mass",method:"multiplicative",value:.2},{label:"PowerCapacity",method:"multiplicative",value:.52}]},{symbol:"Int_Powerplant_Size3_Class5",name:"Power Plant",blueprintSymbol:"PowerPlant_Boosted",grade:5,acquisition:"communityGoal",modifiers:[{label:"HeatEfficiency",method:"multiplicative",value:.35},{label:"Integrity",method:"multiplicative",value:-.3},{label:"PowerCapacity",method:"multiplicative",value:.6}]},{symbol:"Int_Powerplant_Size4_Class5",name:"Power Plant",blueprintSymbol:"PowerPlant_Boosted",grade:5,acquisition:"communityGoal",modifiers:[{label:"HeatEfficiency",method:"multiplicative",value:.35},{label:"Integrity",method:"multiplicative",value:-.3},{label:"PowerCapacity",method:"multiplicative",value:.6}]},{symbol:"Int_Powerplant_Size5_Class5",name:"Power Plant",blueprintSymbol:"PowerPlant_Boosted",grade:5,acquisition:"communityGoal",modifiers:[{label:"HeatEfficiency",method:"multiplicative",value:.35},{label:"Integrity",method:"overwrite",value:74},{label:"PowerCapacity",method:"multiplicative",value:.6}]},{symbol:"Int_Hyperdrive_Size3_Class5",name:"Frame Shift Drive",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"communityGoal",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Size4_Class5",name:"Frame Shift Drive",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"communityGoal",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Size6_Class5",name:"Frame Shift Drive",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"communityGoal",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_CargoRack_Size5_Class1",name:"Cargo Rack",blueprintSymbol:"CargoRack_IncreasedCapacity",grade:5,acquisition:"communityGoal",modifiers:[{label:"CargoCapacity",method:"multiplicative",value:.34375}]},{symbol:"Int_CargoRack_Size6_Class1",name:"Cargo Rack",blueprintSymbol:"CargoRack_IncreasedCapacity",grade:5,acquisition:"communityGoal",modifiers:[{label:"CargoCapacity",method:"multiplicative",value:.34375}]},{symbol:"Int_ShieldGenerator_Size3_Class5",name:"Shield Generator",blueprintSymbol:"ShieldGenerator_Kinetic",grade:5,acquisition:"communityGoal",modifiers:[{label:"Integrity",method:"multiplicative",value:.2},{label:"KineticResistance",method:"additive",value:.18},{label:"PowerDraw",method:"multiplicative",value:.4},{label:"ThermicResistance",method:"additive",value:.42}]},{symbol:"Hpt_ATDumbfireMissile_Fixed_Medium",name:"AX Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"BurstInterval",method:"multiplicative",value:-.3},{label:"Damage",method:"multiplicative",value:-.03},{label:"DistributorDraw",method:"multiplicative",value:-.2},{label:"Jitter",method:"additive",value:.5},{label:"Mass",method:"multiplicative",value:.7},{label:"PowerDraw",method:"multiplicative",value:.2},{label:"ReloadTime",method:"multiplicative",value:-.45}]},{symbol:"Hpt_ATDumbfireMissile_Fixed_Large",name:"AX Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"BurstInterval",method:"multiplicative",value:-.3},{label:"Damage",method:"multiplicative",value:-.03},{label:"DistributorDraw",method:"multiplicative",value:-.2},{label:"Jitter",method:"additive",value:.5},{label:"Mass",method:"multiplicative",value:.7},{label:"PowerDraw",method:"multiplicative",value:.2},{label:"ReloadTime",method:"multiplicative",value:-.45}]},{symbol:"Hpt_ATMultiCannon_Gimbal_Medium",name:"Enhanced AX Multi-Cannon",blueprintSymbol:"Weapon_Overcharged",grade:5,acquisition:"techBroker",experimentalEffectSymbol:"special_auto_loader",engineeringLocked:true,modifiers:[{label:"Damage",method:"multiplicative",value:.1},{label:"PowerDraw",method:"multiplicative",value:.75},{label:"ThermalLoad",method:"multiplicative",value:3}]},{symbol:"Hpt_ATMultiCannon_Gimbal_Large",name:"Enhanced AX Multi-Cannon",blueprintSymbol:"Weapon_Overcharged",grade:5,acquisition:"techBroker",experimentalEffectSymbol:"special_auto_loader",engineeringLocked:true,modifiers:[{label:"Damage",method:"multiplicative",value:.1},{label:"PowerDraw",method:"multiplicative",value:.75},{label:"ThermalLoad",method:"multiplicative",value:3}]},{symbol:"Hpt_Guardian_GaussCannon_Fixed_Small",name:"Guardian Gauss Cannon",blueprintSymbol:"Weapon_RapidFire",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:3},{label:"AmmoMaximum",method:"multiplicative",value:4},{label:"BurstInterval",method:"multiplicative",value:-.38237},{label:"BurstRateOfFire",method:"overwrite",value:10},{label:"BurstSize",method:"overwrite",value:4},{label:"Damage",method:"multiplicative",value:-.75214},{label:"DistributorDraw",method:"multiplicative",value:-.75},{label:"FalloffRange",method:"multiplicative",value:-.2},{label:"ThermalLoad",method:"multiplicative",value:-.75}]},{symbol:"Hpt_Guardian_GaussCannon_Fixed_Medium",name:"Guardian Gauss Cannon",blueprintSymbol:"Weapon_RapidFire",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:3},{label:"AmmoMaximum",method:"multiplicative",value:4},{label:"BurstInterval",method:"multiplicative",value:-.38237},{label:"BurstRateOfFire",method:"overwrite",value:10},{label:"BurstSize",method:"overwrite",value:4},{label:"Damage",method:"multiplicative",value:-.75214},{label:"DistributorDraw",method:"multiplicative",value:-.75},{label:"FalloffRange",method:"multiplicative",value:-.2},{label:"ThermalLoad",method:"multiplicative",value:-.75}]},{symbol:"Hpt_Guardian_PlasmaLauncher_Fixed_Small",name:"Guardian Plasma Charger",blueprintSymbol:"Weapon_Overcharged",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"overwrite",value:20},{label:"ArmourPenetration",method:"multiplicative",value:.375},{label:"Damage",method:"multiplicative",value:.66},{label:"PowerDraw",method:"multiplicative",value:.3239},{label:"ShotSpeed",method:"multiplicative",value:4},{label:"ThermalLoad",method:"multiplicative",value:.5}]},{symbol:"Hpt_Guardian_PlasmaLauncher_Fixed_Medium",name:"Guardian Plasma Charger",blueprintSymbol:"Weapon_Overcharged",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"AmmoClipSize",method:"overwrite",value:20},{label:"ArmourPenetration",method:"multiplicative",value:.375},{label:"Damage",method:"multiplicative",value:.66},{label:"PowerDraw",method:"multiplicative",value:.3239},{label:"ShotSpeed",method:"multiplicative",value:4},{label:"ThermalLoad",method:"multiplicative",value:.5}]},{symbol:"Hpt_Guardian_ShardCannon_Fixed_Small",name:"Guardian Shard Cannon",blueprintSymbol:"Weapon_LongRange",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"ArmourPenetration",method:"multiplicative",value:1.02},{label:"DistributorDraw",method:"multiplicative",value:4.2769},{label:"FalloffRange",method:"overwrite",value:1500},{label:"Jitter",method:"additive",value:-3.5},{label:"Mass",method:"multiplicative",value:.5},{label:"MaximumRange",method:"overwrite",value:3e3},{label:"PowerDraw",method:"multiplicative",value:1.3},{label:"ShotSpeed",method:"overwrite",value:3568.6},{label:"ThermalLoad",method:"multiplicative",value:15.5}]},{symbol:"Hpt_Guardian_ShardCannon_Fixed_Medium",name:"Guardian Shard Cannon",blueprintSymbol:"Weapon_LongRange",grade:1,acquisition:"techBroker",engineeringLocked:true,modifiers:[{label:"ArmourPenetration",method:"multiplicative",value:1.02},{label:"DistributorDraw",method:"overwrite",value:3.43},{label:"FalloffRange",method:"overwrite",value:1500},{label:"Jitter",method:"additive",value:-3.5},{label:"Mass",method:"multiplicative",value:.5},{label:"MaximumRange",method:"overwrite",value:3e3},{label:"PowerDraw",method:"multiplicative",value:1.3},{label:"ShotSpeed",method:"overwrite",value:6299.209},{label:"ThermalLoad",method:"multiplicative",value:15.5}]},{symbol:"Hpt_MiningLaser_Fixed_Small",name:"Mining Laser",blueprintSymbol:"Weapon_LongRange",grade:5,acquisition:"techBroker",experimentalEffectSymbol:"special_incendiary_rounds",modifiers:[{label:"Damage",method:"multiplicative",value:-.05},{label:"DistributorDraw",method:"multiplicative",value:-.5},{label:"FalloffRange",method:"multiplicative",value:7.3333},{label:"Integrity",method:"multiplicative",value:-.5},{label:"MaximumRange",method:"multiplicative",value:4},{label:"PowerDraw",method:"multiplicative",value:-.5},{label:"ThermalLoad",method:"multiplicative",value:-.83}]},{symbol:"Hpt_BasicMissileRack_Fixed_Medium",name:"Seeker Missile Rack",blueprintSymbol:"Weapon_HighCapacity",grade:5,acquisition:"techBroker",experimentalEffectSymbol:"special_thermal_cascade",modifiers:[{label:"AmmoClipSize",method:"multiplicative",value:1},{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"BurstInterval",method:"multiplicative",value:-.1},{label:"DistributorDraw",method:"multiplicative",value:-.4},{label:"Integrity",method:"multiplicative",value:-.6},{label:"Mass",method:"multiplicative",value:-.9},{label:"PowerDraw",method:"multiplicative",value:-.2}]},{symbol:"Hpt_HeatSinkLauncher_Turret_Tiny",name:"Heat Sink Launcher",blueprintSymbol:"Misc_HeatSinkCapacity",grade:1,acquisition:"techBroker",modifiers:[{label:"AmmoMaximum",method:"multiplicative",value:1},{label:"ReloadTime",method:"multiplicative",value:.75}]},{symbol:"Int_Hyperdrive_Size5_Class5",name:"Frame Shift Drive",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size2_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size3_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size4_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size5_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size6_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_Hyperdrive_Overcharge_Size7_Class5",name:"Frame Shift Drive (SCO)",blueprintSymbol:"FSD_LongRange",grade:5,acquisition:"techBroker",modifiers:[{label:"BootTime",method:"multiplicative",value:-.8},{label:"FSDHeatRate",method:"multiplicative",value:.2},{label:"FSDOptimalMass",method:"multiplicative",value:.7},{label:"Integrity",method:"multiplicative",value:-.3},{label:"Mass",method:"multiplicative",value:.3},{label:"PowerDraw",method:"multiplicative",value:.15}]},{symbol:"Int_DetailedSurfaceScanner_Tiny",name:"Detailed Surface Scanner",blueprintSymbol:"Sensor_Expanded",grade:5,acquisition:"techBroker",modifiers:[{label:"DSS_PatchRadius",method:"multiplicative",value:1}]},{symbol:"Hpt_FlakMortar_Turret_Medium",name:"Festive Green Remote Release Flak Launcher",blueprintSymbol:"Decorative_Green",grade:5,acquisition:"eventReward",modifiers:[{label:"Damage",method:"multiplicative",value:-.99}]},{symbol:"Hpt_FlakMortar_Turret_Medium",name:"Festive Red Remote Release Flak Launcher",blueprintSymbol:"Decorative_Red",grade:5,acquisition:"eventReward",modifiers:[{label:"Damage",method:"multiplicative",value:-.99}]},{symbol:"Hpt_FlakMortar_Turret_Medium",name:"Festive Yellow Remote Release Flak Launcher",blueprintSymbol:"Decorative_Yellow",grade:5,acquisition:"eventReward",modifiers:[{label:"Damage",method:"multiplicative",value:-.99}]}];var PRE_ENGINEERED_MODULES=deepFreeze(pre_engineered_default);function getPreEngineeredVariants(symbol){return filterByKey(PRE_ENGINEERED_MODULES,"symbol",symbol,"getPreEngineeredVariants: symbol")}function isPreEngineered(symbol){requireStringIfPresent(symbol,"isPreEngineered: symbol");return getPreEngineeredVariants(symbol).length>0}export{PRE_ENGINEERED_MODULES,getPreEngineeredVariants,isPreEngineered};//# sourceMappingURL=chunk-PL75RTA2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ships/pre-engineered.ts"],"names":["filterByKey","requireStringIfPresent","deepFreeze","pre_engineered_default","symbol","PRE_ENGINEERED_MODULES","getPreEngineeredVariants","isPreEngineered","length"],"mappings":"O,2w4BAuKO,IAAMK,uBAA0DH,WACnEC,wBA4BG,SAASG,yBAAyBF,QACrC,OAAOJ,YACHK,uBACA,SACAD,OACA,mCAER,CAkBO,SAASG,gBAAgBH,QAC5BH,uBAAuBG,OAAQ,2BAC/B,OAAOE,yBAAyBF,QAAQI,OAAS,CACrD,QAAAH,uBAAAC,yBAAAC"}
1
+ {"version":3,"sources":["../src/ships/pre-engineered.ts"],"names":["filterByKey","requireStringIfPresent","deepFreeze","pre_engineered_default","symbol","PRE_ENGINEERED_MODULES","getPreEngineeredVariants","isPreEngineered","length"],"mappings":"O,m25BAuKO,IAAMK,uBAA0DH,WACnEC,wBA4BG,SAASG,yBAAyBF,QACrC,OAAOJ,YACHK,uBACA,SACAD,OACA,mCAER,CAkBO,SAASG,gBAAgBH,QAC5BH,uBAAuBG,OAAQ,2BAC/B,OAAOE,yBAAyBF,QAAQI,OAAS,CACrD,QAAAH,uBAAAC,yBAAAC"}
@@ -0,0 +1 @@
1
+ import{weaponsCapacitorMetrics}from"./chunk-RRYBSAPX.js";import{shieldCapacitorMetrics}from"./chunk-6L56LWTT.js";import{cellBankSummary,shieldRecovery}from"./chunk-4KJ7CR74.js";import{loadoutInternals,fittedThrusterParamsFor,powerConsumerFor,powerAvailable,heatInputResultFor,completeResult,cellBankInputsFor,armourInputFor,weaponStatsFor,weaponsCapacitorInputFor,mobilityInputResultFor,shieldInputResultFor,shieldCapacitorInputResultFor,shieldRecoveryInputResultFor,distributorInputResultFor,incompleteResult}from"./chunk-VYDQHPY2.js";import{isNonOutfittingSlot,isBuiltInHullModule,identifyPreEngineeredVariant,orderBySlotLayout}from"./chunk-GZYPQIO2.js";import{weaponMetrics,sumWeaponMetrics}from"./chunk-7TQ2X6Q3.js";import{shieldMetrics}from"./chunk-QTAMQ6ME.js";import{powerBudget}from"./chunk-D6YEHR5S.js";import{frameShiftDriveMassFactor,singleJumpRange,fuelPerJump,totalRange}from"./chunk-6O4NRRSB.js";import{calculateUnladenMass}from"./chunk-DCB4COCL.js";import{mobilityCapacitorMetrics}from"./chunk-XUHAPOM6.js";import{mobilityMetrics}from"./chunk-Y6KJJMIM.js";import{distributorMetrics}from"./chunk-YXPZ7QQB.js";import{getExperimentalEffectCost}from"./chunk-CJK2IBI2.js";import{heatMetrics}from"./chunk-Q2L75GSI.js";import{ammunitionCapacity}from"./chunk-AA3K5XUE.js";import{armourMetrics}from"./chunk-FYVPZBXN.js";import{getBlueprintCost}from"./chunk-MTJ4MS7W.js";import{sumMaterials}from"./chunk-CJQ37JII.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var FACADE="BuildMetrics";function requireLoadOptions(scope,options){for(const field of["fuel","cargo"]){const value=options[field];if(value!==void 0&&(!Number.isFinite(value)||value<0)){throw new RangeError(`${scope}: ${field} must be a finite non-negative number`)}}}function requirePipAllocation(scope,name,value){if(!Number.isFinite(value)||value<0||value>4){throw new RangeError(`${scope}: ${name} must be a finite number from 0 to 4`)}return value}var BuildMetrics=class _BuildMetrics{#build;#state;constructor(build,state){this.#build=build;this.#state=state}static of(build){return new _BuildMetrics(build,loadoutInternals(build,`${FACADE}.of: build`))}loadout(){return this.#build}frameShiftDrive(){const drive=this.#state.resolveDrive();if(drive===null){throw new TypeError(`${FACADE}: build has no frame shift drive`)}return drive}thrusters(){return fittedThrusterParamsFor(this.#state.modules(),this.#state.statsFor)}frameShiftDriveMassFactor(options={}){requireLoadOptions(`${FACADE}.frameShiftDriveMassFactor`,options);return frameShiftDriveMassFactor(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}maxJumpRange(){const fsd=this.frameShiftDrive();return singleJumpRange(this.#loadedMass(0),this.#maxJumpFuel(fsd),fsd)}jumpRange(options={}){requireLoadOptions(`${FACADE}.jumpRange`,options);return singleJumpRange(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}ladenJumpRange(){return this.jumpRange({cargo:this.#build.cargoCapacity})}fuelPerJump(distance,options={}){requireLoadOptions(`${FACADE}.fuelPerJump`,options);return fuelPerJump(distance,this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}totalRange(options={}){requireLoadOptions(`${FACADE}.totalRange`,options);return totalRange(this.#loadedMass(options.cargo??0),options.fuel??this.#build.fuelCapacity.main,this.frameShiftDrive())}standardLoad(load){return this.#standardLoad("standardLoad",load).value}standardLoadResult(load){return this.#standardLoad("standardLoadResult",load)}jumpRangeSummary(){const maximum=this.#require(this.standardLoadResult("maximum"),"maximum load");const unladen=this.#require(this.standardLoadResult("unladen"),"unladen load");const laden=this.#require(this.standardLoadResult("laden"),"laden load");return{max:this.jumpRange(maximum),unladen:this.jumpRange(unladen),laden:this.jumpRange(laden),totalMax:this.totalRange(maximum),totalUnladen:this.totalRange(unladen),totalLaden:this.totalRange(laden)}}buildMass(options={}){requireLoadOptions(`${FACADE}.buildMass`,options);const unladen=this.#build.unladenMass;const fuel=options.fuel??this.#build.fuelCapacity.main;const cargo=options.cargo??0;return Object.freeze({hull:this.#state.ship.hullMass,modules:calculateUnladenMass(0,this.#state.calculationModules()),unladen:unladen,fuel:fuel,cargo:cargo,total:unladen+fuel+cargo})}buildCost(){const hull=this.#state.ship.hullCost;let modules=0;let mercCoins=0;const unpriced=[];const materials=[];for(const module of this.#state.modules()){const stats=this.#state.statsFor(module);if(stats?.cost!==void 0){modules+=stats.cost}else if(stats!==null||!isNonOutfittingSlot(module.Slot)&&!isBuiltInHullModule(module)){unpriced.push({slot:module.Slot,symbol:module.Item})}const variant=identifyPreEngineeredVariant(module);mercCoins+=variant?.mercCoinCost??0;const engineering=module.Engineering;if(!engineering)continue;const grade=engineering.Level;const bought=variant?.grade??0;if(Number.isInteger(grade)&&grade>bought&&grade<=5){const climb=getBlueprintCost(engineering.BlueprintName,grade,bought);if(climb){materials.push(climb.materials);mercCoins+=climb.mercCoins}}const experimental=engineering.ExperimentalEffect;if(experimental!==void 0&&experimental.toLowerCase()!==variant?.experimentalEffectSymbol?.toLowerCase()){const cost=getExperimentalEffectCost(experimental);if(cost)materials.push(cost)}}return deepFreeze({credits:{total:hull+modules,hull:hull,modules:modules,rebuy:Math.trunc((hull+modules)*.05),unpriced:unpriced},mercCoins:mercCoins,materials:sumMaterials(...materials)})}powerBudget(){const modules=this.#state.modules();const consumers=[];for(const module of modules){const consumer=powerConsumerFor(module,this.#state.statsFor(module));if(consumer)consumers.push(consumer)}return powerBudget(powerAvailable(modules,this.#state.statsFor),consumers)}heatMetrics(){return this.heatMetricsResult().value}heatMetricsResult(){const input=heatInputResultFor(this.#state.ship,this.#state.effectiveModules(),this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(heatMetrics(input.value)):input}mobilityMetrics(options={}){return this.#mobility("mobilityMetrics",options).value}mobilityMetricsResult(options={}){return this.#mobility("mobilityMetricsResult",options)}mobilityCapacitorMetrics(options={}){return this.#mobilityCapacitor("mobilityCapacitorMetrics",options).value}mobilityCapacitorMetricsResult(options={}){return this.#mobilityCapacitor("mobilityCapacitorMetricsResult",options)}shieldMetrics(){return this.#shields().value}shieldMetricsResult(){return this.#shields()}shieldCapacitorMetrics(options={}){return this.#shieldCapacitor("shieldCapacitorMetrics",options).value}shieldCapacitorMetricsResult(options={}){return this.#shieldCapacitor("shieldCapacitorMetricsResult",options)}shieldRecovery(options={}){return this.#recovery("shieldRecovery",options).value}shieldRecoveryResult(options={}){return this.#recovery("shieldRecoveryResult",options)}cellBanks(){return cellBankSummary(orderBySlotLayout(cellBankInputsFor(this.#state.modules(),this.powerBudget(),this.#state.statsFor),this.#state.layout(),bank=>bank.slot))}armourMetrics(){return armourMetrics(armourInputFor(this.#state.ship,this.#state.modules(),this.#state.statsFor))}weaponMetrics(){const weapons=[];for(const module of this.#state.modules()){const record=this.#state.statsFor(module);const stats=weaponStatsFor(this.#state.effectiveModule(module),record);if(!stats)continue;weapons.push({slot:module.Slot,symbol:module.Item,name:record?.name??module.Item,enabled:module.On!==false,metrics:weaponMetrics(stats),ammunition:ammunitionCapacity(stats),...stats.maximumRange===void 0?{}:{maximumRange:stats.maximumRange},...stats.falloffRange===void 0?{}:{falloffRange:stats.falloffRange},...stats.projectileRange===void 0?{}:{projectileRange:{...stats.projectileRange}},...stats.armourPiercing===void 0?{}:{armourPiercing:stats.armourPiercing}})}const orderedWeapons=orderBySlotLayout(weapons,this.#state.layout(),weapon=>weapon.slot);return{weapons:orderedWeapons,total:sumWeaponMetrics(orderedWeapons.filter(weapon=>weapon.enabled).map(weapon=>weapon.metrics))}}weaponsCapacitorMetrics(options={}){const weaponsPips=requirePipAllocation(`${FACADE}.weaponsCapacitorMetrics`,"weaponsPips",options.weaponsPips??4);return weaponsCapacitorMetrics(weaponsCapacitorInputFor(this.#state.effectiveModules(),weaponsPips,this.powerBudget(),this.#state.statsFor))}distributorMetrics(options={}){return this.#distributor("distributorMetrics",options).value}distributorMetricsResult(options={}){return this.#distributor("distributorMetricsResult",options)}#mobility(method,options){const input=this.#mobilityInput(`${FACADE}.${method}`,options);return input.complete?completeResult(mobilityMetrics(input.value)):input}#mobilityCapacitor(method,options){const scope=`${FACADE}.${method}`;const enginesPips=requirePipAllocation(scope,"enginesPips",options.enginesPips??4);const input=this.#mobilityInput(scope,options);return input.complete?completeResult(mobilityCapacitorMetrics({...input.value,enginesPips:enginesPips})):input}#mobilityInput(scope,options){requireLoadOptions(scope,options);return mobilityInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),()=>this.#loadedMass(options.cargo??0)+(options.fuel??this.#state.statedMainFuel()??this.#build.fuelCapacity.main),this.#state.statsFor)}#shields(){const input=shieldInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(shieldMetrics(input.value)):input}#shieldCapacitor(method,options){const systemsPips=requirePipAllocation(`${FACADE}.${method}`,"systemsPips",options.systemsPips??4);const input=shieldCapacitorInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),systemsPips,this.#state.statsFor);return input.complete?completeResult(shieldCapacitorMetrics(input.value)):input}#recovery(method,options){const systemsPips=requirePipAllocation(`${FACADE}.${method}`,"systemsPips",options.systemsPips??4);const input=shieldRecoveryInputResultFor(this.#state.ship,this.#state.modules(),()=>this.powerBudget(),systemsPips,this.#state.statsFor);return input.complete?completeResult(shieldRecovery(input.value)):input}#distributor(method,options){const scope=`${FACADE}.${method}`;const pips={systemsPips:requirePipAllocation(scope,"systemsPips",options.systemsPips??4),enginesPips:requirePipAllocation(scope,"enginesPips",options.enginesPips??4),weaponsPips:requirePipAllocation(scope,"weaponsPips",options.weaponsPips??4)};const input=distributorInputResultFor(this.#state.effectiveModules(),pips,this.powerBudget(),this.#state.statsFor);return input.complete?completeResult(distributorMetrics(input.value)):input}#standardLoad(method,load){if(load!=="maximum"&&load!=="unladen"&&load!=="laden"){throw new RangeError(`${FACADE}.${method}: load must be 'maximum', 'unladen', or 'laden'`)}const fuel=this.#build.fuelCapacity;const cargo=load==="laden"?this.#build.cargoCapacity:0;const mass=load==="maximum"?this.#build.unladenMass:0;let drive=null;let maximumFuel=null;if(load==="maximum"){const fitted=this.#state.frameShiftDriveModule();let driveError=null;try{drive=this.#state.resolveDrive();maximumFuel=drive?.maxFuel??null}catch(error){if(!(error instanceof Error))throw error;driveError=error}if(maximumFuel===null){return incompleteResult([{field:"frameShiftDrive",reason:fitted?"unresolved":"missing",slot:fitted?.Slot??"FrameShiftDrive",...fitted?{symbol:fitted.Item}:{},message:driveError?.message??"FrameShiftDrive: no frame shift drive is fitted",params:fitted?{field:"frameShiftDrive",reason:"unresolved",slot:fitted.Slot,symbol:fitted.Item}:{field:"frameShiftDrive",reason:"missing",slot:"FrameShiftDrive"}}])}}const carriedFuel=load==="maximum"?Math.min(fuel.main,maximumFuel):fuel.main;const value=Object.freeze({fuel:carriedFuel,cargo:cargo,mass:this.#build.unladenMass+carriedFuel+cargo});if(load==="maximum"){try{this.jumpRange(value)}catch(error){if(!(error instanceof RangeError))throw error;const fitted=this.#state.frameShiftDriveModule();const field=drive!==null&&(!Number.isFinite(drive.maxFuel)||drive.maxFuel<0)?"frameShiftDrive":!Number.isFinite(value.fuel)||value.fuel<0?"fuelCapacity":!Number.isFinite(mass)||mass<0?"mass":"frameShiftDrive";const driveParams=field==="frameShiftDrive"&&fitted?{slot:fitted.Slot,symbol:fitted.Item}:{};return incompleteResult([{field:field,reason:"invalid",...driveParams,message:error.message,params:{field:field,reason:"invalid",...driveParams}}])}}return completeResult(value)}#require(result,what){if(result.value===null){throw new TypeError(`${FACADE}: cannot determine ${what} (${result.issues.map(issue=>issue.message).join("; ")})`)}return result.value}#loadedMass(cargo){return this.#build.unladenMass+cargo}#maxJumpFuel(fsd){return Math.min(this.#build.fuelCapacity.main,fsd.maxFuel)}};export{BuildMetrics};//# sourceMappingURL=chunk-PY5L6WC5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/build-metrics.ts"],"names":["weaponsCapacitorMetrics","shieldCapacitorMetrics","cellBankSummary","shieldRecovery","loadoutInternals","fittedThrusterParamsFor","powerConsumerFor","powerAvailable","heatInputResultFor","completeResult","cellBankInputsFor","armourInputFor","weaponStatsFor","weaponsCapacitorInputFor","mobilityInputResultFor","shieldInputResultFor","shieldCapacitorInputResultFor","shieldRecoveryInputResultFor","distributorInputResultFor","incompleteResult","isNonOutfittingSlot","isBuiltInHullModule","identifyPreEngineeredVariant","orderBySlotLayout","weaponMetrics","sumWeaponMetrics","shieldMetrics","powerBudget","frameShiftDriveMassFactor","singleJumpRange","fuelPerJump","totalRange","calculateUnladenMass","mobilityCapacitorMetrics","mobilityMetrics","distributorMetrics","getExperimentalEffectCost","heatMetrics","ammunitionCapacity","armourMetrics","getBlueprintCost","sumMaterials","deepFreeze","FACADE","requireLoadOptions","scope","options","field","value","Number","isFinite","RangeError","requirePipAllocation","name","BuildMetrics","_BuildMetrics","build","state","constructor","this","of","loadout","frameShiftDrive","drive","resolveDrive","TypeError","thrusters","modules","statsFor","loadedMass","cargo","fuel","fuelCapacity","main","maxJumpRange","fsd","maxJumpFuel","jumpRange","ladenJumpRange","cargoCapacity","distance","standardLoad","load","standardLoadResult","jumpRangeSummary","maximum","require","unladen","laden","max","totalMax","totalUnladen","totalLaden","buildMass","unladenMass","Object","freeze","hull","ship","hullMass","calculationModules","total","buildCost","hullCost","mercCoins","unpriced","materials","module","stats","cost","Slot","push","slot","symbol","Item","variant","mercCoinCost","engineering","Engineering","grade","Level","bought","isInteger","climb","BlueprintName","experimental","ExperimentalEffect","toLowerCase","experimentalEffectSymbol","credits","rebuy","Math","trunc","consumers","consumer","heatMetricsResult","input","effectiveModules","complete","mobility","mobilityMetricsResult","mobilityCapacitor","mobilityCapacitorMetricsResult","shields","shieldMetricsResult","shieldCapacitor","shieldCapacitorMetricsResult","recovery","shieldRecoveryResult","cellBanks","layout","bank","weapons","record","effectiveModule","enabled","On","metrics","ammunition","maximumRange","falloffRange","projectileRange","armourPiercing","orderedWeapons","weapon","filter","map","weaponsPips","distributor","distributorMetricsResult","method","mobilityInput","enginesPips","statedMainFuel","systemsPips","pips","mass","maximumFuel","fitted","frameShiftDriveModule","driveError","maxFuel","error","Error","reason","message","params","carriedFuel","min","driveParams","result","what","issues","issue","join"],"mappings":"O,m7CAsHA,IAAM2C,OAAS,eAuQf,SAASC,mBAAmBC,MAAeC,SACvC,IAAA,MAAWC,QAAS,CAAC,OAAQ,SAAmB,CAC5C,MAAMC,MAAQF,QAAQC,OACtB,GAAIC,aAAU,KAAeC,OAAOC,SAASF,QAAUA,MAAQ,GAAI,CAC/D,MAAM,IAAIG,WAAW,GAAGN,UAAUE,6CACtC,CACJ,CACJ,CAGA,SAASK,qBAAqBP,MAAeQ,KAAcL,OACvD,IAAKC,OAAOC,SAASF,QAAUA,MAAQ,GAAKA,MAAQ,EAAG,CACnD,MAAM,IAAIG,WAAW,GAAGN,UAAUQ,2CACtC,CACA,OAAOL,KACX,CA4BO,IAAMM,aAAN,MAAMC,cACAC,OACAC,OAED,WAAAC,CAAYF,MAAoBC,OACpCE,MAAKH,MAASA,MACdG,MAAKF,MAASA,KAClB,CAqBA,SAAOG,CAAGJ,OACN,OAAO,IAAID,cAAaC,MAAOpD,iBAAiBoD,MAAO,GAAGb,oBAC9D,CASA,OAAAkB,GACI,OAAOF,MAAKH,KAChB,CAUA,eAAAM,GACI,MAAMC,MAAQJ,MAAKF,MAAOO,eAC1B,GAAID,QAAU,KAAM,CAChB,MAAM,IAAIE,UAAU,GAAGtB,yCAC3B,CACA,OAAOoB,KACX,CAgCA,SAAAG,GACI,OAAO7D,wB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AAOsC,YAAcxB,KACrC,CAGA,YAAAM,CAAaD,KACT,OAAOwD,KAAKyD,IAAIjI,MAAKH,MAAOgB,aAAaC,KAAME,IAAI0G,QACvD,UACJ/H"}
@@ -1 +1 @@
1
- var OVERHEAT_HEAT_LEVEL=1.5;var DRAINED_CAPACITOR_MULTIPLIER=5;function equilibriumHeatLevel(dissipation,thermalLoad){requireNonNegative("equilibriumHeatLevel","dissipation",dissipation);requireNonNegative("equilibriumHeatLevel","thermal load",thermalLoad);if(dissipation===0)return thermalLoad===0?0:Infinity;return Math.sqrt(thermalLoad/dissipation)}function effectiveWeaponThermalLoad(thermalLoad,distributorDraw,weaponsCapacity,capacitorLevel){requireNonNegative("effectiveWeaponThermalLoad","thermal load",thermalLoad);requireNonNegative("effectiveWeaponThermalLoad","distributor draw",distributorDraw);requireNonNegative("effectiveWeaponThermalLoad","weapons capacity",weaponsCapacity);requireNonNegative("effectiveWeaponThermalLoad","capacitor level",capacitorLevel);if(capacitorLevel>1){throw new RangeError("effectiveWeaponThermalLoad: capacitor level must be at most 1")}if(weaponsCapacity===0){return thermalLoad*(distributorDraw>0?DRAINED_CAPACITOR_MULTIPLIER:1)}const shortfall=clamp(1-(weaponsCapacity*capacitorLevel-distributorDraw)/weaponsCapacity);return thermalLoad*(1+(DRAINED_CAPACITOR_MULTIPLIER-1)*shortfall)}function heatLevelAtTime(params){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:startLevel,seconds:seconds}=params;validateHeatParams("heatLevelAtTime",heatCapacity,heatDissipation,thermalLoad,startLevel);requireNonNegative("heatLevelAtTime","seconds",seconds);if(seconds===0)return startLevel;const linearRate=(thermalLoad-heatDissipation)/heatCapacity;if(startLevel>=1){if(linearRate>=0)return startLevel+linearRate*seconds;const secondsToOne=(startLevel-1)/-linearRate;if(seconds<=secondsToOne)return startLevel+linearRate*seconds;return belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,1,seconds-secondsToOne)}if(thermalLoad>heatDissipation){const secondsToOne=belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,startLevel,1);if(seconds>secondsToOne)return 1+linearRate*(seconds-secondsToOne)}return belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,startLevel,seconds)}function secondsToHeatLevel(params){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:startLevel,targetLevel:targetLevel}=params;validateHeatParams("secondsToHeatLevel",heatCapacity,heatDissipation,thermalLoad,startLevel);requireNonNegative("secondsToHeatLevel","target level",targetLevel);if(targetLevel===startLevel)return 0;const linearRate=(thermalLoad-heatDissipation)/heatCapacity;if(targetLevel>startLevel){let seconds2=0;let level2=startLevel;if(level2<1){const to=Math.min(targetLevel,1);seconds2=belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,level2,to);if(!Number.isFinite(seconds2)||targetLevel<=1)return seconds2;level2=1}if(linearRate<=0)return Infinity;return seconds2+(targetLevel-level2)/linearRate}let seconds=0;let level=startLevel;if(level>1){if(linearRate>=0)return Infinity;const to=Math.max(targetLevel,1);seconds=(level-to)/-linearRate;if(targetLevel>=1)return seconds;level=1}return seconds+belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,level,targetLevel)}function heatMetrics(input){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,heatEfficiency:heatEfficiency}=input;requireNonNegative("heatMetrics","heat capacity",heatCapacity);requireNonNegative("heatMetrics","heat dissipation",heatDissipation);if(heatCapacity===0)throw new RangeError("heatMetrics: heat capacity must be above 0");requireNonNegative("heatMetrics","heat efficiency",heatEfficiency);const retracted=requireNonNegative("heatMetrics","retracted power draw",input.retractedPowerDraw??0);const deployed=requireNonNegative("heatMetrics","deployed power draw",input.deployedPowerDraw??retracted);const thrusterHeat=requireNonNegative("heatMetrics","thruster heat rate",input.thrusterHeatRate??0);const deployedThrusterHeat=requireNonNegative("heatMetrics","deployed thruster heat rate",input.deployedThrusterHeatRate??thrusterHeat);const fsdHeat=requireNonNegative("heatMetrics","FSD heat rate",input.fsdHeatRate??0);const weaponsCapacity=requireNonNegative("heatMetrics","weapons capacity",input.weaponsCapacity??0);const idleLoad=retracted*heatEfficiency;const deployedLoad=deployed*heatEfficiency;const weaponHeat=capacitorLevel=>(input.weapons??[]).reduce((total,weapon)=>total+effectiveWeaponThermalLoad(weapon.heatPerSecond??0,weapon.distributorDraw??0,weaponsCapacity,capacitorLevel),0);const firingBase=deployedLoad+deployedThrusterHeat;const state=(load,base)=>heatState(heatCapacity,heatDissipation,load,base);return{heatEfficiency:heatEfficiency,hullHeatCapacity:heatCapacity,hullHeatDissipation:heatDissipation,idle:state(idleLoad,0),thrusters:state(idleLoad+thrusterHeat,idleLoad),fsdCharging:state(idleLoad+thrusterHeat+fsdHeat,idleLoad+thrusterHeat),firingSustained:state(firingBase+weaponHeat(1),firingBase),firingDrained:state(firingBase+weaponHeat(0),firingBase)}}function heatState(heatCapacity,heatDissipation,thermalLoad,baseLoad){const overheats=thermalLoad>heatDissipation;const heatLevel=overheats?Infinity:equilibriumHeatLevel(heatDissipation,thermalLoad);const baseLevel=baseLoad>heatDissipation?1:equilibriumHeatLevel(heatDissipation,baseLoad);return{thermalLoad:thermalLoad,heatLevel:heatLevel,gauge:heatLevel/OVERHEAT_HEAT_LEVEL,overheats:overheats,secondsToOverheat:overheats?secondsToHeatLevel({heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:baseLevel,targetLevel:OVERHEAT_HEAT_LEVEL}):null}}function belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,startLevel,seconds){const dissipationRate=heatDissipation/heatCapacity;if(heatDissipation===0)return startLevel+thermalLoad/heatCapacity*seconds;if(thermalLoad===0){if(startLevel===0)return 0;return 1/(1/startLevel+dissipationRate*seconds)}const loadRate=thermalLoad/heatCapacity;const settled=Math.sqrt(loadRate/dissipationRate);const rate=Math.sqrt(dissipationRate*loadRate);if(startLevel===settled)return settled;if(startLevel<settled){return settled*Math.tanh(rate*seconds+Math.atanh(startLevel/settled))}return settled/Math.tanh(rate*seconds+Math.atanh(settled/startLevel))}function belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,startLevel,targetLevel){const dissipationRate=heatDissipation/heatCapacity;if(heatDissipation===0){if(targetLevel<startLevel||thermalLoad===0)return Infinity;return(targetLevel-startLevel)*heatCapacity/thermalLoad}if(thermalLoad===0){if(targetLevel>startLevel)return Infinity;if(targetLevel===0)return Infinity;return(1/targetLevel-1/startLevel)/dissipationRate}const loadRate=thermalLoad/heatCapacity;const settled=Math.sqrt(loadRate/dissipationRate);const rate=Math.sqrt(dissipationRate*loadRate);if(targetLevel>startLevel?targetLevel>=settled:targetLevel<=settled)return Infinity;const from=startLevel<settled?startLevel/settled:settled/startLevel;const to=startLevel<settled?targetLevel/settled:settled/targetLevel;return(Math.atanh(to)-Math.atanh(from))/rate}function clamp(value){return Math.min(Math.max(value,0),1)}function requireNonNegative(caller,what,value){if(!Number.isFinite(value)||value<0){throw new RangeError(`${caller}: ${what} must be a finite non-negative number`)}return value}function validateHeatParams(caller,heatCapacity,heatDissipation,thermalLoad,startLevel){requireNonNegative(caller,"heat capacity",heatCapacity);requireNonNegative(caller,"heat dissipation",heatDissipation);requireNonNegative(caller,"thermal load",thermalLoad);requireNonNegative(caller,"start level",startLevel);if(heatCapacity===0)throw new RangeError(`${caller}: heat capacity must be above 0`)}export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel};//# sourceMappingURL=chunk-W6EPHHTS.js.map
1
+ var OVERHEAT_HEAT_LEVEL=1.5;var DRAINED_CAPACITOR_MULTIPLIER=5;function equilibriumHeatLevel(dissipation,thermalLoad){requireNonNegative("equilibriumHeatLevel","dissipation",dissipation);requireNonNegative("equilibriumHeatLevel","thermal load",thermalLoad);if(dissipation===0)return thermalLoad===0?0:Infinity;return Math.sqrt(thermalLoad/dissipation)}function effectiveWeaponThermalLoad(thermalLoad,distributorDraw,weaponsCapacity,capacitorLevel){requireNonNegative("effectiveWeaponThermalLoad","thermal load",thermalLoad);requireNonNegative("effectiveWeaponThermalLoad","distributor draw",distributorDraw);requireNonNegative("effectiveWeaponThermalLoad","weapons capacity",weaponsCapacity);requireNonNegative("effectiveWeaponThermalLoad","capacitor level",capacitorLevel);if(capacitorLevel>1){throw new RangeError("effectiveWeaponThermalLoad: capacitor level must be at most 1")}if(weaponsCapacity===0){return thermalLoad*(distributorDraw>0?DRAINED_CAPACITOR_MULTIPLIER:1)}const shortfall=clamp(1-(weaponsCapacity*capacitorLevel-distributorDraw)/weaponsCapacity);return thermalLoad*(1+(DRAINED_CAPACITOR_MULTIPLIER-1)*shortfall)}function heatLevelAtTime(params){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:startLevel,seconds:seconds}=params;validateHeatParams("heatLevelAtTime",heatCapacity,heatDissipation,thermalLoad,startLevel);requireNonNegative("heatLevelAtTime","seconds",seconds);if(seconds===0)return startLevel;const linearRate=(thermalLoad-heatDissipation)/heatCapacity;if(startLevel>=1){if(linearRate>=0)return startLevel+linearRate*seconds;const secondsToOne=(startLevel-1)/-linearRate;if(seconds<=secondsToOne)return startLevel+linearRate*seconds;return belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,1,seconds-secondsToOne)}if(thermalLoad>heatDissipation){const secondsToOne=belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,startLevel,1);if(seconds>secondsToOne)return 1+linearRate*(seconds-secondsToOne)}return belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,startLevel,seconds)}function secondsToHeatLevel(params){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:startLevel,targetLevel:targetLevel}=params;validateHeatParams("secondsToHeatLevel",heatCapacity,heatDissipation,thermalLoad,startLevel);requireNonNegative("secondsToHeatLevel","target level",targetLevel);if(targetLevel===startLevel)return 0;const linearRate=(thermalLoad-heatDissipation)/heatCapacity;if(targetLevel>startLevel){let seconds2=0;let level2=startLevel;if(level2<1){const to=Math.min(targetLevel,1);seconds2=belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,level2,to);if(!Number.isFinite(seconds2)||targetLevel<=1)return seconds2;level2=1}if(linearRate<=0)return Infinity;return seconds2+(targetLevel-level2)/linearRate}let seconds=0;let level=startLevel;if(level>1){if(linearRate>=0)return Infinity;const to=Math.max(targetLevel,1);seconds=(level-to)/-linearRate;if(targetLevel>=1)return seconds;level=1}return seconds+belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,level,targetLevel)}function heatMetrics(input){const{heatCapacity:heatCapacity,heatDissipation:heatDissipation,heatEfficiency:heatEfficiency}=input;requireNonNegative("heatMetrics","heat capacity",heatCapacity);requireNonNegative("heatMetrics","heat dissipation",heatDissipation);if(heatCapacity===0)throw new RangeError("heatMetrics: heat capacity must be above 0");requireNonNegative("heatMetrics","heat efficiency",heatEfficiency);const retracted=requireNonNegative("heatMetrics","retracted power draw",input.retractedPowerDraw??0);const deployed=requireNonNegative("heatMetrics","deployed power draw",input.deployedPowerDraw??retracted);const thrusterHeat=requireNonNegative("heatMetrics","thruster heat rate",input.thrusterHeatRate??0);const deployedThrusterHeat=requireNonNegative("heatMetrics","deployed thruster heat rate",input.deployedThrusterHeatRate??thrusterHeat);const fsdHeat=requireNonNegative("heatMetrics","FSD heat rate",input.fsdHeatRate??0);const weaponsCapacity=requireNonNegative("heatMetrics","weapons capacity",input.weaponsCapacity??0);const idleLoad=retracted*heatEfficiency;const deployedLoad=deployed*heatEfficiency;const weaponHeat=capacitorLevel=>(input.weapons??[]).reduce((total,weapon)=>total+effectiveWeaponThermalLoad(weapon.heatPerSecond??0,weapon.distributorDraw??0,weaponsCapacity,capacitorLevel),0);const firingBase=deployedLoad+deployedThrusterHeat;const state=(load,base)=>heatState(heatCapacity,heatDissipation,load,base);return Object.freeze({heatEfficiency:heatEfficiency,hullHeatCapacity:heatCapacity,hullHeatDissipation:heatDissipation,idle:state(idleLoad,0),thrusters:state(idleLoad+thrusterHeat,idleLoad),fsdCharging:state(idleLoad+thrusterHeat+fsdHeat,idleLoad+thrusterHeat),firingSustained:state(firingBase+weaponHeat(1),firingBase),firingDrained:state(firingBase+weaponHeat(0),firingBase)})}function heatState(heatCapacity,heatDissipation,thermalLoad,baseLoad){const overheats=thermalLoad>heatDissipation;const heatLevel=overheats?Infinity:equilibriumHeatLevel(heatDissipation,thermalLoad);const baseLevel=baseLoad>heatDissipation?1:equilibriumHeatLevel(heatDissipation,baseLoad);return Object.freeze({thermalLoad:thermalLoad,heatLevel:heatLevel,gauge:heatLevel/OVERHEAT_HEAT_LEVEL,overheats:overheats,secondsToOverheat:overheats?secondsToHeatLevel({heatCapacity:heatCapacity,heatDissipation:heatDissipation,thermalLoad:thermalLoad,startLevel:baseLevel,targetLevel:OVERHEAT_HEAT_LEVEL}):null})}function belowOneLevelAtTime(heatCapacity,heatDissipation,thermalLoad,startLevel,seconds){const dissipationRate=heatDissipation/heatCapacity;if(heatDissipation===0)return startLevel+thermalLoad/heatCapacity*seconds;if(thermalLoad===0){if(startLevel===0)return 0;return 1/(1/startLevel+dissipationRate*seconds)}const loadRate=thermalLoad/heatCapacity;const settled=Math.sqrt(loadRate/dissipationRate);const rate=Math.sqrt(dissipationRate*loadRate);if(startLevel===settled)return settled;if(startLevel<settled){return settled*Math.tanh(rate*seconds+Math.atanh(startLevel/settled))}return settled/Math.tanh(rate*seconds+Math.atanh(settled/startLevel))}function belowOneSecondsToLevel(heatCapacity,heatDissipation,thermalLoad,startLevel,targetLevel){const dissipationRate=heatDissipation/heatCapacity;if(heatDissipation===0){if(targetLevel<startLevel||thermalLoad===0)return Infinity;return(targetLevel-startLevel)*heatCapacity/thermalLoad}if(thermalLoad===0){if(targetLevel>startLevel)return Infinity;if(targetLevel===0)return Infinity;return(1/targetLevel-1/startLevel)/dissipationRate}const loadRate=thermalLoad/heatCapacity;const settled=Math.sqrt(loadRate/dissipationRate);const rate=Math.sqrt(dissipationRate*loadRate);if(targetLevel>startLevel?targetLevel>=settled:targetLevel<=settled)return Infinity;const from=startLevel<settled?startLevel/settled:settled/startLevel;const to=startLevel<settled?targetLevel/settled:settled/targetLevel;return(Math.atanh(to)-Math.atanh(from))/rate}function clamp(value){return Math.min(Math.max(value,0),1)}function requireNonNegative(caller,what,value){if(!Number.isFinite(value)||value<0){throw new RangeError(`${caller}: ${what} must be a finite non-negative number`)}return value}function validateHeatParams(caller,heatCapacity,heatDissipation,thermalLoad,startLevel){requireNonNegative(caller,"heat capacity",heatCapacity);requireNonNegative(caller,"heat dissipation",heatDissipation);requireNonNegative(caller,"thermal load",thermalLoad);requireNonNegative(caller,"start level",startLevel);if(heatCapacity===0)throw new RangeError(`${caller}: heat capacity must be above 0`)}export{OVERHEAT_HEAT_LEVEL,effectiveWeaponThermalLoad,equilibriumHeatLevel,heatLevelAtTime,heatMetrics,secondsToHeatLevel};//# sourceMappingURL=chunk-Q2L75GSI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/heat.ts"],"names":["OVERHEAT_HEAT_LEVEL","DRAINED_CAPACITOR_MULTIPLIER","equilibriumHeatLevel","dissipation","thermalLoad","requireNonNegative","Infinity","Math","sqrt","effectiveWeaponThermalLoad","distributorDraw","weaponsCapacity","capacitorLevel","RangeError","shortfall","clamp","heatLevelAtTime","params","heatCapacity","heatDissipation","startLevel","seconds","validateHeatParams","linearRate","secondsToOne","belowOneLevelAtTime","belowOneSecondsToLevel","secondsToHeatLevel","targetLevel","level","to","min","Number","isFinite","max","heatMetrics","input","heatEfficiency","retracted","retractedPowerDraw","deployed","deployedPowerDraw","thrusterHeat","thrusterHeatRate","deployedThrusterHeat","deployedThrusterHeatRate","fsdHeat","fsdHeatRate","idleLoad","deployedLoad","weaponHeat","weapons","reduce","total","weapon","heatPerSecond","firingBase","state","load","base","heatState","Object","freeze","hullHeatCapacity","hullHeatDissipation","idle","thrusters","fsdCharging","firingSustained","firingDrained","baseLoad","overheats","heatLevel","baseLevel","gauge","secondsToOverheat","dissipationRate","loadRate","settled","rate","tanh","atanh","from","value","caller","what"],"mappings":"AA8EO,IAAMA,oBAAsB,IAMnC,IAAMC,6BAA+B,EAgL9B,SAASC,qBAAqBC,YAAqBC,aACtDC,mBAAmB,uBAAwB,cAAeF,aAC1DE,mBAAmB,uBAAwB,eAAgBD,aAC3D,GAAID,cAAgB,EAAG,OAAOC,cAAgB,EAAI,EAAIE,SACtD,OAAOC,KAAKC,KAAKJ,YAAcD,YACnC,CAwBO,SAASM,2BACZL,YACAM,gBACAC,gBACAC,gBAEAP,mBAAmB,6BAA8B,eAAgBD,aACjEC,mBAAmB,6BAA8B,mBAAoBK,iBACrEL,mBAAmB,6BAA8B,mBAAoBM,iBACrEN,mBAAmB,6BAA8B,kBAAmBO,gBACpE,GAAIA,eAAiB,EAAG,CACpB,MAAM,IAAIC,WAAW,gEACzB,CACA,GAAIF,kBAAoB,EAAG,CAEvB,OAAOP,aAAeM,gBAAkB,EAAIT,6BAA+B,EAC/E,CACA,MAAMa,UAAYC,MACd,GAAKJ,gBAAkBC,eAAiBF,iBAAmBC,iBAE/D,OAAOP,aAAe,GAAKH,6BAA+B,GAAKa,UACnE,CAoBO,SAASE,gBAAgBC,QAY5B,MAAMC,aAAEA,aAAAC,gBAAcA,gBAAAf,YAAiBA,YAAAgB,WAAaA,WAAAC,QAAYA,SAAYJ,OAC5EK,mBAAmB,kBAAmBJ,aAAcC,gBAAiBf,YAAagB,YAClFf,mBAAmB,kBAAmB,UAAWgB,SACjD,GAAIA,UAAY,EAAG,OAAOD,WAE1B,MAAMG,YAAcnB,YAAce,iBAAmBD,aACrD,GAAIE,YAAc,EAAG,CAEjB,GAAIG,YAAc,EAAG,OAAOH,WAAaG,WAAaF,QACtD,MAAMG,cAAgBJ,WAAa,IAAMG,WACzC,GAAIF,SAAWG,aAAc,OAAOJ,WAAaG,WAAaF,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A,MAAMC,SAAWzE,YAAcc,aAC/B,MAAM4D,QAAUvE,KAAKC,KAAKqE,SAAWD,iBACrC,MAAMG,KAAOxE,KAAKC,KAAKoE,gBAAkBC,UACzC,GAAIjD,YAAcR,WAAaQ,aAAekD,QAAUlD,aAAekD,QAAS,OAAOxE,SACvF,MAAM4E,KAAO9D,WAAa0D,QAAU1D,WAAa0D,QAAUA,QAAU1D,WACrE,MAAMU,GAAKV,WAAa0D,QAAUlD,YAAckD,QAAUA,QAAUlD,YACpE,OAAQrB,KAAK0E,MAAMnD,IAAMvB,KAAK0E,MAAMC,OAASH,IACjD,CAEA,SAAShE,MAAMoE,OACX,OAAO5E,KAAKwB,IAAIxB,KAAK2B,IAAIiD,MAAO,GAAI,EACxC,CAEA,SAAS9E,mBAAmB+E,OAAgBC,KAAcF,OACtD,IAAKnD,OAAOC,SAASkD,QAAUA,MAAQ,EAAG,CACtC,MAAM,IAAItE,WAAW,GAAGuE,WAAWC,4CACvC,CACA,OAAOF,KACX,CAEA,SAAS7D,mBACL8D,OACAlE,aACAC,gBACAf,YACAgB,YAEAf,mBAAmB+E,OAAQ,gBAAiBlE,cAC5Cb,mBAAmB+E,OAAQ,mBAAoBjE,iBAC/Cd,mBAAmB+E,OAAQ,eAAgBhF,aAC3CC,mBAAmB+E,OAAQ,cAAehE,YAC1C,GAAIF,eAAiB,EAAG,MAAM,IAAIL,WAAW,GAAGuE,wCACpD,QAAApF,oBAAAS,2BAAAP,qBAAAc,gBAAAmB,YAAAR"}
@@ -0,0 +1 @@
1
+ function requirePips(scope,name,value){if(!Number.isFinite(value)||value<0||value>4){throw new RangeError(`${scope}: ${name} must be a finite number from 0 to 4`)}}export{requirePips};//# sourceMappingURL=chunk-QJ7GB6FF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/internal/pips.ts"],"names":["requirePips","scope","name","value","Number","isFinite","RangeError"],"mappings":"AAqBO,SAASA,YAAYC,MAAeC,KAAcC,OACrD,IAAKC,OAAOC,SAASF,QAAUA,MAAQ,GAAKA,MAAQ,EAAG,CACnD,MAAM,IAAIG,WAAW,GAAGL,UAAUC,2CACtC,CACJ,QAAAF"}
@@ -0,0 +1 @@
1
+ import{massCurveMultiplier}from"./chunk-EVW4Z4CB.js";import{mapDamageTypes,effectiveHitPoints,stackShieldResistance}from"./chunk-JGOAQLYW.js";var curveLabels=scope=>({scope:scope,mass:"hullMass",curve:"generator"});function generatorCurveMultiplier(scope,hullMass,generator){const{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:minMultiplier,optMultiplier:optMultiplier,maxMultiplier:maxMultiplier}=generator;if(minMass===void 0||optMass===void 0||maxMass===void 0||minMultiplier===void 0||optMultiplier===void 0||maxMultiplier===void 0){return 0}return massCurveMultiplier(curveLabels(scope),hullMass,{minMass:minMass,optMass:optMass,maxMass:maxMass,minMultiplier:minMultiplier,optMultiplier:optMultiplier,maxMultiplier:maxMultiplier})}function shieldMassCurveMultiplier(hullMass,generator){return generatorCurveMultiplier("shieldMassCurveMultiplier",hullMass,generator)}function shieldStrength(hullMass,baseShieldStrength,generator,boostMultiplier=1){return baseShieldStrength*generatorCurveMultiplier("shieldStrength",hullMass,generator)*boostMultiplier}var boosterResistances=(boosters,type)=>boosters.map(booster=>booster[`${type}Resistance`]??0);function shieldMetrics(input){const boosters=input.boosters??[];const reinforcement=input.reinforcement??0;const generator=input.generator??null;if(!generator){const none=Object.freeze(mapDamageTypes(()=>0));return Object.freeze({strength:0,generator:0,boosters:0,reinforcement:0,massCurveMultiplier:0,boostMultiplier:1,resistances:none,effectiveHitPoints:Object.freeze(effectiveHitPoints(0,none))})}const massCurveMultiplier2=generatorCurveMultiplier("shieldMetrics",input.hullMass,generator);const boostMultiplier=1+boosters.reduce((sum,booster)=>sum+(booster.shieldBoost??0),0);const generatorStrength=input.baseShieldStrength*massCurveMultiplier2;const boostersStrength=generatorStrength*(boostMultiplier-1);const strength=generatorStrength+boostersStrength+reinforcement;const resistances=Object.freeze(mapDamageTypes(type=>stackShieldResistance(generator[`${type}Resistance`]??0,boosterResistances(boosters,type))));return Object.freeze({strength:strength,generator:generatorStrength,boosters:boostersStrength,reinforcement:reinforcement,massCurveMultiplier:massCurveMultiplier2,boostMultiplier:boostMultiplier,resistances:resistances,effectiveHitPoints:Object.freeze(effectiveHitPoints(strength,resistances))})}export{shieldMassCurveMultiplier,shieldMetrics,shieldStrength};//# sourceMappingURL=chunk-QTAMQ6ME.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/shields.ts"],"names":["massCurveMultiplier","mapDamageTypes","effectiveHitPoints","stackShieldResistance","curveLabels","scope","mass","curve","generatorCurveMultiplier","hullMass","generator","minMass","optMass","maxMass","minMultiplier","optMultiplier","maxMultiplier","shieldMassCurveMultiplier","shieldStrength","baseShieldStrength","boostMultiplier","boosterResistances","boosters","type","map","booster","shieldMetrics","input","reinforcement","none","Object","freeze","strength","resistances","reduce","sum","shieldBoost","generatorStrength","boostersStrength"],"mappings":"O,uIAmLA,IAAMI,YAAeC,QAAA,CACjBA,YACAC,KAAM,WACNC,MAAO,cAQX,SAASC,yBACLH,MACAI,SACAC,WAEA,MAAMC,QAAEA,QAAAC,QAASA,QAAAC,QAASA,QAAAC,cAASA,cAAAC,cAAeA,cAAAC,cAAeA,eAAkBN,UACnF,GACIC,eAAY,GACZC,eAAY,GACZC,eAAY,GACZC,qBAAkB,GAClBC,qBAAkB,GAClBC,qBAAkB,EACpB,CAGE,OAAO,CACX,CAGA,OAAOhB,oBAAoBI,YAAYC,OAAQI,SAAU,CACrDE,gBACAC,gBACAC,gBACAC,4BACAC,4BACAC,6BAER,CA2DO,SAASC,0BACZR,SACAC,WAEA,OAAOF,yBAAyB,4BAA6BC,SAAUC,UAC3E,CAiBO,SAASQ,eACZT,SACAU,mBACAT,UACAU,gBAAkB,GAElB,OACID,mBACAX,yBAAyB,iBAAkBC,SAAUC,WACrDU,eAER,CAGA,IAAMC,mBAAqB,CAACC,SAA0CC,OAClED,SAASE,IAAKC,SAAYA,QAAQ,GAAGF,mBAAqB,GA2CvD,SAASG,cAAcC,OAC1B,MAAML,SAAWK,MAAML,UAAY,GACnC,MAAMM,cAAgBD,MAAMC,eAAiB,EAC7C,MAAMlB,UAAYiB,MAAMjB,WAAa,KAErC,IAAKA,UAAW,CACZ,MAAMmB,KAAOC,OAAOC,OAAO9B,eAAe,IAAM,IAChD,OAAO6B,OAAOC,OAAO,CACjBC,SAAU,EACVtB,UAAW,EACXY,SAAU,EACVM,cAAe,EACf5B,oBAAqB,EACrBoB,gBAAiB,EACjBa,YAAaJ,KACb3B,mBAAoB4B,OAAOC,OAAO7B,mBAAmB,EAAG2B,QAEhE,CAEA,MAAM7B,qBAAsBQ,yBACxB,gBACAmB,MAAMlB,SACNC,WAEJ,MAAMU,gBACF,EAAIE,SAASY,OAAO,CAACC,IAAKV,UAAYU,KAAOV,QAAQW,aAAe,GAAI,GAC5E,MAAMC,kBAAoBV,MAAMR,mBAAqBnB,qBACrD,MAAMsC,iBAAmBD,mBAAqBjB,gBAAkB,GAChE,MAAMY,SAAWK,kBAAoBC,iBAAmBV,cAExD,MAAMK,YAAiCH,OAAOC,OAC1C9B,eAAgBsB,MACZpB,sBACIO,UAAU,GAAGa,mBAAqB,EAClCF,mBAAmBC,SAAUC,SAKzC,OAAOO,OAAOC,OAAO,CACjBC,kBACAtB,UAAW2B,kBACXf,SAAUgB,iBACVV,4BACA5B,oBAAAA,qBACAoB,gCACAa,wBACA/B,mBAAoB4B,OAAOC,OAAO7B,mBAAmB8B,SAAUC,eAEvE,QAAAhB,0BAAAS,cAAAR"}
@@ -1 +1 @@
1
- import{CORE_MODULES}from"./chunk-UHSNB5SV.js";import{HARDPOINT_MODULES}from"./chunk-4TFAZX73.js";import{INTERNAL_MODULES}from"./chunk-4ZGUSHTP.js";import{UTILITY_MODULES}from"./chunk-ELT3FEA4.js";var ALL_MODULES=Object.freeze([...CORE_MODULES,...INTERNAL_MODULES,...HARDPOINT_MODULES,...UTILITY_MODULES]);export{ALL_MODULES};//# sourceMappingURL=chunk-VDVFJXX5.js.map
1
+ import{CORE_MODULES}from"./chunk-EVJ32UF3.js";import{HARDPOINT_MODULES}from"./chunk-4TFAZX73.js";import{INTERNAL_MODULES}from"./chunk-4ZGUSHTP.js";import{UTILITY_MODULES}from"./chunk-ELT3FEA4.js";var ALL_MODULES=Object.freeze([...CORE_MODULES,...INTERNAL_MODULES,...HARDPOINT_MODULES,...UTILITY_MODULES]);export{ALL_MODULES};//# sourceMappingURL=chunk-QY3L5BKN.js.map
@@ -1 +1 @@
1
- import{capacitorRechargeAtPips}from"./chunk-JOTAOI5T.js";function requireFiniteNonNegative(scope,name,value){if(!Number.isFinite(value)||value<0){throw new RangeError(`${scope}: ${name} must be a finite non-negative number`)}}function weaponsCapacitorMetrics(input){const scope="weaponsCapacitorMetrics";const weaponsPips=input.weaponsPips??4;if(!Number.isFinite(weaponsPips)||weaponsPips<0||weaponsPips>4){throw new RangeError(`${scope}: weaponsPips must be a finite number from 0 to 4`)}for(const field of["weaponsCapacity","weaponsRecharge","sustainedEnergyPerSecond"]){requireFiniteNonNegative(scope,field,input[field])}const rechargeRate=capacitorRechargeAtPips(input.weaponsRecharge,weaponsPips);const netDrainRate=Math.max(0,input.sustainedEnergyPerSecond-rechargeRate);return{weaponsPips:weaponsPips,capacity:input.weaponsCapacity,rechargeRate:rechargeRate,sustainedEnergyPerSecond:input.sustainedEnergyPerSecond,netDrainRate:netDrainRate,timeToDrain:netDrainRate===0?Infinity:input.weaponsCapacity/netDrainRate}}export{weaponsCapacitorMetrics};//# sourceMappingURL=chunk-FMPRCYKY.js.map
1
+ import{capacitorRechargeAtPips}from"./chunk-JOTAOI5T.js";function requireFiniteNonNegative(scope,name,value){if(!Number.isFinite(value)||value<0){throw new RangeError(`${scope}: ${name} must be a finite non-negative number`)}}function weaponsCapacitorMetrics(input){const scope="weaponsCapacitorMetrics";const weaponsPips=input.weaponsPips??4;if(!Number.isFinite(weaponsPips)||weaponsPips<0||weaponsPips>4){throw new RangeError(`${scope}: weaponsPips must be a finite number from 0 to 4`)}for(const field of["weaponsCapacity","weaponsRecharge","sustainedEnergyPerSecond"]){requireFiniteNonNegative(scope,field,input[field])}const rechargeRate=capacitorRechargeAtPips(input.weaponsRecharge,weaponsPips);const netDrainRate=Math.max(0,input.sustainedEnergyPerSecond-rechargeRate);return Object.freeze({weaponsPips:weaponsPips,capacity:input.weaponsCapacity,rechargeRate:rechargeRate,sustainedEnergyPerSecond:input.sustainedEnergyPerSecond,netDrainRate:netDrainRate,timeToDrain:netDrainRate===0?Infinity:input.weaponsCapacity/netDrainRate})}export{weaponsCapacitorMetrics};//# sourceMappingURL=chunk-RRYBSAPX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ships/weapons-capacitor.ts"],"names":["capacitorRechargeAtPips","requireFiniteNonNegative","scope","name","value","Number","isFinite","RangeError","weaponsCapacitorMetrics","input","weaponsPips","field","rechargeRate","weaponsRecharge","netDrainRate","Math","max","sustainedEnergyPerSecond","Object","freeze","capacity","weaponsCapacity","timeToDrain","Infinity"],"mappings":"O,kDA0DA,SAASC,yBAAyBC,MAAeC,KAAcC,OAC3D,IAAKC,OAAOC,SAASF,QAAUA,MAAQ,EAAG,CACtC,MAAM,IAAIG,WAAW,GAAGL,UAAUC,4CACtC,CACJ,CAwBO,SAASK,wBAAwBC,OACpC,MAAMP,MAAQ,0BACd,MAAMQ,YAAcD,MAAMC,aAAe,EACzC,IAAKL,OAAOC,SAASI,cAAgBA,YAAc,GAAKA,YAAc,EAAG,CACrE,MAAM,IAAIH,WAAW,GAAGL,yDAC5B,CACA,IAAA,MAAWS,QAAS,CAChB,kBACA,kBACA,4BACQ,CACRV,yBAAyBC,MAAOS,MAAOF,MAAME,OACjD,CAEA,MAAMC,aAAeZ,wBAAwBS,MAAMI,gBAAiBH,aACpE,MAAMI,aAAeC,KAAKC,IAAI,EAAGP,MAAMQ,yBAA2BL,cAClE,OAAOM,OAAOC,OAAO,CACjBT,wBACAU,SAAUX,MAAMY,gBAChBT,0BACAK,yBAA0BR,MAAMQ,yBAChCH,0BACAQ,YAAaR,eAAiB,EAAIS,SAAWd,MAAMY,gBAAkBP,cAE7E,QAAAN"}