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C,UAEJ,SAACM,MAAAA,CAAIC,UAAW,GAAc,OAAXC,EAAAA,QAAW,mBAIxC,C,yICCA,C,wBApDkB,O,EACI,Q,MACP,Q,MACM,Q,mDAErB,IAAMC,EAAQ,CACZC,OAAOC,EAAAA,EAAAA,SAAG,MAAO,OACjBC,MAAMD,EAAAA,EAAAA,SAAG,MAAO,OAChBE,OAAOF,EAAAA,EAAAA,SAAG,MAAO,OACjBG,YAAYH,EAAAA,EAAAA,SAAG,MAAO,QASlBI,EAAY,SAACC,EAAgBC,GACjC,OAAID,GAAUC,EAAI,IACT,WAELD,GAAUC,EAAI,IACT,WAEF,WACT,EA0BA,EAxBc,Y,IAAGD,EAAAA,EAAAA,OAAQ,EAARA,EAAQE,KAAAA,OAAAA,IAAO,eAAQC,iBAAAA,OAAAA,IAAmB,O,OACzD,qB,SACKH,GAAUA,EAAS,GACpB,UAACI,MAAAA,CACChB,UAAW,CAAC,oCAAqCe,GAC9C/B,OAAOiC,SACPC,KAAK,KACRjB,cAAY,gB,WAEZ,SAACkB,OAAAA,CAAKnB,UAAU,U,SAAW,SAEJ,OAFaY,EACjCQ,QAAQ,GACRC,QAAQ,OAAQ,IAAI,sBACtBC,EAAAA,EAAAA,OAAM,EAAG,GAAGlC,KAAI,SAACyB,G,OAChB,SAACU,EAAAA,QAAQ,CACP5B,MAAOgB,EAAUC,EAAQC,GAEzBb,UAAWK,EAAMS,IADZD,E,OAKT,M","sources":["webpack://webstaurantstore/./ProductDetails/Pricing/getLowestPrice.ts","webpack://webstaurantstore/./ProductDetails/Pricing/isActiveSale.ts","webpack://webstaurantstore/./ProductDetails/Pricing/shouldDisplayBelowMapPrice.ts","webpack://webstaurantstore/./ProductDetails/Pricing/shouldDisplayMapStyle.ts","webpack://webstaurantstore/./ProductDetails/Pricing/shouldDisplayQuantityDiscounts.ts","webpack://webstaurantstore/./common/StarIcon/index.tsx","webpack://webstaurantstore/./common/Stars.tsx"],"sourcesContent":["import { User } from \"~/common/Store/models/User\";\nimport isActiveSale from \"./isActiveSale\";\nimport { QuantityDiscount } from \"~/common/Store/models/ProductPage\";\nimport shouldDisplayQuantityDiscounts from \"~/ProductDetails/Pricing/shouldDisplayQuantityDiscounts\";\nimport shouldDisplayRequiredCustomization from \"~/common/Product/shouldDisplayRequiredCustomization\";\n\ninterface Price {\n minimumAdvertisedPriceOverride: {\n priceLevel5: number;\n };\n minimumAdvertisedPriceProperties: {\n price: number;\n type: string;\n };\n salePrice: number;\n price: number;\n displaySalePrice: boolean;\n saleStartDate?: string;\n saleEndDate?: string;\n quantityDiscounts?: QuantityDiscount[];\n}\n\ninterface LowestPricingQuantityDiscount {\n endQuantity?: number;\n isLotDiscount: boolean;\n quantity: number;\n price: number;\n startQuantity: number;\n}\n\ninterface LowestPricingProduct {\n customizationRequired: boolean;\n customizationUrl: string;\n isCustomizable: boolean;\n minimumCustomizationPrice: number;\n showBelowMinimumAdvertisedPriceForLoggedInCustomers: boolean;\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers: boolean;\n startBuy: number;\n price: {\n minimumAdvertisedPriceProperties: {\n price: number;\n type: string;\n };\n minimumAdvertisedPriceOverride: {\n priceLevel5: number;\n };\n quantityDiscounts: LowestPricingQuantityDiscount[];\n displaySalePrice: boolean;\n saleStartDate?: string;\n saleEndDate?: string;\n salePrice: number;\n price: number;\n displayMinimumAdvertisedPrice: boolean;\n };\n}\n// This method get the lowest from among p1, p4, and sale price.\nconst getLowestPrice = (\n price: Price,\n showBelowMinimumAdvertisedPriceForLoggedInCustomers: boolean,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers: boolean,\n user: User,\n showPlusPricing = false\n): number => {\n const activeSale = isActiveSale(price);\n\n const hasMAPStyle =\n price.minimumAdvertisedPriceProperties &&\n !!price.minimumAdvertisedPriceProperties.type?.trim();\n\n const hasPlusPricing =\n !!price.minimumAdvertisedPriceOverride?.priceLevel5 && user.hasWebPlus;\n\n let lowestPrice = Math.min(\n activeSale ? price.salePrice : Infinity,\n price.price\n );\n\n if (hasMAPStyle) {\n if (user.registered) {\n if (\n showBelowMinimumAdvertisedPriceForLoggedInCustomers ||\n (showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers &&\n (user.hasWebPlus || user.platinum?.enabled))\n ) {\n lowestPrice = Math.min(\n price.minimumAdvertisedPriceProperties.price || Infinity,\n lowestPrice\n );\n }\n }\n\n if (price.minimumAdvertisedPriceProperties.type?.trim() === \"G\") {\n lowestPrice = Math.min(\n price.minimumAdvertisedPriceProperties.price || Infinity,\n lowestPrice\n );\n }\n }\n\n if (showPlusPricing && hasPlusPricing) {\n lowestPrice = Math.min(\n price.minimumAdvertisedPriceOverride.priceLevel5 || Infinity,\n lowestPrice\n );\n }\n\n return lowestPrice;\n};\n\nexport const getLowestPriceWithQuantityDiscounts = (\n product: LowestPricingProduct,\n user: User,\n isGoogleView = false\n): number => {\n const {\n price,\n showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers,\n minimumCustomizationPrice = 0,\n } = product;\n\n if (shouldDisplayRequiredCustomization(product)) {\n return minimumCustomizationPrice;\n }\n\n let lowestPrice = getLowestPrice(\n price,\n showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers,\n user\n );\n\n const showPlusPrice =\n !!price.minimumAdvertisedPriceOverride?.priceLevel5 &&\n price.minimumAdvertisedPriceOverride.priceLevel5 < lowestPrice &&\n user.hasWebPlus;\n\n if (showPlusPrice) {\n lowestPrice =\n price.minimumAdvertisedPriceOverride.priceLevel5 < lowestPrice\n ? price.minimumAdvertisedPriceOverride.priceLevel5\n : lowestPrice;\n }\n\n const [display, quantityDiscounts] = shouldDisplayQuantityDiscounts(\n product,\n user\n );\n\n if (!display) {\n return lowestPrice;\n }\n\n const lowestQuantityDiscount = quantityDiscounts?.sort((a, b) => {\n if (a.price < b.price) {\n return -1;\n }\n\n if (a.price > b.price) {\n return 1;\n }\n\n return 0;\n })[0]?.price;\n\n if (isGoogleView && !user.registered) {\n return lowestPrice;\n }\n\n return lowestQuantityDiscount && lowestQuantityDiscount < lowestPrice\n ? lowestQuantityDiscount\n : lowestPrice;\n};\n\nexport default getLowestPrice;\n","interface Price {\n displaySalePrice: boolean;\n saleStartDate?: string;\n saleEndDate?: string;\n}\n\nexport default ({\n displaySalePrice,\n saleStartDate,\n saleEndDate,\n}: Price): boolean => {\n const currentDate = new Date();\n\n return (\n displaySalePrice &&\n new Date(String(saleStartDate)) < currentDate &&\n currentDate < new Date(String(saleEndDate))\n );\n};\n","import { User } from \"~/common/Store/models/User\";\n\ninterface Product {\n showBelowMinimumAdvertisedPriceForLoggedInCustomers: boolean;\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers: boolean;\n price: {\n minimumAdvertisedPriceProperties: {\n type: string;\n };\n displayMinimumAdvertisedPrice: boolean;\n };\n}\n\nexport default (product: Product, user: User): boolean => {\n const {\n price: { minimumAdvertisedPriceProperties, displayMinimumAdvertisedPrice },\n showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers,\n } = product;\n\n const hasMapStyle = !!minimumAdvertisedPriceProperties?.type?.trim();\n\n const regularUserQualifiedForMapPricing =\n user.registered &&\n !(user.hasWebPlus || user.platinum.enabled) &&\n showBelowMinimumAdvertisedPriceForLoggedInCustomers;\n\n const regularUserQualifiedForMapJPricing =\n regularUserQualifiedForMapPricing && user.amountSpentOneThousandOrMore;\n\n const regularUserQualifiedForMapYPricing =\n regularUserQualifiedForMapPricing && user.amountSpentFiveThousandOrMore;\n\n const platPlusUserQualifiedForMapPricing =\n (user.hasWebPlus || user.platinum.enabled) &&\n (showBelowMinimumAdvertisedPriceForLoggedInCustomers ||\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers);\n\n switch (minimumAdvertisedPriceProperties.type?.trim()) {\n case \"J\":\n return (\n regularUserQualifiedForMapJPricing || platPlusUserQualifiedForMapPricing\n );\n case \"G\":\n return !!user.registered;\n case \"L\":\n return (\n !!(user.registered && user.hasPurchaseHistory) &&\n (showBelowMinimumAdvertisedPriceForLoggedInCustomers ||\n (showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers &&\n (user.hasWebPlus || (user.platinum && user.platinum.enabled))))\n );\n case \"Y\":\n return (\n regularUserQualifiedForMapYPricing || platPlusUserQualifiedForMapPricing\n );\n default:\n return (\n hasMapStyle &&\n displayMinimumAdvertisedPrice &&\n ((showBelowMinimumAdvertisedPriceForLoggedInCustomers &&\n user.registered) ||\n platPlusUserQualifiedForMapPricing)\n );\n }\n};\n","import { User } from \"~/common/Store/models/User\";\nimport shouldDisplayBelowMapPrice from \"./shouldDisplayBelowMapPrice\";\n\ninterface Product {\n showBelowMinimumAdvertisedPriceForLoggedInCustomers: boolean;\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers: boolean;\n price: {\n minimumAdvertisedPriceProperties: {\n type: string;\n };\n displayMinimumAdvertisedPrice: boolean;\n };\n}\n\nexport default (product: Product, user: User): boolean => {\n const {\n price: { minimumAdvertisedPriceProperties, displayMinimumAdvertisedPrice },\n } = product;\n\n const hasMapStyle = !!minimumAdvertisedPriceProperties?.type?.trim();\n\n if (!hasMapStyle || !displayMinimumAdvertisedPrice) {\n return false;\n }\n\n const displayBelowMapPrice = shouldDisplayBelowMapPrice(product, user);\n\n return !displayBelowMapPrice;\n};\n","import { User } from \"~/common/Store/models/User\";\nimport getLowestPrice from \"./getLowestPrice\";\nimport shouldDisplayMapStyle from \"./shouldDisplayMapStyle\";\n\ninterface QuantityDiscount {\n endQuantity?: number;\n isLotDiscount: boolean;\n quantity: number;\n price: number;\n startQuantity: number;\n}\n\ninterface Product {\n showBelowMinimumAdvertisedPriceForLoggedInCustomers: boolean;\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers: boolean;\n startBuy: number;\n price: {\n minimumAdvertisedPriceProperties: {\n price: number;\n type: string;\n };\n minimumAdvertisedPriceOverride: {\n priceLevel5: number;\n };\n quantityDiscounts: QuantityDiscount[];\n displaySalePrice: boolean;\n saleStartDate?: string;\n saleEndDate?: string;\n salePrice: number;\n price: number;\n displayMinimumAdvertisedPrice: boolean;\n };\n}\n\nexport default (\n product: Product,\n user: User\n): [boolean, QuantityDiscount[]] => {\n const {\n price,\n showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers,\n startBuy,\n } = product;\n\n if (!price.quantityDiscounts || price.quantityDiscounts.length <= 0) {\n return [false, []];\n }\n\n const lowestPrice = getLowestPrice(\n price,\n showBelowMinimumAdvertisedPriceForLoggedInCustomers,\n showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers,\n user\n );\n\n // Use this number to filter out lot discounts that are more expensive than what customers\n // are already getting with non-lot discounts by buying the minimum requirement,\n // We don't want to show prices that are more expensive at lower quantity than min buy.\n // Ex: min buy is 100 and quantity discounts as follow:\n // [{startQty: 2, lot: true, price: 20.90}, {startQty: 10: lot: false, price: 19.91}, {startQty: 100, lot: true, price:18.75}]\n // If customer buys 100 to meet the minimum requirement, they will get $18.75 for all 100.\n // If customer buys 101, they will get $18.75 for all 100 and $19.91 for 1, because it's bigger than 10.\n // If customer buys 102, they will get $18.75 for all 100 and $19.91 for 2, because it's bigger than 10 and cheaper than the lot discount of 2 qty.\n const lowestNonLotDiscountThatUserIsAlreadyQualifiedByBuyingTheMinimum = Math.min(\n ...price.quantityDiscounts\n .filter((x) => !x.isLotDiscount && x.startQuantity < startBuy)\n .map((x) => x.price)\n );\n\n const discountsWithLowerPriceAndHigherStartBuy = price.quantityDiscounts\n .filter((discount) => discount.price < lowestPrice)\n .filter(\n (discount) =>\n discount.startQuantity >= startBuy ||\n (discount.isLotDiscount &&\n discount.price <\n lowestNonLotDiscountThatUserIsAlreadyQualifiedByBuyingTheMinimum) ||\n (!discount.endQuantity && !discount.isLotDiscount) ||\n (discount.endQuantity && discount.endQuantity > startBuy)\n )\n .map((x) => {\n return {\n isLotDiscount: x.isLotDiscount,\n price: x.price,\n quantity: x.quantity,\n startQuantity:\n !x.isLotDiscount && x.startQuantity < startBuy\n ? startBuy\n : x.startQuantity,\n endQuantity: x.endQuantity,\n };\n });\n\n const displayMapStyle = shouldDisplayMapStyle(product, user);\n\n const shouldDisplayQuantityDiscountTable =\n !displayMapStyle && discountsWithLowerPriceAndHigherStartBuy.length > 0;\n\n return [\n shouldDisplayQuantityDiscountTable,\n discountsWithLowerPriceAndHigherStartBuy,\n ];\n};\n","import React from \"react\";\nimport spritePath from \"./standard.sprite.svg\";\n\nexport type StarLevel = \"fullstar\" | \"halfstar\" | \"emptystar\";\n\nexport interface IconProps {\n className?: string;\n level: StarLevel;\n}\n\nexport default (properties: IconProps) => {\n const { level, ...rest } = properties;\n\n switch (level) {\n case \"fullstar\":\n return (\n \n \n \n );\n case \"halfstar\":\n return (\n \n \n \n \n );\n default:\n return (\n \n \n \n );\n }\n};\n","import React from \"react\";\nimport { range } from \"range\";\nimport ct from \"class-types.macro\";\nimport StarIcon from \"./StarIcon\";\n\nconst sizes = {\n small: ct(\"h-3\", \"w-3\"),\n base: ct(\"h-4\", \"w-4\"),\n large: ct(\"h-5\", \"w-5\"),\n extraLarge: ct(\"h-6\", \"w-6\"),\n};\n\ninterface Props {\n rating: number;\n size?: keyof typeof sizes;\n containerClasses?: ClassTypes;\n}\n\nconst starLevel = (rating: number, i: number) => {\n if (rating >= i - 0.25) {\n return \"fullstar\";\n }\n if (rating >= i - 0.75) {\n return \"halfstar\";\n }\n return \"emptystar\";\n};\n\nconst Stars = ({ rating, size = \"base\", containerClasses = \"\" }: Props) => (\n <>\n {!!rating && rating > 0 ? (\n \n {`Rated ${rating\n .toFixed(1)\n .replace(/\\.0$/, \"\")} out of 5 stars`}\n {range(1, 6).map((i) => (\n \n ))}\n \n ) : null}\n \n);\n\nexport default Stars;\n"],"names":["getLowestPriceWithQuantityDiscounts","getLowestPrice","price","showBelowMinimumAdvertisedPriceForLoggedInCustomers","showBelowMinimumAdvertisedPriceForPlatinumAndPlusCustomers","user","showPlusPricing","activeSale","isActiveSale","hasMAPStyle","minimumAdvertisedPriceProperties","type","trim","hasPlusPricing","minimumAdvertisedPriceOverride","priceLevel5","hasWebPlus","lowestPrice","Math","min","salePrice","Infinity","registered","platinum","enabled","product","quantityDiscounts","isGoogleView","minimumCustomizationPrice","shouldDisplayRequiredCustomization","showPlusPrice","shouldDisplayQuantityDiscounts","display","lowestQuantityDiscount","sort","a","b","displaySalePrice","saleStartDate","saleEndDate","currentDate","Date","String","displayMinimumAdvertisedPrice","hasMapStyle","regularUserQualifiedForMapPricing","regularUserQualifiedForMapJPricing","amountSpentOneThousandOrMore","regularUserQualifiedForMapYPricing","amountSpentFiveThousandOrMore","platPlusUserQualifiedForMapPricing","hasPurchaseHistory","shouldDisplayBelowMapPrice","startBuy","length","lowestNonLotDiscountThatUserIsAlreadyQualifiedByBuyingTheMinimum","filter","x","isLotDiscount","startQuantity","map","discountsWithLowerPriceAndHigherStartBuy","discount","endQuantity","quantity","shouldDisplayMapStyle","properties","level","rest","svg","fill","aria-hidden","className","data-testid","use","xlinkHref","spritePath","sizes","small","ct","base","large","extraLarge","starLevel","rating","i","size","containerClasses","div","Boolean","join","span","toFixed","replace","range","StarIcon"],"sourceRoot":""}