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","webpack://msdyn365.commerce.online/./src/components/elicit-amountselector.component.tsx?44b2","webpack://msdyn365.commerce.online/./src/components/elicit-cartlineitem.component.tsx?7980","webpack://msdyn365.commerce.online/./src/modules/cartmanager/cart-verified.ts?60c4","webpack://msdyn365.commerce.online/./src/modules/cartmanager/cart-data-cookie.ts?b01d","webpack://msdyn365.commerce.online/./src/modules/cartmanager/cartmanager.props.autogenerated.ts?757f","webpack://msdyn365.commerce.online/./src/modules/cartmanager/cartmanager.tsx?a4fb","webpack://msdyn365.commerce.online/./src/modules/cartmanager/cartmanager.view.tsx?f952","webpack://msdyn365.commerce.online/./src/modules/clear-wineclub/clear-wineclub.tsx?2607","webpack://msdyn365.commerce.online/./src/modules/clear-wineclub/clear-wineclub.view.tsx?2c32","webpack://msdyn365.commerce.online/./src/modules/page-tos/page-tos.tsx?273c","webpack://msdyn365.commerce.online/./src/modules/page-tos/components/tos-checkbox.tsx?2beb","webpack://msdyn365.commerce.online/./src/modules/page-tos/page-tos.view.tsx?75e7","webpack://msdyn365.commerce.online/./src/modules/wine-club-signup/wine-club-data.ts?ff5b"],"sourcesContent":["/* tslint:disable */\r\nimport { IReactComponent } from 'mobx-react/index';\r\nimport React, { Component, ComponentType } from 'react';\r\n\r\ntype subscriptionCallback = (...args: T[]) => void;\r\n\r\ntype subscription = { [uniqueId: string]: subscriptionCallback };\r\n\r\n/**\r\n * A loader that maintains a list of current namespaces. Meant to be later\r\n * singleton'd\r\n */\r\nclass EventBusLoader {\r\n\r\n // list of current buses that are in action\r\n private _buses: { [namespace: string]: BusLoader } = {};\r\n\r\n /**\r\n * get's an existing bus or creating a new bus of that namespace\r\n *\r\n * @param busNamespace the namespace of the bus to retrieve\r\n */\r\n public getBus(busNamespace: string): BusLoader {\r\n // fast return if the bus already exists\r\n if (this._buses[busNamespace]) {\r\n return this._buses[busNamespace];\r\n }\r\n\r\n // create a new bus and do the internal subscription for deleting the entire bus when bus\r\n // is empty\r\n this._buses[busNamespace] = new BusLoader();\r\n this._buses[busNamespace].subscribe('_readyForDeletion', this.deleteBus.bind(this));\r\n return this._buses[busNamespace];\r\n }\r\n\r\n /**\r\n * deletes and purges all events\r\n *\r\n * @param busNamespace the namespace of the bus to delete\r\n */\r\n public deleteBus(busNamespace: string): void {\r\n if (this._buses[busNamespace]) {\r\n this._buses[busNamespace].purge();\r\n }\r\n delete this._buses[busNamespace];\r\n }\r\n}\r\n\r\n/**\r\n * Contains a single namespace of events of the event bus\r\n */\r\nexport class BusLoader {\r\n\r\n // list of all subscriptions within this bus's namespace\r\n private _subscriptions: { [subName: string]: subscription } = {};\r\n\r\n /**\r\n * subscribe to a subscription within this namespace\r\n *\r\n * @param subName event subscription name\r\n * @param onPublish callback that triggers when subscription gets published\r\n */\r\n public subscribe(subName: string, onPublish: subscriptionCallback): { unsubscribe(): void, id: number } {\r\n\r\n // generates an ever-counting up id generator\r\n const nextId = IdGenerator();\r\n\r\n // create a new list if the bus loader contains no subscription\r\n if (!this._subscriptions[subName]) {\r\n this._subscriptions[subName] = {\r\n _readyForDeletion: () => { /* event to notify loader that this is going to be deleted */ }\r\n };\r\n }\r\n\r\n // add the subscription to the list\r\n this._subscriptions[subName][nextId] = onPublish as subscriptionCallback;\r\n\r\n // return an unsubscribe method for deleting this specific subscription\r\n return {\r\n id: nextId,\r\n unsubscribe: () => {\r\n this._purgeById(subName, nextId);\r\n }\r\n };\r\n }\r\n\r\n /**\r\n * remove a subscription from anywhere within the namespace\r\n *\r\n * @param id subscription id\r\n */\r\n public unsubscribe(id: number): boolean {\r\n for (const subName in this._subscriptions) {\r\n if (this._subscriptions[subName][id]) {\r\n this._purgeById(subName, id);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * publish data to all subscriptions\r\n *\r\n * @param subName subscription name to publish to\r\n * @param args data to pass into the subscribed functions\r\n */\r\n public publish(subName: string, ...args: any): void {\r\n // don't do anything if it doesnt exist and fail\r\n // gracefully\r\n if (!this._subscriptions[subName]) {\r\n return;\r\n }\r\n\r\n Object.keys(this._subscriptions[subName])\r\n .forEach(id => {\r\n this._subscriptions[subName] && this._subscriptions[subName][id] && this._subscriptions[subName][id](...args);\r\n });\r\n }\r\n\r\n /**\r\n * purge all data in the bus loader\r\n */\r\n public purge(): void {\r\n this._subscriptions = {};\r\n }\r\n\r\n /**\r\n * purges a single subscription id endpoint from a subscription\r\n * name\r\n *\r\n * @param subName subscription name\r\n * @param id subscription id\r\n */\r\n private _purgeById(subName: string, id: number) {\r\n delete this._subscriptions[subName][id];\r\n\r\n // not zero because there will always be the internal _readyForDeletion event\r\n if (Object.keys(this._subscriptions[subName]).length === 1) {\r\n this.publish('_readyForDeletion');\r\n delete this._subscriptions[subName];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * generates a singleton of ids\r\n */\r\nconst IdGenerator = (() => {\r\n let idValue = 0;\r\n\r\n return () => {\r\n idValue += 1;\r\n return idValue;\r\n };\r\n})();\r\n\r\n/**\r\n * generates a singleton of the bus loader\r\n */\r\nconst Loader = (() => {\r\n return new EventBusLoader();\r\n})();\r\n\r\nexport function LoadBus(eventNamespace: string): (newComponent: T) => void {\r\n return (CHILD_COMP: ComponentType) => {\r\n return class extends Component {\r\n constructor(props: any) {\r\n super(props);\r\n\r\n // add to the component the bus\r\n CHILD_COMP.prototype.bus = this.bus;\r\n }\r\n\r\n // the bus's definition\r\n public get bus() { return Loader.getBus(eventNamespace); }\r\n\r\n // we arent decorating anything related to the UI so just return the child with\r\n // all it's props\r\n public render(): JSX.Element {\r\n return ;\r\n }\r\n };\r\n };\r\n}","import { ICartState } from '@msdyn365-commerce/global-state';\r\nimport debounce from 'lodash/debounce';\r\nimport { observable, reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { CartUtilities } from '../Utilities/cart-utils';\r\nimport { BusLoader, LoadBus } from '../Utilities/event-bus';\r\nimport { filterCartLines } from '../Utilities/subscription-manager';\r\n\r\ninterface IEditSelectComponentProps {\r\n currentQuantity: number;\r\n cartLineId?: string;\r\n isSubLine?: boolean;\r\n cart?: ICartState;\r\n zeroAvailabilityError?: boolean;\r\n shouldDisableQty?: boolean;\r\n _updateQuantityRaw(quantity: number): void;\r\n}\r\n\r\n/**\r\n * edit component\r\n */\r\n@LoadBus('elicit-amount-selector')\r\n@observer\r\nexport class ElicitAmountSelector extends React.Component {\r\n\r\n private bus: BusLoader | undefined;\r\n @observable private _trackedTotal: number | undefined;\r\n\r\n public constructor(constProps: IEditSelectComponentProps) {\r\n super(constProps);\r\n this._setQuantity = debounce(this._setQuantity.bind(this), 500);\r\n this._upQuantity = this._upQuantity.bind(this);\r\n this._downQuantity = this._downQuantity.bind(this);\r\n this._onQuantityChange = this._onQuantityChange.bind(this);\r\n this._postValidateQuantity = this._postValidateQuantity.bind(this);\r\n\r\n if (this.props.isSubLine) {\r\n this._trackedTotal = filterCartLines(this.props.cart?.cart).subscriptionLines.length;\r\n reaction(\r\n () => [this.props.cart, this.props.cart?.cart, this.props.cart?.cart.CartLines],\r\n () => {\r\n const unrelatedLines = filterCartLines(this.props.cart?.cart).subscriptionLines.filter(line => line.LineId !== this.props.cartLineId);\r\n this._trackedTotal = CartUtilities.countCartLineAmount(unrelatedLines);\r\n }\r\n );\r\n\r\n this.bus?.subscribe('added-locally', () => {\r\n this._trackedTotal!++;\r\n });\r\n\r\n this.bus?.subscribe('removed-locally', () => {\r\n this._trackedTotal!--;\r\n });\r\n\r\n this.bus?.subscribe('delta-change-local', (delta: number) => {\r\n this._trackedTotal! -= delta;\r\n });\r\n }\r\n\r\n this.state = { quantityState: this.props.currentQuantity };\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n
\r\n \r\n { /* tslint:disable-next-line: react-a11y-role-has-required-aria-props react-this-binding-issue */}\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n private get _canAddMore(): boolean {\r\n if (!this.props.isSubLine) { return true; }\r\n return this.state.quantityState + this._trackedTotal! < 12;\r\n }\r\n\r\n private _upQuantity(): void {\r\n this.setState({ quantityState: this.state.quantityState + 1 });\r\n this.props.isSubLine && this.bus?.publish('added-locally');\r\n this._setQuantity();\r\n }\r\n\r\n private _downQuantity(): void {\r\n if (this.state.quantityState - 1 < 1) { return; }\r\n this.setState({ quantityState: this.state.quantityState - 1 });\r\n this.props.isSubLine && this.bus?.publish('removed-locally');\r\n this._setQuantity();\r\n }\r\n\r\n private _onQuantityChange({ target }: React.ChangeEvent): void {\r\n this.setState({ quantityState: parseInt(target.value, 10) });\r\n }\r\n\r\n private _postValidateQuantity({ target }: React.ChangeEvent): void {\r\n if (this.props.isSubLine) {\r\n if ((this._trackedTotal! + parseInt(target.value, 10)) <= 12) {\r\n this.setState({ quantityState: parseInt(target.value, 10) });\r\n this.bus?.publish('delta-change-local', this._trackedTotal! - parseInt(target.value, 10));\r\n } else {\r\n this.setState({ quantityState: 1 });\r\n }\r\n } else {\r\n if (parseInt(target.value, 10) > 0) {\r\n this.setState({ quantityState: parseInt(target.value, 10) });\r\n } else {\r\n this.setState({ quantityState: 1 });\r\n }\r\n }\r\n this._setQuantity();\r\n }\r\n\r\n private _setQuantity(): void {\r\n this.props._updateQuantityRaw(this.state.quantityState);\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport {\r\n IActionContext,\r\n IComponentProps,\r\n IGridSettings,\r\n IImageSettings,\r\n Image,\r\n RichTextComponent\r\n} from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n AttributeValue,\r\n CartLine,\r\n SalesLine\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { brandCodeParser } from '../Utilities/brand-code-parser';\r\nimport { isLineSubscriptionLine } from '../Utilities/subscription-manager';\r\nimport { ElicitAmountSelector } from './elicit-amountselector.component';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs\r\n */\r\nexport interface ICartlineResourceString {\r\n /** Display string for discount label */\r\n discountStringText: string;\r\n /** String for size key */\r\n sizeString: string;\r\n /** String for color key */\r\n colorString: string;\r\n /** String associated with the configuration product dimension */\r\n configString: string;\r\n /** String for style key */\r\n styleString: string;\r\n /** Display string for quantity label */\r\n quantityDisplayString: string;\r\n /** Display string for quantity label */\r\n inputQuantityAriaLabel: string;\r\n}\r\n\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n product: SimpleProduct;\r\n}\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n percentSaving: number;\r\n templateSavingText: string;\r\n templatePercentSavingText: string;\r\n /** The flag to change the quantity component from interactible to static */\r\n disableQuantityInteractivity?: boolean;\r\n /** The primary image url */\r\n primaryImageUrl?: string;\r\n /** The product url */\r\n productUrl?: string;\r\n /** GridSettings for the product image in cartLine */\r\n gridSettings: IGridSettings;\r\n /** ImageSettings for the product image in cartLine */\r\n imageSettings: IImageSettings;\r\n /** Boolean flag to indicate if the item is out of stock */\r\n isOutOfStock?: boolean;\r\n /** Flag to make quantity section editable */\r\n isQuantityEditable?: boolean;\r\n /** Max quantity for line item */\r\n maxQuantity?: number;\r\n /** Current quantity for line item */\r\n currentQuantity?: number;\r\n /** Resource string for the component */\r\n resources: ICartlineResourceString;\r\n /** SalesLine flag */\r\n isSalesLine?: boolean;\r\n // Remove button coming from smwe-cartline\r\n // remove:string;\r\n remove?: React.ReactNode;\r\n /** Display images for on cart lines */\r\n showImages?: boolean;\r\n /** Has zero availability error? */\r\n zeroAvailabilityError?: boolean;\r\n cartState?: ICartState;\r\n cartLineErrors?: { [index: string]: boolean };\r\n /** Replaces discount code name with percent */\r\n showDiscountPercent?: boolean;\r\n /** Attributes for product */\r\n productAttributes?: AttributeValue[];\r\n /** Quantity onChange callback */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number): void;\r\n cartLineOnChange?(ctx: IActionContext, cartState: ICartState | undefined, cartLine: CartLine): void;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nconst SmweCartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources, primaryImageUrl, showImages, gridSettings, imageSettings, zeroAvailabilityError } = props;\r\n const intlFormatter = props.context.cultureFormatter;\r\n const { product } = props.data;\r\n\r\n const _updateQuantityRaw = (num: number) => {\r\n if (props.quantityOnChange) {\r\n props.quantityOnChange(\r\n props.data.cartLine,\r\n num || 10\r\n );\r\n }\r\n };\r\n\r\n const _generateSelectMenu = (\r\n quantity: number,\r\n currentQuantity: number | undefined\r\n ): JSX.Element => {\r\n const shouldDisableQty = props.data.product && props.data.product.ItemId?.toLowerCase() === props.context.request.channel?.GiftCardItemId?.toLowerCase();\r\n return (\r\n \r\n \r\n {props.remove}\r\n \r\n );\r\n };\r\n const _isWineProduct = (productId: string | undefined) => {\r\n return productId && /^\\d+$/.test(productId);\r\n };\r\n\r\n const _generateQuantityAndPrice = (): JSX.Element[] | null => {\r\n const nodes = [];\r\n const priceAdjustmentSavings = _getPriceAdjustmentSavings();\r\n // TODO: Temporary solution till we get better solution in checking product type in Cart\r\n const isWineProduct = _isWineProduct(product.ItemId);\r\n if (isWineProduct && props.isOutOfStock && !zeroAvailabilityError) {\r\n return null;\r\n }\r\n\r\n if (props.isQuantityEditable) {\r\n nodes.push(\r\n _generateSelectMenu(props.maxQuantity || 10, props.currentQuantity)\r\n );\r\n } else {\r\n nodes.push(\r\n \r\n \r\n \r\n {props.data.cartLine.Quantity} {props.remove}\r\n \r\n \r\n );\r\n }\r\n nodes.push(\r\n \r\n
\r\n {props.data.cartLine.Price !== undefined\r\n ? intlFormatter.formatCurrency(props.data.cartLine.Price * (1 - ((props.data.cartLine.DiscountAmountWithoutTax || 0) / (props.data.cartLine.NetPrice || 0))))\r\n : ''}\r\n {_getPriceAdjustmentPercent()}\r\n
\r\n
\r\n {_getPriceDiscount()}\r\n
\r\n \r\n );\r\n let price = props.data.cartLine.NetPrice! / props.percentSaving;\r\n if (!isFinite(price)) {\r\n price = 0;\r\n }\r\n nodes.push(\r\n \r\n
\r\n {isSalesLine\r\n ? props.data.cartLine.Price && intlFormatter.formatCurrency(props.data.cartLine.Price)\r\n : props.data.cartLine.TotalAmount === 0\r\n ? intlFormatter.formatCurrency(0)\r\n : props.data.cartLine.TotalAmount && intlFormatter.formatCurrency(props.data.cartLine.TotalAmount)\r\n }\r\n
\r\n
\r\n {(props.data.cartLine.DiscountAmountWithoutTax && props.data.cartLine.DiscountAmountWithoutTax > 0)\r\n || (priceAdjustmentSavings && priceAdjustmentSavings > 0)\r\n ? `${intlFormatter.formatCurrency((props.data.cartLine.DiscountAmountWithoutTax || 0) + _getPriceAdjustmentSavings())} savings`\r\n : null\r\n }\r\n
\r\n \r\n );\r\n return nodes;\r\n };\r\n\r\n const _getCartLineImage = (): JSX.Element | null => {\r\n if (showImages && primaryImageUrl) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n const _getPriceAdjustmentPercent = (): JSX.Element | null => {\r\n if (props.data.product.Price && props.data.cartLine.Price && (props.data.cartLine.Price < props.data.product.Price)) {\r\n return {` (${((props.data.cartLine.Price / props.data.product.Price) * 100).toFixed(0)}% Off)`};\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n const _getPriceDiscount = (): string | null => {\r\n if (\r\n props.data.cartLine.DiscountAmountWithoutTax !== undefined &&\r\n props.data.cartLine.DiscountAmountWithoutTax !== 0 &&\r\n props.data.cartLine.Quantity &&\r\n props.data.cartLine.DiscountLines\r\n ) {\r\n if (props.showDiscountPercent && props.data.cartLine.NetPrice) {\r\n return `${((props.data.cartLine.DiscountAmountWithoutTax / props.data.cartLine.NetPrice) * 100).toFixed(0)}% off`;\r\n }\r\n return `${_doubleDiscounts()} ${props.data.cartLine.DiscountLines[0].DiscountCode}`;\r\n\r\n }\r\n return null;\r\n };\r\n\r\n enum GiftCardFieldType {\r\n Extension, Attribute\r\n }\r\n\r\n interface IGiftCardFields {\r\n Key: string;\r\n Type: GiftCardFieldType;\r\n StringValue: string;\r\n Required: boolean;\r\n isValid?: boolean;\r\n }\r\n\r\n interface IGiftCardFormObj {\r\n FirstName: IGiftCardFields;\r\n LastName: IGiftCardFields;\r\n ElectronicDeliveryEmail: IGiftCardFields;\r\n ElectronicDeliveryEmailContent: IGiftCardFields;\r\n }\r\n\r\n const giftCardFormObj: IGiftCardFormObj = {\r\n FirstName: {\r\n Key: 'FirstName',\r\n Type: GiftCardFieldType.Extension,\r\n StringValue: '',\r\n Required: true,\r\n isValid: true\r\n },\r\n LastName: {\r\n Key: 'LastName',\r\n Type: GiftCardFieldType.Extension,\r\n StringValue: '',\r\n Required: true,\r\n isValid: true\r\n },\r\n ElectronicDeliveryEmail: {\r\n Key: 'ElectronicDeliveryEmail',\r\n Type: GiftCardFieldType.Attribute,\r\n StringValue: '',\r\n Required: true,\r\n isValid: true\r\n },\r\n ElectronicDeliveryEmailContent: {\r\n Key: 'ElectronicDeliveryEmailContent',\r\n Type: GiftCardFieldType.Attribute,\r\n StringValue: '',\r\n Required: false\r\n },\r\n };\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n const _renderGiftCardPrompt = (): JSX.Element | null => {\r\n\r\n if (!props.data.cartLine.IsGiftCardLine) {\r\n return null;\r\n }\r\n\r\n const [giftCardFormField, setGiftCardFormField] = useState(giftCardFormObj);\r\n const [formFieldsDebounce, setFormFieldsDebounce] = useState('');\r\n\r\n const setFormFieldState = () => {\r\n const unhydratedCartLineLoad = { ...props.data.cartLine };\r\n Object.keys(giftCardFormField).forEach((field) => {\r\n const fieldState = giftCardFormField[field];\r\n if (fieldState.Type === GiftCardFieldType.Extension) {\r\n unhydratedCartLineLoad.ExtensionProperties = unhydratedCartLineLoad.ExtensionProperties || [];\r\n const property = unhydratedCartLineLoad.ExtensionProperties.find((extension) => {\r\n return extension.Key?.toLowerCase() === fieldState.Key?.toLowerCase();\r\n });\r\n if (property) {\r\n setGiftCardFormField((prevState: IGiftCardFormObj) => ({\r\n ...prevState,\r\n [field]: {\r\n ...prevState[field],\r\n StringValue: property.Value?.StringValue\r\n }\r\n }));\r\n }\r\n } else if (fieldState.Type === GiftCardFieldType.Attribute) {\r\n const property = unhydratedCartLineLoad[fieldState.Key];\r\n if (property) {\r\n setGiftCardFormField((prevState: IGiftCardFormObj) => ({\r\n ...prevState,\r\n [fieldState.Key]: {\r\n ...prevState[fieldState.Key],\r\n StringValue: unhydratedCartLineLoad[fieldState.Key]\r\n }\r\n }));\r\n }\r\n }\r\n });\r\n };\r\n\r\n const updateFormFieldToCartLine = () => {\r\n const unhydratedCartLineLoad = { ...props.data.cartLine };\r\n Object.keys(giftCardFormField).forEach((field) => {\r\n const fieldState = giftCardFormField[field];\r\n if (fieldState.Type === GiftCardFieldType.Extension) {\r\n unhydratedCartLineLoad.ExtensionProperties = unhydratedCartLineLoad.ExtensionProperties || [];\r\n unhydratedCartLineLoad.ExtensionProperties.push({\r\n Key: fieldState.Key,\r\n Value: {\r\n StringValue: fieldState.StringValue\r\n }\r\n });\r\n } else if (fieldState.Type === GiftCardFieldType.Attribute) {\r\n unhydratedCartLineLoad[fieldState.Key] = giftCardFormField[fieldState.Key].StringValue;\r\n }\r\n });\r\n // Removing 'ItemTaxGroupId' from the object because now in new SSK its READONLY Attribute, can't be updated.\r\n delete (unhydratedCartLineLoad.ItemTaxGroupId);\r\n props.cartLineOnChange && props.cartLineOnChange(props.context.actionContext, props.cartState, unhydratedCartLineLoad);\r\n };\r\n\r\n const giftCardValidation = () => {\r\n let giftCardFormIsValid = true;\r\n Object.keys(giftCardFormField).forEach((field) => {\r\n const fieldState = giftCardFormField[field];\r\n if (fieldState.Required) {\r\n if (fieldState.StringValue.trim() === '') {\r\n giftCardFormIsValid = false;\r\n fieldState.isValid = false;\r\n } else {\r\n fieldState.isValid = true;\r\n }\r\n\r\n if (fieldState.Key === 'ElectronicDeliveryEmail') {\r\n const validEmailRegex =\r\n RegExp(/^(([^<>()\\[\\]\\.,;:\\s@\\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/i);\r\n if (!validEmailRegex.test(fieldState.StringValue)) {\r\n giftCardFormIsValid = false;\r\n fieldState.isValid = false;\r\n } else {\r\n fieldState.isValid = true;\r\n }\r\n }\r\n }\r\n });\r\n if (props.cartLineErrors) {\r\n if (giftCardFormIsValid) {\r\n props.cartLineErrors[props.data.cartLine.LineId!] = false;\r\n } else {\r\n props.cartLineErrors[props.data.cartLine.LineId!] = true;\r\n }\r\n }\r\n };\r\n\r\n // Setting the data from the cartline to State on load\r\n useEffect(() => {\r\n setFormFieldState();\r\n }, []);\r\n\r\n //Checking giftCard form validation\r\n useEffect(() => {\r\n giftCardValidation();\r\n }, [giftCardFormField]);\r\n\r\n // Updating formfield to cardLine\r\n useEffect(() => {\r\n const delayDebounceFn = setTimeout(() => {\r\n updateFormFieldToCartLine();\r\n }, 600);\r\n\r\n return () => clearTimeout(delayDebounceFn);\r\n }, [formFieldsDebounce]);\r\n\r\n const handleChange = (name: string) => (event: React.ChangeEvent) => {\r\n const value = event?.target.value;\r\n if (name) {\r\n setGiftCardFormField((prevState: IGiftCardFormObj) => ({\r\n ...prevState,\r\n [name]: {\r\n ...prevState[name],\r\n StringValue: value,\r\n },\r\n }));\r\n setFormFieldsDebounce(value);\r\n }\r\n };\r\n\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n

IMPORTANT: Gift Cards are sent to the recipient email address the same day orders are placed. You can use your own e-mail address to keep it a surprise.

\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n };\r\n\r\n const _getCartLineComment = (): JSX.Element | null => {\r\n if (_isWineProduct(props.data.product.ItemId) && props.data.cartLine.Comment) {\r\n return (\r\n
\r\n {props.data.cartLine.Comment}\r\n
);\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n const _getPriceAdjustmentSavings = (): number => {\r\n if (props.data.product.Price && props.data.cartLine.Price && props.data.cartLine.NetPrice) {\r\n const priceUnadjusted = (props.data.cartLine.NetPrice / (props.data.cartLine.Price / props.data.product.Price));\r\n return (priceUnadjusted - props.data.cartLine.NetPrice);\r\n } else {\r\n return 0;\r\n }\r\n };\r\n\r\n const _doubleDiscounts = (): string => {\r\n if (_getPriceAdjustmentPercent()) {\r\n return '+ ';\r\n } else {\r\n return '';\r\n }\r\n };\r\n\r\n const _getKitDescription = (): JSX.Element | null => {\r\n if (props.productAttributes) {\r\n const productType = props.productAttributes.find(attribute => attribute.Name === 'Product Type');\r\n if (productType?.TextValue === 'Assembly') {\r\n const description = props.productAttributes.find(\r\n attribute => attribute.Name === 'Includes'\r\n )?.TextValue;\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n const brandCode = brandCodeParser({ description: product.Description, appContext: props.context });\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {_getCartLineImage()}\r\n
\r\n {brandCode &&\r\n
\r\n {brandCode}\r\n
\r\n }\r\n
\r\n {product.Name}\r\n
\r\n {_getKitDescription()}\r\n
\r\n
\r\n \r\n {_generateQuantityAndPrice()}\r\n \r\n {_getCartLineComment()}\r\n {_renderGiftCardPrompt()}\r\n \r\n );\r\n};\r\n\r\n// @ts-ignore\r\nexport default SmweCartLine;\r\n","\r\n/**\r\n * simple singleton just to know if the cart was verified\r\n */\r\nexport class CartVerifier {\r\n public static instance: CartVerifier = new CartVerifier();\r\n public isVerified: boolean = false;\r\n}","import { ICookieContext, ICookieSetOptions } from '@msdyn365-commerce/core-internal';\r\nimport { cartType } from './cartmanager.props.autogenerated';\r\n\r\ntype CookieExport = {\r\n cookieType: cartType;\r\n cartId: string;\r\n};\r\n\r\n/**\r\n * class to maintain cart <--> cookie interactions\r\n */\r\nexport class CartDataCookie {\r\n public cookieContext: ICookieContext;\r\n public cookieType: cartType | undefined;\r\n public cartId: string | undefined;\r\n private readonly _PREFIX: string = 'temp:cart-data-cookie';\r\n\r\n constructor(cookieContext: ICookieContext, cookie?: string) {\r\n this.cookieContext = cookieContext;\r\n\r\n if (cookie) {\r\n const parsedCookie: CookieExport = JSON.parse(cookie);\r\n this.cookieType = parsedCookie.cookieType;\r\n this.cartId = parsedCookie.cartId;\r\n }\r\n }\r\n\r\n public load(cartName: cartType): boolean {\r\n // @ts-ignore\r\n // i dont know why all these values aren't typed - true param is DNE\r\n const cookie = this.cookieContext.get(`${this._PREFIX}-${cartName}`, true);\r\n if (cookie.status === 'FOUND' && cookie.value) {\r\n\r\n // more poor typing on the cookie API\r\n const parsedCookie: CookieExport = cookie.value;\r\n this.cartId = parsedCookie.cartId;\r\n this.cookieType = parsedCookie.cookieType;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public clear(cartName: cartType): void {\r\n // @ts-ignore\r\n this.cookieContext.remove(`${this._PREFIX}-${cartName}`, true);\r\n }\r\n\r\n public save(): void {\r\n this.cookieContext.set(`${this._PREFIX}-${this.cookieType}`, JSON.stringify({\r\n cartId: this.cartId,\r\n cookieType: this.cookieType\r\n }), {\r\n path: '/',\r\n maxAge: 31556952000, /* 1 year */\r\n isEssential: true\r\n });\r\n }\r\n}","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * ICartmanager contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum cartType {\r\n CLUB = 'CLUB',\r\n WINE = 'WINE'\r\n}\r\n\r\nexport interface ICartmanagerConfig extends Msdyn365.IModuleConfig {\r\n cartType: cartType;\r\n redirectPage?: Msdyn365.ILinkData;\r\n refreshOnAction?: boolean;\r\n}\r\n\r\nexport interface ICartmanagerProps extends Msdyn365.IModule {\r\n config: ICartmanagerConfig;\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from 'react';\r\n\r\n// import { createNewCart, getCartFromCookie } from '@msdyn365-commerce/global-state/src/cart-state';\r\nimport { BaseCartState, createNewCart, getCartFromCookie, GlobalStateInput, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { Cart, CartLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { computed } from 'mobx';\r\nimport { IWineClub, wineClubSetup } from '../../settings/app.settings';\r\nimport { CartUtilities } from '../../Utilities/cart-utils';\r\nimport { BusLoader, LoadBus } from '../../Utilities/event-bus';\r\nimport { WineClubDataStore } from '../wine-club-signup/wine-club-data';\r\nimport { CartDataCookie } from './cart-data-cookie';\r\nimport { CartVerifier } from './cart-verified';\r\nimport { ICartmanagerData } from './cartmanager.data';\r\nimport { cartType, ICartmanagerProps } from './cartmanager.props.autogenerated';\r\n\r\nexport interface ICartmanagerViewProps extends ICartmanagerProps {\r\n\r\n}\r\n\r\nfunction printC(log: string, color: string): void {\r\n console.log(`%c${log}`, `color: ${color}`);\r\n}\r\n\r\n// WINE CART VALIDATION DOES NOT DEFAULT\r\n/**\r\n *\r\n * Cartmanager component\r\n * @extends {React.PureComponent>}\r\n */\r\n@LoadBus('cartmanager')\r\nclass Cartmanager extends React.PureComponent> {\r\n\r\n // TODO: to remove after testing\r\n private CART_TYPE: cartType = cartType.CLUB;\r\n\r\n private bus!: BusLoader;\r\n\r\n // declaration on what sort of data persistence behaviour will be done for\r\n // each cart type\r\n private readonly PERSISTENCE_MAP: { [cartDataType: string]: boolean } = {\r\n [cartType.WINE]: true,\r\n [cartType.CLUB]: false\r\n };\r\n\r\n @computed private get _clubItemIds(): string[] {\r\n const wineClub = this.props.app.config.wineClubSetup as wineClubSetup;\r\n const ids: string[] = [];\r\n wineClub.forEach(club => club.variants.forEach(variant => ids.push(variant.itemId)));\r\n return ids;\r\n }\r\n\r\n public constructor(props: ICartmanagerProps) {\r\n super(props);\r\n\r\n // TODO: when done testing, remove the class field and replace\r\n // TODO: fully with props\r\n this.CART_TYPE = this.props.config.cartType;\r\n }\r\n\r\n public componentDidMount(): void {\r\n void this._processCartManager();\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n\r\n private async _processCartManager(): Promise {\r\n printC('ENTER CART MANAGER----------------------------------------------', 'red');\r\n const doCartRepair = await this._doesCartNeedRepair();\r\n printC(`CART REPAIR CHECK FINISHED WITH : ${doCartRepair}`, 'red');\r\n if (doCartRepair) {\r\n await this._repairCartAndProcess();\r\n await this._autoSetAnonCartCookie();\r\n } else {\r\n await this._autoSetAnonCartCookie();\r\n await this._processSwappableCart();\r\n }\r\n printC('PROCESS CART OPERATION COMPLETE', 'red');\r\n await this._preserveCartSplit();\r\n const query = this.props.context.request.query;\r\n // tslint:disable-next-line: no-typeof-undefined\r\n if (this.props.config.redirectPage?.destinationUrl && typeof window !== 'undefined') {\r\n printC(`REDIRECTING TO ${this.props.config.redirectPage.destinationUrl}`, 'red');\r\n let destinationUrl = this.props.config.redirectPage.destinationUrl;\r\n const refId = sessionStorage.getItem('refId');\r\n if(refId) {\r\n destinationUrl = destinationUrl.includes('?') ? `${destinationUrl}&refId=${refId}`: `${destinationUrl}?refId=${refId}`;\r\n sessionStorage.removeItem('refId');\r\n } else if(query?.refId) {\r\n destinationUrl = destinationUrl.includes('?') ? `${destinationUrl}&refId=${query.refId}`: `${destinationUrl}?refId=${query.refId}`;\r\n }\r\n window.location.href = destinationUrl;\r\n\r\n // tslint:disable-next-line: no-typeof-undefined\r\n } else if (doCartRepair && typeof window !== 'undefined') {\r\n printC('RELOADING PAGE', 'red');\r\n window.location.reload();\r\n }\r\n }\r\n\r\n private async _repairCartAndProcess(): Promise {\r\n printC('ENTER REPAIR CART----------------------------------------------', 'blue');\r\n const cartState = await this.props.data.cart;\r\n const lines = cartState.cart.CartLines || [];\r\n const sortedItems = this._sortCart(lines);\r\n printC(`SORTED ITEMS: ${JSON.stringify(sortedItems)}`, 'blue');\r\n const itemsForAdd = {\r\n club: sortedItems.club.map(item => { return { id: item.ProductId!, amount: item.Quantity || 1 }; }),\r\n nonclub: sortedItems.nonclub.map(item => { return { id: item.ProductId!, amount: item.Quantity || 1 }; })\r\n };\r\n\r\n // we do the reverse based on the page's cart type\r\n if (this.CART_TYPE === cartType.CLUB) {\r\n printC('CART TYPE CLUB DETECTED', 'blue');\r\n const activeClubId = this._getClubItemId();\r\n\r\n // remove ALL items, we only want club in this cart\r\n await this._removeCartItems([...sortedItems.club, ...sortedItems.nonclub]);\r\n await this._addCartItems([{ id: +activeClubId, amount: 1 }]);\r\n\r\n const clubCartCookie = new CartDataCookie(\r\n this.props.context.request.cookies\r\n );\r\n\r\n clubCartCookie.cartId = this.props.context.request.cookies.getCartCookie();\r\n clubCartCookie.cookieType = cartType.CLUB;\r\n clubCartCookie.save();\r\n\r\n // create a new cart in the wine context\r\n await this._processNewCart(cartType.WINE);\r\n\r\n // now within the wine's context, re-add the nonclub items\r\n await this._addCartItems(itemsForAdd.nonclub);\r\n\r\n await this._processCartSwap(clubCartCookie);\r\n }\r\n\r\n // same as above\r\n if (this.CART_TYPE === cartType.WINE) {\r\n printC('CART TYPE CLUB WINE', 'blue');\r\n await this._removeCartItems(sortedItems.club);\r\n\r\n new CartDataCookie(\r\n this.props.context.request.cookies\r\n ).clear(cartType.CLUB);\r\n }\r\n }\r\n\r\n /**\r\n * main swap process\r\n */\r\n private async _processSwappableCart(): Promise {\r\n printC('ENTER SWAPPABLE CART--------------------------------------------', 'green');\r\n // on every page load, ensure the proper cart is being used\r\n const cart = await this.props.data.cart;\r\n\r\n // construct a cart cookie and attempt a load of the cart id\r\n const cookie = new CartDataCookie(this.props.context.request.cookies);\r\n\r\n // if the load was successful and the cookie contains a valid cart id\r\n // (not undefined), then initiate a check to ensure\r\n if (cookie.load(this.CART_TYPE) && cookie.cartId) {\r\n printC(`COOKIE ${cookie.cartId} of ${this.CART_TYPE} found`, 'green');\r\n\r\n // if the current cart DOES NOT match the cart that should be loaded\r\n // on this page\r\n if (cookie.cartId.split(':')[1] !== cart.cart.Id) {\r\n printC(`CART ID'S DO NOT MATCH, PROCEED WITH SWAP`, 'green');\r\n // depending on wether we want the cart types data to stay,\r\n // create a new cart or wipe and delete\r\n if (this.PERSISTENCE_MAP[this.CART_TYPE]) {\r\n printC(`SWAPPING CURRENT CART WITH COOKIE ${JSON.stringify(cookie)}`, 'green');\r\n await this._processCartSwap(cookie);\r\n } else {\r\n printC(`CREATING NEW CART OF TYPE ${this.CART_TYPE}`, 'green');\r\n await this._processNewCart(this.CART_TYPE);\r\n }\r\n }\r\n } else {\r\n printC('EXISTING COOKIE NOT FOUND', 'green');\r\n printC(`CREATING NEW CART OF TYPE ${this.CART_TYPE}`, 'green');\r\n await this._processNewCart(this.CART_TYPE);\r\n }\r\n\r\n // cache as a promise maybe?\r\n CartVerifier.instance.isVerified = true;\r\n this.bus.publish('cart-verified');\r\n // for debugging which cart is currently active\r\n // console.log(JSON.parse(JSON.stringify(cart.cart.CartLines)));\r\n }\r\n\r\n /**\r\n * swaps the cart to another specified cart via a cart data cookie\r\n *\r\n * @param toCookie cart cookie to swap to\r\n * @returns the cart or a failure\r\n */\r\n private async _processCartSwap(toCookie: CartDataCookie): Promise {\r\n printC('CART SWAPING NOW', 'blue');\r\n // this will AUTOMATICALLY set the cookie in storage, no other\r\n // processing needed\r\n const newCart = await getCartFromCookie(\r\n toCookie.cartId!.split(':'),\r\n this.props.context.actionContext\r\n );\r\n\r\n await this._triggerCartReload();\r\n\r\n return newCart;\r\n }\r\n\r\n /**\r\n * create a fresh new cart\r\n */\r\n private async _processNewCart(cookieCartType: cartType): Promise {\r\n const newCart = await this._createCart();\r\n\r\n // if the new cart was successfully created, create a cookie to match up\r\n // with the new cart\r\n if (newCart) {\r\n const newCartCookie = new CartDataCookie(\r\n this.props.context.request.cookies\r\n );\r\n newCartCookie.cartId = this.props.context.request.cookies.getCartCookie();\r\n newCartCookie.cookieType = cookieCartType;\r\n newCartCookie.save();\r\n\r\n }\r\n\r\n await this._triggerCartReload();\r\n return newCart || undefined;\r\n }\r\n\r\n /**\r\n * creates a fresh and new empty cart\r\n *\r\n * @returns cart id\r\n */\r\n private async _createCart(): Promise {\r\n // this will AUTOMATICALLY set the cookie in storage, no other\r\n // processing needed\r\n const newCart = await createNewCart(this.props.context.actionContext);\r\n if (newCart) {\r\n return newCart;\r\n } else { console.error('[CartManager] failed new cart load'); }\r\n }\r\n\r\n private async _triggerCartReload(): Promise {\r\n const cart = await this.props.data.cart;\r\n\r\n // IMPORTANT - this line modified a private variable within the\r\n // cart's source code. this allows us to reinitialise the cart\r\n // with the correct carts changes without refreshing the page\r\n // @ts-ignore\r\n cart.isInitialized = false;\r\n await cart.initialize();\r\n\r\n // taken from addtocart.component.tsx:updateCart()\r\n setTimeout(async () => {\r\n const context = this.props.context;\r\n const cartInput = new GlobalStateInput('CARTSTATE', BaseCartState, context.actionContext.requestContext.apiSettings);\r\n context.actionContext.update(cartInput, cart);\r\n await cart.refreshCart({});\r\n\r\n // tslint:disable-next-line: no-typeof-undefined\r\n if (typeof window !== 'undefined') {\r\n const curUrl = new URL(window.location.href);\r\n\r\n if (\r\n this.props.config.refreshOnAction &&\r\n !this.props.config.redirectPage?.destinationUrl &&\r\n !curUrl.searchParams.has('mg_refresh')\r\n ) {\r\n printC('REFRESHING PAGE', 'BLACK');\r\n curUrl.searchParams.set('mg_refresh', 'true');\r\n window.location.href = curUrl.href;\r\n }\r\n }\r\n }, 10);\r\n }\r\n\r\n /**\r\n * checks if theres a mix of club items and not\r\n *\r\n * @returns if cart need a repair\r\n */\r\n private async _doesCartNeedRepair(): Promise {\r\n const cartState = await this.props.data.cart;\r\n const lines = cartState.cart.CartLines || [];\r\n\r\n const clubCookie = new CartDataCookie(this.props.context.request.cookies);\r\n const wineCookie = new CartDataCookie(this.props.context.request.cookies);\r\n clubCookie.load(cartType.CLUB);\r\n wineCookie.load(cartType.WINE);\r\n\r\n // we need at least one of these to exist to test. if both are undefined\r\n // it will pass the test and cause a cart repair where its not needed.\r\n // (will infinite refresh loop new customers)\r\n if (clubCookie.cartId !== undefined || wineCookie.cartId !== undefined) {\r\n if (clubCookie.cartId === wineCookie.cartId) {\r\n return true;\r\n }\r\n }\r\n\r\n let hasClubItem: boolean = false;\r\n let hasWineItem: boolean = false;\r\n\r\n for (const line of lines) {\r\n if (hasClubItem && hasWineItem) { break; }\r\n const isClubItem = this._clubItemIds.find(itemId => +itemId === line.ProductId);\r\n if (isClubItem) { hasClubItem = true; } else { hasWineItem = true; }\r\n }\r\n\r\n // no item exception\r\n if (!hasClubItem && !hasWineItem) { return false; }\r\n\r\n // if cart has more than 1 club item\r\n if (hasClubItem && lines.length !== 1) { return true; }\r\n if (lines.length === 0) { return true; }\r\n\r\n // if is cart mixed logic\r\n\r\n // true, false => false\r\n // false, true => false\r\n // true, true => true\r\n return !(hasWineItem && !hasClubItem || !hasWineItem && hasClubItem);\r\n }\r\n\r\n /**\r\n * sorts cart based on club / nonclub items\r\n *\r\n * @param lines cart lines to sort\r\n * @returns sorted lines\r\n */\r\n private _sortCart(lines: CartLine[]): { club: CartLine[]; nonclub: CartLine[] } {\r\n const nonclub: CartLine[] = [];\r\n const club: CartLine[] = [];\r\n for (const line of lines) {\r\n const hasItem = this._clubItemIds.includes(`${line.ProductId}` || '');\r\n\r\n if (!hasItem) {\r\n nonclub.push(line);\r\n } else {\r\n club.push(line);\r\n }\r\n }\r\n return { club, nonclub };\r\n }\r\n\r\n /**\r\n * removes items from the cart based by line\r\n *\r\n * @param items items to remove\r\n * @returns the result of removal\r\n */\r\n private async _removeCartItems(items: CartLine[]): Promise {\r\n const lineIds = items.map(item => item.LineId!);\r\n\r\n const cartState = await this.props.data.cart;\r\n return cartState.removeCartLines({\r\n cartLineIds: lineIds\r\n });\r\n }\r\n\r\n private async _addCartItems(items: { id: number; amount: number }[]): Promise {\r\n for (const item of items) {\r\n await CartUtilities.addItem({\r\n context: this.props.context,\r\n recordId: item.id,\r\n amount: item.amount\r\n }, true);\r\n }\r\n }\r\n\r\n private async _isValidClubCart(): Promise {\r\n const cartState = await this.props.data.cart;\r\n const lines = cartState.cart.CartLines || [];\r\n if (lines.length === 0) { return false; } // empty carts are not valid\r\n for (const line of lines) {\r\n const isClubItem = this._clubItemIds.find(id => +id === line.ProductId);\r\n if (!isClubItem) { return false; }\r\n }\r\n return true;\r\n }\r\n\r\n private async _isValidWineCart(): Promise {\r\n const cartState = await this.props.data.cart;\r\n const lines = cartState.cart.CartLines || [];\r\n if (lines.length === 0) { return false; } // empty carts are not valid\r\n for (const line of lines) {\r\n const isClubItem = this._clubItemIds.find(id => +id === line.ProductId);\r\n if (isClubItem) { return false; }\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * take an anon cart cookie, possibly from a cart merge and set it as a\r\n * proper cart save\r\n *\r\n * why do this? for some reason if we dont take cart ownership here, the\r\n * anon carts items dont persist and get removed. this is essentially used\r\n * as a prevalidation check to make sure our cart cookies match post cart\r\n * merge (the cart cookie gets a new id when you merge)\r\n */\r\n private async _autoSetAnonCartCookie(): Promise {\r\n printC(`ENTER AUTOSET ANON CART COOKIE----------------------------------`, 'green');\r\n const isClubCart = await this._isValidClubCart();\r\n const isWineCart = await this._isValidWineCart();\r\n printC(`VALID CLUB CART IS ${isClubCart}`, 'green');\r\n printC(`VALID WINE CART IS ${isWineCart}`, 'green');\r\n\r\n const cookie = new CartDataCookie(this.props.context.request.cookies);\r\n if (isClubCart) {\r\n printC('SET CUR CART COOKIE AS CLUB', 'green');\r\n cookie.cartId = this.props.context.request.cookies.getCartCookie();\r\n cookie.cookieType = cartType.CLUB;\r\n cookie.save();\r\n } else if (isWineCart) {\r\n printC('SET CUR CART COOKIE AS WINE', 'green');\r\n cookie.cartId = this.props.context.request.cookies.getCartCookie();\r\n cookie.cookieType = cartType.WINE;\r\n cookie.save();\r\n }\r\n }\r\n\r\n private _getClubItemId(): string {\r\n const wineClubs = this.props.app.config.wineClubSetup as IWineClub[] || [];\r\n const store = WineClubDataStore.getInstance().get();\r\n const club = wineClubs[store.clubId!];\r\n if (!club) {\r\n return '';\r\n }\r\n const variant = club.variants.find(cVariant => cVariant.winePreference === store.variantPreference);\r\n\r\n if (!variant) { return ''; }\r\n printC(`[_getClubItemId] retrieved ${variant.itemId} as club item`, 'orange');\r\n return variant.itemId;\r\n }\r\n\r\n private async _preserveCartSplit(): Promise {\r\n printC('ENTER PRESERVE CART SPLIT---------------------------------------', 'blue');\r\n const cartState = await this.props.data.cart;\r\n\r\n const lines = cartState.cart.CartLines || [];\r\n\r\n printC(`PRESERVING SPLIT AS ${this.CART_TYPE}`, 'blue');\r\n if (this.CART_TYPE === cartType.WINE) {\r\n const foundClubItems = lines.filter(line =>\r\n this._clubItemIds.find(id => +id === line.ProductId)\r\n );\r\n\r\n if (foundClubItems.length !== 0) {\r\n await this._removeCartItems(foundClubItems);\r\n }\r\n }\r\n\r\n if (this.CART_TYPE === cartType.CLUB) {\r\n const foundNonClubItems = lines.filter(line =>\r\n !this._clubItemIds.find(id => +id === line.ProductId)\r\n );\r\n\r\n // unfortunately at this point, we have to delete their previous\r\n // item selections to ensure that they are able to checkout their\r\n // club\r\n if (foundNonClubItems) {\r\n await this._removeCartItems(foundNonClubItems);\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default Cartmanager;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nexport default () => {\r\n return (\r\n
\r\n );\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from 'react';\r\nimport { CartUtilities } from '../../Utilities/cart-utils';\r\n\r\nimport { IClearWineclubData } from './clear-wineclub.data';\r\nimport { IClearWineclubProps } from './clear-wineclub.props.autogenerated';\r\n\r\nexport interface IClearWineclubViewProps extends IClearWineclubProps {\r\n\r\n}\r\n\r\n/**\r\n *\r\n * ClearWineclub component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass ClearWineclub extends React.PureComponent> {\r\n\r\n private _didClearWineClub: boolean = false;\r\n\r\n public render(): JSX.Element | null {\r\n\r\n if (!this._didClearWineClub && this.props.data.cart.result) {\r\n void CartUtilities.removeCartHeadExtensionProps(\r\n this.props.data.cart,\r\n this.props.context,\r\n 'WC First Name',\r\n 'WC Last Name',\r\n 'Gift recipient Email',\r\n 'Gift recipient Phone Number',\r\n 'Gift membership end date',\r\n 'WC signup',\r\n 'IsGiftedMembership',\r\n 'Wine club delivery preference',\r\n 'WC Additional Name'\r\n );\r\n this._didClearWineClub = true;\r\n }\r\n\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default ClearWineclub;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nexport default () => {\r\n return (\r\n
\r\n );\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from 'react';\r\n\r\nimport { IPageTosData } from './page-tos.data';\r\nimport { IPageTosProps } from './page-tos.props.autogenerated';\r\n\r\nexport interface IPageTosViewProps extends IPageTosProps {\r\n\r\n}\r\n\r\n/**\r\n *\r\n * PageTos component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass PageTos extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default PageTos;\r\n","import * as React from 'react';\r\nimport { WineClubDataStore } from '../../wine-club-signup/wine-club-data';\r\nimport { IPageTosData } from '../page-tos.data';\r\nimport { IPageTosProps } from '../page-tos.props.autogenerated';\r\n\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\n\r\nimport { BusLoader, LoadBus } from '../../../Utilities/event-bus';\r\n\r\nexport interface ITosCheckbox {\r\n props: IPageTosProps;\r\n}\r\n\r\n/**\r\n * renders the state of the TOS checkbox\r\n */\r\n@LoadBus('tos')\r\n@observer\r\nexport class TosCheckbox extends React.Component {\r\n\r\n private bus: BusLoader | undefined;\r\n\r\n // set of actions able to create persisted behaviour for the context of\r\n // where the module was placed\r\n private _modulePersist: { location: string; doPersistance(): void }[] = [\r\n {\r\n location: 'wine-club-signup',\r\n doPersistance: () => {\r\n const store = WineClubDataStore.getInstance().get();\r\n this._isChecked = store.tosAgree;\r\n }\r\n }\r\n ];\r\n\r\n @observable private _isChecked: boolean = false;\r\n\r\n constructor(props: ITosCheckbox) {\r\n super(props);\r\n\r\n this._onAgreementChange = this._onAgreementChange.bind(this);\r\n this._applyPersistableTOS();\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n
\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n private _onAgreementChange(): void {\r\n this._isChecked = !this._isChecked;\r\n this.bus!.publish('tos-agreement-changed', this._isChecked);\r\n }\r\n\r\n private _applyPersistableTOS(): void {\r\n // parent id is the parent that the module was slotted into, needs a bit\r\n // of cleanup, so we use startsWith as it ends with __XXXX\r\n const { parentId } = this.props.props;\r\n if (parentId) {\r\n const foundAPersist = this._modulePersist\r\n .find(module => parentId.startsWith(module.location));\r\n if (foundAPersist) {\r\n foundAPersist.doPersistance();\r\n }\r\n }\r\n }\r\n}","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport { TosCheckbox } from './components/tos-checkbox';\r\nimport { IPageTosViewProps } from './page-tos';\r\n\r\nexport default (props: IPageTosViewProps) => {\r\n return (\r\n
\r\n \r\n \r\n
\r\n );\r\n};\r\n","import { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { wineClubShippingLabels } from '../../settings/app.settings';\r\n\r\nexport type WineClubDataRef = {\r\n variantPreference: string | null;\r\n forMyself: boolean | null;\r\n deliveryType: DeliveryType;\r\n clubId: number | null;\r\n tosAgree: boolean;\r\n pickupLocationId?: string;\r\n};\r\n\r\nexport type DeliveryType = 'STANDARD' | 'PREMIUM' | 'PICKUP';\r\nexport type DeletableKeys = 'variantPreference' | 'forMyself' | 'deliveryType' | 'clubId' | 'tosAgree' | 'pickupLocationId';\r\n\r\n/**\r\n * singleton class responsible for the users selections\r\n */\r\nexport class WineClubDataStore {\r\n private static instance: WineClubDataStore;\r\n\r\n private readonly LOCAL_STORAGE_LOCATION: string = 'WINE-CLUB-SELECTIONS';\r\n\r\n private wineClubData!: WineClubDataRef;\r\n\r\n private changeEvents: ((newData: WineClubDataRef) => void)[] = [];\r\n\r\n /**\r\n * get the current pages data\r\n * @returns singleton data of data store\r\n */\r\n public static getInstance(onChange?: (newData: WineClubDataRef) => void): WineClubDataStore {\r\n if (!WineClubDataStore.instance) {\r\n WineClubDataStore.instance = new WineClubDataStore();\r\n }\r\n\r\n if (onChange) {\r\n WineClubDataStore.instance.changeEvents.push(onChange);\r\n }\r\n\r\n return WineClubDataStore.instance;\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n public getDeliveryMapFromConfig(coreContext: ICoreContext<{ [x: string]: any }>): {\r\n standard: string; premium: string; pickup: string;\r\n } {\r\n const config = coreContext.app.config.wineClubShippingLabels || {};\r\n return {\r\n standard: config.standard,\r\n pickup: config.pickup,\r\n premium: config.premium\r\n };\r\n }\r\n\r\n public edit(newData: WineClubDataRef): void {\r\n this.wineClubData = newData;\r\n this.changeEvents.forEach(event => event(newData));\r\n this._save();\r\n }\r\n\r\n public get(): WineClubDataRef {\r\n return { ...this.wineClubData };\r\n }\r\n\r\n public deleteKeys(...keys: DeletableKeys[]): void {\r\n keys.forEach(key => delete this.wineClubData[key]);\r\n this.changeEvents.forEach(event => event(this.wineClubData));\r\n this._save();\r\n }\r\n\r\n public reset(): WineClubDataStore {\r\n this.wineClubData = {\r\n deliveryType: 'STANDARD',\r\n tosAgree: false,\r\n forMyself: null,\r\n clubId: null,\r\n variantPreference: null\r\n };\r\n this.changeEvents.forEach(event => event(this.wineClubData));\r\n this._save();\r\n return this;\r\n }\r\n\r\n public isInResetState(): boolean {\r\n const {\r\n deliveryType,\r\n tosAgree,\r\n forMyself,\r\n clubId,\r\n variantPreference\r\n } = this.wineClubData;\r\n\r\n return deliveryType === 'STANDARD' &&\r\n tosAgree === false &&\r\n forMyself === null &&\r\n clubId === null &&\r\n variantPreference === null;\r\n }\r\n\r\n private constructor() {\r\n // tslint:disable-next-line: no-typeof-undefined\r\n if (typeof window !== 'undefined') {\r\n const previousWineData = window && window.localStorage.getItem(this.LOCAL_STORAGE_LOCATION);\r\n\r\n if (!previousWineData) {\r\n this.reset();\r\n return;\r\n }\r\n\r\n this.wineClubData = JSON.parse(previousWineData);\r\n }\r\n }\r\n\r\n private _save(): void {\r\n // tslint:disable-next-line: no-typeof-undefined\r\n if (typeof window !== 'undefined') {\r\n window.localStorage.setItem(this.LOCAL_STORAGE_LOCATION, JSON.stringify(this.wineClubData));\r\n }\r\n }\r\n}"],"names":["EventBusLoader","constructor","_buses","getBus","busNamespace","this","BusLoader","subscribe","deleteBus","bind","purge","_subscriptions","subName","onPublish","nextId","IdGenerator","_readyForDeletion","id","unsubscribe","_purgeById","publish","_len","arguments","length","args","Array","_key","Object","keys","forEach","idValue","Loader","LoadBus","eventNamespace","CHILD_COMP","Component","props","super","prototype","bus","render","React","assign","ElicitAmountSelector","constProps","_this$props$cart","_this$bus","_this$bus2","_this$bus3","_setQuantity","debounce","_upQuantity","_downQuantity","_onQuantityChange","_postValidateQuantity","isSubLine","_trackedTotal","filterCartLines","cart","subscriptionLines","reaction","_this$props$cart2","_this$props$cart3","CartLines","_this$props$cart4","unrelatedLines","filter","line","LineId","cartLineId","CartUtilities","countCartLineAmount","delta","state","quantityState","currentQuantity","className","zeroAvailabilityError","shouldDisableQty","onClick","type","value","onChange","onBlur","disabled","_canAddMore","_this$bus4","setState","_this$bus5","_ref","target","parseInt","_ref2","_this$bus6","_updateQuantityRaw","__decorate","observable","observer","isSalesLine","productUrl","resources","primaryImageUrl","showImages","gridSettings","imageSettings","intlFormatter","context","cultureFormatter","product","data","num","quantityOnChange","cartLine","_isWineProduct","productId","test","_getPriceAdjustmentPercent","Price","toFixed","_getPriceDiscount","undefined","DiscountAmountWithoutTax","Quantity","DiscountLines","showDiscountPercent","NetPrice","_doubleDiscounts","DiscountCode","GiftCardFieldType","giftCardFormObj","FirstName","Key","Type","Extension","StringValue","Required","isValid","LastName","ElectronicDeliveryEmail","Attribute","ElectronicDeliveryEmailContent","_getPriceAdjustmentSavings","brandCode","brandCodeParser","description","Description","appContext","tabIndex","href","Image","src","altText","Name","_getKitDescription","productAttributes","productType","find","attribute","TextValue","_props$productAttribu","RichTextComponent","text","_generateQuantityAndPrice","nodes","priceAdjustmentSavings","ItemId","isOutOfStock","isQuantityEditable","push","_generateSelectMenu","quantity","_props$data$product$I","_props$context$reques","toLowerCase","request","channel","GiftCardItemId","cartState","key","RecordId","isLineSubscriptionLine","remove","maxQuantity","quantityDisplayString","formatCurrency","price","percentSaving","isFinite","TotalAmount","Comment","_renderGiftCardPrompt","IsGiftCardLine","giftCardFormField","setGiftCardFormField","useState","formFieldsDebounce","setFormFieldsDebounce","useEffect","setFormFieldState","unhydratedCartLineLoad","_objectSpread","field","fieldState","ExtensionProperties","property","extension","_extension$Key","_fieldState$Key","prevState","_property$Value","Value","giftCardValidation","giftCardFormIsValid","trim","RegExp","cartLineErrors","delayDebounceFn","setTimeout","updateFormFieldToCartLine","ItemTaxGroupId","cartLineOnChange","actionContext","clearTimeout","handleChange","name","event","CartVerifier","isVerified","instance","CartDataCookie","cookieContext","cookie","_PREFIX","parsedCookie","JSON","parse","cookieType","cartId","load","cartName","get","status","clear","save","set","stringify","path","maxAge","isEssential","cartType","printC","log","color","console","Cartmanager","CART_TYPE","CLUB","PERSISTENCE_MAP","WINE","config","wineClub","app","wineClubSetup","ids","club","variants","variant","itemId","componentDidMount","_processCartManager","renderView","_this$props$config$re","doCartRepair","_doesCartNeedRepair","_repairCartAndProcess","_autoSetAnonCartCookie","_processSwappableCart","_preserveCartSplit","query","redirectPage","destinationUrl","window","refId","sessionStorage","getItem","includes","removeItem","location","reload","lines","sortedItems","_sortCart","itemsForAdd","map","item","ProductId","amount","nonclub","activeClubId","_getClubItemId","_removeCartItems","_addCartItems","clubCartCookie","cookies","getCartCookie","_processNewCart","_processCartSwap","split","Id","toCookie","newCart","getCartFromCookie","_triggerCartReload","cookieCartType","_createCart","newCartCookie","createNewCart","error","isInitialized","initialize","async","cartInput","GlobalStateInput","BaseCartState","requestContext","apiSettings","update","refreshCart","_this$props$config$re2","curUrl","URL","refreshOnAction","searchParams","has","clubCookie","wineCookie","hasClubItem","hasWineItem","_clubItemIds","items","lineIds","removeCartLines","cartLineIds","addItem","recordId","isClubCart","_isValidClubCart","isWineCart","_isValidWineCart","wineClubs","store","WineClubDataStore","getInstance","clubId","cVariant","winePreference","variantPreference","foundClubItems","foundNonClubItems","computed","ClearWineclub","_didClearWineClub","result","removeCartHeadExtensionProps","PageTos","TosCheckbox","_modulePersist","doPersistance","_isChecked","tosAgree","_onAgreementChange","_applyPersistableTOS","checked","htmlFor","agreeText","parentId","foundAPersist","module","startsWith","tosText","LOCAL_STORAGE_LOCATION","changeEvents","previousWineData","localStorage","reset","wineClubData","getDeliveryMapFromConfig","coreContext","wineClubShippingLabels","standard","pickup","premium","edit","newData","_save","deleteKeys","deliveryType","forMyself","isInResetState","setItem"],"sourceRoot":""}