@ubnt/store.core 9.12.0-alpha.9 → 9.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -91
- package/lib/_virtual/_virtual_multi-entry.js +2 -15
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +0 -2
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/AITheta.jpg +0 -0
- package/lib/assets/MobileR.jpg +0 -0
- package/lib/assets/ProAV.jpg +0 -0
- package/lib/assets/ai360.jpg +0 -0
- package/lib/assets/ai3602.jpg +0 -0
- package/lib/assets/close.svg +3 -1
- package/lib/assets/close2.svg +1 -4
- package/lib/assets/close3.svg +3 -2
- package/lib/assets/cloudgatewayultra.jpg +0 -0
- package/lib/assets/dreamRouter.jpg +0 -0
- package/lib/assets/dreamWall.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz2.jpg +0 -0
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- package/lib/assets/udr.jpg +0 -0
- package/lib/assets/udw.jpg +0 -0
- package/lib/assets/umr.jpg +0 -0
- package/lib/assets/wideAngle.jpg +0 -0
- package/lib/assets/wideAngle2.jpg +0 -0
- package/lib/components/CustomImage/CustomImage.js +1 -1
- package/lib/components/CustomImage/CustomImage.mjs +1 -1
- package/lib/components/Explore/Explore.js +9 -2
- package/lib/components/Explore/Explore.js.map +1 -1
- package/lib/components/Explore/Explore.mjs +9 -2
- package/lib/components/Explore/Explore.mjs.map +1 -1
- package/lib/components/Explore/ExploreData.d.ts +7 -4
- package/lib/components/Explore/ExploreData.js +138 -87
- package/lib/components/Explore/ExploreData.js.map +1 -1
- package/lib/components/Explore/ExploreData.mjs +128 -79
- package/lib/components/Explore/ExploreData.mjs.map +1 -1
- package/lib/components/Explore/LensCompare/LensCompare.d.ts +2 -0
- package/lib/components/Explore/LensCompare/LensCompare.js +111 -0
- package/lib/components/Explore/LensCompare/LensCompare.js.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompare.mjs +109 -0
- package/lib/components/Explore/LensCompare/LensCompare.mjs.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompare.styles.d.ts +16 -0
- package/lib/components/Explore/LensCompare/LensCompare.styles.js +153 -0
- package/lib/components/Explore/LensCompare/LensCompare.styles.js.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompare.styles.mjs +132 -0
- package/lib/components/Explore/LensCompare/LensCompare.styles.mjs.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompare.types.d.ts +9 -0
- package/lib/components/Explore/LensCompare/LensCompare.utils.d.ts +2 -0
- package/lib/components/Explore/LensCompare/LensCompare.utils.js +23 -0
- package/lib/components/Explore/LensCompare/LensCompare.utils.js.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompare.utils.mjs +21 -0
- package/lib/components/Explore/LensCompare/LensCompare.utils.mjs.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompareData.d.ts +29 -0
- package/lib/components/Explore/LensCompare/LensCompareData.js +68 -0
- package/lib/components/Explore/LensCompare/LensCompareData.js.map +1 -0
- package/lib/components/Explore/LensCompare/LensCompareData.mjs +58 -0
- package/lib/components/Explore/LensCompare/LensCompareData.mjs.map +1 -0
- package/lib/{assets/keyFeatures/music.svg.js → components/Explore/LensCompare/assets/ai360.jpg.js} +6 -6
- package/lib/components/Explore/LensCompare/assets/ai360.jpg.js.map +1 -0
- package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs +3 -0
- package/lib/components/Explore/LensCompare/assets/ai360.jpg.mjs.map +1 -0
- package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js +27 -0
- package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.js.map +1 -0
- package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs +3 -0
- package/lib/components/Explore/LensCompare/assets/wideAngle.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/AITheta.jpg.js +27 -0
- package/lib/components/Explore/assets/AITheta.jpg.js.map +1 -0
- package/lib/components/Explore/assets/AITheta.jpg.mjs +3 -0
- package/lib/components/Explore/assets/AITheta.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/MobileR.jpg.js +27 -0
- package/lib/components/Explore/assets/MobileR.jpg.js.map +1 -0
- package/lib/components/Explore/assets/MobileR.jpg.mjs +3 -0
- package/lib/components/Explore/assets/MobileR.jpg.mjs.map +1 -0
- package/lib/{assets/keyFeatures/group.svg.js → components/Explore/assets/ProAV.jpg.js} +6 -6
- package/lib/components/Explore/assets/ProAV.jpg.js.map +1 -0
- package/lib/components/Explore/assets/ProAV.jpg.mjs +3 -0
- package/lib/components/Explore/assets/ProAV.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/UISPConsole.jpg.js +5 -5
- package/lib/components/Explore/assets/{baseStation--mobile.jpg.js → baseStation-mobile.jpg.js} +6 -6
- package/lib/components/Explore/assets/baseStation-mobile.jpg.js.map +1 -0
- package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs +3 -0
- package/lib/components/Explore/assets/baseStation-mobile.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/baseStation.jpg.js +5 -5
- package/lib/components/Explore/assets/cloudgatewayultra.jpg.js +27 -0
- package/lib/components/Explore/assets/cloudgatewayultra.jpg.js.map +1 -0
- package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs +3 -0
- package/lib/components/Explore/assets/cloudgatewayultra.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/dreamRouter.jpg.js +27 -0
- package/lib/components/Explore/assets/dreamRouter.jpg.js.map +1 -0
- package/lib/components/Explore/assets/dreamRouter.jpg.mjs +3 -0
- package/lib/components/Explore/assets/dreamRouter.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/dreamWall.jpg.js +27 -0
- package/lib/components/Explore/assets/dreamWall.jpg.js.map +1 -0
- package/lib/components/Explore/assets/dreamWall.jpg.mjs +3 -0
- package/lib/components/Explore/assets/dreamWall.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/{g4Ptz.jpg.js → g4-ptz.jpg.js} +2 -2
- package/lib/components/Explore/assets/g4-ptz.jpg.js.map +1 -0
- package/lib/components/Explore/assets/g4-ptz.jpg.mjs +3 -0
- package/lib/components/Explore/assets/g4-ptz.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/{g5Ptz.jpg.js → g5-ptz.jpg.js} +2 -2
- package/lib/components/Explore/assets/g5-ptz.jpg.js.map +1 -0
- package/lib/components/Explore/assets/g5-ptz.jpg.mjs +3 -0
- package/lib/components/Explore/assets/g5-ptz.jpg.mjs.map +1 -0
- package/lib/components/Explore/assets/unifiExpress.jpg.js +27 -0
- package/lib/components/Explore/assets/unifiExpress.jpg.js.map +1 -0
- package/lib/components/Explore/assets/unifiExpress.jpg.mjs +3 -0
- package/lib/components/Explore/assets/unifiExpress.jpg.mjs.map +1 -0
- package/lib/components/Explore/translations/ar.json.js +0 -19
- package/lib/components/Explore/translations/ar.json.js.map +1 -1
- package/lib/components/Explore/translations/ar.json.mjs +0 -19
- package/lib/components/Explore/translations/ar.json.mjs.map +1 -1
- package/lib/components/Explore/translations/de.json.js +0 -19
- package/lib/components/Explore/translations/de.json.js.map +1 -1
- package/lib/components/Explore/translations/de.json.mjs +0 -19
- package/lib/components/Explore/translations/de.json.mjs.map +1 -1
- package/lib/components/Explore/translations/el.json.js +0 -19
- package/lib/components/Explore/translations/el.json.js.map +1 -1
- package/lib/components/Explore/translations/el.json.mjs +0 -19
- package/lib/components/Explore/translations/el.json.mjs.map +1 -1
- package/lib/components/Explore/translations/en.json.js +30 -11
- package/lib/components/Explore/translations/en.json.js.map +1 -1
- package/lib/components/Explore/translations/en.json.mjs +30 -12
- package/lib/components/Explore/translations/en.json.mjs.map +1 -1
- package/lib/components/Explore/translations/es.json.js +82 -101
- package/lib/components/Explore/translations/es.json.js.map +1 -1
- package/lib/components/Explore/translations/es.json.mjs +82 -101
- package/lib/components/Explore/translations/es.json.mjs.map +1 -1
- package/lib/components/Explore/translations/fr.json.js +0 -19
- package/lib/components/Explore/translations/fr.json.js.map +1 -1
- package/lib/components/Explore/translations/fr.json.mjs +0 -19
- package/lib/components/Explore/translations/fr.json.mjs.map +1 -1
- package/lib/components/Explore/translations/it.json.js +0 -19
- package/lib/components/Explore/translations/it.json.js.map +1 -1
- package/lib/components/Explore/translations/it.json.mjs +0 -19
- package/lib/components/Explore/translations/it.json.mjs.map +1 -1
- package/lib/components/Explore/translations/ja.json.js +0 -19
- package/lib/components/Explore/translations/ja.json.js.map +1 -1
- package/lib/components/Explore/translations/ja.json.mjs +0 -19
- package/lib/components/Explore/translations/ja.json.mjs.map +1 -1
- package/lib/components/Explore/translations/pt-BR.json.js +0 -19
- package/lib/components/Explore/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Explore/translations/pt-BR.json.mjs +0 -19
- package/lib/components/Explore/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Explore/translations/zh-Hans.json.js +0 -19
- package/lib/components/Explore/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Explore/translations/zh-Hans.json.mjs +0 -19
- package/lib/components/Explore/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Explore/translations/zh-Hant-TW.json.js +0 -19
- package/lib/components/Explore/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Explore/translations/zh-Hant-TW.json.mjs +0 -19
- package/lib/components/Explore/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/GridGallery/GridModal/GridModal.js +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.mjs +1 -1
- package/lib/components/Header/CartModalV2/CartModal.js +1 -1
- package/lib/components/Header/CartModalV2/CartModal.mjs +1 -1
- package/lib/components/Header/Header.js +1 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +1 -2
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.d.ts +0 -3
- package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.js +1 -1
- package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +0 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udw.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Interior/ai360.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Interior/wideAngle.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/MobileRouters/umr.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +2 -2
- package/lib/components/ModelCompareV3/data/Switching.js +1 -3
- package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.mjs +1 -3
- package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.js +8 -16
- package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs +8 -16
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/connectDisplay.js +1 -1
- package/lib/components/ModelCompareV3/data/products/connectDisplay.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/connectDisplay.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js +8 -16
- package/lib/components/ModelCompareV3/data/products/enterprise24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs +8 -16
- package/lib/components/ModelCompareV3/data/products/enterprise24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js +8 -16
- package/lib/components/ModelCompareV3/data/products/enterprise48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs +8 -16
- package/lib/components/ModelCompareV3/data/products/enterprise48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js +8 -16
- package/lib/components/ModelCompareV3/data/products/enterpriseXG24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs +8 -16
- package/lib/components/ModelCompareV3/data/products/enterpriseXG24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/g5Ptz.js +1 -1
- package/lib/components/ModelCompareV3/data/products/g5Ptz.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +8 -16
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +8 -16
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.js +0 -8
- package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/phoneTouch.js +3 -5
- package/lib/components/ModelCompareV3/data/products/phoneTouch.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs +3 -5
- package/lib/components/ModelCompareV3/data/products/phoneTouch.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js +2 -4
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/phoneTouchMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional24.js +0 -8
- package/lib/components/ModelCompareV3/data/products/professional24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional24.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/professional24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional24PoE.js +0 -8
- package/lib/components/ModelCompareV3/data/products/professional24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/professional24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional48.js +0 -8
- package/lib/components/ModelCompareV3/data/products/professional48.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional48.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/professional48.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional48PoE.js +0 -8
- package/lib/components/ModelCompareV3/data/products/professional48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/professional48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +1 -11
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +1 -11
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/theta360.js +1 -1
- package/lib/components/ModelCompareV3/data/products/theta360.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/thetaWideAngle.js +1 -1
- package/lib/components/ModelCompareV3/data/products/thetaWideAngle.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCast.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCast.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCast.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCast.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCastPro.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCastPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/ucCastPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/umr.js +1 -1
- package/lib/components/ModelCompareV3/data/products/umr.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.d.ts +0 -1
- package/lib/components/ModelCompareV3/data/properties/index.js +0 -2
- package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs +0 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/property-sets/switching.js +4 -6
- package/lib/components/ModelCompareV3/data/property-sets/switching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/property-sets/switching.mjs +4 -6
- package/lib/components/ModelCompareV3/data/property-sets/switching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/de.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.js +2 -5
- package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.mjs +2 -5
- package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +0 -3
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +0 -3
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +15 -311
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +15 -309
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +22 -38
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs +22 -38
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +2 -10
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js +4 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs +4 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +0 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/components/Search/Input/Input.js +1 -1
- package/lib/components/Search/Input/Input.mjs +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/icons/generic/close.svg.js +1 -1
- package/lib/constants/icons/generic/close.svg.mjs +2 -2
- package/lib/constants/icons/generic/index.js +1 -1
- package/lib/constants/icons/generic/index.mjs +1 -1
- package/lib/constants/icons/menu/index.d.ts +0 -1
- package/lib/constants/icons/menu/index.js +0 -9
- package/lib/constants/icons/menu/index.js.map +1 -1
- package/lib/constants/icons/menu/index.mjs +0 -2
- package/lib/constants/icons/menu/index.mjs.map +1 -1
- package/lib/constants/keyFeatureIcons.d.ts +0 -2
- package/lib/constants/keyFeatureIcons.js +0 -6
- package/lib/constants/keyFeatureIcons.js.map +1 -1
- package/lib/constants/keyFeatureIcons.mjs +0 -6
- package/lib/constants/keyFeatureIcons.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +1 -3
- package/lib/constants/proStoreCategories/mapping/index.js +8 -18
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +8 -18
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.js +1 -8
- package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.mjs +1 -8
- package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +2 -4
- package/lib/constants/proStoreCategories/mapping/unifi.js +1 -3
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -3
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +1 -5
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +2 -5
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +3 -4
- package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +3 -4
- package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +2 -3
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +2 -3
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -4
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +3 -4
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -4
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +3 -4
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/shopify/keyFeatureIcons.js +0 -8
- package/lib/constants/shopify/keyFeatureIcons.js.map +1 -1
- package/lib/constants/shopify/keyFeatureIcons.mjs +0 -6
- package/lib/constants/shopify/keyFeatureIcons.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +1 -1
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +1 -1
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/contexts/MenuContext/mapping.d.ts +3 -3
- package/lib/contexts/MenuContext/mapping.js +7 -21
- package/lib/contexts/MenuContext/mapping.js.map +1 -1
- package/lib/contexts/MenuContext/mapping.mjs +7 -20
- package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/presets.d.ts +4 -11
- package/lib/contexts/MenuContext/presets.js +12 -16
- package/lib/contexts/MenuContext/presets.js.map +1 -1
- package/lib/contexts/MenuContext/presets.mjs +13 -13
- package/lib/contexts/MenuContext/presets.mjs.map +1 -1
- package/lib/contexts/MenuContext/types.d.ts +1 -1
- package/lib/contexts/MenuContext/types.js.map +1 -1
- package/lib/contexts/MenuContext/types.mjs.map +1 -1
- package/lib/contexts/MenuContext/utils.js +1 -5
- package/lib/contexts/MenuContext/utils.js.map +1 -1
- package/lib/contexts/MenuContext/utils.mjs +1 -5
- package/lib/contexts/MenuContext/utils.mjs.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/helpers/index.js +0 -11
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +0 -1
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +0 -1
- package/lib/types/index.mjs.map +1 -1
- package/lib/utils/array.d.ts +0 -4
- package/lib/utils/array.js +0 -10
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +1 -10
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/money/constants.d.ts +25 -56
- package/lib/utils/money/constants.js +7 -72
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +7 -70
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/format.d.ts +5 -10
- package/lib/utils/money/format.js +14 -22
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +16 -23
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +1 -4
- package/lib/utils/money/index.js +8 -26
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +4 -8
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/misc.d.ts +28 -68
- package/lib/utils/money/misc.js +64 -35
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs +43 -32
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/money/tax.d.ts +2 -38
- package/lib/utils/money/tax.js +10 -46
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +11 -42
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/types.d.ts +3 -78
- package/lib/utils/nextjs/navigationPresets.d.ts +5 -7
- package/lib/utils/nextjs/navigationPresets.js +7 -13
- package/lib/utils/nextjs/navigationPresets.js.map +1 -1
- package/lib/utils/nextjs/navigationPresets.mjs +8 -14
- package/lib/utils/nextjs/navigationPresets.mjs.map +1 -1
- package/lib/utils/number.d.ts +1 -1
- package/lib/utils/number.js +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/validations.d.ts +15 -0
- package/lib/utils/validations.js +23 -0
- package/lib/utils/validations.js.map +1 -0
- package/lib/utils/validations.mjs +21 -0
- package/lib/utils/validations.mjs.map +1 -0
- package/package.json +54 -55
- package/lib/assets/efg.png +0 -0
- package/lib/assets/g5Ptz.jpg +0 -0
- package/lib/assets/group.svg +0 -6
- package/lib/assets/keyFeatures/group.svg +0 -6
- package/lib/assets/keyFeatures/group.svg.js.map +0 -1
- package/lib/assets/keyFeatures/group.svg.mjs +0 -3
- package/lib/assets/keyFeatures/group.svg.mjs.map +0 -1
- package/lib/assets/keyFeatures/music.svg +0 -3
- package/lib/assets/keyFeatures/music.svg.js.map +0 -1
- package/lib/assets/keyFeatures/music.svg.mjs +0 -3
- package/lib/assets/keyFeatures/music.svg.mjs.map +0 -1
- package/lib/assets/music.svg +0 -3
- package/lib/assets/powerAmp.jpg +0 -0
- package/lib/assets/powerAmp.svg +0 -3
- package/lib/assets/ucg-max.png +0 -0
- package/lib/assets/udr2.jpg +0 -0
- package/lib/assets/udw2.jpg +0 -0
- package/lib/assets/umr2.jpg +0 -0
- package/lib/assets/volume-on2.svg +0 -3
- package/lib/components/Explore/assets/baseStation--mobile.jpg.js.map +0 -1
- package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs +0 -3
- package/lib/components/Explore/assets/baseStation--mobile.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/g4Ptz.jpg.js.map +0 -1
- package/lib/components/Explore/assets/g4Ptz.jpg.mjs +0 -3
- package/lib/components/Explore/assets/g4Ptz.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/g5Ptz.jpg.js.map +0 -1
- package/lib/components/Explore/assets/g5Ptz.jpg.mjs +0 -3
- package/lib/components/Explore/assets/g5Ptz.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/powerAmp.jpg.js +0 -27
- package/lib/components/Explore/assets/powerAmp.jpg.js.map +0 -1
- package/lib/components/Explore/assets/powerAmp.jpg.mjs +0 -3
- package/lib/components/Explore/assets/powerAmp.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/udr.jpg.js +0 -27
- package/lib/components/Explore/assets/udr.jpg.js.map +0 -1
- package/lib/components/Explore/assets/udr.jpg.mjs +0 -3
- package/lib/components/Explore/assets/udr.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/udw.jpg.js +0 -27
- package/lib/components/Explore/assets/udw.jpg.js.map +0 -1
- package/lib/components/Explore/assets/udw.jpg.mjs +0 -3
- package/lib/components/Explore/assets/udw.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/umr.jpg.js +0 -27
- package/lib/components/Explore/assets/umr.jpg.js.map +0 -1
- package/lib/components/Explore/assets/umr.jpg.mjs +0 -3
- package/lib/components/Explore/assets/umr.jpg.mjs.map +0 -1
- package/lib/components/Explore/assets/ux.jpg.js +0 -27
- package/lib/components/Explore/assets/ux.jpg.js.map +0 -1
- package/lib/components/Explore/assets/ux.jpg.mjs +0 -3
- package/lib/components/Explore/assets/ux.jpg.mjs.map +0 -1
- package/lib/components/ModelCompareV3/assets/volume-on.svg.js +0 -27
- package/lib/components/ModelCompareV3/assets/volume-on.svg.js.map +0 -1
- package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs +0 -3
- package/lib/components/ModelCompareV3/assets/volume-on.svg.mjs.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/proAvSupport.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/properties/proAvSupport.js +0 -19
- package/lib/components/ModelCompareV3/data/properties/proAvSupport.js.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs +0 -11
- package/lib/components/ModelCompareV3/data/properties/proAvSupport.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +0 -1
- package/lib/constants/icons/menu/powerAmp.svg.js +0 -27
- package/lib/constants/icons/menu/powerAmp.svg.js.map +0 -1
- package/lib/constants/icons/menu/powerAmp.svg.mjs +0 -3
- package/lib/constants/icons/menu/powerAmp.svg.mjs.map +0 -1
- package/lib/helpers/product.d.ts +0 -87
- package/lib/helpers/product.js +0 -346
- package/lib/helpers/product.js.map +0 -1
- package/lib/helpers/product.mjs +0 -335
- package/lib/helpers/product.mjs.map +0 -1
- package/lib/types/product.d.ts +0 -87
- package/lib/types/product.js +0 -14
- package/lib/types/product.js.map +0 -1
- package/lib/types/product.mjs +0 -13
- package/lib/types/product.mjs.map +0 -1
- package/lib/utils/money/allocators/fixedAmount.d.ts +0 -26
- package/lib/utils/money/allocators/fixedAmount.js +0 -55
- package/lib/utils/money/allocators/fixedAmount.js.map +0 -1
- package/lib/utils/money/allocators/fixedAmount.mjs +0 -53
- package/lib/utils/money/allocators/fixedAmount.mjs.map +0 -1
- package/lib/utils/money/allocators/index.d.ts +0 -2
- package/lib/utils/money/allocators/index.js +0 -8
- package/lib/utils/money/allocators/index.js.map +0 -1
- package/lib/utils/money/allocators/index.mjs +0 -4
- package/lib/utils/money/allocators/index.mjs.map +0 -1
- package/lib/utils/money/allocators/productAmount.d.ts +0 -13
- package/lib/utils/money/allocators/productAmount.js +0 -110
- package/lib/utils/money/allocators/productAmount.js.map +0 -1
- package/lib/utils/money/allocators/productAmount.mjs +0 -108
- package/lib/utils/money/allocators/productAmount.mjs.map +0 -1
- package/lib/utils/money/exchangeRate.d.ts +0 -31
- package/lib/utils/money/exchangeRate.js +0 -27
- package/lib/utils/money/exchangeRate.js.map +0 -1
- package/lib/utils/money/exchangeRate.mjs +0 -23
- package/lib/utils/money/exchangeRate.mjs.map +0 -1
- package/lib/utils/money/misc.private.d.ts +0 -23
- package/lib/utils/money/misc.private.js +0 -46
- package/lib/utils/money/misc.private.js.map +0 -1
- package/lib/utils/money/misc.private.mjs +0 -21
- package/lib/utils/money/misc.private.mjs.map +0 -1
- package/lib/utils/money/shipping.d.ts +0 -5
- package/lib/utils/money/shipping.js +0 -8
- package/lib/utils/money/shipping.js.map +0 -1
- package/lib/utils/money/shipping.mjs +0 -6
- package/lib/utils/money/shipping.mjs.map +0 -1
- package/lib/utils/money/tax.private.d.ts +0 -17
- package/lib/utils/money/tax.private.js +0 -65
- package/lib/utils/money/tax.private.js.map +0 -1
- package/lib/utils/money/tax.private.mjs +0 -60
- package/lib/utils/money/tax.private.mjs.map +0 -1
- package/lib/utils/productSort.d.ts +0 -41
- package/lib/utils/productSort.js +0 -66
- package/lib/utils/productSort.js.map +0 -1
- package/lib/utils/productSort.mjs +0 -59
- package/lib/utils/productSort.mjs.map +0 -1
- /package/lib/assets/{baseStation--mobile.jpg → baseStation-mobile.jpg} +0 -0
- /package/lib/assets/{g4Ptz.jpg → g4-ptz.jpg} +0 -0
- /package/lib/assets/{ux.jpg → unifiExpress.jpg} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax.mjs","sources":["../../../src/utils/money/tax.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"tax.mjs","sources":["../../../src/utils/money/tax.ts"],"sourcesContent":["import { allocate, type Dinero, dinero, down, toSnapshot } from \"dinero.js\";\n\nexport const allocateTaxAmount = (\n baseAmountObj: Dinero<number>,\n floatRate: number,\n) => {\n // FIXME: currently the API returns rate as a floating number, but the dinero lib expects be a integer number with some\n // scale so for now we attempt calculate the scale from the float rate\n // @see https://v2.dinerojs.com/docs/api/mutations/allocate\n const rateScale = String(floatRate).split(\".\")[1]?.length;\n if (rateScale === undefined) {\n throw new Error(`rateScale is unsupported ${floatRate}`);\n }\n const rateInt = Math.round(floatRate * Math.pow(10, rateScale));\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return allocate(baseAmountObj, [\n rateInt,\n Math.pow(10, rateScale) - rateInt,\n ])[0]!;\n};\n\nexport const removeTaxAmount = (\n baseAmountWithTaxObj: Dinero<number>,\n floatRate: number,\n) => {\n const snapshot = toSnapshot(baseAmountWithTaxObj);\n return dinero({\n ...snapshot,\n amount: down(snapshot.amount / (1 + floatRate)),\n });\n};\n"],"names":["allocateTaxAmount","baseAmountObj","floatRate","rateScale","String","split","length","Error","rateInt","Math","round","pow","allocate","removeTaxAmount","baseAmountWithTaxObj","snapshot","toSnapshot","dinero","amount","down"],"mappings":";;AAEa,MAAAA,iBAAA,GAAoBA,CAC/BC,aAAA,EACAC,SACG,KAAA;EAIG,MAAAC,SAAA,GAAYC,OAAOF,SAAS,CAAA,CAAEG,MAAM,GAAG,CAAA,CAAE,CAAC,CAAG,EAAAC,MAAA;EACnD,IAAIH,cAAc,KAAW,CAAA,EAAA;IAC3B,MAAM,IAAII,KAAA,CAAkC,4BAAAL,SAAW,EAAA,CAAA;EACzD;EACM,MAAAM,OAAA,GAAUC,KAAKC,KAAM,CAAAR,SAAA,GAAYO,KAAKE,GAAI,CAAA,EAAA,EAAIR,SAAS,CAAC,CAAA;EAE9D,OAAOS,SAASX,aAAe,EAAA,CAC7BO,OAAA,EACAC,IAAK,CAAAE,GAAA,CAAI,EAAI,EAAAR,SAAS,CAAI,GAAAK,OAAA,CAC3B,EAAE,CAAC,CAAA;AACN,CAAA;AAEa,MAAAK,eAAA,GAAkBA,CAC7BC,oBAAA,EACAZ,SACG,KAAA;EACG,MAAAa,QAAA,GAAWC,WAAWF,oBAAoB,CAAA;EAChD,OAAOG,MAAO,CAAA;IACZ,GAAGF,QAAA;IACHG,MAAQ,EAAAC,IAAA,CAAKJ,QAAS,CAAAG,MAAA,IAAU,IAAIhB,SAAU,CAAA;EAAA,CAC/C,CAAA;AACH,CAAA;"}
|
|
@@ -1,85 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Currency } from "../../types";
|
|
3
|
-
/**
|
|
4
|
-
* Floating point number of item tax rate
|
|
5
|
-
* Number in range of 0>rate<1 (non-inclusive boundaries)
|
|
6
|
-
* @example
|
|
7
|
-
* 0.09 // 9%
|
|
8
|
-
*/
|
|
9
|
-
export type TaxRate = number;
|
|
10
|
-
/**
|
|
11
|
-
* Shorthand for Dinero.js instance with number as the amount
|
|
12
|
-
*/
|
|
13
|
-
export type Dino = Dinero<number>;
|
|
14
|
-
/**
|
|
15
|
-
* Shorthand for Dinero.js currency instance representing either a currency or custom currency such as tax-rate or shipping
|
|
16
|
-
*/
|
|
17
|
-
export type DinoCurrency = DineroCurrency<number>;
|
|
18
|
-
/**
|
|
19
|
-
* Cents representation of specific currency
|
|
20
|
-
* As a helper to easily understand the code, we use `Cents` as a type alias for `number` as historically we have had
|
|
21
|
-
* mistakes by the team where we have used as dollar instead of `Cents` and vice versa.
|
|
22
|
-
* @example
|
|
23
|
-
* 100 // in USD this is $1.00
|
|
24
|
-
* 100 // in YEN this is ¥100
|
|
25
|
-
*/
|
|
26
|
-
export type Cents = number;
|
|
27
|
-
/**
|
|
28
|
-
* Type definition for a rounding function that can be used to round fractions
|
|
29
|
-
*/
|
|
30
|
-
export type RoundingFn = (float: number) => Cents;
|
|
31
|
-
/**
|
|
32
|
-
* Convenient way to represent a money on the API level
|
|
33
|
-
* When working with dinero you typically will convert this to a Dinero instance
|
|
34
|
-
*/
|
|
35
|
-
export interface Money {
|
|
36
|
-
amount: Cents;
|
|
37
|
-
currency: Currency;
|
|
38
|
-
}
|
|
1
|
+
import type { Currency as DineroCurrency } from "dinero.js";
|
|
39
2
|
/**
|
|
40
3
|
* Attempt to type out some locales `language-TERRITORY` which "we" as store care about
|
|
41
4
|
* @see https://unicode-org.github.io/cldr-staging/charts/38/supplemental/territory_language_information.html
|
|
42
5
|
*/
|
|
43
6
|
export type Locale = "ar-AE" | "ar-SA" | "bg-BG" | "bn-BD" | "bn-IN" | "cs-CZ" | "da-DK" | "de-AT" | "de-CH" | "de-DE" | "el-GR" | "en-AU" | "en-BR" | "en-CA" | "en-GB" | "en-IE" | "en-IN" | "en-JP" | "en-NZ" | "en-SG" | "en-US" | "en-ZA" | "es-AR" | "es-CL" | "es-CO" | "es-ES" | "es-MX" | "es-US" | "fi-FI" | "fr-BE" | "fr-CA" | "fr-CH" | "fr-FR" | "he-IL" | "hi-IN" | "hr-HR" | "hu-HU" | "id-ID" | "it-CH" | "it-IT" | "ja-JP" | "ko-KR" | "nl-BE" | "nl-NL" | "no-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sv-SE" | "ta-IN" | "ta-LK" | "th-TH" | "tr-TR" | "zh-CN" | "zh-HK" | "zh-TW" | string;
|
|
44
|
-
export type
|
|
45
|
-
currency:
|
|
7
|
+
export type CurrencyObj = {
|
|
8
|
+
currency: DineroCurrency<number>;
|
|
46
9
|
locale: Locale;
|
|
47
10
|
};
|
|
48
|
-
export interface LineItemSummary {
|
|
49
|
-
itemPrice: Cents;
|
|
50
|
-
/**
|
|
51
|
-
* Item quantity that is always bigger than zero!
|
|
52
|
-
*/
|
|
53
|
-
quantity: number;
|
|
54
|
-
currency: Currency;
|
|
55
|
-
/**
|
|
56
|
-
* Total discount amount (only) applied for the given item quantity.
|
|
57
|
-
* No taxes are included. Calculated by `total_raw_price * <discount-allocation-percentage>`
|
|
58
|
-
*/
|
|
59
|
-
discountAmount: Cents;
|
|
60
|
-
/**
|
|
61
|
-
* subtotal - discountAmount
|
|
62
|
-
*/
|
|
63
|
-
taxableAmount: Cents;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Pretty much the same as PreTaxItemSummary but with quantity always set to 1 (for clearer type hinting and reasoning
|
|
67
|
-
* around the topic)
|
|
68
|
-
*/
|
|
69
|
-
export interface SingleLineItemSummary extends LineItemSummary {
|
|
70
|
-
quantity: 1;
|
|
71
|
-
}
|
|
72
|
-
export interface FullLineItemSummary extends LineItemSummary {
|
|
73
|
-
/**
|
|
74
|
-
* Total price for the given item quantity. Calculated by `(itemPrice * quantity)`
|
|
75
|
-
*/
|
|
76
|
-
subtotal: Cents;
|
|
77
|
-
/**
|
|
78
|
-
* Total tax amount for the given item quantity.
|
|
79
|
-
*/
|
|
80
|
-
tax: Cents;
|
|
81
|
-
/**
|
|
82
|
-
* Total price for the given item quantity. Calculated by `subtotal - discountAmount + tax`
|
|
83
|
-
*/
|
|
84
|
-
total: Cents;
|
|
85
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { DeployedLanguages } from "../../contexts/MenuContext/mapping";
|
|
2
1
|
import type { BasicSiteConfig } from "../../contexts/MenuContext/types";
|
|
3
2
|
import { SiteConfigType } from "../../contexts/MenuContext/types";
|
|
4
3
|
import { GlobalStoreId } from "../../types";
|
|
@@ -34,8 +33,8 @@ export declare const getGlobalSiteConfigByEnv: (buildEnv: BuildEnv) => {
|
|
|
34
33
|
store: {
|
|
35
34
|
type: SiteConfigType.Regional;
|
|
36
35
|
defaultRegion: {
|
|
37
|
-
languages?: DeployedLanguages;
|
|
38
|
-
defaultLanguage?: import("../../types").Language;
|
|
36
|
+
languages?: import("../../contexts/MenuContext/mapping").DeployedLanguages | undefined;
|
|
37
|
+
defaultLanguage?: import("../../types").Language | undefined;
|
|
39
38
|
type: SiteConfigType.Basic;
|
|
40
39
|
baseUrl: string;
|
|
41
40
|
};
|
|
@@ -47,8 +46,8 @@ export declare const getGlobalSiteConfigByEnv: (buildEnv: BuildEnv) => {
|
|
|
47
46
|
ui: {
|
|
48
47
|
type: SiteConfigType.Regional;
|
|
49
48
|
defaultRegion: {
|
|
50
|
-
languages?: DeployedLanguages;
|
|
51
|
-
defaultLanguage?: import("../../types").Language;
|
|
49
|
+
languages?: import("../../contexts/MenuContext/mapping").DeployedLanguages | undefined;
|
|
50
|
+
defaultLanguage?: import("../../types").Language | undefined;
|
|
52
51
|
type: SiteConfigType.Basic;
|
|
53
52
|
baseUrl: string;
|
|
54
53
|
};
|
|
@@ -83,10 +82,9 @@ export declare const getGlobalSiteConfigByEnv: (buildEnv: BuildEnv) => {
|
|
|
83
82
|
* "experts.ui.com" site config
|
|
84
83
|
* NOTE: will be deprecated
|
|
85
84
|
*/
|
|
86
|
-
|
|
85
|
+
experts: {
|
|
87
86
|
type: SiteConfigType.Basic;
|
|
88
87
|
baseUrl: string;
|
|
89
|
-
languages: DeployedLanguages;
|
|
90
88
|
};
|
|
91
89
|
/**
|
|
92
90
|
* "experts.uisp.com" site config
|
|
@@ -73,24 +73,21 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
73
73
|
{
|
|
74
74
|
return {
|
|
75
75
|
store: presets.STORE_DEPLOYED_LANGUAGES_LOCAL,
|
|
76
|
-
ui: presets.UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
77
|
-
uwc: presets.UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
76
|
+
ui: presets.UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
79
|
case "proto":
|
|
81
80
|
{
|
|
82
81
|
return {
|
|
83
82
|
store: presets.STORE_DEPLOYED_LANGUAGES_PROTO,
|
|
84
|
-
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
85
|
-
uwc: presets.UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
83
|
+
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
86
84
|
};
|
|
87
85
|
}
|
|
88
86
|
case "qa":
|
|
89
87
|
{
|
|
90
88
|
return {
|
|
91
89
|
store: presets.STORE_DEPLOYED_LANGUAGES_QA,
|
|
92
|
-
ui: presets.UI_COM_DEPLOYED_LANGUAGES_QA
|
|
93
|
-
uwc: presets.UWC_UI_COM_DEPLOYED_LANGUAGES_QA
|
|
90
|
+
ui: presets.UI_COM_DEPLOYED_LANGUAGES_QA
|
|
94
91
|
};
|
|
95
92
|
}
|
|
96
93
|
case void 0:
|
|
@@ -99,8 +96,7 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
99
96
|
{
|
|
100
97
|
return {
|
|
101
98
|
store: presets.STORE_DEPLOYED_LANGUAGES_PROD,
|
|
102
|
-
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
103
|
-
uwc: presets.UWC_UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
99
|
+
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
104
100
|
};
|
|
105
101
|
}
|
|
106
102
|
default:
|
|
@@ -108,8 +104,7 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
108
104
|
errors.checkUnreachable(buildEnv);
|
|
109
105
|
return {
|
|
110
106
|
store: presets.STORE_DEPLOYED_LANGUAGES_PROD,
|
|
111
|
-
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
112
|
-
uwc: presets.UWC_UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
107
|
+
ui: presets.UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
113
108
|
};
|
|
114
109
|
}
|
|
115
110
|
}
|
|
@@ -233,10 +228,9 @@ const getGlobalSiteConfigByEnv = buildEnv => {
|
|
|
233
228
|
* "experts.ui.com" site config
|
|
234
229
|
* NOTE: will be deprecated
|
|
235
230
|
*/
|
|
236
|
-
|
|
231
|
+
experts: {
|
|
237
232
|
type: types.SiteConfigType.Basic,
|
|
238
|
-
baseUrl: micrositeRootUrls.
|
|
239
|
-
languages: deployedLanguages.uwc
|
|
233
|
+
baseUrl: micrositeRootUrls.experts
|
|
240
234
|
},
|
|
241
235
|
/**
|
|
242
236
|
* "experts.uisp.com" site config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationPresets.js","sources":["../../../src/utils/nextjs/navigationPresets.ts"],"sourcesContent":["import type {\n DeployedLanguages,\n DeployedLanguagesMapping,\n} from \"../../contexts/MenuContext/mapping\";\nimport {\n MICROSITE_ROOT_URLS_LOCAL,\n MICROSITE_ROOT_URLS_PROD,\n MICROSITE_ROOT_URLS_PROTO,\n MICROSITE_ROOT_URLS_QA,\n STORE_DEPLOYED_LANGUAGES_LOCAL,\n STORE_DEPLOYED_LANGUAGES_PROD,\n STORE_DEPLOYED_LANGUAGES_PROTO,\n STORE_DEPLOYED_LANGUAGES_QA,\n STORE_ROOT_URLS_HONEYPOT,\n STORE_ROOT_URLS_LOCAL,\n STORE_ROOT_URLS_PROD,\n STORE_ROOT_URLS_PROTO,\n STORE_ROOT_URLS_QA,\n UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UI_COM_DEPLOYED_LANGUAGES_PROD,\n UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UI_COM_DEPLOYED_LANGUAGES_QA,\n UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UWC_UI_COM_DEPLOYED_LANGUAGES_QA,\n} from \"../../contexts/MenuContext/presets\";\nimport type {\n BasicSiteConfig,\n RegionalSite,\n StaticGlobalSiteConfig,\n} from \"../../contexts/MenuContext/types\";\nimport { SiteConfigType } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../errors\";\nimport { isStoreId } from \"../storeId\";\n\n/**\n * Values that indicate what kind of target build environment it is\n */\nexport type BuildEnv = \"local\" | \"e2e\" | \"proto\" | \"qa\" | \"prod\" | \"honeypot\";\n\n/**\n * Get the root URLs for each store by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each store\n */\nexport const getStoreRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return STORE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return STORE_ROOT_URLS_PROTO;\n }\n case \"honeypot\": {\n return STORE_ROOT_URLS_HONEYPOT;\n }\n case \"qa\": {\n return STORE_ROOT_URLS_QA;\n }\n case undefined:\n case \"prod\": {\n return STORE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return STORE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the root URLs for each microsite by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each microsite\n */\nconst getMicrositeRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return MICROSITE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return MICROSITE_ROOT_URLS_PROTO;\n }\n case \"qa\": {\n return MICROSITE_ROOT_URLS_QA;\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return MICROSITE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return MICROSITE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the deployed languages for each site by build environment\n * @param buildEnv The build environment\n * @returns The deployed languages for each site\n */\nconst getDeployedLanguagesBySiteByEnv = (\n buildEnv: BuildEnv,\n): {\n store: DeployedLanguagesMapping;\n ui: DeployedLanguagesMapping;\n uwc: DeployedLanguages;\n} => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_LOCAL,\n ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n };\n }\n case \"proto\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROTO,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROTO,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO,\n };\n }\n case \"qa\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_QA,\n ui: UI_COM_DEPLOYED_LANGUAGES_QA,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_QA,\n };\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n default: {\n checkUnreachable(buildEnv);\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n }\n};\n\n// #############################################################################\n// Global site config - ✨ the NEW way to handle global site config\n// #############################################################################\nconst REGION_PRESET: Record<GlobalStoreId, null> = {\n [GlobalStoreId.Us]: null,\n [GlobalStoreId.Ca]: null,\n [GlobalStoreId.Eu]: null,\n [GlobalStoreId.Uk]: null,\n [GlobalStoreId.Jp]: null,\n [GlobalStoreId.Br]: null,\n [GlobalStoreId.In]: null,\n [GlobalStoreId.Me]: null,\n [GlobalStoreId.Za]: null,\n [GlobalStoreId.Tw]: null,\n [GlobalStoreId.Sg]: null,\n [GlobalStoreId.Cn]: null,\n [GlobalStoreId.Mx]: null,\n [GlobalStoreId.Ph]: null,\n};\n\nexport const getGlobalSiteConfigByEnv = (buildEnv: BuildEnv) => {\n const storeRootUrls = getStoreRootUrlsByEnv(buildEnv);\n const micrositeRootUrls = getMicrositeRootUrlsByEnv(buildEnv);\n const deployedLanguages = getDeployedLanguagesBySiteByEnv(buildEnv);\n\n const getLanguageConfig = (\n siteId: \"store\" | \"ui\",\n storeId: GlobalStoreId | StoreId,\n ): Pick<BasicSiteConfig, \"defaultLanguage\" | \"languages\"> => {\n if (!isStoreId(storeId)) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n const languages = deployedLanguages[siteId][storeId];\n\n // If region does not have languages, return undefined\n if (!languages?.length) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n return {\n defaultLanguage: languages[0],\n languages: languages,\n };\n };\n\n return {\n /**\n * \"store.ui.com\" site config\n */\n store: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[GlobalStoreId.Us],\n ...getLanguageConfig(\"store\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[storeId],\n ...getLanguageConfig(\"store\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"ui.com\" site config\n */\n ui: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"uisp.ui.com\" site config\n */\n uisp: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"amplifi.com\" site config\n */\n amplifi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.amplifi,\n } satisfies BasicSiteConfig,\n\n /**\n * \"techspecs.ui.com\" site config\n */\n techSpecs: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.techSpecs,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n * NOTE: will be deprecated\n */\n uwc: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uwc,\n languages: deployedLanguages.uwc,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.uisp.com\" site config\n */\n expertsUisp: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUisp,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n */\n expertsUi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUi,\n } satisfies BasicSiteConfig,\n } satisfies StaticGlobalSiteConfig;\n};\n"],"names":["getStoreRootUrlsByEnv","buildEnv","STORE_ROOT_URLS_LOCAL","STORE_ROOT_URLS_PROTO","STORE_ROOT_URLS_HONEYPOT","STORE_ROOT_URLS_QA","STORE_ROOT_URLS_PROD","checkUnreachable","getMicrositeRootUrlsByEnv","MICROSITE_ROOT_URLS_LOCAL","MICROSITE_ROOT_URLS_PROTO","MICROSITE_ROOT_URLS_QA","MICROSITE_ROOT_URLS_PROD","getDeployedLanguagesBySiteByEnv","store","STORE_DEPLOYED_LANGUAGES_LOCAL","ui","UI_COM_DEPLOYED_LANGUAGES_LOCAL","uwc","UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL","STORE_DEPLOYED_LANGUAGES_PROTO","UI_COM_DEPLOYED_LANGUAGES_PROTO","UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO","STORE_DEPLOYED_LANGUAGES_QA","UI_COM_DEPLOYED_LANGUAGES_QA","UWC_UI_COM_DEPLOYED_LANGUAGES_QA","STORE_DEPLOYED_LANGUAGES_PROD","UI_COM_DEPLOYED_LANGUAGES_PROD","UWC_UI_COM_DEPLOYED_LANGUAGES_PROD","REGION_PRESET","GlobalStoreId","Us","Ca","Eu","Uk","Jp","Br","In","Me","Za","Tw","Sg","Cn","Mx","Ph","getGlobalSiteConfigByEnv","storeRootUrls","micrositeRootUrls","deployedLanguages","getLanguageConfig","siteId","storeId","isStoreId","defaultLanguage","languages","length","type","SiteConfigType","Regional","defaultRegion","Basic","baseUrl","regions","Object","values","reduce","acc","uisp","amplifi","techSpecs","expertsUisp","expertsUi"],"mappings":";;;;;;;;;AAgDa,MAAAA,qBAAA,GAAyBC,QAAuB,IAAA;EAC3D,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAC,6BAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,6BAAA;MACT;IACA,KAAK,UAAY;MAAA;QACR,OAAAC,gCAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,0BAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,4BAAA;MACT;IACA;MAAS;QACPC,MAAA,CAAAA,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAK,4BAAA;MACT;EACF;AACF,CAAA;AAOA,MAAME,yBAAA,GAA6BP,QAAuB,IAAA;EACxD,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAQ,iCAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,iCAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,8BAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,UAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,gCAAA;MACT;IACA;M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C,WAAWN,iBAAkB,CAAA9B;IAC/B,CAAA;IAAA;AAAA;AAAA;IAKAoD,WAAa,EAAA;MACXd,MAAMC,KAAe,CAAAA,cAAA,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAuB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,SAAW,EAAA;MACTf,MAAMC,KAAe,CAAAA,cAAA,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAwB;IAC7B;EAAA,CACF;AACF,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"navigationPresets.js","sources":["../../../src/utils/nextjs/navigationPresets.ts"],"sourcesContent":["import type { DeployedLanguagesMapping } from \"../../contexts/MenuContext/mapping\";\nimport {\n MICROSITE_ROOT_URLS_LOCAL,\n MICROSITE_ROOT_URLS_PROD,\n MICROSITE_ROOT_URLS_PROTO,\n MICROSITE_ROOT_URLS_QA,\n STORE_DEPLOYED_LANGUAGES_LOCAL,\n STORE_DEPLOYED_LANGUAGES_PROD,\n STORE_DEPLOYED_LANGUAGES_PROTO,\n STORE_DEPLOYED_LANGUAGES_QA,\n STORE_ROOT_URLS_HONEYPOT,\n STORE_ROOT_URLS_LOCAL,\n STORE_ROOT_URLS_PROD,\n STORE_ROOT_URLS_PROTO,\n STORE_ROOT_URLS_QA,\n UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UI_COM_DEPLOYED_LANGUAGES_PROD,\n UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UI_COM_DEPLOYED_LANGUAGES_QA,\n} from \"../../contexts/MenuContext/presets\";\nimport type {\n BasicSiteConfig,\n RegionalSite,\n StaticGlobalSiteConfig,\n} from \"../../contexts/MenuContext/types\";\nimport { SiteConfigType } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../errors\";\nimport { isStoreId } from \"../storeId\";\n\n/**\n * Values that indicate what kind of target build environment it is\n */\nexport type BuildEnv = \"local\" | \"e2e\" | \"proto\" | \"qa\" | \"prod\" | \"honeypot\";\n\n/**\n * Get the root URLs for each store by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each store\n */\nexport const getStoreRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return STORE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return STORE_ROOT_URLS_PROTO;\n }\n case \"honeypot\": {\n return STORE_ROOT_URLS_HONEYPOT;\n }\n case \"qa\": {\n return STORE_ROOT_URLS_QA;\n }\n case undefined:\n case \"prod\": {\n return STORE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return STORE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the root URLs for each microsite by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each microsite\n */\nconst getMicrositeRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return MICROSITE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return MICROSITE_ROOT_URLS_PROTO;\n }\n case \"qa\": {\n return MICROSITE_ROOT_URLS_QA;\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return MICROSITE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return MICROSITE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the deployed languages for each site by build environment\n * @param buildEnv The build environment\n * @returns The deployed languages for each site\n */\nconst getDeployedLanguagesBySiteByEnv = (\n buildEnv: BuildEnv,\n): {\n store: DeployedLanguagesMapping;\n ui: DeployedLanguagesMapping;\n} => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_LOCAL,\n ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n };\n }\n case \"proto\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROTO,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROTO,\n };\n }\n case \"qa\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_QA,\n ui: UI_COM_DEPLOYED_LANGUAGES_QA,\n };\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n default: {\n checkUnreachable(buildEnv);\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n }\n};\n\n// #############################################################################\n// Global site config - ✨ the NEW way to handle global site config\n// #############################################################################\nconst REGION_PRESET: Record<GlobalStoreId, null> = {\n [GlobalStoreId.Us]: null,\n [GlobalStoreId.Ca]: null,\n [GlobalStoreId.Eu]: null,\n [GlobalStoreId.Uk]: null,\n [GlobalStoreId.Jp]: null,\n [GlobalStoreId.Br]: null,\n [GlobalStoreId.In]: null,\n [GlobalStoreId.Me]: null,\n [GlobalStoreId.Za]: null,\n [GlobalStoreId.Tw]: null,\n [GlobalStoreId.Sg]: null,\n [GlobalStoreId.Cn]: null,\n [GlobalStoreId.Mx]: null,\n [GlobalStoreId.Ph]: null,\n};\n\nexport const getGlobalSiteConfigByEnv = (buildEnv: BuildEnv) => {\n const storeRootUrls = getStoreRootUrlsByEnv(buildEnv);\n const micrositeRootUrls = getMicrositeRootUrlsByEnv(buildEnv);\n const deployedLanguages = getDeployedLanguagesBySiteByEnv(buildEnv);\n\n const getLanguageConfig = (\n siteId: \"store\" | \"ui\",\n storeId: GlobalStoreId | StoreId,\n ): Pick<BasicSiteConfig, \"defaultLanguage\" | \"languages\"> => {\n if (!isStoreId(storeId)) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n const languages = deployedLanguages[siteId][storeId];\n\n // If region does not have languages, return undefined\n if (!languages?.length) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n return {\n defaultLanguage: languages[0],\n languages: languages,\n };\n };\n\n return {\n /**\n * \"store.ui.com\" site config\n */\n store: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[GlobalStoreId.Us],\n ...getLanguageConfig(\"store\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[storeId],\n ...getLanguageConfig(\"store\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"ui.com\" site config\n */\n ui: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"uisp.ui.com\" site config\n */\n uisp: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"amplifi.com\" site config\n */\n amplifi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.amplifi,\n } satisfies BasicSiteConfig,\n\n /**\n * \"techspecs.ui.com\" site config\n */\n techSpecs: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.techSpecs,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n * NOTE: will be deprecated\n */\n experts: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.experts,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.uisp.com\" site config\n */\n expertsUisp: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUisp,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n */\n expertsUi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUi,\n } satisfies BasicSiteConfig,\n } satisfies StaticGlobalSiteConfig;\n};\n"],"names":["getStoreRootUrlsByEnv","buildEnv","STORE_ROOT_URLS_LOCAL","STORE_ROOT_URLS_PROTO","STORE_ROOT_URLS_HONEYPOT","STORE_ROOT_URLS_QA","STORE_ROOT_URLS_PROD","checkUnreachable","getMicrositeRootUrlsByEnv","MICROSITE_ROOT_URLS_LOCAL","MICROSITE_ROOT_URLS_PROTO","MICROSITE_ROOT_URLS_QA","MICROSITE_ROOT_URLS_PROD","getDeployedLanguagesBySiteByEnv","store","STORE_DEPLOYED_LANGUAGES_LOCAL","ui","UI_COM_DEPLOYED_LANGUAGES_LOCAL","STORE_DEPLOYED_LANGUAGES_PROTO","UI_COM_DEPLOYED_LANGUAGES_PROTO","STORE_DEPLOYED_LANGUAGES_QA","UI_COM_DEPLOYED_LANGUAGES_QA","STORE_DEPLOYED_LANGUAGES_PROD","UI_COM_DEPLOYED_LANGUAGES_PROD","REGION_PRESET","GlobalStoreId","Us","Ca","Eu","Uk","Jp","Br","In","Me","Za","Tw","Sg","Cn","Mx","Ph","getGlobalSiteConfigByEnv","storeRootUrls","micrositeRootUrls","deployedLanguages","getLanguageConfig","siteId","storeId","isStoreId","defaultLanguage","languages","length","type","SiteConfigType","Regional","defaultRegion","Basic","baseUrl","regions","Object","values","reduce","acc","uisp","amplifi","techSpecs","experts","expertsUisp","expertsUi"],"mappings":";;;;;;;;;AAyCa,MAAAA,qBAAA,GAAyBC,QAAuB,IAAA;EAC3D,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAC,6BAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,6BAAA;MACT;IACA,KAAK,UAAY;MAAA;QACR,OAAAC,gCAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,0BAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,4BAAA;MACT;IACA;MAAS;QACPC,MAAA,CAAAA,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAK,4BAAA;MACT;EACF;AACF,CAAA;AAOA,MAAME,yBAAA,GAA6BP,QAAuB,IAAA;EACxD,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAQ,iCAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,iCAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,8BAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,UAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,gCAAA;MACT;IACA;MAAS;QACPL,MAAA,CAAAA,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAW,gCAAA;MACT;EACF;AACF,CAAA;AAOA,MAAMC,+BAAA,GACJZ,QAIG,IAAA;EACH,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAA;UACLa,KAAO,EAAAC,OAAA,CAAAA,8BAAA;UACPC,EAAI,EAAAC,OAAA,CAAAA;QAAA,CACN;MACF;IACA,KAAK,OAAS;MAAA;QACL,OAAA;UACLH,KAAO,EAAAI,OAAA,CAAAA,8BAAA;UACPF,EAAI,EAAAG,O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
|
1
|
+
import { STORE_ROOT_URLS_PROD, STORE_ROOT_URLS_QA, STORE_ROOT_URLS_HONEYPOT, STORE_ROOT_URLS_PROTO, STORE_ROOT_URLS_LOCAL, MICROSITE_ROOT_URLS_PROD, MICROSITE_ROOT_URLS_QA, MICROSITE_ROOT_URLS_PROTO, MICROSITE_ROOT_URLS_LOCAL, STORE_DEPLOYED_LANGUAGES_PROD, UI_COM_DEPLOYED_LANGUAGES_PROD, STORE_DEPLOYED_LANGUAGES_QA, UI_COM_DEPLOYED_LANGUAGES_QA, STORE_DEPLOYED_LANGUAGES_PROTO, UI_COM_DEPLOYED_LANGUAGES_PROTO, STORE_DEPLOYED_LANGUAGES_LOCAL, UI_COM_DEPLOYED_LANGUAGES_LOCAL } from '../../contexts/MenuContext/presets.mjs';
|
|
2
2
|
import { SiteConfigType } from '../../contexts/MenuContext/types.mjs';
|
|
3
3
|
import '../../types/index.mjs';
|
|
4
4
|
import { checkUnreachable } from '../errors.mjs';
|
|
@@ -71,24 +71,21 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
71
71
|
{
|
|
72
72
|
return {
|
|
73
73
|
store: STORE_DEPLOYED_LANGUAGES_LOCAL,
|
|
74
|
-
ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
75
|
-
uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
74
|
+
ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
77
|
case "proto":
|
|
79
78
|
{
|
|
80
79
|
return {
|
|
81
80
|
store: STORE_DEPLOYED_LANGUAGES_PROTO,
|
|
82
|
-
ui: UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
83
|
-
uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
81
|
+
ui: UI_COM_DEPLOYED_LANGUAGES_PROTO
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
case "qa":
|
|
87
85
|
{
|
|
88
86
|
return {
|
|
89
87
|
store: STORE_DEPLOYED_LANGUAGES_QA,
|
|
90
|
-
ui: UI_COM_DEPLOYED_LANGUAGES_QA
|
|
91
|
-
uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_QA
|
|
88
|
+
ui: UI_COM_DEPLOYED_LANGUAGES_QA
|
|
92
89
|
};
|
|
93
90
|
}
|
|
94
91
|
case void 0:
|
|
@@ -97,8 +94,7 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
97
94
|
{
|
|
98
95
|
return {
|
|
99
96
|
store: STORE_DEPLOYED_LANGUAGES_PROD,
|
|
100
|
-
ui: UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
101
|
-
uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
97
|
+
ui: UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
102
98
|
};
|
|
103
99
|
}
|
|
104
100
|
default:
|
|
@@ -106,8 +102,7 @@ const getDeployedLanguagesBySiteByEnv = buildEnv => {
|
|
|
106
102
|
checkUnreachable(buildEnv);
|
|
107
103
|
return {
|
|
108
104
|
store: STORE_DEPLOYED_LANGUAGES_PROD,
|
|
109
|
-
ui: UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
110
|
-
uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
105
|
+
ui: UI_COM_DEPLOYED_LANGUAGES_PROD
|
|
111
106
|
};
|
|
112
107
|
}
|
|
113
108
|
}
|
|
@@ -231,10 +226,9 @@ const getGlobalSiteConfigByEnv = buildEnv => {
|
|
|
231
226
|
* "experts.ui.com" site config
|
|
232
227
|
* NOTE: will be deprecated
|
|
233
228
|
*/
|
|
234
|
-
|
|
229
|
+
experts: {
|
|
235
230
|
type: SiteConfigType.Basic,
|
|
236
|
-
baseUrl: micrositeRootUrls.
|
|
237
|
-
languages: deployedLanguages.uwc
|
|
231
|
+
baseUrl: micrositeRootUrls.experts
|
|
238
232
|
},
|
|
239
233
|
/**
|
|
240
234
|
* "experts.uisp.com" site config
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigationPresets.mjs","sources":["../../../src/utils/nextjs/navigationPresets.ts"],"sourcesContent":["import type {\n DeployedLanguages,\n DeployedLanguagesMapping,\n} from \"../../contexts/MenuContext/mapping\";\nimport {\n MICROSITE_ROOT_URLS_LOCAL,\n MICROSITE_ROOT_URLS_PROD,\n MICROSITE_ROOT_URLS_PROTO,\n MICROSITE_ROOT_URLS_QA,\n STORE_DEPLOYED_LANGUAGES_LOCAL,\n STORE_DEPLOYED_LANGUAGES_PROD,\n STORE_DEPLOYED_LANGUAGES_PROTO,\n STORE_DEPLOYED_LANGUAGES_QA,\n STORE_ROOT_URLS_HONEYPOT,\n STORE_ROOT_URLS_LOCAL,\n STORE_ROOT_URLS_PROD,\n STORE_ROOT_URLS_PROTO,\n STORE_ROOT_URLS_QA,\n UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UI_COM_DEPLOYED_LANGUAGES_PROD,\n UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UI_COM_DEPLOYED_LANGUAGES_QA,\n UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UWC_UI_COM_DEPLOYED_LANGUAGES_QA,\n} from \"../../contexts/MenuContext/presets\";\nimport type {\n BasicSiteConfig,\n RegionalSite,\n StaticGlobalSiteConfig,\n} from \"../../contexts/MenuContext/types\";\nimport { SiteConfigType } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../errors\";\nimport { isStoreId } from \"../storeId\";\n\n/**\n * Values that indicate what kind of target build environment it is\n */\nexport type BuildEnv = \"local\" | \"e2e\" | \"proto\" | \"qa\" | \"prod\" | \"honeypot\";\n\n/**\n * Get the root URLs for each store by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each store\n */\nexport const getStoreRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return STORE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return STORE_ROOT_URLS_PROTO;\n }\n case \"honeypot\": {\n return STORE_ROOT_URLS_HONEYPOT;\n }\n case \"qa\": {\n return STORE_ROOT_URLS_QA;\n }\n case undefined:\n case \"prod\": {\n return STORE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return STORE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the root URLs for each microsite by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each microsite\n */\nconst getMicrositeRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return MICROSITE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return MICROSITE_ROOT_URLS_PROTO;\n }\n case \"qa\": {\n return MICROSITE_ROOT_URLS_QA;\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return MICROSITE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return MICROSITE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the deployed languages for each site by build environment\n * @param buildEnv The build environment\n * @returns The deployed languages for each site\n */\nconst getDeployedLanguagesBySiteByEnv = (\n buildEnv: BuildEnv,\n): {\n store: DeployedLanguagesMapping;\n ui: DeployedLanguagesMapping;\n uwc: DeployedLanguages;\n} => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_LOCAL,\n ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n };\n }\n case \"proto\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROTO,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROTO,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO,\n };\n }\n case \"qa\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_QA,\n ui: UI_COM_DEPLOYED_LANGUAGES_QA,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_QA,\n };\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n default: {\n checkUnreachable(buildEnv);\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n uwc: UWC_UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n }\n};\n\n// #############################################################################\n// Global site config - ✨ the NEW way to handle global site config\n// #############################################################################\nconst REGION_PRESET: Record<GlobalStoreId, null> = {\n [GlobalStoreId.Us]: null,\n [GlobalStoreId.Ca]: null,\n [GlobalStoreId.Eu]: null,\n [GlobalStoreId.Uk]: null,\n [GlobalStoreId.Jp]: null,\n [GlobalStoreId.Br]: null,\n [GlobalStoreId.In]: null,\n [GlobalStoreId.Me]: null,\n [GlobalStoreId.Za]: null,\n [GlobalStoreId.Tw]: null,\n [GlobalStoreId.Sg]: null,\n [GlobalStoreId.Cn]: null,\n [GlobalStoreId.Mx]: null,\n [GlobalStoreId.Ph]: null,\n};\n\nexport const getGlobalSiteConfigByEnv = (buildEnv: BuildEnv) => {\n const storeRootUrls = getStoreRootUrlsByEnv(buildEnv);\n const micrositeRootUrls = getMicrositeRootUrlsByEnv(buildEnv);\n const deployedLanguages = getDeployedLanguagesBySiteByEnv(buildEnv);\n\n const getLanguageConfig = (\n siteId: \"store\" | \"ui\",\n storeId: GlobalStoreId | StoreId,\n ): Pick<BasicSiteConfig, \"defaultLanguage\" | \"languages\"> => {\n if (!isStoreId(storeId)) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n const languages = deployedLanguages[siteId][storeId];\n\n // If region does not have languages, return undefined\n if (!languages?.length) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n return {\n defaultLanguage: languages[0],\n languages: languages,\n };\n };\n\n return {\n /**\n * \"store.ui.com\" site config\n */\n store: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[GlobalStoreId.Us],\n ...getLanguageConfig(\"store\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[storeId],\n ...getLanguageConfig(\"store\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"ui.com\" site config\n */\n ui: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"uisp.ui.com\" site config\n */\n uisp: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"amplifi.com\" site config\n */\n amplifi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.amplifi,\n } satisfies BasicSiteConfig,\n\n /**\n * \"techspecs.ui.com\" site config\n */\n techSpecs: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.techSpecs,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n * NOTE: will be deprecated\n */\n uwc: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uwc,\n languages: deployedLanguages.uwc,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.uisp.com\" site config\n */\n expertsUisp: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUisp,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n */\n expertsUi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUi,\n } satisfies BasicSiteConfig,\n } satisfies StaticGlobalSiteConfig;\n};\n"],"names":["getStoreRootUrlsByEnv","buildEnv","STORE_ROOT_URLS_LOCAL","STORE_ROOT_URLS_PROTO","STORE_ROOT_URLS_HONEYPOT","STORE_ROOT_URLS_QA","STORE_ROOT_URLS_PROD","checkUnreachable","getMicrositeRootUrlsByEnv","MICROSITE_ROOT_URLS_LOCAL","MICROSITE_ROOT_URLS_PROTO","MICROSITE_ROOT_URLS_QA","MICROSITE_ROOT_URLS_PROD","getDeployedLanguagesBySiteByEnv","store","STORE_DEPLOYED_LANGUAGES_LOCAL","ui","UI_COM_DEPLOYED_LANGUAGES_LOCAL","uwc","UWC_UI_COM_DEPLOYED_LANGUAGES_LOCAL","STORE_DEPLOYED_LANGUAGES_PROTO","UI_COM_DEPLOYED_LANGUAGES_PROTO","UWC_UI_COM_DEPLOYED_LANGUAGES_PROTO","STORE_DEPLOYED_LANGUAGES_QA","UI_COM_DEPLOYED_LANGUAGES_QA","UWC_UI_COM_DEPLOYED_LANGUAGES_QA","STORE_DEPLOYED_LANGUAGES_PROD","UI_COM_DEPLOYED_LANGUAGES_PROD","UWC_UI_COM_DEPLOYED_LANGUAGES_PROD","REGION_PRESET","GlobalStoreId","Us","Ca","Eu","Uk","Jp","Br","In","Me","Za","Tw","Sg","Cn","Mx","Ph","getGlobalSiteConfigByEnv","storeRootUrls","micrositeRootUrls","deployedLanguages","getLanguageConfig","siteId","storeId","isStoreId","defaultLanguage","languages","length","type","SiteConfigType","Regional","defaultRegion","Basic","baseUrl","regions","Object","values","reduce","acc","uisp","amplifi","techSpecs","expertsUisp","expertsUi"],"mappings":";;;;;;;AAgDa,MAAAA,qBAAA,GAAyBC,QAAuB,IAAA;EAC3D,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAC,qBAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,qBAAA;MACT;IACA,KAAK,UAAY;MAAA;QACR,OAAAC,wBAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,kBAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,oBAAA;MACT;IACA;MAAS;QACPC,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAK,oBAAA;MACT;EACF;AACF,CAAA;AAOA,MAAME,yBAAA,GAA6BP,QAAuB,IAAA;EACxD,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAQ,yBAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,yBAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,sBAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,UAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,wBAAA;MACT;IACA;MAAS;QACPL,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAW,wBAAA;MACT;EACF;AACF,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rBC,SAASd,iBAAkB,CAAAoB;QAAA,CAC7B;QACO,OAAAD,GAAA;MACT,CAAA,EACA;QAAE,GAAGrC;MAAc,CAAA,CAClB,EAAA;IACP,CAAA;IAAA;AAAA;AAAA;IAKAuC,OAAS,EAAA;MACPZ,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAqB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,SAAW,EAAA;MACTb,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAsB;IAC7B,CAAA;IAAA;AAAA;AAAA;AAAA;IAMAnD,GAAK,EAAA;MACHsC,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAA7B,GAAA;MAC3BoC,WAAWN,iBAAkB,CAAA9B;IAC/B,CAAA;IAAA;AAAA;AAAA;IAKAoD,WAAa,EAAA;MACXd,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAuB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,SAAW,EAAA;MACTf,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAwB;IAC7B;EAAA,CACF;AACF,CAAA;"}
|
|
1
|
+
{"version":3,"file":"navigationPresets.mjs","sources":["../../../src/utils/nextjs/navigationPresets.ts"],"sourcesContent":["import type { DeployedLanguagesMapping } from \"../../contexts/MenuContext/mapping\";\nimport {\n MICROSITE_ROOT_URLS_LOCAL,\n MICROSITE_ROOT_URLS_PROD,\n MICROSITE_ROOT_URLS_PROTO,\n MICROSITE_ROOT_URLS_QA,\n STORE_DEPLOYED_LANGUAGES_LOCAL,\n STORE_DEPLOYED_LANGUAGES_PROD,\n STORE_DEPLOYED_LANGUAGES_PROTO,\n STORE_DEPLOYED_LANGUAGES_QA,\n STORE_ROOT_URLS_HONEYPOT,\n STORE_ROOT_URLS_LOCAL,\n STORE_ROOT_URLS_PROD,\n STORE_ROOT_URLS_PROTO,\n STORE_ROOT_URLS_QA,\n UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n UI_COM_DEPLOYED_LANGUAGES_PROD,\n UI_COM_DEPLOYED_LANGUAGES_PROTO,\n UI_COM_DEPLOYED_LANGUAGES_QA,\n} from \"../../contexts/MenuContext/presets\";\nimport type {\n BasicSiteConfig,\n RegionalSite,\n StaticGlobalSiteConfig,\n} from \"../../contexts/MenuContext/types\";\nimport { SiteConfigType } from \"../../contexts/MenuContext/types\";\nimport type { StoreId } from \"../../types\";\nimport { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../errors\";\nimport { isStoreId } from \"../storeId\";\n\n/**\n * Values that indicate what kind of target build environment it is\n */\nexport type BuildEnv = \"local\" | \"e2e\" | \"proto\" | \"qa\" | \"prod\" | \"honeypot\";\n\n/**\n * Get the root URLs for each store by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each store\n */\nexport const getStoreRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return STORE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return STORE_ROOT_URLS_PROTO;\n }\n case \"honeypot\": {\n return STORE_ROOT_URLS_HONEYPOT;\n }\n case \"qa\": {\n return STORE_ROOT_URLS_QA;\n }\n case undefined:\n case \"prod\": {\n return STORE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return STORE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the root URLs for each microsite by build environment\n * @param buildEnv The build environment\n * @returns The root URLs for each microsite\n */\nconst getMicrositeRootUrlsByEnv = (buildEnv: BuildEnv) => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return MICROSITE_ROOT_URLS_LOCAL;\n }\n case \"proto\": {\n return MICROSITE_ROOT_URLS_PROTO;\n }\n case \"qa\": {\n return MICROSITE_ROOT_URLS_QA;\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return MICROSITE_ROOT_URLS_PROD;\n }\n default: {\n checkUnreachable(buildEnv);\n return MICROSITE_ROOT_URLS_PROD;\n }\n }\n};\n\n/**\n * Get the deployed languages for each site by build environment\n * @param buildEnv The build environment\n * @returns The deployed languages for each site\n */\nconst getDeployedLanguagesBySiteByEnv = (\n buildEnv: BuildEnv,\n): {\n store: DeployedLanguagesMapping;\n ui: DeployedLanguagesMapping;\n} => {\n switch (buildEnv) {\n case \"e2e\":\n case \"local\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_LOCAL,\n ui: UI_COM_DEPLOYED_LANGUAGES_LOCAL,\n };\n }\n case \"proto\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROTO,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROTO,\n };\n }\n case \"qa\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_QA,\n ui: UI_COM_DEPLOYED_LANGUAGES_QA,\n };\n }\n case undefined:\n case \"honeypot\":\n case \"prod\": {\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n default: {\n checkUnreachable(buildEnv);\n return {\n store: STORE_DEPLOYED_LANGUAGES_PROD,\n ui: UI_COM_DEPLOYED_LANGUAGES_PROD,\n };\n }\n }\n};\n\n// #############################################################################\n// Global site config - ✨ the NEW way to handle global site config\n// #############################################################################\nconst REGION_PRESET: Record<GlobalStoreId, null> = {\n [GlobalStoreId.Us]: null,\n [GlobalStoreId.Ca]: null,\n [GlobalStoreId.Eu]: null,\n [GlobalStoreId.Uk]: null,\n [GlobalStoreId.Jp]: null,\n [GlobalStoreId.Br]: null,\n [GlobalStoreId.In]: null,\n [GlobalStoreId.Me]: null,\n [GlobalStoreId.Za]: null,\n [GlobalStoreId.Tw]: null,\n [GlobalStoreId.Sg]: null,\n [GlobalStoreId.Cn]: null,\n [GlobalStoreId.Mx]: null,\n [GlobalStoreId.Ph]: null,\n};\n\nexport const getGlobalSiteConfigByEnv = (buildEnv: BuildEnv) => {\n const storeRootUrls = getStoreRootUrlsByEnv(buildEnv);\n const micrositeRootUrls = getMicrositeRootUrlsByEnv(buildEnv);\n const deployedLanguages = getDeployedLanguagesBySiteByEnv(buildEnv);\n\n const getLanguageConfig = (\n siteId: \"store\" | \"ui\",\n storeId: GlobalStoreId | StoreId,\n ): Pick<BasicSiteConfig, \"defaultLanguage\" | \"languages\"> => {\n if (!isStoreId(storeId)) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n const languages = deployedLanguages[siteId][storeId];\n\n // If region does not have languages, return undefined\n if (!languages?.length) {\n return {\n defaultLanguage: undefined,\n languages: undefined,\n };\n }\n\n return {\n defaultLanguage: languages[0],\n languages: languages,\n };\n };\n\n return {\n /**\n * \"store.ui.com\" site config\n */\n store: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[GlobalStoreId.Us],\n ...getLanguageConfig(\"store\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: storeRootUrls[storeId],\n ...getLanguageConfig(\"store\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"ui.com\" site config\n */\n ui: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", GlobalStoreId.Us),\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.ui,\n ...getLanguageConfig(\"ui\", storeId),\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"uisp.ui.com\" site config\n */\n uisp: {\n type: SiteConfigType.Regional,\n defaultRegion: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n } satisfies BasicSiteConfig,\n regions: (() =>\n Object.values(GlobalStoreId).reduce<\n Record<GlobalStoreId, BasicSiteConfig | null>\n >(\n (acc, storeId) => {\n acc[storeId] = {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.uisp,\n };\n return acc;\n },\n { ...REGION_PRESET },\n ))(),\n } satisfies RegionalSite,\n\n /**\n * \"amplifi.com\" site config\n */\n amplifi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.amplifi,\n } satisfies BasicSiteConfig,\n\n /**\n * \"techspecs.ui.com\" site config\n */\n techSpecs: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.techSpecs,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n * NOTE: will be deprecated\n */\n experts: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.experts,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.uisp.com\" site config\n */\n expertsUisp: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUisp,\n } satisfies BasicSiteConfig,\n\n /**\n * \"experts.ui.com\" site config\n */\n expertsUi: {\n type: SiteConfigType.Basic,\n baseUrl: micrositeRootUrls.expertsUi,\n } satisfies BasicSiteConfig,\n } satisfies StaticGlobalSiteConfig;\n};\n"],"names":["getStoreRootUrlsByEnv","buildEnv","STORE_ROOT_URLS_LOCAL","STORE_ROOT_URLS_PROTO","STORE_ROOT_URLS_HONEYPOT","STORE_ROOT_URLS_QA","STORE_ROOT_URLS_PROD","checkUnreachable","getMicrositeRootUrlsByEnv","MICROSITE_ROOT_URLS_LOCAL","MICROSITE_ROOT_URLS_PROTO","MICROSITE_ROOT_URLS_QA","MICROSITE_ROOT_URLS_PROD","getDeployedLanguagesBySiteByEnv","store","STORE_DEPLOYED_LANGUAGES_LOCAL","ui","UI_COM_DEPLOYED_LANGUAGES_LOCAL","STORE_DEPLOYED_LANGUAGES_PROTO","UI_COM_DEPLOYED_LANGUAGES_PROTO","STORE_DEPLOYED_LANGUAGES_QA","UI_COM_DEPLOYED_LANGUAGES_QA","STORE_DEPLOYED_LANGUAGES_PROD","UI_COM_DEPLOYED_LANGUAGES_PROD","REGION_PRESET","GlobalStoreId","Us","Ca","Eu","Uk","Jp","Br","In","Me","Za","Tw","Sg","Cn","Mx","Ph","getGlobalSiteConfigByEnv","storeRootUrls","micrositeRootUrls","deployedLanguages","getLanguageConfig","siteId","storeId","isStoreId","defaultLanguage","languages","length","type","SiteConfigType","Regional","defaultRegion","Basic","baseUrl","regions","Object","values","reduce","acc","uisp","amplifi","techSpecs","experts","expertsUisp","expertsUi"],"mappings":";;;;;;;AAyCa,MAAAA,qBAAA,GAAyBC,QAAuB,IAAA;EAC3D,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAC,qBAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,qBAAA;MACT;IACA,KAAK,UAAY;MAAA;QACR,OAAAC,wBAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,kBAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,MAAQ;MAAA;QACJ,OAAAC,oBAAA;MACT;IACA;MAAS;QACPC,gBAAA,CAAiBN,QAAQ,CAAA;QAClB,OAAAK,oBAAA;MACT;EACF;AACF,CAAA;AAOA,MAAME,yBAAA,GAA6BP,QAAuB,IAAA;EACxD,QAAQA,QAAU;IAChB,KAAK,KAAA;IACL,KAAK,OAAS;MAAA;QACL,OAAAQ,yBAAA;MACT;IACA,KAAK,OAAS;MAAA;QACL,OAAAC,yBAAA;MACT;IACA,KAAK,IAAM;MAAA;QACF,OAAAC,sBAAA;MACT;IACA,KAAK,KAAA,CAAA;IACL,KAAK,UAAA;IACL,KA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d,iBAAkB,CAAAoB;QAAA,CAC7B;QACO,OAAAD,GAAA;MACT,CAAA,EACA;QAAE,GAAGrC;MAAc,CAAA,CAClB,EAAA;IACP,CAAA;IAAA;AAAA;AAAA;IAKAuC,OAAS,EAAA;MACPZ,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAqB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,SAAW,EAAA;MACTb,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAsB;IAC7B,CAAA;IAAA;AAAA;AAAA;AAAA;IAMAC,OAAS,EAAA;MACPd,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAuB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,WAAa,EAAA;MACXf,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAwB;IAC7B,CAAA;IAAA;AAAA;AAAA;IAKAC,SAAW,EAAA;MACThB,MAAMC,cAAe,CAAAG,KAAA;MACrBC,SAASd,iBAAkB,CAAAyB;IAC7B;EAAA,CACF;AACF,CAAA;"}
|
package/lib/utils/number.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function isFloat(value: unknown, entity?: string, ErrorClass?: ne
|
|
|
31
31
|
* toFixed(1.2345, 0) // => "1"
|
|
32
32
|
* toFixed(1.23, 4) // => "1.2300"
|
|
33
33
|
*/
|
|
34
|
-
export declare function toFixedRate(rate: number, scale: number
|
|
34
|
+
export declare function toFixedRate(rate: number, scale: number): string;
|
|
35
35
|
export declare function toFixedRate(rate: number, scale: number, asNumber: true): number;
|
|
36
36
|
/**
|
|
37
37
|
* Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of
|
package/lib/utils/number.js
CHANGED
|
@@ -21,7 +21,7 @@ function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
|
21
21
|
function isFloat(value, entity = "Value", ErrorClass = TypeError) {
|
|
22
22
|
isFiniteNumber(value, entity, ErrorClass);
|
|
23
23
|
}
|
|
24
|
-
function toFixedRate(rate, scale, asNumber) {
|
|
24
|
+
function toFixedRate(rate, scale = 0, asNumber = false) {
|
|
25
25
|
isFloat(rate, "Rate");
|
|
26
26
|
const fixedRate = rate.toFixed(scale);
|
|
27
27
|
return asNumber ? +fixedRate : fixedRate;
|
package/lib/utils/number.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(
|
|
1
|
+
{"version":3,"file":"number.js","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(rate: number, scale: number): string;\nexport function toFixedRate(\n rate: number,\n scale: number,\n asNumber: true,\n): number;\nexport function toFixedRate(rate: number, scale = 0, asNumber = false) {\n // Verify rate\n isFloat(rate, \"Rate\");\n\n const fixedRate = rate.toFixed(scale);\n\n return asNumber ? +fixedRate : fixedRate;\n}\n\n/**\n * Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of\n * doing it. Removes any redundant trailing zeros.\n * @example\n * numberToString(1.23) // => \"1.23\"\n * numberToString(10.00) // => \"10\"\n * @throws If given input is not a valid number\n */\nexport const numberToString = (num: number): string => {\n isFloat(num);\n return num.toString(10);\n};\n\n/**\n * @see https://stackoverflow.com/a/35000557\n */\nexport const findClosestNumber = <T extends number>(\n haystack: T[],\n needle: number,\n): T => {\n return haystack.reduce((prev, curr) =>\n Math.abs(curr - needle) < Math.abs(prev - needle) ? curr : prev,\n );\n};\n\n/**\n * Splits number into array by max value provided.\n * E.g. splitNumberBy(100, 30) => [30, 30, 30, 10]\n */\nexport const splitNumberBy = (value: number, by: number) => {\n const chunks = new Array(Math.floor(value / by)).fill(by);\n const remainder = value % by;\n\n if (remainder > 0) {\n chunks.push(remainder);\n }\n\n return chunks;\n};\n\n/**\n * Clamp value to a given range\n */\nexport const clamp = (val: number, min: number, max: number) => {\n const trueMin = Math.min(min, max);\n const trueMax = Math.max(min, max);\n\n return Math.min(trueMax, Math.max(trueMin, val));\n};\n\n/**\n * Interpolate a number to a new range\n *\n * @example\n * linearInterpolate(5, [0, 10], [0, 100]); // 50\n */\nexport const linearInterpolate = (\n inputY: number,\n [fromMin, fromMax]: [number, number],\n [toMin, toMax]: [number, number],\n clampResult = true,\n) => {\n const percent = (inputY - fromMin) / (fromMax - fromMin);\n const outputX = percent * (toMax - toMin) + toMin;\n\n return clampResult ? clamp(outputX, toMin, toMax) : outputX;\n};\n\n/**\n * Increase value and start over once the range is overflown\n */\nexport const incrementLoopValue = (\n value: number,\n [min, max]: [number, number],\n) => {\n if (value === max) {\n return min;\n }\n return value + 1;\n};\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger","isFloat","toFixedRate","rate","scale","asNumber","fixedRate","toFixed","numberToString","num","toString","findClosestNumber","haystack","needle","reduce","prev","curr","Math","abs","splitNumberBy","by","chunks","Array","floor","fill","remainder","push","clamp","val","min","max","trueMin","trueMax","linearInterpolate","inputY","fromMin","fromMax","toMin","toMax","clampResult","percent","outputX","incrementLoopValue"],"mappings":";;;AAIO,SAASA,cACdA,CAAAC,KAAA,EACAC,MAAS,GAAA,OAAA,EACTC,aAA4CC,SACnB,EAAA;EACzB,IAAI,OAAOH,KAAU,KAAA,QAAA,IAAYI,MAAO,CAAAC,KAAA,CAAML,KAAK,CAAG,EAAA;IAEpD,MAAM,IAAIE,UAAW,CAAA,GAAGD,MAAM,qBAAqBD,KAAO,EAAA,CAAA;EAC5D;EAEA,IAAI,CAACI,MAAA,CAAOE,QAAS,C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CnD,KAAA,EACA,CAACsC,GAAA,EAAKC,GAAG,CACN,KAAA;EACH,IAAIvC,UAAUuC,GAAK,EAAA;IACV,OAAAD,GAAA;EACT;EACA,OAAOtC,KAAQ,GAAA,CAAA;AACjB,CAAA;;;;;;;;;;"}
|
package/lib/utils/number.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
|
20
20
|
function isFloat(value, entity = "Value", ErrorClass = TypeError) {
|
|
21
21
|
isFiniteNumber(value, entity, ErrorClass);
|
|
22
22
|
}
|
|
23
|
-
function toFixedRate(rate, scale, asNumber) {
|
|
23
|
+
function toFixedRate(rate, scale = 0, asNumber = false) {
|
|
24
24
|
isFloat(rate, "Rate");
|
|
25
25
|
const fixedRate = rate.toFixed(scale);
|
|
26
26
|
return asNumber ? +fixedRate : fixedRate;
|
package/lib/utils/number.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.mjs","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(
|
|
1
|
+
{"version":3,"file":"number.mjs","sources":["../../src/utils/number.ts"],"sourcesContent":["/**\n * Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)\n * @throws If given input is not a finite number\n */\nexport function isFiniteNumber(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a number: ${value}`);\n }\n\n if (!Number.isFinite(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a finite number: ${value}`);\n }\n}\n\n/**\n * Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.isSafeInteger would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32\n * @throws If given input is not a valid integer\n */\nexport function isInt(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n\n if (!Number.isInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not an integer: ${value}`);\n }\n\n if (!Number.isSafeInteger(value)) {\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw new ErrorClass(`${entity} is not a safe integer: ${value}`);\n }\n}\n\n/**\n * Custom isFloat validation function that returns a more fine-grained error message otherwise for type safety alone a\n * Number.parseFloat would be sufficient.\n *\n * Code inspired from graphql-scalars library.\n * @see\n * https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L34-L38\n * @throws If given input is not a valid float\n */\nexport function isFloat(\n value: unknown,\n entity = \"Value\",\n ErrorClass: new (message: string) => void = TypeError,\n): asserts value is number {\n isFiniteNumber(value, entity, ErrorClass);\n}\n\n/**\n * Returns a string representing a number in fixed-point notation.\n * Overload: Returns the rate parsed as a number\n * @example\n * toFixed(1.2345, 2) // => \"1.23\"\n * toFixed(1.2345, 0) // => \"1\"\n * toFixed(1.23, 4) // => \"1.2300\"\n */\nexport function toFixedRate(rate: number, scale: number): string;\nexport function toFixedRate(\n rate: number,\n scale: number,\n asNumber: true,\n): number;\nexport function toFixedRate(rate: number, scale = 0, asNumber = false) {\n // Verify rate\n isFloat(rate, \"Rate\");\n\n const fixedRate = rate.toFixed(scale);\n\n return asNumber ? +fixedRate : fixedRate;\n}\n\n/**\n * Util to convert a float number to a string. Using this rather than simple template string to have a consistent way of\n * doing it. Removes any redundant trailing zeros.\n * @example\n * numberToString(1.23) // => \"1.23\"\n * numberToString(10.00) // => \"10\"\n * @throws If given input is not a valid number\n */\nexport const numberToString = (num: number): string => {\n isFloat(num);\n return num.toString(10);\n};\n\n/**\n * @see https://stackoverflow.com/a/35000557\n */\nexport const findClosestNumber = <T extends number>(\n haystack: T[],\n needle: number,\n): T => {\n return haystack.reduce((prev, curr) =>\n Math.abs(curr - needle) < Math.abs(prev - needle) ? curr : prev,\n );\n};\n\n/**\n * Splits number into array by max value provided.\n * E.g. splitNumberBy(100, 30) => [30, 30, 30, 10]\n */\nexport const splitNumberBy = (value: number, by: number) => {\n const chunks = new Array(Math.floor(value / by)).fill(by);\n const remainder = value % by;\n\n if (remainder > 0) {\n chunks.push(remainder);\n }\n\n return chunks;\n};\n\n/**\n * Clamp value to a given range\n */\nexport const clamp = (val: number, min: number, max: number) => {\n const trueMin = Math.min(min, max);\n const trueMax = Math.max(min, max);\n\n return Math.min(trueMax, Math.max(trueMin, val));\n};\n\n/**\n * Interpolate a number to a new range\n *\n * @example\n * linearInterpolate(5, [0, 10], [0, 100]); // 50\n */\nexport const linearInterpolate = (\n inputY: number,\n [fromMin, fromMax]: [number, number],\n [toMin, toMax]: [number, number],\n clampResult = true,\n) => {\n const percent = (inputY - fromMin) / (fromMax - fromMin);\n const outputX = percent * (toMax - toMin) + toMin;\n\n return clampResult ? clamp(outputX, toMin, toMax) : outputX;\n};\n\n/**\n * Increase value and start over once the range is overflown\n */\nexport const incrementLoopValue = (\n value: number,\n [min, max]: [number, number],\n) => {\n if (value === max) {\n return min;\n }\n return value + 1;\n};\n"],"names":["isFiniteNumber","value","entity","ErrorClass","TypeError","Number","isNaN","isFinite","isInt","isInteger","isSafeInteger","isFloat","toFixedRate","rate","scale","asNumber","fixedRate","toFixed","numberToString","num","toString","findClosestNumber","haystack","needle","reduce","prev","curr","Math","abs","splitNumberBy","by","chunks","Array","floor","fill","remainder","push","clamp","val","min","max","trueMin","trueMax","linearInterpolate","inputY","fromMin","fromMax","toMin","toM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EAAAC,WAAA,GAAc,IACX,KAAA;EACG,MAAAC,OAAA,GAAA,CAAWN,MAAS,GAAAC,OAAA,KAAYC,OAAU,GAAAD,OAAA,CAAA;EAC1C,MAAAM,OAAA,GAAUD,OAAW,IAAAF,KAAA,GAAQD,KAAS,CAAA,GAAAA,KAAA;EAE5C,OAAOE,WAAc,GAAAZ,KAAA,CAAMc,OAAS,EAAAJ,KAAA,EAAOC,KAAK,CAAI,GAAAG,OAAA;AACtD,CAAA;AAKO,MAAMC,qBAAqBA,CAChCnD,KAAA,EACA,CAACsC,GAAA,EAAKC,GAAG,CACN,KAAA;EACH,IAAIvC,UAAUuC,GAAK,EAAA;IACV,OAAAD,GAAA;EACT;EACA,OAAOtC,KAAQ,GAAA,CAAA;AACjB,CAAA;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Util to easily parse that any given input is a finite number (not NaN, Infinity, -Infinity, etc.)
|
|
3
|
+
* @throws If given input is not a finite number
|
|
4
|
+
*/
|
|
5
|
+
export declare function isFiniteNumber(value: unknown, entity?: string, ErrorClass?: new (message: string) => void): asserts value is number;
|
|
6
|
+
/**
|
|
7
|
+
* Custom isInt validation function that returns a more fine-grained error message otherwise for type safety alone a
|
|
8
|
+
* Number.isSafeInteger would be sufficient.
|
|
9
|
+
*
|
|
10
|
+
* Code inspired from graphql-scalars library.
|
|
11
|
+
* @see
|
|
12
|
+
* https://github.com/Urigo/graphql-scalars/blob/c4fa3d27b965e39ceda6c33fc18041f112ecce49/src/scalars/utilities.ts#L20-L32
|
|
13
|
+
* @throws If given input is not a valid integer
|
|
14
|
+
*/
|
|
15
|
+
export declare function isInt(value: unknown, entity?: string, ErrorClass?: new (message: string) => void): asserts value is number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
function isFiniteNumber(value, entity = "Value", ErrorClass = TypeError) {
|
|
5
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
6
|
+
throw new ErrorClass(`${entity} is not a number: ${value}`);
|
|
7
|
+
}
|
|
8
|
+
if (!Number.isFinite(value)) {
|
|
9
|
+
throw new ErrorClass(`${entity} is not a finite number: ${value}`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function isInt(value, entity = "Value", ErrorClass = TypeError) {
|
|
13
|
+
isFiniteNumber(value, entity, ErrorClass);
|
|
14
|
+
if (!Number.isInteger(value)) {
|
|
15
|
+
throw new ErrorClass(`${entity} is not an integer: ${value}`);
|
|
16
|
+
}
|
|
17
|
+
if (!Number.isSafeInteger(value)) {
|
|
18
|
+
throw new ErrorClass(`${entity} is not a safe integer: ${value}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.isFiniteNumber = isFiniteNumber;
|
|
22
|
+
exports.isInt = isInt;
|
|
23
|
+
//# sourceMappingURL=validations.js.map
|