@ubnt/store.core 9.6.0-alpha.7 → 9.6.0-alpha.8

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 (68) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/lib/assets/close2.svg +2 -3
  3. package/lib/assets/close3.svg +3 -2
  4. package/lib/assets/minus4.svg +8 -8
  5. package/lib/assets/minus5.svg +8 -8
  6. package/lib/assets/pause.svg +3 -3
  7. package/lib/assets/pause2.svg +3 -3
  8. package/lib/assets/plus5.svg +9 -9
  9. package/lib/assets/plus6.svg +9 -9
  10. package/lib/assets/ucgMax.jpg +0 -0
  11. package/lib/assets/ucgMax2.jpg +0 -0
  12. package/lib/assets/ucgUltra.jpg +0 -0
  13. package/lib/assets/ucgUltra2.jpg +0 -0
  14. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
  15. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
  16. package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
  17. package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
  18. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
  19. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
  20. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
  21. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
  22. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
  23. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
  24. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  25. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  26. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
  27. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
  28. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  29. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  30. package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
  31. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
  32. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  33. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  34. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  35. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  36. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  37. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  38. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  39. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  40. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  41. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  42. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  43. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  44. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  45. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  46. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  47. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  48. package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
  49. package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
  50. package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
  51. package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
  52. package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
  53. package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
  54. package/lib/utils/money/allocators/index.d.ts +1 -0
  55. package/lib/utils/money/allocators/index.js +2 -0
  56. package/lib/utils/money/allocators/index.js.map +1 -1
  57. package/lib/utils/money/allocators/index.mjs +1 -0
  58. package/lib/utils/money/allocators/index.mjs.map +1 -1
  59. package/lib/utils/money/allocators/productAmount.d.ts +17 -0
  60. package/lib/utils/money/allocators/productAmount.js +69 -0
  61. package/lib/utils/money/allocators/productAmount.js.map +1 -0
  62. package/lib/utils/money/allocators/productAmount.mjs +67 -0
  63. package/lib/utils/money/allocators/productAmount.mjs.map +1 -0
  64. package/lib/utils/money/exchangeRate.d.ts +1 -1
  65. package/lib/utils/money/exchangeRate.js.map +1 -1
  66. package/lib/utils/money/exchangeRate.mjs.map +1 -1
  67. package/lib/utils/money/types.d.ts +15 -5
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@
6
6
 
7
7
  ## Releases
8
8
 
9
+ ### 9.6.0-alpha.8
10
+
11
+ - [Refactor] Upstream Money refactor changes
12
+
9
13
  ### 9.6.0-alpha.7
10
14
 
11
15
  - [Feat] [NEP-3419](https://ubiquiti.atlassian.net/browse/NEP-3419) Make own Tooltip that wraps ui-components Tooltip with hide on scroll feature
@@ -36,7 +40,7 @@
36
40
 
37
41
  ### 9.6.0-alpha.0
38
42
 
39
- - [Refacot] Money refactor
43
+ - [Refactor] Money refactor
40
44
 
41
45
  ### 9.5.0
42
46
 
@@ -1,4 +1,3 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
2
- xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.2175 18.6475C4.9275 18.9375 4.9275 19.4175 5.2175 19.7075C5.5075 19.9975 5.9875 19.9975 6.2775 19.7075L12.4675 13.5175L18.6575 19.7075C18.9475 19.9975 19.4275 19.9975 19.7175 19.7075C20.0075 19.4175 20.0075 18.9375 19.7175 18.6475L13.5275 12.4675L19.7175 6.2775C20.0075 5.9875 20.0075 5.5075 19.7175 5.2175C19.4275 4.9275 18.9475 4.9275 18.6575 5.2175L12.4675 11.4075L6.2775 5.2175C5.9875 4.9275 5.5075 4.9275 5.2175 5.2175C4.9275 5.5075 4.9275 5.9875 5.2175 6.2775L11.4075 12.4675L5.2175 18.6475Z" fill="currentColor"/>
1
+ <svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.7175 18.6475C5.4275 18.9375 5.4275 19.4175 5.7175 19.7075C6.0075 19.9975 6.4875 19.9975 6.7775 19.7075L12.9675 13.5175L19.1575 19.7075C19.4475 19.9975 19.9275 19.9975 20.2175 19.7075C20.5075 19.4175 20.5075 18.9375 20.2175 18.6475L14.0275 12.4675L20.2175 6.2775C20.5075 5.9875 20.5075 5.5075 20.2175 5.2175C19.9275 4.9275 19.4475 4.9275 19.1575 5.2175L12.9675 11.4075L6.7775 5.2175C6.4875 4.9275 6.0075 4.9275 5.7175 5.2175C5.4275 5.5075 5.4275 5.9875 5.7175 6.2775L11.9075 12.4675L5.7175 18.6475Z" fill="#36373C"/>
4
3
  </svg>
@@ -1,3 +1,4 @@
1
- <svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.7175 18.6475C5.4275 18.9375 5.4275 19.4175 5.7175 19.7075C6.0075 19.9975 6.4875 19.9975 6.7775 19.7075L12.9675 13.5175L19.1575 19.7075C19.4475 19.9975 19.9275 19.9975 20.2175 19.7075C20.5075 19.4175 20.5075 18.9375 20.2175 18.6475L14.0275 12.4675L20.2175 6.2775C20.5075 5.9875 20.5075 5.5075 20.2175 5.2175C19.9275 4.9275 19.4475 4.9275 19.1575 5.2175L12.9675 11.4075L6.7775 5.2175C6.4875 4.9275 6.0075 4.9275 5.7175 5.2175C5.4275 5.5075 5.4275 5.9875 5.7175 6.2775L11.9075 12.4675L5.7175 18.6475Z" fill="#36373C"/>
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
2
+ xmlns="http://www.w3.org/2000/svg">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5.2175 18.6475C4.9275 18.9375 4.9275 19.4175 5.2175 19.7075C5.5075 19.9975 5.9875 19.9975 6.2775 19.7075L12.4675 13.5175L18.6575 19.7075C18.9475 19.9975 19.4275 19.9975 19.7175 19.7075C20.0075 19.4175 20.0075 18.9375 19.7175 18.6475L13.5275 12.4675L19.7175 6.2775C20.0075 5.9875 20.0075 5.5075 19.7175 5.2175C19.4275 4.9275 18.9475 4.9275 18.6575 5.2175L12.4675 11.4075L6.2775 5.2175C5.9875 4.9275 5.5075 4.9275 5.2175 5.2175C4.9275 5.5075 4.9275 5.9875 5.2175 6.2775L11.4075 12.4675L5.2175 18.6475Z" fill="currentColor"/>
3
4
  </svg>
@@ -1,15 +1,15 @@
1
- <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
- <g clip-path="url(#clip0_658_406)">
4
- <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15898)">
4
+ <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_658_406)">
8
- <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
7
+ <g mask="url(#mask0_426_15898)">
8
+ <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_658_406">
12
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
11
+ <clipPath id="clip0_426_15898">
12
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,15 +1,15 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15898)">
4
- <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
1
+ <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
+ <g clip-path="url(#clip0_658_406)">
4
+ <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_426_15898)">
8
- <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
7
+ <g mask="url(#mask0_658_406)">
8
+ <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_426_15898">
12
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
11
+ <clipPath id="clip0_658_406">
12
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,4 +1,4 @@
1
- <svg width="13" height="17" viewBox="0 0 13 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect x="0.232422" width="4" height="17" rx="2" fill="#393A3F"/>
3
- <rect x="8.23242" width="4" height="17" rx="2" fill="#393A3F"/>
1
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="6" y="3" width="3" height="16" rx="1.5" fill="#393A3F"/>
3
+ <rect x="12" y="3" width="3" height="16" rx="1.5" fill="#393A3F"/>
4
4
  </svg>
@@ -1,4 +1,4 @@
1
- <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <rect x="6" y="3" width="3" height="16" rx="1.5" fill="#393A3F"/>
3
- <rect x="12" y="3" width="3" height="16" rx="1.5" fill="#393A3F"/>
1
+ <svg width="13" height="17" viewBox="0 0 13 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.232422" width="4" height="17" rx="2" fill="#393A3F"/>
3
+ <rect x="8.23242" width="4" height="17" rx="2" fill="#393A3F"/>
4
4
  </svg>
@@ -1,16 +1,16 @@
1
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
- <g clip-path="url(#clip0_658_411)">
4
- <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
- <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15903)">
4
+ <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
+ <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_658_411)">
9
- <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
8
+ <g mask="url(#mask0_426_15903)">
9
+ <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_658_411">
13
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
12
+ <clipPath id="clip0_426_15903">
13
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
@@ -1,16 +1,16 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15903)">
4
- <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
- <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
1
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
+ <g clip-path="url(#clip0_658_411)">
4
+ <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
+ <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_426_15903)">
9
- <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
8
+ <g mask="url(#mask0_658_411)">
9
+ <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_426_15903">
13
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
12
+ <clipPath id="clip0_658_411">
13
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
Binary file
Binary file
Binary file
Binary file
@@ -14,7 +14,7 @@ var FeaturesSection_styles = require('./FeaturesSection.styles.js');
14
14
  var useLockBodyScrollCustom = require('../../hooks/useLockBodyScrollCustom.js');
15
15
  var Container = require('../Container/Container.js');
16
16
  var StyleableSvgImage = require('../StyleableSvgImage/StyleableSvgImage.js');
17
- var CloseSvg = require("../../assets/close2.svg");
17
+ var CloseSvg = require("../../assets/close3.svg");
18
18
  function _interopDefault(e) {
19
19
  return e && e.__esModule ? e : {
20
20
  default: e
@@ -12,7 +12,7 @@ import { WrapOuter, OverlayWrap, OverlayClose, Wrap, MetaWrap, SubHeading, Headi
12
12
  import { useLockBodyScrollCustom } from '../../hooks/useLockBodyScrollCustom.mjs';
13
13
  import { Container } from '../Container/Container.mjs';
14
14
  import { StyleableSvgImage } from '../StyleableSvgImage/StyleableSvgImage.mjs';
15
- import CloseSvg__default from "../../assets/close2.svg";
15
+ import CloseSvg__default from "../../assets/close3.svg";
16
16
  "use strict";
17
17
  const FEATURES_DEFAULT_PLAYBACK = 500;
18
18
  const parseTime = time => parseFloat(time.toFixed(3));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var CloseSvg = require("../../../assets/close2.svg");
6
+ var CloseSvg = require("../../../assets/close3.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../assets/close2.svg";
2
- export { default } from "../../../assets/close2.svg";
1
+ export * from "../../../assets/close3.svg";
2
+ export { default } from "../../../assets/close3.svg";
3
3
  //# sourceMappingURL=close.svg.mjs.map
@@ -11,7 +11,7 @@ require('./assets/play.svg.js');
11
11
  var MicrositeVideoSlideshow_styles = require('./MicrositeVideoSlideshow.styles.js');
12
12
  var MicrositeSectionWrap = require('../MicrositeSectionWrap/MicrositeSectionWrap.js');
13
13
  var PlayIcon = require("../../assets/play.svg");
14
- var PauseIcon = require("../../assets/pause.svg");
14
+ var PauseIcon = require("../../assets/pause2.svg");
15
15
  var ActiveIconBox = require("../../assets/active-icon-box.svg");
16
16
  function _interopDefault(e) {
17
17
  return e && e.__esModule ? e : {
@@ -9,7 +9,7 @@ import './assets/play.svg.mjs';
9
9
  import { VideoBlock, Video, VideoControls, VideoInnerWrap, ProgressCircle, PlayIcon, PauseIcon, SlideRow, Slide, FeatureIconWrap, FeatureIconActiveBackground, FeatureIcon, FeatureTitle, MicrositeBuyButton } from './MicrositeVideoSlideshow.styles.mjs';
10
10
  import { MicrositeSectionWrap } from '../MicrositeSectionWrap/MicrositeSectionWrap.mjs';
11
11
  import PlayIcon__default from "../../assets/play.svg";
12
- import PauseIcon__default from "../../assets/pause.svg";
12
+ import PauseIcon__default from "../../assets/pause2.svg";
13
13
  import ActiveIconBox__default from "../../assets/active-icon-box.svg";
14
14
  "use strict";
15
15
  const MicrositeVideoSlideshow = ({
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PauseIcon = require("../../../assets/pause.svg");
6
+ var PauseIcon = require("../../../assets/pause2.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../assets/pause.svg";
2
- export { default } from "../../../assets/pause.svg";
1
+ export * from "../../../assets/pause2.svg";
2
+ export { default } from "../../../assets/pause2.svg";
3
3
  //# sourceMappingURL=pause.svg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_ReJhRoVe = require("../../../../../assets/ucgMax2.jpg");
6
+ var _externalAssets_DfjB$I0W = require("../../../../../assets/ucgMax.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
12
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_ReJhRoVe__default["default"];
16
+ return _externalAssets_DfjB$I0W__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_ReJhRoVe).forEach(function (k) {
19
+ Object.keys(_externalAssets_DfjB$I0W).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_ReJhRoVe[k];
23
+ return _externalAssets_DfjB$I0W[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgMax2.jpg";
2
- export { default } from "../../../../../assets/ucgMax2.jpg";
1
+ export * from "../../../../../assets/ucgMax.jpg";
2
+ export { default } from "../../../../../assets/ucgMax.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_sWF40Ihh = require("../../../../../assets/ucgUltra2.jpg");
6
+ var _externalAssets_BGAVPUHK = require("../../../../../assets/ucgUltra.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
12
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_sWF40Ihh__default["default"];
16
+ return _externalAssets_BGAVPUHK__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_sWF40Ihh).forEach(function (k) {
19
+ Object.keys(_externalAssets_BGAVPUHK).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_sWF40Ihh[k];
23
+ return _externalAssets_BGAVPUHK[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgUltra2.jpg";
2
- export { default } from "../../../../../assets/ucgUltra2.jpg";
1
+ export * from "../../../../../assets/ucgUltra.jpg";
2
+ export { default } from "../../../../../assets/ucgUltra.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgMax.jpg");
6
+ var image = require("../../../../assets/ucgMax2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgMax.jpg";
2
- export { default } from "../../../../assets/ucgMax.jpg";
1
+ export * from "../../../../assets/ucgMax2.jpg";
2
+ export { default } from "../../../../assets/ucgMax2.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgUltra.jpg");
6
+ var image = require("../../../../assets/ucgUltra2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgUltra.jpg";
2
- export { default } from "../../../../assets/ucgUltra.jpg";
1
+ export * from "../../../../assets/ucgUltra2.jpg";
2
+ export { default } from "../../../../assets/ucgUltra2.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -26,8 +26,8 @@ var _externalAssets_CmLfPohF = require("../../../assets/udmProMax.jpg");
26
26
  var image = require("../../../assets/udmPro.jpg");
27
27
  var _externalAssets_BUotdZNw = require("../../../assets/udmProSpecial.jpg");
28
28
  var image$1 = require("../../../assets/udw.jpg");
29
- var _externalAssets_ReJhRoVe = require("../../../assets/ucgMax2.jpg");
30
- var _externalAssets_sWF40Ihh = require("../../../assets/ucgUltra2.jpg");
29
+ var _externalAssets_DfjB$I0W = require("../../../assets/ucgMax.jpg");
30
+ var _externalAssets_BGAVPUHK = require("../../../assets/ucgUltra.jpg");
31
31
  var image$2 = require("../../../assets/udr.jpg");
32
32
  var image$3 = require("../../../assets/express.jpg");
33
33
  var nextAiInspection = require('./properties/nextAiInspection.js');
@@ -40,8 +40,8 @@ var _externalAssets_CmLfPohF__default = /*#__PURE__*/_interopDefault(_externalAs
40
40
  var image__default = /*#__PURE__*/_interopDefault(image);
41
41
  var _externalAssets_BUotdZNw__default = /*#__PURE__*/_interopDefault(_externalAssets_BUotdZNw);
42
42
  var image__default$1 = /*#__PURE__*/_interopDefault(image$1);
43
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
44
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
43
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
44
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
45
45
  var image__default$2 = /*#__PURE__*/_interopDefault(image$2);
46
46
  var image__default$3 = /*#__PURE__*/_interopDefault(image$3);
47
47
  "use strict";
@@ -75,12 +75,12 @@ const udw = {
75
75
  };
76
76
  const ucgMax = {
77
77
  ...ucgMax$1.ucgMax,
78
- image: getImage(_externalAssets_ReJhRoVe__default["default"]),
78
+ image: getImage(_externalAssets_DfjB$I0W__default["default"]),
79
79
  notes: ["ucgMax.note.accessory"]
80
80
  };
81
81
  const ucgUltra = {
82
82
  ...ucgUltra$1.ucgUltra,
83
- image: getImage(_externalAssets_sWF40Ihh__default["default"])
83
+ image: getImage(_externalAssets_BGAVPUHK__default["default"])
84
84
  };
85
85
  const udr = {
86
86
  ...udr$1.udr,
@@ -24,8 +24,8 @@ import _externalAssets_CmLfPohF__default from "../../../assets/udmProMax.jpg";
24
24
  import image__default from "../../../assets/udmPro.jpg";
25
25
  import _externalAssets_BUotdZNw__default from "../../../assets/udmProSpecial.jpg";
26
26
  import image__default$1 from "../../../assets/udw.jpg";
27
- import _externalAssets_ReJhRoVe__default from "../../../assets/ucgMax2.jpg";
28
- import _externalAssets_sWF40Ihh__default from "../../../assets/ucgUltra2.jpg";
27
+ import _externalAssets_DfjB$I0W__default from "../../../assets/ucgMax.jpg";
28
+ import _externalAssets_BGAVPUHK__default from "../../../assets/ucgUltra.jpg";
29
29
  import image__default$2 from "../../../assets/udr.jpg";
30
30
  import image__default$3 from "../../../assets/express.jpg";
31
31
  import { nextAiInspection } from './properties/nextAiInspection.mjs';
@@ -60,12 +60,12 @@ const udw = {
60
60
  };
61
61
  const ucgMax = {
62
62
  ...ucgMax$1,
63
- image: getImage(_externalAssets_ReJhRoVe__default),
63
+ image: getImage(_externalAssets_DfjB$I0W__default),
64
64
  notes: ["ucgMax.note.accessory"]
65
65
  };
66
66
  const ucgUltra = {
67
67
  ...ucgUltra$1,
68
- image: getImage(_externalAssets_sWF40Ihh__default)
68
+ image: getImage(_externalAssets_BGAVPUHK__default)
69
69
  };
70
70
  const udr = {
71
71
  ...udr$1,
@@ -9,7 +9,7 @@ require('../../assets/applications.svg.js');
9
9
  require('../../assets/Consoles/ucgMax.jpg.js');
10
10
  require('../properties/index.js');
11
11
  var integratedWiFi6 = require('../properties/integratedWiFi6.js');
12
- var image = require("../../../../assets/ucgMax.jpg");
12
+ var image = require("../../../../assets/ucgMax2.jpg");
13
13
  var unifiAppSuite = require('../properties/unifiAppSuite.js');
14
14
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
15
15
  var applications = require("../../../../assets/applications.svg");
@@ -7,7 +7,7 @@ import '../../assets/applications.svg.mjs';
7
7
  import '../../assets/Consoles/ucgMax.jpg.mjs';
8
8
  import '../properties/index.mjs';
9
9
  import { integratedWiFi6 } from '../properties/integratedWiFi6.mjs';
10
- import image__default from "../../../../assets/ucgMax.jpg";
10
+ import image__default from "../../../../assets/ucgMax2.jpg";
11
11
  import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
12
12
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
13
13
  import applications__default from "../../../../assets/applications.svg";
@@ -21,7 +21,7 @@ var unifiDevices = require('../properties/unifiDevices.js');
21
21
  var wanPorts = require('../properties/wanPorts.js');
22
22
  var StyleableSvgImage$1 = require('../../../StyleableSvgImage/StyleableSvgImage.js');
23
23
  var unifi = require('../../../../constants/proStoreCategories/mapping/unifi.js');
24
- var image = require("../../../../assets/ucgUltra.jpg");
24
+ var image = require("../../../../assets/ucgUltra2.jpg");
25
25
  var applications = require("../../../../assets/wifi-device.svg");
26
26
  var nextAiInspection = require('../properties/nextAiInspection.js');
27
27
  function _interopDefault(e) {
@@ -19,7 +19,7 @@ import { unifiDevices } from '../properties/unifiDevices.mjs';
19
19
  import { wanPorts } from '../properties/wanPorts.mjs';
20
20
  import { StyleableSvgImage as StyleableSvgImage$1 } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
21
21
  import { UniFiCategoryId } from '../../../../constants/proStoreCategories/mapping/unifi.mjs';
22
- import image__default from "../../../../assets/ucgUltra.jpg";
22
+ import image__default from "../../../../assets/ucgUltra2.jpg";
23
23
  import applications__default from "../../../../assets/wifi-device.svg";
24
24
  import { nextAiInspection } from '../properties/nextAiInspection.mjs';
25
25
  "use strict";
@@ -11,8 +11,8 @@ require('../assets/plus.svg.js');
11
11
  var Layout_styles = require('./Layout.styles.js');
12
12
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
13
13
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
14
- var MinusIcon = require("../../../../../../assets/minus4.svg");
15
- var PlusIcon = require("../../../../../../assets/plus5.svg");
14
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
15
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
16
16
  function _interopDefault(e) {
17
17
  return e && e.__esModule ? e : {
18
18
  default: e
@@ -9,8 +9,8 @@ import '../assets/plus.svg.mjs';
9
9
  import { InputWrapper, Label, InputFlexWrapper } from './Layout.styles.mjs';
10
10
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
11
11
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
12
- import MinusIcon__default from "../../../../../../assets/minus4.svg";
13
- import PlusIcon__default from "../../../../../../assets/plus5.svg";
12
+ import MinusIcon__default from "../../../../../../assets/minus5.svg";
13
+ import PlusIcon__default from "../../../../../../assets/plus6.svg";
14
14
  "use strict";
15
15
  const CounterSection = ({
16
16
  value,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus4.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus4.svg";
2
- export { default } from "../../../../../../assets/minus4.svg";
1
+ export * from "../../../../../../assets/minus5.svg";
2
+ export { default } from "../../../../../../assets/minus5.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus5.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus5.svg";
2
- export { default } from "../../../../../../assets/plus5.svg";
1
+ export * from "../../../../../../assets/plus6.svg";
2
+ export { default } from "../../../../../../assets/plus6.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -19,8 +19,8 @@ var ComputeResourceCalculator_types = require('../../../../ComputeResourceCalcul
19
19
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
20
20
  var SearchIcon = require("../../../../../../assets/search2.svg");
21
21
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
22
- var MinusIcon = require("../../../../../../assets/minus5.svg");
23
- var PlusIcon = require("../../../../../../assets/plus6.svg");
22
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
23
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
24
24
  function _interopDefault(e) {
25
25
  return e && e.__esModule ? e : {
26
26
  default: e
@@ -17,8 +17,8 @@ import { isMessageFormatted } from '../../../../ComputeResourceCalculator/Comput
17
17
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
18
18
  import SearchIcon__default from "../../../../../../assets/search2.svg";
19
19
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
20
- import MinusIcon__default from "../../../../../../assets/minus5.svg";
21
- import PlusIcon__default from "../../../../../../assets/plus6.svg";
20
+ import MinusIcon__default from "../../../../../../assets/minus4.svg";
21
+ import PlusIcon__default from "../../../../../../assets/plus5.svg";
22
22
  "use strict";
23
23
  const PoeConsumerSelectModal = ({
24
24
  isOpen,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus5.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus5.svg";
2
- export { default } from "../../../../../../assets/minus5.svg";
1
+ export * from "../../../../../../assets/minus4.svg";
2
+ export { default } from "../../../../../../assets/minus4.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus6.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus6.svg";
2
- export { default } from "../../../../../../assets/plus6.svg";
1
+ export * from "../../../../../../assets/plus5.svg";
2
+ export { default } from "../../../../../../assets/plus5.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -12,9 +12,9 @@ require('./assets/play.svg.js');
12
12
  require('./assets/volume-off.svg.js');
13
13
  require('./assets/volume-on.svg.js');
14
14
  var VideoPlayer_styles = require('./VideoPlayer.styles.js');
15
- var CloseIcon = require("../../assets/close3.svg");
15
+ var CloseIcon = require("../../assets/close2.svg");
16
16
  var BackIcon = require("../../assets/back.svg");
17
- var PauseIcon = require("../../assets/pause2.svg");
17
+ var PauseIcon = require("../../assets/pause.svg");
18
18
  var PlayIcon = require("../../assets/play.svg");
19
19
  var VolumeOffIcon = require("../../assets/volume-off.svg");
20
20
  var VolumeOnIcon = require("../../assets/volume-on.svg");
@@ -10,9 +10,9 @@ import './assets/play.svg.mjs';
10
10
  import './assets/volume-off.svg.mjs';
11
11
  import './assets/volume-on.svg.mjs';
12
12
  import { Wrap, IconWrap, Icon, Video, ControlWrap, TimelineWrap, Timeline, Controls, LeftSide, IconButton, VolumeWrap, VolumeSliderWrap, VolumeSlider, Time, Center, RightSide } from './VideoPlayer.styles.mjs';
13
- import CloseIcon__default from "../../assets/close3.svg";
13
+ import CloseIcon__default from "../../assets/close2.svg";
14
14
  import BackIcon__default from "../../assets/back.svg";
15
- import PauseIcon__default from "../../assets/pause2.svg";
15
+ import PauseIcon__default from "../../assets/pause.svg";
16
16
  import PlayIcon__default from "../../assets/play.svg";
17
17
  import VolumeOffIcon__default from "../../assets/volume-off.svg";
18
18
  import VolumeOnIcon__default from "../../assets/volume-on.svg";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var CloseIcon = require("../../../assets/close3.svg");
6
+ var CloseIcon = require("../../../assets/close2.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../assets/close3.svg";
2
- export { default } from "../../../assets/close3.svg";
1
+ export * from "../../../assets/close2.svg";
2
+ export { default } from "../../../assets/close2.svg";
3
3
  //# sourceMappingURL=close.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PauseIcon = require("../../../assets/pause2.svg");
6
+ var PauseIcon = require("../../../assets/pause.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../assets/pause2.svg";
2
- export { default } from "../../../assets/pause2.svg";
1
+ export * from "../../../assets/pause.svg";
2
+ export { default } from "../../../assets/pause.svg";
3
3
  //# sourceMappingURL=pause.svg.mjs.map
@@ -1 +1,2 @@
1
1
  export * from "./fixedAmount";
2
+ export * from "./productAmount";
@@ -1,6 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var fixedAmount = require('./fixedAmount.js');
4
+ var productAmount = require('./productAmount.js');
4
5
  "use strict";
5
6
  exports.FixedAmountAllocator = fixedAmount.FixedAmountAllocator;
7
+ exports.ProductAmountAllocator = productAmount.ProductAmountAllocator;
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,3 +1,4 @@
1
1
  export { FixedAmountAllocator } from './fixedAmount.mjs';
2
+ export { ProductAmountAllocator } from './productAmount.mjs';
2
3
  "use strict";
3
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,17 @@
1
+ import type { Currency } from "../../../types";
2
+ import type { Cents, FullLineItemSummary } from "../types";
3
+ import { FixedAmountAllocator } from "./fixedAmount";
4
+ /**
5
+ * Helper class to distribute a total amount for a product
6
+ */
7
+ export declare class ProductAmountAllocator {
8
+ itemPrice: Cents;
9
+ currency: Currency;
10
+ quantity: number;
11
+ discountAmount: FixedAmountAllocator;
12
+ taxableAmount: FixedAmountAllocator;
13
+ tax: FixedAmountAllocator;
14
+ total: FixedAmountAllocator;
15
+ constructor(productSummary: FullLineItemSummary);
16
+ allocateQty(quantity: number): FullLineItemSummary;
17
+ }
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var misc = require('../misc.js');
4
+ var fixedAmount = require('./fixedAmount.js');
5
+ "use strict";
6
+ var __defProp = Object.defineProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
8
+ enumerable: true,
9
+ configurable: true,
10
+ writable: true,
11
+ value
12
+ }) : obj[key] = value;
13
+ var __publicField = (obj, key, value) => {
14
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
15
+ return value;
16
+ };
17
+ class ProductAmountAllocator {
18
+ constructor(productSummary) {
19
+ __publicField(this, "itemPrice");
20
+ __publicField(this, "currency");
21
+ __publicField(this, "quantity");
22
+ __publicField(this, "discountAmount");
23
+ __publicField(this, "taxableAmount");
24
+ __publicField(this, "tax");
25
+ __publicField(this, "total");
26
+ const currency = productSummary.currency;
27
+ const priceForAllocation = productSummary.itemPrice * productSummary.quantity;
28
+ this.itemPrice = productSummary.itemPrice;
29
+ this.currency = currency;
30
+ this.quantity = productSummary.quantity;
31
+ this.discountAmount = new fixedAmount.FixedAmountAllocator({
32
+ initialAllocateAmount: productSummary.discountAmount,
33
+ initialTotalAmount: priceForAllocation,
34
+ currency
35
+ });
36
+ this.taxableAmount = new fixedAmount.FixedAmountAllocator({
37
+ initialAllocateAmount: productSummary.taxableAmount,
38
+ initialTotalAmount: priceForAllocation,
39
+ currency
40
+ });
41
+ this.tax = new fixedAmount.FixedAmountAllocator({
42
+ initialAllocateAmount: productSummary.tax,
43
+ initialTotalAmount: priceForAllocation,
44
+ currency
45
+ });
46
+ this.total = new fixedAmount.FixedAmountAllocator({
47
+ initialAllocateAmount: productSummary.total,
48
+ initialTotalAmount: priceForAllocation,
49
+ currency
50
+ });
51
+ }
52
+ allocateQty(quantity) {
53
+ let quantityNormalized = Math.max(quantity, 0);
54
+ quantityNormalized = this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;
55
+ this.quantity = Math.max(this.quantity - quantityNormalized, 0);
56
+ const itemQuantityPrice = this.itemPrice * quantityNormalized;
57
+ return {
58
+ itemPrice: this.itemPrice,
59
+ currency: this.currency,
60
+ quantity: quantityNormalized,
61
+ discountAmount: misc.amount(this.discountAmount.allocate(itemQuantityPrice, this.currency)),
62
+ taxableAmount: misc.amount(this.taxableAmount.allocate(itemQuantityPrice, this.currency)),
63
+ tax: misc.amount(this.tax.allocate(itemQuantityPrice, this.currency)),
64
+ total: misc.amount(this.total.allocate(itemQuantityPrice, this.currency))
65
+ };
66
+ }
67
+ }
68
+ exports.ProductAmountAllocator = ProductAmountAllocator;
69
+ //# sourceMappingURL=productAmount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productAmount.js","sources":["../../../../src/utils/money/allocators/productAmount.ts"],"sourcesContent":["import type { Currency } from \"../../../types\";\nimport { amount } from \"../misc\";\nimport type { Cents, FullLineItemSummary } from \"../types\";\nimport { FixedAmountAllocator } from \"./fixedAmount\";\n\n/**\n * Helper class to distribute a total amount for a product\n */\nexport class ProductAmountAllocator {\n itemPrice: Cents;\n currency: Currency;\n quantity: number;\n discountAmount: FixedAmountAllocator;\n taxableAmount: FixedAmountAllocator;\n tax: FixedAmountAllocator;\n total: FixedAmountAllocator;\n\n constructor(productSummary: FullLineItemSummary) {\n const currency = productSummary.currency;\n\n /**\n * Somewhat hackish, just need a stable price that can easily divide later by quantity\n */\n const priceForAllocation =\n productSummary.itemPrice * productSummary.quantity;\n\n this.itemPrice = productSummary.itemPrice;\n this.currency = currency;\n this.quantity = productSummary.quantity;\n this.discountAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.discountAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.taxableAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.taxableAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.tax = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.tax,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.total = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.total,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n }\n\n allocateQty(quantity: number): FullLineItemSummary {\n // Calculate remaining allocatable quantity\n let quantityNormalized = Math.max(quantity, 0);\n quantityNormalized =\n this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;\n\n // Adjust remaining qty\n this.quantity = Math.max(this.quantity - quantityNormalized, 0);\n\n // How big of a slice of the total price we need to allocate\n const itemQuantityPrice = this.itemPrice * quantityNormalized;\n\n return {\n itemPrice: this.itemPrice,\n currency: this.currency,\n quantity: quantityNormalized,\n discountAmount: amount(\n this.discountAmount.allocate(itemQuantityPrice, this.currency),\n ),\n taxableAmount: amount(\n this.taxableAmount.allocate(itemQuantityPrice, this.currency),\n ),\n tax: amount(this.tax.allocate(itemQuantityPrice, this.currency)),\n total: amount(this.total.allocate(itemQuantityPrice, this.currency)),\n } satisfies FullLineItemSummary;\n }\n}\n"],"names":["ProductAmountAllocator","constructor","productSummary","__publicField","currency","priceForAllocation","itemPrice","quantity","discountAmount","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","taxableAmount","tax","total","allocateQty","quantityNormalized","Math","max","itemQuantityPrice","amount","allocate"],"mappings":";;;;;;;;;;;;;;;;AAQO,MAAMA,sBAAuB,CAAA;EASlCC,YAAYC,cAAqC,EAAA;IARjDC,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,gBAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,KAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,OAAA,CAAA;IAGE,MAAMC,WAAWF,cAAe,CAAAE,QAAA;IAK1B,MAAAC,kBAAA,GACJH,cAAe,CAAAI,SAAA,GAAYJ,cAAe,CAAAK,QAAA;IAE5C,IAAA,CAAKD,YAAYJ,cAAe,CAAAI,SAAA;IAChC,IAAA,CAAKF,QAAW,GAAAA,QAAA;IAChB,IAAA,CAAKG,WAAWL,cAAe,CAAAK,QAAA;IAC1B,IAAA,CAAAC,cAAA,GAAiB,IAAIC,gCAAqB,CAAA;MAC7CC,uBAAuBR,cAAe,CAAAM,cAAA;MACtCG,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAQ,aAAA,GAAgB,IAAIH,gCAAqB,CAAA;MAC5CC,uBAAuBR,cAAe,CAAAU,aAAA;MACtCD,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAS,GAAA,GAAM,IAAIJ,gCAAqB,CAAA;MAClCC,uBAAuBR,cAAe,CAAAW,GAAA;MACtCF,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAU,KAAA,GAAQ,IAAIL,gCAAqB,CAAA;MACpCC,uBAAuBR,cAAe,CAAAY,KAAA;MACtCH,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;EACH;EAEAW,YAAYR,QAAuC,EAAA;IAEjD,IAAIS,kBAAqB,GAAAC,IAAA,CAAKC,GAAI,CAAAX,QAAA,EAAU,CAAC,CAAA;IAC7CS,kBAAA,GACE,IAAK,CAAAT,QAAA,GAAWS,kBAAsB,IAAA,CAAA,GAAIA,kBAAqB,GAAA,CAAA;IAGjE,IAAA,CAAKT,WAAWU,IAAK,CAAAC,GAAA,CAAI,IAAK,CAAAX,QAAA,GAAWS,oBAAoB,CAAC,CAAA;IAGxD,MAAAG,iBAAA,GAAoB,KAAKb,SAAY,GAAAU,kBAAA;IAEpC,OAAA;MACLV,WAAW,IAAK,CAAAA,SAAA;MAChBF,UAAU,IAAK,CAAAA,QAAA;MACfG,QAAU,EAAAS,kBAAA;MACVR,cAAgB,EAAAY,IAAA,CAAAA,MAAA,CACd,IAAK,CAAAZ,cAAA,CAAea,QAAS,CAAAF,iBAAA,EAAmB,KAAKf,QAAQ,CAC/D,CAAA;MACAQ,aAAe,EAAAQ,IAAA,CAAAA,MAAA,CACb,IAAK,CAAAR,aAAA,CAAcS,QAAS,CAAAF,iBAAA,EAAmB,KAAKf,QAAQ,CAC9D,CAAA;MACAS,GAAA,EAAKO,IAAAA,CAAAA,OAAO,IAAK,CAAAP,GAAA,CAAIQ,SAASF,iBAAmB,EAAA,IAAA,CAAKf,QAAQ,CAAC,CAAA;MAC/DU,KAAA,EAAOM,IAAAA,CAAAA,OAAO,IAAK,CAAAN,KAAA,CAAMO,SAASF,iBAAmB,EAAA,IAAA,CAAKf,QAAQ,CAAC;IAAA,CACrE;EACF;AACF;"}
@@ -0,0 +1,67 @@
1
+ import { amount } from '../misc.mjs';
2
+ import { FixedAmountAllocator } from './fixedAmount.mjs';
3
+ "use strict";
4
+ var __defProp = Object.defineProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true,
9
+ value
10
+ }) : obj[key] = value;
11
+ var __publicField = (obj, key, value) => {
12
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13
+ return value;
14
+ };
15
+ class ProductAmountAllocator {
16
+ constructor(productSummary) {
17
+ __publicField(this, "itemPrice");
18
+ __publicField(this, "currency");
19
+ __publicField(this, "quantity");
20
+ __publicField(this, "discountAmount");
21
+ __publicField(this, "taxableAmount");
22
+ __publicField(this, "tax");
23
+ __publicField(this, "total");
24
+ const currency = productSummary.currency;
25
+ const priceForAllocation = productSummary.itemPrice * productSummary.quantity;
26
+ this.itemPrice = productSummary.itemPrice;
27
+ this.currency = currency;
28
+ this.quantity = productSummary.quantity;
29
+ this.discountAmount = new FixedAmountAllocator({
30
+ initialAllocateAmount: productSummary.discountAmount,
31
+ initialTotalAmount: priceForAllocation,
32
+ currency
33
+ });
34
+ this.taxableAmount = new FixedAmountAllocator({
35
+ initialAllocateAmount: productSummary.taxableAmount,
36
+ initialTotalAmount: priceForAllocation,
37
+ currency
38
+ });
39
+ this.tax = new FixedAmountAllocator({
40
+ initialAllocateAmount: productSummary.tax,
41
+ initialTotalAmount: priceForAllocation,
42
+ currency
43
+ });
44
+ this.total = new FixedAmountAllocator({
45
+ initialAllocateAmount: productSummary.total,
46
+ initialTotalAmount: priceForAllocation,
47
+ currency
48
+ });
49
+ }
50
+ allocateQty(quantity) {
51
+ let quantityNormalized = Math.max(quantity, 0);
52
+ quantityNormalized = this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;
53
+ this.quantity = Math.max(this.quantity - quantityNormalized, 0);
54
+ const itemQuantityPrice = this.itemPrice * quantityNormalized;
55
+ return {
56
+ itemPrice: this.itemPrice,
57
+ currency: this.currency,
58
+ quantity: quantityNormalized,
59
+ discountAmount: amount(this.discountAmount.allocate(itemQuantityPrice, this.currency)),
60
+ taxableAmount: amount(this.taxableAmount.allocate(itemQuantityPrice, this.currency)),
61
+ tax: amount(this.tax.allocate(itemQuantityPrice, this.currency)),
62
+ total: amount(this.total.allocate(itemQuantityPrice, this.currency))
63
+ };
64
+ }
65
+ }
66
+ export { ProductAmountAllocator };
67
+ //# sourceMappingURL=productAmount.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productAmount.mjs","sources":["../../../../src/utils/money/allocators/productAmount.ts"],"sourcesContent":["import type { Currency } from \"../../../types\";\nimport { amount } from \"../misc\";\nimport type { Cents, FullLineItemSummary } from \"../types\";\nimport { FixedAmountAllocator } from \"./fixedAmount\";\n\n/**\n * Helper class to distribute a total amount for a product\n */\nexport class ProductAmountAllocator {\n itemPrice: Cents;\n currency: Currency;\n quantity: number;\n discountAmount: FixedAmountAllocator;\n taxableAmount: FixedAmountAllocator;\n tax: FixedAmountAllocator;\n total: FixedAmountAllocator;\n\n constructor(productSummary: FullLineItemSummary) {\n const currency = productSummary.currency;\n\n /**\n * Somewhat hackish, just need a stable price that can easily divide later by quantity\n */\n const priceForAllocation =\n productSummary.itemPrice * productSummary.quantity;\n\n this.itemPrice = productSummary.itemPrice;\n this.currency = currency;\n this.quantity = productSummary.quantity;\n this.discountAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.discountAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.taxableAmount = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.taxableAmount,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.tax = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.tax,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n this.total = new FixedAmountAllocator({\n initialAllocateAmount: productSummary.total,\n initialTotalAmount: priceForAllocation,\n currency,\n });\n }\n\n allocateQty(quantity: number): FullLineItemSummary {\n // Calculate remaining allocatable quantity\n let quantityNormalized = Math.max(quantity, 0);\n quantityNormalized =\n this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;\n\n // Adjust remaining qty\n this.quantity = Math.max(this.quantity - quantityNormalized, 0);\n\n // How big of a slice of the total price we need to allocate\n const itemQuantityPrice = this.itemPrice * quantityNormalized;\n\n return {\n itemPrice: this.itemPrice,\n currency: this.currency,\n quantity: quantityNormalized,\n discountAmount: amount(\n this.discountAmount.allocate(itemQuantityPrice, this.currency),\n ),\n taxableAmount: amount(\n this.taxableAmount.allocate(itemQuantityPrice, this.currency),\n ),\n tax: amount(this.tax.allocate(itemQuantityPrice, this.currency)),\n total: amount(this.total.allocate(itemQuantityPrice, this.currency)),\n } satisfies FullLineItemSummary;\n }\n}\n"],"names":["ProductAmountAllocator","constructor","productSummary","__publicField","currency","priceForAllocation","itemPrice","quantity","discountAmount","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","taxableAmount","tax","total","allocateQty","quantityNormalized","Math","max","itemQuantityPrice","amount","allocate"],"mappings":";;;;;;;;;;;;;;AAQO,MAAMA,sBAAuB,CAAA;EASlCC,YAAYC,cAAqC,EAAA;IARjDC,aAAA,CAAA,IAAA,EAAA,WAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,gBAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,eAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,KAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,OAAA,CAAA;IAGE,MAAMC,WAAWF,cAAe,CAAAE,QAAA;IAK1B,MAAAC,kBAAA,GACJH,cAAe,CAAAI,SAAA,GAAYJ,cAAe,CAAAK,QAAA;IAE5C,IAAA,CAAKD,YAAYJ,cAAe,CAAAI,SAAA;IAChC,IAAA,CAAKF,QAAW,GAAAA,QAAA;IAChB,IAAA,CAAKG,WAAWL,cAAe,CAAAK,QAAA;IAC1B,IAAA,CAAAC,cAAA,GAAiB,IAAIC,oBAAqB,CAAA;MAC7CC,uBAAuBR,cAAe,CAAAM,cAAA;MACtCG,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAQ,aAAA,GAAgB,IAAIH,oBAAqB,CAAA;MAC5CC,uBAAuBR,cAAe,CAAAU,aAAA;MACtCD,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAS,GAAA,GAAM,IAAIJ,oBAAqB,CAAA;MAClCC,uBAAuBR,cAAe,CAAAW,GAAA;MACtCF,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;IACI,IAAA,CAAAU,KAAA,GAAQ,IAAIL,oBAAqB,CAAA;MACpCC,uBAAuBR,cAAe,CAAAY,KAAA;MACtCH,kBAAoB,EAAAN,kBAAA;MACpBD;IAAA,CACD,CAAA;EACH;EAEAW,YAAYR,QAAuC,EAAA;IAEjD,IAAIS,kBAAqB,GAAAC,IAAA,CAAKC,GAAI,CAAAX,QAAA,EAAU,CAAC,CAAA;IAC7CS,kBAAA,GACE,IAAK,CAAAT,QAAA,GAAWS,kBAAsB,IAAA,CAAA,GAAIA,kBAAqB,GAAA,CAAA;IAGjE,IAAA,CAAKT,WAAWU,IAAK,CAAAC,GAAA,CAAI,IAAK,CAAAX,QAAA,GAAWS,oBAAoB,CAAC,CAAA;IAGxD,MAAAG,iBAAA,GAAoB,KAAKb,SAAY,GAAAU,kBAAA;IAEpC,OAAA;MACLV,WAAW,IAAK,CAAAA,SAAA;MAChBF,UAAU,IAAK,CAAAA,QAAA;MACfG,QAAU,EAAAS,kBAAA;MACVR,cAAgB,EAAAY,MAAA,CACd,IAAK,CAAAZ,cAAA,CAAea,QAAS,CAAAF,iBAAA,EAAmB,KAAKf,QAAQ,CAC/D,CAAA;MACAQ,aAAe,EAAAQ,MAAA,CACb,IAAK,CAAAR,aAAA,CAAcS,QAAS,CAAAF,iBAAA,EAAmB,KAAKf,QAAQ,CAC9D,CAAA;MACAS,GAAA,EAAKO,OAAO,IAAK,CAAAP,GAAA,CAAIQ,SAASF,iBAAmB,EAAA,IAAA,CAAKf,QAAQ,CAAC,CAAA;MAC/DU,KAAA,EAAOM,OAAO,IAAK,CAAAN,KAAA,CAAMO,SAASF,iBAAmB,EAAA,IAAA,CAAKf,QAAQ,CAAC;IAAA,CACrE;EACF;AACF;"}
@@ -21,7 +21,7 @@ export declare const toSnapshotExchangeRate: (exchangeRate: TaxRate) => {
21
21
  * toFixedExchangeRate("0.123456789", true) // 0.123457
22
22
  */
23
23
  export declare function toFixedExchangeRate(rate: string | number, asNumber?: boolean): string;
24
- export declare function toFixedExchangeRate(rate: string | number, asNumber?: true): number;
24
+ export declare function toFixedExchangeRate(rate: string | number, asNumber: true): number;
25
25
  /**
26
26
  * Invert an exchange rate by doing 1 / rate
27
27
  * Used to fake a reverse exchange rate in case we don't have it
@@ -1 +1 @@
1
- {"version":3,"file":"exchangeRate.js","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: NoInfer<boolean>,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,cAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAAA,CAAAA,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,YAAA,CAAAA,UAAA,CACdJ,YAAA,EACAK,SAAAA,CAAAA,6BAA8B,CAAAC,IAAA,EAC9BD,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,SAA8B,CAAAA,6BAAA,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,MAAA,CAAAA,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;;;"}
1
+ {"version":3,"file":"exchangeRate.js","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,cAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAAA,CAAAA,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,YAAA,CAAAA,UAAA,CACdJ,YAAA,EACAK,SAAAA,CAAAA,6BAA8B,CAAAC,IAAA,EAC9BD,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,SAA8B,CAAAA,6BAAA,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,MAAA,CAAAA,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,SAAAA,CAAAA,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"exchangeRate.mjs","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: NoInfer<boolean>,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,OAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,UAAA,CACdJ,YAAA,EACAK,6BAA8B,CAAAC,IAAA,EAC9BD,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,6BAA8B,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;"}
1
+ {"version":3,"file":"exchangeRate.mjs","sources":["../../../src/utils/money/exchangeRate.ts"],"sourcesContent":["import { assert } from \"../errors\";\nimport { isFloat, toFixedRate } from \"../number\";\nimport { EXCHANGE_RATE_DINERO_CURRENCY } from \"./constants\";\nimport { floatToInt } from \"./misc.private\";\nimport type { Cents, TaxRate } from \"./types\";\n\n// FIXME: reconsider if needed her as only used in BE for exchange rate Graph other places in code use Float|number\n/**\n * Parse exchange rate to dinero friendly amount and scale.\n *\n * Used to prepare exchange rate for sending over API.\n *\n * @example\n * toSnapshotExchangeRate(0.22); // {amount: 22000, scale: 6}\n */\nexport const toSnapshotExchangeRate = (\n exchangeRate: TaxRate,\n): {\n amount: Cents;\n scale: number;\n} => {\n // Validate input\n isFloat(exchangeRate, \"Exchange rate\");\n assert(exchangeRate > 0, \"Exchange rate must be greater than 0\");\n\n // Get scale of exchange rate\n const rateInt = floatToInt(\n exchangeRate,\n EXCHANGE_RATE_DINERO_CURRENCY.base,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n );\n\n // Return dinero friendly amount and scale\n return {\n amount: rateInt,\n scale: EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n };\n};\n\n/**\n * Converts an arbitrary exchange rate to a fixed decimal place number.\n *\n * Used to take in an input and convert it for storage in the database.\n *\n * @example\n * toFixedExchangeRate(\"0.123456789\") // \"0.123457\"\n * toFixedExchangeRate(\"0.123456789\", true) // 0.123457\n */\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber: true,\n): number;\nexport function toFixedExchangeRate(\n rate: string | number,\n asNumber?: boolean,\n): string | number {\n // FIXME: Remove + but instead add proper parsing of the string --> number\n // https://stackoverflow.com/a/12862627/1378261\n return toFixedRate(\n typeof rate === \"string\" ? +rate : rate,\n EXCHANGE_RATE_DINERO_CURRENCY.exponent,\n asNumber,\n );\n}\n\n/**\n * Invert an exchange rate by doing 1 / rate\n * Used to fake a reverse exchange rate in case we don't have it\n * @example\n * invertExchangeRate(\"0.22\") // \"4.545455\"\n */\nexport function invertExchangeRate(rate: string | number) {\n const exchangeRate = toFixedExchangeRate(rate, true);\n return toFixedExchangeRate(1 / exchangeRate, false);\n}\n"],"names":["toSnapshotExchangeRate","exchangeRate","isFloat","assert","rateInt","floatToInt","EXCHANGE_RATE_DINERO_CURRENCY","base","exponent","amount","scale","toFixedExchangeRate","rate","asNumber","toFixedRate","invertExchangeRate"],"mappings":";;;;;AAea,MAAAA,sBAAA,GACXC,YAIG,IAAA;EAEHC,OAAA,CAAQD,cAAc,eAAe,CAAA;EAC9BE,MAAA,CAAAF,YAAA,GAAe,GAAG,sCAAsC,CAAA;EAG/D,MAAMG,OAAU,GAAAC,UAAA,CACdJ,YAAA,EACAK,6BAA8B,CAAAC,IAAA,EAC9BD,6BAA8B,CAAAE,QAAA,CAChC;EAGO,OAAA;IACLC,MAAQ,EAAAL,OAAA;IACRM,OAAOJ,6BAA8B,CAAAE;EAAA,CACvC;AACF,CAAA;AAmBgB,SAAAG,mBAAAA,CACdC,MACAC,QACiB,EAAA;EAGV,OAAAC,WAAA,CACL,OAAOF,IAAA,KAAS,QAAW,GAAA,CAACA,IAAO,GAAAA,IAAA,EACnCN,6BAA8B,CAAAE,QAAA,EAC9BK,QAAA,CACF;AACF;AAQO,SAASE,mBAAmBH,IAAuB,EAAA;EAClD,MAAAX,YAAA,GAAeU,mBAAoB,CAAAC,IAAA,EAAM,IAAI,CAAA;EAC5C,OAAAD,mBAAA,CAAoB,CAAI,GAAAV,YAAA,EAAc,KAAK,CAAA;AACpD;"}
@@ -48,19 +48,19 @@ export type LocalizedCurrency = {
48
48
  export interface LineItemSummary {
49
49
  itemPrice: Cents;
50
50
  /**
51
- * (itemPrice * quantity) - discountAmount
51
+ * Item quantity that is always bigger than zero!
52
52
  */
53
- taxableAmount: Cents;
53
+ quantity: number;
54
+ currency: Currency;
54
55
  /**
55
56
  * Total discount amount (only) applied for the given item quantity.
56
57
  * No taxes are included. Calculated by `total_raw_price * <discount-allocation-percentage>`
57
58
  */
58
59
  discountAmount: Cents;
59
- currency: Currency;
60
60
  /**
61
- * Item quantity that is always bigger than zero!
61
+ * (itemPrice * quantity) - discountAmount
62
62
  */
63
- quantity: number;
63
+ taxableAmount: Cents;
64
64
  }
65
65
  /**
66
66
  * Pretty much the same as PreTaxItemSummary but with quantity always set to 1 (for clearer type hinting and reasoning
@@ -69,3 +69,13 @@ export interface LineItemSummary {
69
69
  export interface SingleLineItemSummary extends LineItemSummary {
70
70
  quantity: 1;
71
71
  }
72
+ export interface FullLineItemSummary extends LineItemSummary {
73
+ /**
74
+ * Total tax amount for the given item quantity.
75
+ */
76
+ tax: Cents;
77
+ /**
78
+ * Total price for the given item quantity. Calculated by `(itemPrice * quantity) - discountAmount + tax`
79
+ */
80
+ total: Cents;
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "9.6.0-alpha.7",
3
+ "version": "9.6.0-alpha.8",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {