Liferay.Loader.define("commerce-frontend-js@4.0.52/components/price/util/index",["module","exports","require"],(function(e,t,r){window;{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0}),t.adaptLegacyPriceModel=function(t){if("".concat(e,"1")in t)return t;const{discountPercentage:r,discountPercentages:n,finalPrice:o,price:i,promoPrice:a}=t;return c({discountPercentage:parseFloat(r||0),finalPriceFormatted:o||i,priceFormatted:i,promoPrice:a?a.match(/\d/gi)[0]:"0",promoPriceFormatted:a},(n||["0","0","0","0"]).reduce(((t,r,n)=>c(c({},t),{},{["".concat(e).concat(n+1)]:parseFloat(r)})),{}))},t.collectDiscountLevels=function(t){return Object.keys(t).reduce(((r,n)=>(n.startsWith(e)&&r.push(t[n].toFixed(2)),r)),[])},t.isNonnull=function(...e){return!!e.find((e=>parseFloat(e)>0))};const e="discountPercentageLevel"}}));
//# sourceMappingURL=index.js.map