{"version":3,"sources":["webpack:///./src/modules/wine-club-signup/wine-club-data.ts?aeec","webpack:///./src/modules/event-schedule/event-schedule.tsx?ec01","webpack:///./src/modules/checkout-club-info-collector/components/display-info.tsx?49a6","webpack:///./src/modules/checkout-club-info-collector/components/gift-collector.tsx?adb1","webpack:///./src/modules/checkout-club-info-collector/components/member-collector.tsx?2fd5","webpack:///./src/modules/checkout-club-info-collector/checkout-club-info-collector.view.tsx?196d","webpack:///../../../src/module-state-manager/module-state.ts?7579","webpack:///../../../src/module-state-manager/with-module-state.tsx?61ca","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$?fe16","webpack:///./src/modules/checkout-club-info-collector/checkout-club-info-collector.tsx?733f","webpack:///./src/modules/conditional-container/conditional-container.tsx?2c67","webpack:///./src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.tsx?0988","webpack:///./src/Utilities/product-placement-data-helper.ts?eab5","webpack:///./src/Utilities/event-list-render.tsx?1a2e","webpack:///./src/modules/event-list/event-list.tsx?aafa","webpack:///./src/modules/checkout-date-of-birth/checkout-date-of-birth.tsx?a250","webpack:///./src/modules/offer-container/offer-container.tsx?4df0"],"names":["WineClubDataStore","constructor","LOCAL_STORAGE_LOCATION","changeEvents","window","previousWineData","localStorage","getItem","this","reset","wineClubData","JSON","parse","onChange","instance","push","getDeliveryMapFromConfig","coreContext","config","app","wineClubShippingLabels","standard","pickup","premium","edit","newData","forEach","event","_save","get","deleteKeys","keys","key","deliveryType","tosAgree","forMyself","clubId","variantPreference","isInResetState","setItem","stringify","EventSchedule","React","_productAttributeEventStartDate","_productAttributeEventEndDate","_productAttributeEventTimeRange","_productAttributeEventLocation","render","content","props","data","productSpecificationData","result","eventScheduledata","length","attributeEventLocation","filter","attribute","Name","toUpperCase","attributeEventStartDate","attributeEventEndDate","attributeEventTime","TextValue","DateTimeOffsetValue","className","_renderProductAttributes","_renderDateAttributes","productattribute","classNameValue","RichTextComponent","text","startDateAttribute","endDateAttribute","startDate","moment","format","endDate","DisplayInfo","isForSelf","_selfJSX","_giftJSX","checkoutClubInfoCollector__memberFirstName","checkoutClubInfoCollector__memberLastName","checkoutClubInfoCollector__additionalMemberFirstName","resources","firstName","lastName","additionalMemberFirstName","aggregate","checkoutClubInfoCollector__giftFirstName","checkoutClubInfoCollector__giftLastName","checkoutClubInfoCollector__giftEmail","checkoutClubInfoCollector__giftPhoneNumber","checkoutClubInfoCollector__giftEndDate","email","phoneNumber","endDateSubmit","GiftCollector","super","_firstName","_lastName","_email","_phoneNumber","_endDate","_customDate","_endDateSubmit","formData","customDate","_onChange","bind","_onChangeSelect","allowEdits","htmlFor","type","name","disabled","value","configEndDates","configDatePicker","getEndDatePulldown","id","min","add","minType","minLength","endDates","datePicker","nodes","checkoutClubInfoCollector__giftNoEndDate","dateFormatted","timeToExpireType","timeToExpire","target","dataset","map","formattedCustomDate","__decorate","observable","observer","MemberCollector","_spouseFirst","CheckoutClubInfoManager","giftData","updateData","wineClubGiftEndDate","wineClubGiftDatePicker","collectedInfo","memberData","forMember","checkoutClubInfoCollector__title","displayOnly","displayError","renderDisplayOnly","renderGiftCollector","renderMemberCollector","getCacheKey","getCacheObjectType","dataCacheType","getModuleStates","ctx","cacheKey","ModuleStatesCacheKey","moduleStates","update","withModuleState","WrappedComponent","_super","_this","typeName","context","states","actionContext","_a","hasInitialized","hasError","isRequired","isCancellable","isSubmitContainer","status","undefined","childIds","telemetry","error","moduleState","validate","isReady","isUpdating","isPending","isSkipped","isDisabled","isCancelAllowed","shouldSubmitContainer","hasExternalSubmitGroup","hasModuleState","setIsRequired","setIsCancellable","setIsSubmitContainer","setHasError","onReady","onUpdating","onPending","onSkip","onDisable","getModule","moduleId","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","init","options","__assign","Object","values","find","_moduleState","modules","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","method","childId","_validateContainer","enableControl","initializeState","__extends","ModuleState","webpackContext","req","webpackContextResolve","__webpack_require__","o","e","Error","code","resolve","exports","CheckoutClubInfoCollector","_editing","_displayOnly","_displayError","request","user","isAuthenticated","emailAddress","_store","getInstance","setState","_submitGift","_submitMember","_updateData","componentDidMount","_initAsCheckoutModule","store","renderView","submitGift","submitMember","clubAggregate","tempAggregate","_deliveryPreferenceMap","PICKUP","PREMIUM","STANDARD","giftInfo","headerEdit","IsGiftedMembership","pickupLocationId","checkoutState","checkout","CartUtilities","editCartHeadExtensionProps","checkoutCart","updateGuestCheckoutEmail","newGuestCheckoutEmail","memberInfo","cart","onEdit","onCancel","onSubmit","_formIsInvalid","catch","errors","giftAggregate","minimumDate","dateSelected","isBefore","checkoutClubInfoCollector__endDateValidationError","checkoutClubInfoCollector__firstAndLastValidationError","ConditionalContainer","affiliations","_isAffiliated","_displayPromo","slots","contentBlock","isEnabled","enabled","_isEnabled","_renderSlotItems","items","slot","index","now","startDateMoment","isValid","endDateMoment","isAfter","customer","CustomerAffiliations","declaredAffiliation","affiliation","String","RetailAffiliationId","CheckoutTermsAndConditions","state","accepted","submitted","checkbox","checked","when","isDataReady","Input","conditions","dangerouslySetInnerHTML","getRichTextHtml","_prop65Icon","prop65WarningText","legalDisclaimer","prop65Icon","src","alt","computed","mapProductPrice","productPrice","requestContext","freePriceText","originalPriceText","currentPriceText","locale","currencyCode","CurrencyCode","currentPrice","_mapNumberToIPriceRange","CustomerContextualPrice","originalPrice","Math","max","BasePrice","TradeAgreementPrice","AdjustedPrice","mapProductRating","productRating","ariaLabel","averageRating","AverageRating","totalRatings","TotalRatings","price","startingValue","eventSortKey","date","time","oldSortKey","RenderEventList","_renderEventList","maxToDisplay","maximum","eventList","_formatList","events","_sortAndTrimList","noFutureEventsJSX","_renderEvent","href","pdp","productImage","_renderDateRange","category","intro","location","priceText","soldOut","soldOutText","isRange","_renderDate","_renderMonth","_renderDay","_renderYear","list","fieldSources","default","entry","attributes","_getAttributes","debugMode","console","log","tz","timezone","dates","_dateLogic","recordId","heading","productUrl","image","Introduction","description","Body","start","end","purchaseUrl","eventUrlTitle","downloadPDFUrl","reduce","output","attributeSource","isSame","today","Date","startOf","_isEventPast","sort","event1","event2","a","b","splice","EventList","products","_getEventListItems","ratingAriaLabel","productItems","product","ProductDetails","getProductUrlSync","item","Description","ProductPrice","rating","ProductRating","PrimaryImageUrl","RecordId","ProductAttributes","mapProductCollection","_renderNoEventsMessage","events__soldOut","query","debug","siteTimezone","noEventsText","textToShow","CheckoutDateOfBirth","enteredDOB","oldEnough","dobInMs","addDOBToCart","inputRef","current","async","ExtensionProperties","extensionValue","StringValue","extensionProperties","property","extension","Key","Value","updatedCart","updateAsync","callerContext","GetCheckoutCartInput","apiSettings","refreshCart","tabIndex","role","ref","placeholder","OfferContainer","WineClubOffersBusInput","offerTaken","offerAcceptedText","wineClubId","isActive","offerExpired","contentJSX","dateLocation","_interpretDateLocation","_renderRichText"],"mappings":"wXAkBM,MAAOA,EAkFTC,cAEI,GAjFa,KAAAC,uBAAiC,uBAI1C,KAAAC,aAAuD,GA6ErC,oBAAXC,OAAwB,CAC/B,MAAMC,EAAmBD,QAAUA,OAAOE,aAAaC,QAAQC,KAAKN,wBAEpE,IAAKG,EAED,YADAG,KAAKC,QAITD,KAAKE,aAAeC,KAAKC,MAAMP,IA/Ed,mBAACQ,GAStB,OARKb,EAAkBc,WACnBd,EAAkBc,SAAW,IAAId,GAGjCa,GACAb,EAAkBc,SAASX,aAAaY,KAAKF,GAG1Cb,EAAkBc,SAItBE,yBAAyBC,GAG5B,MAAMC,EAAiCD,EAAYE,IAAID,OAAOE,wBAA0B,GACxF,MAAO,CACHC,SAAUH,EAAOG,SACjBC,OAAQJ,EAAOI,OACfC,QAASL,EAAOK,SAIjBC,KAAKC,GACRjB,KAAKE,aAAee,EACpBjB,KAAKL,aAAauB,QAAQC,GAASA,EAAMF,IACzCjB,KAAKoB,QAGFC,MACH,O,yWAAA,IAAYrB,KAAKE,cAGdoB,aAAmC,2BAArBC,EAAqB,yBAArBA,EAAqB,gBACtCA,EAAKL,QAAQM,UAAcxB,KAAKE,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,GAqJSA,a,kCChLf,oEAkBA,MAAM0B,UAAuBrb,gBAEzBzC,YAAYgD,GACRkD,MAAMlD,GACNA,EAAMyH,QAAQE,cAAcR,OACxB,IAAI4T,yBACJ,CACIC,YAAY,EACZC,kBAAmBjb,EAAM/B,OAAOgd,kBAChCC,WAAYlb,EAAM/B,OAAOid,aAK9Bpb,SACH,MAAM,SACFqb,EADE,UAEF1Z,EAFE,QAGFG,EAHE,aAIFwZ,EAJE,UAKFpa,GACAzD,KAAKyC,MAAM/B,OAEf,IAAIod,EACJ,MAAMC,EAAe/d,KAAKge,uBAAuB9Z,EAAWG,GAG5D,OAAKuZ,GAA6B,WAAjBG,GAGI,UAAjBA,IACAD,EAAa9d,KAAKie,gBAAgBJ,GAAgB,KAKjDC,IACDA,EAAa9d,KAAKoS,iBAAiBpS,KAAKyC,MAAMsP,MAAM/E,UAIpD9K,2BAASuB,UAAS,UAAKA,EAAL,qBACbqa,IAf4C,KAoBjDG,gBAAgBla,GACpB,OACI7B,gBAAC4B,oBAAiB,CAACC,KAAMA,IAWzBia,uBAAuB9Z,EAA+BG,GAC1D,MAAMmO,EAAMrO,MAGZ,GAAID,EAAW,CACX,MAAMuO,EAAkBtO,IAAOD,EAAW,cAC1C,GAAIuO,EAAgBC,WAAaF,EAAIhB,SAASiB,EAAiB,OAC3D,MAAO,SAKf,GAAIpO,EAAS,CACT,MAAMsO,EAAgBxO,IAAOE,EAAS,cACtC,GAAIsO,EAAcD,WAAaF,EAAII,QAAQD,EAAe,OACtD,MAAO,QAKf,MAAO,UAGHP,iBAAiBC,GACrB,OACInQ,gBAACA,WAAc,KACVmQ,EAAMtK,IAAI,CAACuK,EAAuBC,IAC/BrQ,gBAACA,WAAc,CAACV,IAAK+Q,GAChBD,MAQViL","file":"static/js/20.9760a54bedca974913a0.chunk.js","sourcesContent":["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}","/*---------------------------------------------------------------------------------------------\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 { RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport { IEventScheduleData } from './event-schedule.data';\r\nimport { IEventScheduleProps } from './event-schedule.props.autogenerated';\r\n\r\n/**\r\n *\r\n * EventSchedule component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass EventSchedule extends React.PureComponent<\r\n IEventScheduleProps\r\n > {\r\n private _productAttributeEventStartDate: string = 'START DATE';\r\n private _productAttributeEventEndDate: string = 'END DATE';\r\n private _productAttributeEventTimeRange: string = 'TIME RANGE';\r\n private _productAttributeEventLocation: string = 'SLR EVENT LOCATION';\r\n public render(): JSX.Element | null {\r\n const content: IEventScheduleData = this.props.data;\r\n if (\r\n !(\r\n content &&\r\n content.productSpecificationData &&\r\n content.productSpecificationData.result\r\n )\r\n ) {\r\n return null;\r\n }\r\n const eventScheduledata = content.productSpecificationData.result;\r\n if (eventScheduledata && eventScheduledata.length > 0) {\r\n const attributeEventLocation = eventScheduledata.filter(\r\n attribute => attribute.Name!.toUpperCase() === this._productAttributeEventLocation.toUpperCase());\r\n\r\n const attributeEventStartDate = eventScheduledata.filter(\r\n attribute => attribute.Name!.toUpperCase() === this._productAttributeEventStartDate.toUpperCase());\r\n\r\n const attributeEventEndDate = eventScheduledata.filter(\r\n attribute => attribute.Name!.toUpperCase() === this._productAttributeEventEndDate.toUpperCase());\r\n\r\n const attributeEventTime = eventScheduledata.filter(\r\n attribute => attribute.Name!.toUpperCase() === this._productAttributeEventTimeRange.toUpperCase());\r\n\r\n if ((attributeEventLocation && attributeEventLocation.length > 0 && attributeEventLocation[0].TextValue) ||\r\n (attributeEventStartDate && attributeEventStartDate.length > 0 && attributeEventStartDate[0].DateTimeOffsetValue) ||\r\n (attributeEventEndDate && attributeEventEndDate.length > 0 && attributeEventEndDate[0].DateTimeOffsetValue) ||\r\n (attributeEventTime && attributeEventTime.length > 0 && attributeEventTime[0].TextValue)\r\n ) {\r\n return (\r\n
\r\n {this._renderProductAttributes(\r\n attributeEventLocation,\r\n this._productAttributeEventLocation\r\n )}\r\n {this._renderDateAttributes(\r\n attributeEventStartDate,\r\n attributeEventEndDate\r\n )}\r\n {this._renderProductAttributes(\r\n attributeEventTime,\r\n this._productAttributeEventTimeRange\r\n )}\r\n
\r\n );\r\n } else { return null; }\r\n } else { return null; }\r\n }\r\n\r\n private _renderProductAttributes(\r\n productattribute: AttributeValue[],\r\n filter: string\r\n ): JSX.Element | null {\r\n if (productattribute && productattribute.length) {\r\n const classNameValue =\r\n filter === this._productAttributeEventLocation\r\n ? 'event-schedule-location'\r\n : filter === this._productAttributeEventTimeRange\r\n ? 'event-schedule-time' : '';\r\n if (productattribute[0].TextValue) {\r\n return (\r\n \r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _renderDateAttributes(\r\n startDateAttribute: AttributeValue[],\r\n endDateAttribute: AttributeValue[]\r\n ): JSX.Element | null {\r\n const classNameValue = 'event-schedule-date';\r\n const startDate = startDateAttribute && startDateAttribute.length ? moment(startDateAttribute[0].DateTimeOffsetValue).format('MMMM Do, YYYY') : null;\r\n let endDate = endDateAttribute && endDateAttribute.length ? moment(endDateAttribute[0].DateTimeOffsetValue).format('MMMM Do, YYYY') : null;\r\n\r\n if (startDate && endDate && startDate===endDate) {\r\n endDate = null;\r\n }\r\n\r\n if (startDate || endDate) {\r\n if (endDate) {\r\n return (\r\n
{`${startDate} - ${endDate}`}
\r\n );\r\n } else {\r\n return (\r\n
{startDate}
\r\n );\r\n }\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default EventSchedule;\r\n","import * as React from 'react';\r\nimport { ICheckoutClubInfoCollectorResources } from '../checkout-club-info-collector.props.autogenerated';\r\nimport { GiftData } from '../types/gift-type';\r\nimport { MemberData } from '../types/member-type';\r\n\r\nexport interface IDisplayInfo {\r\n aggregate: MemberData | GiftData;\r\n isForSelf: boolean;\r\n resources: ICheckoutClubInfoCollectorResources;\r\n}\r\n\r\n/**\r\n * displays aggregated information, non editable\r\n */\r\nexport class DisplayInfo extends React.Component {\r\n\r\n public render(): JSX.Element {\r\n if (this.props.isForSelf) {\r\n return this._selfJSX;\r\n } else {\r\n return this._giftJSX;\r\n }\r\n }\r\n\r\n public get _selfJSX(): JSX.Element {\r\n const {\r\n checkoutClubInfoCollector__memberFirstName,\r\n checkoutClubInfoCollector__memberLastName,\r\n checkoutClubInfoCollector__additionalMemberFirstName\r\n } = this.props.resources;\r\n\r\n const {\r\n firstName,\r\n lastName,\r\n additionalMemberFirstName\r\n } = this.props.aggregate as MemberData;\r\n\r\n return (\r\n
\r\n
\r\n {checkoutClubInfoCollector__memberFirstName}\r\n {firstName}\r\n
\r\n
\r\n {checkoutClubInfoCollector__memberLastName}\r\n {lastName}\r\n
\r\n
\r\n {checkoutClubInfoCollector__additionalMemberFirstName}\r\n {additionalMemberFirstName}\r\n
\r\n
\r\n );\r\n }\r\n\r\n public get _giftJSX(): JSX.Element {\r\n const {\r\n checkoutClubInfoCollector__giftFirstName,\r\n checkoutClubInfoCollector__giftLastName,\r\n checkoutClubInfoCollector__giftEmail,\r\n checkoutClubInfoCollector__giftPhoneNumber,\r\n checkoutClubInfoCollector__giftEndDate\r\n } = this.props.resources;\r\n\r\n const {\r\n firstName,\r\n lastName,\r\n email,\r\n phoneNumber,\r\n endDateSubmit\r\n } = this.props.aggregate as GiftData;\r\n\r\n return (\r\n
\r\n
\r\n {checkoutClubInfoCollector__giftFirstName}\r\n {firstName}\r\n
\r\n
\r\n {checkoutClubInfoCollector__giftLastName}\r\n {lastName}\r\n
\r\n
\r\n {checkoutClubInfoCollector__giftEmail}\r\n {email}\r\n
\r\n
\r\n {checkoutClubInfoCollector__giftPhoneNumber}\r\n {phoneNumber}\r\n
\r\n {\r\n endDateSubmit &&\r\n
\r\n {checkoutClubInfoCollector__giftEndDate}\r\n {endDateSubmit}\r\n
\r\n }\r\n
\r\n );\r\n }\r\n}","import * as React from 'react';\r\nimport { ICheckoutClubInfoCollectorResources } from '../checkout-club-info-collector.props.autogenerated';\r\n\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport moment from 'moment';\r\nimport { wineClubGiftDatePicker, wineClubGiftEndDate } from '../../../settings/app.settings';\r\nimport { GiftData } from '../types/gift-type';\r\n\r\nexport interface IGiftCollector {\r\n resources: ICheckoutClubInfoCollectorResources;\r\n allowEdits: boolean;\r\n configEndDates: wineClubGiftEndDate;\r\n configDatePicker: wineClubGiftDatePicker;\r\n formData: GiftData;\r\n onChange(giftInfo: GiftData): void;\r\n}\r\n\r\n/**\r\n * used to collect data about the current gift selections\r\n */\r\n@observer\r\nexport class GiftCollector extends React.Component {\r\n\r\n @observable private _firstName: string = '';\r\n @observable private _lastName: string = '';\r\n @observable private _email: string = '';\r\n @observable private _phoneNumber: string = '';\r\n @observable private _endDate: string = '';\r\n @observable private _customDate: string = '';\r\n @observable private _endDateSubmit: string = '';\r\n\r\n public constructor(props: IGiftCollector) {\r\n super(props);\r\n const formData: GiftData = props.formData || {};\r\n\r\n // populate form with any previous saved form data\r\n this._firstName = formData.firstName || '';\r\n this._lastName = formData.lastName || '';\r\n this._email = formData.email || '';\r\n this._phoneNumber = formData.phoneNumber || '';\r\n this._endDate = formData.endDate || '';\r\n this._customDate = formData.customDate || '';\r\n this._endDateSubmit = formData.endDateSubmit || '';\r\n\r\n this.props.onChange({\r\n firstName: this._firstName,\r\n lastName: this._lastName,\r\n email: this._email,\r\n phoneNumber: this._phoneNumber,\r\n endDate: this._endDate,\r\n customDate: this._customDate,\r\n endDateSubmit: this._endDateSubmit\r\n });\r\n\r\n this._onChange = this._onChange.bind(this);\r\n this._onChangeSelect = this._onChangeSelect.bind(this);\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n allowEdits,\r\n resources: {\r\n checkoutClubInfoCollector__giftFirstName,\r\n checkoutClubInfoCollector__giftLastName,\r\n checkoutClubInfoCollector__giftEmail,\r\n checkoutClubInfoCollector__giftPhoneNumber,\r\n checkoutClubInfoCollector__giftEndDate\r\n }\r\n } = this.props;\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 \r\n \r\n
\r\n { this.props.configEndDates || this.props.configDatePicker ?\r\n
\r\n \r\n \r\n {this.getEndDatePulldown()}\r\n \r\n { this._endDate === 'datePicker' && this.props.configDatePicker ?\r\n : ''\r\n }\r\n
: ''\r\n }\r\n
\r\n );\r\n }\r\n\r\n public getEndDatePulldown(): JSX.Element[] {\r\n const endDates = this.props.configEndDates;\r\n const datePicker = this.props.configDatePicker;\r\n const nodes = [] as JSX.Element[];\r\n\r\n // option for no end date\r\n nodes.push();\r\n\r\n // preconfigured options from global config\r\n if (endDates) {\r\n endDates.forEach(endDate => {\r\n const dateFormatted = moment().add(endDate.timeToExpireType, endDate.timeToExpire).format('MM/DD/YY');\r\n nodes.push();\r\n });\r\n }\r\n\r\n // option for custom date with calendar\r\n if (datePicker && datePicker.name) {\r\n nodes.push();\r\n }\r\n return nodes;\r\n }\r\n\r\n private _onChange(event: React.ChangeEvent): void {\r\n this[event.target.dataset.map!] = event.target.value;\r\n const formattedCustomDate = this._customDate ? moment(this._customDate).format('MM/DD/YYYY') : '';\r\n this._endDateSubmit = this._endDate !== 'datePicker' ? this._endDate : formattedCustomDate;\r\n\r\n this.props.onChange({\r\n firstName: this._firstName,\r\n lastName: this._lastName,\r\n email: this._email,\r\n phoneNumber: this._phoneNumber,\r\n endDate: this._endDate,\r\n customDate: this._customDate,\r\n endDateSubmit: this._endDateSubmit\r\n });\r\n }\r\n\r\n // needed to duplicate onChange to work with HTMLSelectElement type\r\n private _onChangeSelect(event: React.ChangeEvent): void {\r\n this[event.target.dataset.map!] = event.target.value;\r\n const formattedCustomDate = this._customDate ? moment(this._customDate).format('MM/DD/YYYY') : '';\r\n this._endDateSubmit = this._endDate !== 'datePicker' ? this._endDate : formattedCustomDate;\r\n\r\n this.props.onChange({\r\n firstName: this._firstName,\r\n lastName: this._lastName,\r\n email: this._email,\r\n phoneNumber: this._phoneNumber,\r\n endDate: this._endDate,\r\n customDate: this._customDate,\r\n endDateSubmit: this._endDateSubmit\r\n });\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { ICheckoutClubInfoCollectorResources } from '../checkout-club-info-collector.props.autogenerated';\r\n\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport { MemberData } from '../types/member-type';\r\n\r\nexport interface IMemberCollector {\r\n resources: ICheckoutClubInfoCollectorResources;\r\n allowEdits: boolean;\r\n formData: MemberData;\r\n onChange(memberInfo: MemberData): void;\r\n}\r\n\r\n/**\r\n * used to collect data about the current members info\r\n */\r\n@observer\r\nexport class MemberCollector extends React.Component {\r\n\r\n @observable private _firstName: string = '';\r\n @observable private _lastName: string = '';\r\n @observable private _spouseFirst: string = '';\r\n\r\n public constructor(props: IMemberCollector) {\r\n super(props);\r\n const formData: MemberData = props.formData || {};\r\n\r\n // populate form with any previous saved form data\r\n this._firstName = formData.firstName || '';\r\n this._lastName = formData.lastName || '';\r\n this._spouseFirst = formData.additionalMemberFirstName || '';\r\n\r\n this.props.onChange({\r\n firstName: this._firstName,\r\n lastName: this._lastName,\r\n additionalMemberFirstName: this._spouseFirst\r\n });\r\n\r\n this._onChange = this._onChange.bind(this);\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n allowEdits,\r\n resources: {\r\n checkoutClubInfoCollector__memberFirstName,\r\n checkoutClubInfoCollector__memberLastName,\r\n checkoutClubInfoCollector__additionalMemberFirstName\r\n }\r\n } = this.props;\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 );\r\n }\r\n\r\n private _onChange(event: React.ChangeEvent): void {\r\n this[event.target.dataset.map!] = event.target.value;\r\n\r\n this.props.onChange({\r\n firstName: this._firstName,\r\n lastName: this._lastName,\r\n additionalMemberFirstName: this._spouseFirst\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 * as React from 'react';\r\nimport { ICheckoutClubInfoCollectorViewProps } from './checkout-club-info-collector';\r\nimport { DisplayInfo } from './components/display-info';\r\nimport { GiftCollector } from './components/gift-collector';\r\nimport { MemberCollector } from './components/member-collector';\r\nimport { GiftData } from './types/gift-type';\r\nimport { MemberData } from './types/member-type';\r\n// import { Submit } from './components/submit';\r\n\r\n// COMMENTED OUT SUBMIT COMPONENT BECAUSE I THINK THE CHECKOUT MANAGER\r\n// CREATES A SUBMIT FOR YOU\r\n\r\nexport namespace CheckoutClubInfoManager {\r\n export const renderGiftCollector = (props: ICheckoutClubInfoCollectorViewProps) => {\r\n\r\n return (\r\n {\r\n props.updateData(giftData);\r\n }}\r\n allowEdits={props.allowEdits}\r\n configEndDates={props.app.config.wineClubGiftEndDate}\r\n configDatePicker={props.app.config.wineClubGiftDatePicker}\r\n formData={props.collectedInfo as GiftData}\r\n />\r\n );\r\n };\r\n\r\n export const renderMemberCollector = (props: ICheckoutClubInfoCollectorViewProps) => {\r\n\r\n return (\r\n {\r\n props.updateData(memberData);\r\n }}\r\n allowEdits={props.allowEdits}\r\n formData={props.collectedInfo as MemberData}\r\n />\r\n );\r\n };\r\n\r\n export const renderDisplayOnly = (props: ICheckoutClubInfoCollectorViewProps) => {\r\n return ;\r\n };\r\n}\r\n\r\nexport default (props: ICheckoutClubInfoCollectorViewProps) => {\r\n const {\r\n checkoutClubInfoCollector__title\r\n } = props.resources;\r\n\r\n const {\r\n forMember,\r\n displayOnly,\r\n displayError\r\n } = props;\r\n\r\n if (displayOnly) {\r\n return (\r\n
\r\n

{checkoutClubInfoCollector__title}

\r\n {CheckoutClubInfoManager.renderDisplayOnly(props)}\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n

{checkoutClubInfoCollector__title}

\r\n {\r\n !displayOnly && displayError &&\r\n
\r\n {displayError}\r\n
\r\n }\r\n {!forMember && CheckoutClubInfoManager.renderGiftCollector(props)}\r\n {forMember && CheckoutClubInfoManager.renderMemberCollector(props)}\r\n
\r\n );\r\n};\r\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n public getCacheObjectType = () => 'ModuleState';\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n // @ts-ignore\n let moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst withModuleState =

(WrappedComponent: React.ComponentType

): React.ComponentType

=> {\n /**\n *\n * ModuleState component\n * @extends {React.Component

}\n */\n @observer\n class ModuleState extends React.Component

{\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return ;\n }\n\n private initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // state has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id\n */\n private getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => this.update(id, { isRequired: value }),\n setIsCancellable: (value: boolean): void => this.update(id, { isCancellable: value }),\n setIsSubmitContainer: (value: boolean): void => this.update(id, { isSubmitContainer: value }),\n setHasError: (value: boolean): void => this.update(id, { hasError: value }),\n onReady: (): void => this.update(id, { status: 'ready' }),\n onUpdating: (): void => this.update(id, { status: 'updating' }),\n onPending: (): void => this.update(id, { status: 'pending' }),\n onSkip: (): void => this.update(id, { status: 'skipped' }),\n onDisable: (): void => this.update(id, { status: 'disabled' }),\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial): void => {\n if (moduleState.hasInitialized) {\n // state has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name\n */\n private getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states\n */\n private get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state\n */\n private update = (id: string, value: Partial): void => {\n // console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id],\n ...value\n };\n };\n\n private _validateLeaf = (id: string, source: Partial): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private _validateContainer = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || !module.childIds.length) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return module.childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition\n */\n private validate = (id: string, source: Partial, allMatched?: boolean, skipSkippableItem?: boolean): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || !module.childIds.length) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * hasExternalSubmitGroup\n * Module will use external submit group\n */\n private hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * hasModuleState\n * Module is using module state manager\n */\n private hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;","var map = {\n\t\"./af\": \"K/tc\",\n\t\"./af.js\": \"K/tc\",\n\t\"./ar\": \"jnO4\",\n\t\"./ar-dz\": \"o1bE\",\n\t\"./ar-dz.js\": \"o1bE\",\n\t\"./ar-kw\": \"Qj4J\",\n\t\"./ar-kw.js\": \"Qj4J\",\n\t\"./ar-ly\": \"HP3h\",\n\t\"./ar-ly.js\": \"HP3h\",\n\t\"./ar-ma\": \"CoRJ\",\n\t\"./ar-ma.js\": \"CoRJ\",\n\t\"./ar-sa\": \"gjCT\",\n\t\"./ar-sa.js\": \"gjCT\",\n\t\"./ar-tn\": \"bYM6\",\n\t\"./ar-tn.js\": \"bYM6\",\n\t\"./ar.js\": \"jnO4\",\n\t\"./az\": \"SFxW\",\n\t\"./az.js\": \"SFxW\",\n\t\"./be\": \"H8ED\",\n\t\"./be.js\": \"H8ED\",\n\t\"./bg\": \"hKrs\",\n\t\"./bg.js\": \"hKrs\",\n\t\"./bm\": \"p/rL\",\n\t\"./bm.js\": \"p/rL\",\n\t\"./bn\": \"kEOa\",\n\t\"./bn-bd\": \"loYQ\",\n\t\"./bn-bd.js\": \"loYQ\",\n\t\"./bn.js\": \"kEOa\",\n\t\"./bo\": \"0mo+\",\n\t\"./bo.js\": \"0mo+\",\n\t\"./br\": \"aIdf\",\n\t\"./br.js\": \"aIdf\",\n\t\"./bs\": \"JVSJ\",\n\t\"./bs.js\": \"JVSJ\",\n\t\"./ca\": \"1xZ4\",\n\t\"./ca.js\": \"1xZ4\",\n\t\"./cs\": \"PA2r\",\n\t\"./cs.js\": \"PA2r\",\n\t\"./cv\": \"A+xa\",\n\t\"./cv.js\": \"A+xa\",\n\t\"./cy\": \"l5ep\",\n\t\"./cy.js\": \"l5ep\",\n\t\"./da\": \"DxQv\",\n\t\"./da.js\": \"DxQv\",\n\t\"./de\": \"tGlX\",\n\t\"./de-at\": \"s+uk\",\n\t\"./de-at.js\": \"s+uk\",\n\t\"./de-ch\": \"u3GI\",\n\t\"./de-ch.js\": \"u3GI\",\n\t\"./de.js\": \"tGlX\",\n\t\"./dv\": \"WYrj\",\n\t\"./dv.js\": \"WYrj\",\n\t\"./el\": \"jUeY\",\n\t\"./el.js\": \"jUeY\",\n\t\"./en-au\": \"Dmvi\",\n\t\"./en-au.js\": \"Dmvi\",\n\t\"./en-ca\": \"OIYi\",\n\t\"./en-ca.js\": \"OIYi\",\n\t\"./en-gb\": \"Oaa7\",\n\t\"./en-gb.js\": \"Oaa7\",\n\t\"./en-ie\": \"4dOw\",\n\t\"./en-ie.js\": \"4dOw\",\n\t\"./en-il\": \"czMo\",\n\t\"./en-il.js\": \"czMo\",\n\t\"./en-in\": \"7C5Q\",\n\t\"./en-in.js\": \"7C5Q\",\n\t\"./en-nz\": \"b1Dy\",\n\t\"./en-nz.js\": \"b1Dy\",\n\t\"./en-sg\": \"t+mt\",\n\t\"./en-sg.js\": \"t+mt\",\n\t\"./eo\": \"Zduo\",\n\t\"./eo.js\": \"Zduo\",\n\t\"./es\": \"iYuL\",\n\t\"./es-do\": \"CjzT\",\n\t\"./es-do.js\": \"CjzT\",\n\t\"./es-mx\": \"tbfe\",\n\t\"./es-mx.js\": \"tbfe\",\n\t\"./es-us\": \"Vclq\",\n\t\"./es-us.js\": \"Vclq\",\n\t\"./es.js\": \"iYuL\",\n\t\"./et\": \"7BjC\",\n\t\"./et.js\": \"7BjC\",\n\t\"./eu\": \"D/JM\",\n\t\"./eu.js\": \"D/JM\",\n\t\"./fa\": \"jfSC\",\n\t\"./fa.js\": \"jfSC\",\n\t\"./fi\": \"gekB\",\n\t\"./fi.js\": \"gekB\",\n\t\"./fil\": \"1ppg\",\n\t\"./fil.js\": \"1ppg\",\n\t\"./fo\": \"ByF4\",\n\t\"./fo.js\": \"ByF4\",\n\t\"./fr\": \"nyYc\",\n\t\"./fr-ca\": \"2fjn\",\n\t\"./fr-ca.js\": \"2fjn\",\n\t\"./fr-ch\": \"Dkky\",\n\t\"./fr-ch.js\": \"Dkky\",\n\t\"./fr.js\": \"nyYc\",\n\t\"./fy\": \"cRix\",\n\t\"./fy.js\": \"cRix\",\n\t\"./ga\": \"USCx\",\n\t\"./ga.js\": \"USCx\",\n\t\"./gd\": \"9rRi\",\n\t\"./gd.js\": \"9rRi\",\n\t\"./gl\": \"iEDd\",\n\t\"./gl.js\": \"iEDd\",\n\t\"./gom-deva\": \"qvJo\",\n\t\"./gom-deva.js\": \"qvJo\",\n\t\"./gom-latn\": \"DKr+\",\n\t\"./gom-latn.js\": \"DKr+\",\n\t\"./gu\": \"4MV3\",\n\t\"./gu.js\": \"4MV3\",\n\t\"./he\": \"x6pH\",\n\t\"./he.js\": \"x6pH\",\n\t\"./hi\": \"3E1r\",\n\t\"./hi.js\": \"3E1r\",\n\t\"./hr\": \"S6ln\",\n\t\"./hr.js\": \"S6ln\",\n\t\"./hu\": \"WxRl\",\n\t\"./hu.js\": \"WxRl\",\n\t\"./hy-am\": \"1rYy\",\n\t\"./hy-am.js\": \"1rYy\",\n\t\"./id\": \"UDhR\",\n\t\"./id.js\": \"UDhR\",\n\t\"./is\": \"BVg3\",\n\t\"./is.js\": \"BVg3\",\n\t\"./it\": \"bpih\",\n\t\"./it-ch\": \"bxKX\",\n\t\"./it-ch.js\": \"bxKX\",\n\t\"./it.js\": \"bpih\",\n\t\"./ja\": \"B55N\",\n\t\"./ja.js\": \"B55N\",\n\t\"./jv\": \"tUCv\",\n\t\"./jv.js\": \"tUCv\",\n\t\"./ka\": \"IBtZ\",\n\t\"./ka.js\": \"IBtZ\",\n\t\"./kk\": \"bXm7\",\n\t\"./kk.js\": \"bXm7\",\n\t\"./km\": \"6B0Y\",\n\t\"./km.js\": \"6B0Y\",\n\t\"./kn\": \"PpIw\",\n\t\"./kn.js\": \"PpIw\",\n\t\"./ko\": \"Ivi+\",\n\t\"./ko.js\": \"Ivi+\",\n\t\"./ku\": \"JCF/\",\n\t\"./ku.js\": \"JCF/\",\n\t\"./ky\": \"lgnt\",\n\t\"./ky.js\": \"lgnt\",\n\t\"./lb\": \"RAwQ\",\n\t\"./lb.js\": \"RAwQ\",\n\t\"./lo\": \"sp3z\",\n\t\"./lo.js\": \"sp3z\",\n\t\"./lt\": \"JvlW\",\n\t\"./lt.js\": \"JvlW\",\n\t\"./lv\": \"uXwI\",\n\t\"./lv.js\": \"uXwI\",\n\t\"./me\": \"KTz0\",\n\t\"./me.js\": \"KTz0\",\n\t\"./mi\": \"aIsn\",\n\t\"./mi.js\": \"aIsn\",\n\t\"./mk\": \"aQkU\",\n\t\"./mk.js\": \"aQkU\",\n\t\"./ml\": \"AvvY\",\n\t\"./ml.js\": \"AvvY\",\n\t\"./mn\": \"lYtQ\",\n\t\"./mn.js\": \"lYtQ\",\n\t\"./mr\": \"Ob0Z\",\n\t\"./mr.js\": \"Ob0Z\",\n\t\"./ms\": \"6+QB\",\n\t\"./ms-my\": \"ZAMP\",\n\t\"./ms-my.js\": \"ZAMP\",\n\t\"./ms.js\": \"6+QB\",\n\t\"./mt\": \"G0Uy\",\n\t\"./mt.js\": \"G0Uy\",\n\t\"./my\": \"honF\",\n\t\"./my.js\": \"honF\",\n\t\"./nb\": \"bOMt\",\n\t\"./nb.js\": \"bOMt\",\n\t\"./ne\": \"OjkT\",\n\t\"./ne.js\": \"OjkT\",\n\t\"./nl\": \"+s0g\",\n\t\"./nl-be\": \"2ykv\",\n\t\"./nl-be.js\": \"2ykv\",\n\t\"./nl.js\": \"+s0g\",\n\t\"./nn\": \"uEye\",\n\t\"./nn.js\": \"uEye\",\n\t\"./oc-lnc\": \"Fnuy\",\n\t\"./oc-lnc.js\": \"Fnuy\",\n\t\"./pa-in\": \"8/+R\",\n\t\"./pa-in.js\": \"8/+R\",\n\t\"./pl\": \"jVdC\",\n\t\"./pl.js\": \"jVdC\",\n\t\"./pt\": \"8mBD\",\n\t\"./pt-br\": \"0tRk\",\n\t\"./pt-br.js\": \"0tRk\",\n\t\"./pt.js\": \"8mBD\",\n\t\"./ro\": \"lyxo\",\n\t\"./ro.js\": \"lyxo\",\n\t\"./ru\": \"lXzo\",\n\t\"./ru.js\": \"lXzo\",\n\t\"./sd\": \"Z4QM\",\n\t\"./sd.js\": \"Z4QM\",\n\t\"./se\": \"//9w\",\n\t\"./se.js\": \"//9w\",\n\t\"./si\": \"7aV9\",\n\t\"./si.js\": \"7aV9\",\n\t\"./sk\": \"e+ae\",\n\t\"./sk.js\": \"e+ae\",\n\t\"./sl\": \"gVVK\",\n\t\"./sl.js\": \"gVVK\",\n\t\"./sq\": \"yPMs\",\n\t\"./sq.js\": \"yPMs\",\n\t\"./sr\": \"zx6S\",\n\t\"./sr-cyrl\": \"E+lV\",\n\t\"./sr-cyrl.js\": \"E+lV\",\n\t\"./sr.js\": \"zx6S\",\n\t\"./ss\": \"Ur1D\",\n\t\"./ss.js\": \"Ur1D\",\n\t\"./sv\": \"X709\",\n\t\"./sv.js\": \"X709\",\n\t\"./sw\": \"dNwA\",\n\t\"./sw.js\": \"dNwA\",\n\t\"./ta\": \"PeUW\",\n\t\"./ta.js\": \"PeUW\",\n\t\"./te\": \"XLvN\",\n\t\"./te.js\": \"XLvN\",\n\t\"./tet\": \"V2x9\",\n\t\"./tet.js\": \"V2x9\",\n\t\"./tg\": \"Oxv6\",\n\t\"./tg.js\": \"Oxv6\",\n\t\"./th\": \"EOgW\",\n\t\"./th.js\": \"EOgW\",\n\t\"./tk\": \"Wv91\",\n\t\"./tk.js\": \"Wv91\",\n\t\"./tl-ph\": \"Dzi0\",\n\t\"./tl-ph.js\": \"Dzi0\",\n\t\"./tlh\": \"z3Vd\",\n\t\"./tlh.js\": \"z3Vd\",\n\t\"./tr\": \"DoHr\",\n\t\"./tr.js\": \"DoHr\",\n\t\"./tzl\": \"z1FC\",\n\t\"./tzl.js\": \"z1FC\",\n\t\"./tzm\": \"wQk9\",\n\t\"./tzm-latn\": \"tT3J\",\n\t\"./tzm-latn.js\": \"tT3J\",\n\t\"./tzm.js\": \"wQk9\",\n\t\"./ug-cn\": \"YRex\",\n\t\"./ug-cn.js\": \"YRex\",\n\t\"./uk\": \"raLr\",\n\t\"./uk.js\": \"raLr\",\n\t\"./ur\": \"UpQW\",\n\t\"./ur.js\": \"UpQW\",\n\t\"./uz\": \"Loxo\",\n\t\"./uz-latn\": \"AQ68\",\n\t\"./uz-latn.js\": \"AQ68\",\n\t\"./uz.js\": \"Loxo\",\n\t\"./vi\": \"KSF8\",\n\t\"./vi.js\": \"KSF8\",\n\t\"./x-pseudo\": \"/X5v\",\n\t\"./x-pseudo.js\": \"/X5v\",\n\t\"./yo\": \"fzPg\",\n\t\"./yo.js\": \"fzPg\",\n\t\"./zh-cn\": \"XDpg\",\n\t\"./zh-cn.js\": \"XDpg\",\n\t\"./zh-hk\": \"SatO\",\n\t\"./zh-hk.js\": \"SatO\",\n\t\"./zh-mo\": \"OmwH\",\n\t\"./zh-mo.js\": \"OmwH\",\n\t\"./zh-tw\": \"kOpN\",\n\t\"./zh-tw.js\": \"kOpN\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"RnhZ\";","/*---------------------------------------------------------------------------------------------\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 { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport { wineClubGiftDatePicker } from '../../settings/app.settings';\r\nimport { CartUtilities } from '../../Utilities/cart-utils';\r\nimport { DeliveryType, WineClubDataStore } from '../wine-club-signup/wine-club-data';\r\nimport { ICheckoutClubInfoCollectorData } from './checkout-club-info-collector.data';\r\nimport { ICheckoutClubInfoCollectorProps } from './checkout-club-info-collector.props.autogenerated';\r\nimport { GiftData } from './types/gift-type';\r\nimport { MemberData } from './types/member-type';\r\nexport interface ICheckoutClubInfoCollectorViewProps extends ICheckoutClubInfoCollectorProps, IModuleStateProps {\r\n forMember: boolean;\r\n displayError: [];\r\n displayOnly: boolean;\r\n allowEdits: boolean;\r\n collectedInfo: MemberData | GiftData;\r\n submitMember(memberInfo: MemberData): void;\r\n submitGift(giftInfo: GiftData): void;\r\n updateData(aggregate: unknown): void;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutClubInfoCollector component\r\n * @extends {React.PureComponent>}\r\n */\r\n// @ts-ignore ?\r\n@withModuleState\r\n@observer\r\nclass CheckoutClubInfoCollector extends React.Component {\r\n\r\n @observable private _editing: boolean = true;\r\n @observable private _displayOnly: boolean = false;\r\n @observable private _displayError: JSX.Element[] = [];\r\n\r\n private _store: WineClubDataStore;\r\n\r\n // since we don't know at what sort of customer they are until runtime, we\r\n // rely on the view to tell us while edits are made. we will know once\r\n // submit runs what sort of data is contained\r\n private clubAggregate!: MemberData | GiftData;\r\n\r\n // used to create temporary layer which updates state on successful submits only\r\n private tempAggregate!: MemberData | GiftData;\r\n\r\n // taken from the checkout-guest-profile autosetter. since you have to be\r\n // signed in for club this should always exist anyway\r\n private _email: string =\r\n (this.props.context &&\r\n this.props.context.request &&\r\n this.props.context.request.user &&\r\n this.props.context.request.user.isAuthenticated &&\r\n this.props.context.request.user.emailAddress) || '';\r\n\r\n constructor(props: ICheckoutClubInfoCollectorViewProps) {\r\n super(props);\r\n\r\n this._store = WineClubDataStore.getInstance(() => {\r\n this.setState({});\r\n });\r\n\r\n this._submitGift = this._submitGift.bind(this);\r\n this._submitMember = this._submitMember.bind(this);\r\n this._updateData = this._updateData.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n void this._initAsCheckoutModule();\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n\r\n const store = this._store.get();\r\n\r\n return this.props.renderView({\r\n ...this.props,\r\n submitGift: this._submitGift,\r\n submitMember: this._submitMember,\r\n updateData: this._updateData,\r\n forMember: store.forMyself,\r\n allowEdits: this._editing,\r\n collectedInfo: this.clubAggregate,\r\n displayOnly: this._displayOnly,\r\n displayError: this._displayError\r\n });\r\n }\r\n\r\n private _updateData(aggregate: MemberData | GiftData): void {\r\n this.tempAggregate = aggregate;\r\n }\r\n\r\n private _deliveryPreferenceMap(type: DeliveryType): string {\r\n return {\r\n PICKUP: 'Pickup',\r\n PREMIUM: 'Premium delivery',\r\n STANDARD: 'Standard delivery'\r\n }[type];\r\n }\r\n\r\n private async _submitGift(giftInfo: GiftData): Promise {\r\n // WC means 'wine club'\r\n this._editing = false;\r\n const store = this._store.get();\r\n const headerEdit = {\r\n 'WC First Name': giftInfo.firstName,\r\n 'WC Last Name': giftInfo.lastName,\r\n 'Gift recipient Email': giftInfo.email,\r\n 'Gift recipient Phone Number': giftInfo.phoneNumber,\r\n 'Gift membership end date': giftInfo.endDateSubmit,\r\n 'WC signup': 'True',\r\n IsGiftedMembership: 'True',\r\n 'Wine club delivery preference': this._deliveryPreferenceMap(store.deliveryType)\r\n };\r\n\r\n // pickup location id should exist here but lets just be safe about it\r\n if (store.deliveryType === 'PICKUP' && store.pickupLocationId) {\r\n headerEdit['Wine Club Pickup Location'] = store.pickupLocationId;\r\n }\r\n\r\n const checkoutState = await this.props.data.checkout;\r\n await CartUtilities.editCartHeadExtensionProps(\r\n checkoutState.checkoutCart,\r\n this.props.context,\r\n headerEdit\r\n );\r\n\r\n void checkoutState.updateGuestCheckoutEmail({ newGuestCheckoutEmail: this._email });\r\n\r\n this._editing = true;\r\n }\r\n private async _submitMember(memberInfo: MemberData): Promise {\r\n // WC means 'wine club'\r\n this._editing = false;\r\n const store = this._store.get();\r\n const headerEdit = {\r\n 'WC First Name': memberInfo.firstName,\r\n 'WC Last Name': memberInfo.lastName,\r\n 'WC Additional Name': memberInfo.additionalMemberFirstName || '',\r\n 'WC signup': 'True',\r\n IsGiftedMembership: 'False',\r\n 'Wine club delivery preference': this._deliveryPreferenceMap(store.deliveryType)\r\n };\r\n // pickup location id should exist here but lets just be safe about it\r\n if (store.deliveryType === 'PICKUP' && store.pickupLocationId) {\r\n headerEdit['Wine Club Pickup Location'] = store.pickupLocationId;\r\n }\r\n const checkoutState = await this.props.data.checkout;\r\n await CartUtilities.editCartHeadExtensionProps(\r\n checkoutState.checkoutCart,\r\n this.props.context,\r\n headerEdit\r\n );\r\n\r\n void checkoutState.updateGuestCheckoutEmail({ newGuestCheckoutEmail: this._email });\r\n\r\n this._editing = true;\r\n }\r\n\r\n private async _initAsCheckoutModule(): Promise {\r\n const cart = await this.props.data.cart;\r\n if (cart) {\r\n // the onUpdate, onReady, setHasError was copied from the\r\n // date of birth checkout implementation\r\n this.props.moduleState.init({\r\n onEdit: () => {\r\n this._editing = true;\r\n this._displayOnly = false;\r\n this._displayError = [];\r\n this.props.moduleState.onUpdating();\r\n },\r\n onCancel: () => {\r\n // reset back to last saved state\r\n this.tempAggregate = this.clubAggregate;\r\n this.props.moduleState.setHasError(false);\r\n this.props.moduleState.onReady();\r\n this._displayOnly = true;\r\n this._editing = false;\r\n this._displayError = [];\r\n },\r\n onSubmit: () => {\r\n const { forMyself } = this._store.get();\r\n if (this._formIsInvalid() && this._formIsInvalid().length) {\r\n this._displayOnly = false;\r\n this._displayError = this._formIsInvalid();\r\n this.props.moduleState.setHasError(true);\r\n this.props.moduleState.onUpdating();\r\n return;\r\n }\r\n // set club form info state after validation passed\r\n this.clubAggregate = this.tempAggregate;\r\n\r\n if (forMyself) {\r\n this._submitMember(this.clubAggregate as MemberData)\r\n .catch(e => {\r\n this.props.moduleState.setHasError(true);\r\n this._displayOnly = false;\r\n });\r\n } else {\r\n this._submitGift(this.clubAggregate as GiftData)\r\n .catch(e => {\r\n this.props.moduleState.setHasError(true);\r\n this._displayOnly = false;\r\n });\r\n }\r\n this.props.moduleState.setHasError(false);\r\n this.props.moduleState.onReady();\r\n this._displayOnly = true;\r\n },\r\n status: 'updating'\r\n });\r\n }\r\n }\r\n\r\n private _formIsInvalid(): JSX.Element[] {\r\n const aggregate: MemberData | GiftData = this.tempAggregate;\r\n const { forMyself } = this._store.get();\r\n const errors = [];\r\n\r\n // validation for gift ending date\r\n if (!forMyself) {\r\n const giftAggregate = aggregate as GiftData;\r\n const configDatePicker = this.props.app.config.wineClubGiftDatePicker as wineClubGiftDatePicker;\r\n if (giftAggregate.endDateSubmit) {\r\n const minimumDate = moment().add(configDatePicker.minType, configDatePicker.minLength || 0);\r\n const dateSelected = moment(giftAggregate.endDateSubmit);\r\n if (dateSelected && dateSelected.isBefore(minimumDate, 'days')) {\r\n errors.push\r\n (\r\n \r\n {this.props.resources.checkoutClubInfoCollector__endDateValidationError}\r\n \r\n );\r\n }\r\n }\r\n }\r\n\r\n if (aggregate.firstName === '' || aggregate.lastName === '') {\r\n errors.push\r\n (\r\n \r\n {this.props.resources.checkoutClubInfoCollector__firstAndLastValidationError}\r\n \r\n );\r\n }\r\n return errors;\r\n }\r\n}\r\n\r\nexport default CheckoutClubInfoCollector;\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 moment from 'moment';\r\nimport * as React from 'react';\r\n\r\nimport { IConditionalContainerData } from './conditional-container.data';\r\nimport {\r\n IConditionalContainerProps\r\n} from './conditional-container.props.autogenerated';\r\n\r\n//==============================================================================\r\n/**\r\n * ConditionalContainer component\r\n * @extends {React.PureComponent>}\r\n */\r\n//==============================================================================\r\nclass ConditionalContainer extends React.PureComponent> {\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n const { affiliations } = this.props.config;\r\n\r\n // If the authors have declared zero affiliations, use the other fields\r\n // logic to determine if the promo should be displayed\r\n if (!affiliations || affiliations.length === 0) {\r\n return this._displayPromo;\r\n }\r\n\r\n // If the authors have declared some afflitiations, check and ensure\r\n // that the currently logged in customer has a particular affiliation\r\n // declared by the authors.\r\n if (this._isAffiliated) {\r\n return this._displayPromo;\r\n }\r\n\r\n // If affiliations were declared and none matched the current employee,\r\n // ignore the promo and don't render\r\n return null;\r\n }\r\n\r\n private get _displayPromo(): JSX.Element | null {\r\n const { config, slots } = this.props;\r\n\r\n const hasSlots = slots && slots.contentBlock && slots.contentBlock.length;\r\n if (hasSlots) {\r\n\r\n // Ensure we should be showing our child modules\r\n const isEnabled = (config.enabled && this._isEnabled(config.startDate, config.endDate));\r\n\r\n return (\r\n \r\n {isEnabled &&\r\n this._renderSlotItems(slots.contentBlock)\r\n }\r\n \r\n );\r\n }\r\n\r\n // No slots, so there's nothing to do\r\n return null;\r\n }\r\n\r\n //==============================================================================\r\n // TSX COMPONENTS\r\n //==============================================================================\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _renderSlotItems(items: React.ReactNode[]): JSX.Element {\r\n return (\r\n \r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n }\r\n\r\n //==============================================================================\r\n // PRIVATE MEMBERS\r\n //==============================================================================\r\n\r\n //------------------------------------------------------\r\n // Determine whether the current date is between the start\r\n // and end dates.\r\n //\r\n // Start and end dates are optional, so only check if they\r\n // are present and valid.\r\n //------------------------------------------------------\r\n private _isEnabled(startDate: string | undefined, endDate: string | undefined): boolean {\r\n const now = moment();\r\n\r\n // Check to see if we should disable based on the start date\r\n if (startDate) {\r\n const startDateMoment = moment(startDate, 'MM/DD/YYYY');\r\n if (startDateMoment.isValid() && now.isBefore(startDateMoment, 'day')) {\r\n return false;\r\n }\r\n }\r\n\r\n // Check to see if we should disable based on the end date\r\n if (endDate) {\r\n const endDateMoment = moment(endDate, 'MM/DD/YYYY');\r\n if (endDateMoment.isValid() && now.isAfter(endDateMoment, 'day')) {\r\n return false;\r\n }\r\n }\r\n\r\n // We failed to fail out. Success!\r\n return true;\r\n }\r\n\r\n private get _isAffiliated(): boolean {\r\n const { affiliations } = this.props.config;\r\n const customer = this.props.data.customer.result;\r\n\r\n // we need to make sure that affiliations were loaded before continuing\r\n if (customer && customer.CustomerAffiliations) {\r\n for (const declaredAffiliation of affiliations!) {\r\n const affiliationExists =\r\n customer.CustomerAffiliations.find(affiliation => String(affiliation.RetailAffiliationId) === declaredAffiliation.id);\r\n if (affiliationExists) { return true; }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n\r\nexport default ConditionalContainer;","import { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport { computed, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport Input from 'reactstrap/lib/Input';\r\nimport { ICheckoutTermsAndConditionsData } from './checkout-terms-and-conditions.data';\r\nimport { ICheckoutTermsAndConditionsProps } from './checkout-terms-and-conditions.props.autogenerated';\r\n\r\ninterface ICheckoutTermsAndConditionsState {\r\n accepted: boolean;\r\n submitted: boolean;\r\n}\r\n\r\ninterface IProps extends ICheckoutTermsAndConditionsProps, IModuleStateProps { }\r\n\r\n/**\r\n * Checkout Terms and Conditions\r\n */\r\n// @ts-ignore\r\n@withModuleState\r\n@observer\r\nclass CheckoutTermsAndConditions extends React.Component {\r\n public state: ICheckoutTermsAndConditionsState = {\r\n accepted: false,\r\n submitted: false\r\n };\r\n\r\n @computed get isDataReady(): boolean {\r\n return (\r\n (this.props.data.checkoutState && this.props.data.checkoutState.result && this.props.data.checkoutState.status) === 'SUCCESS'\r\n );\r\n }\r\n\r\n public componentDidMount(): void {\r\n // @ts-ignore: Compiler not reconizing condition check for function params\r\n when(\r\n () => this.isDataReady,\r\n () => {\r\n this.init();\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n

\r\n \r\n
\r\n {this._prop65Icon}\r\n {this.props.config.prop65WarningText && // tslint:disable-next-line:react-no-dangerous-html\r\n }\r\n {this.props.config.legalDisclaimer && // tslint:disable-next-line:react-no-dangerous-html\r\n }\r\n
\r\n
\r\n );\r\n }\r\n\r\n private init = (): void => {\r\n const accepted = this.state.accepted;\r\n this.props.moduleState.init({\r\n status: (accepted ? 'ready' : 'updating')\r\n });\r\n };\r\n\r\n private onSubmit = (): void => {\r\n const { accepted } = this.state;\r\n if (!accepted) {\r\n this.props.moduleState.setHasError(true);\r\n } else {\r\n this.props.moduleState.onReady();\r\n this.setState({submitted: true});\r\n }\r\n };\r\n\r\n private onChange = (checkbox: React.ChangeEvent) => {\r\n this.setState({accepted: checkbox.target.checked}, () => {\r\n this.onSubmit();\r\n });\r\n };\r\n\r\n private get _prop65Icon(): JSX.Element | null {\r\n const {\r\n prop65Icon,\r\n } = this.props.config;\r\n\r\n if (prop65Icon) {\r\n return Prop 65 Icon;\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\nexport default CheckoutTermsAndConditions;","import { getProductPageUrlSync, getProductUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CategoryHierarchy, FullProduct } from '@msdyn365-commerce/commerce-entities';\r\nimport { ICoreContext, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { AttributeValue, ProductPrice, ProductRating, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IProductPlacementDataItem {\r\n description?: string;\r\n heading?: string;\r\n price?: IPrice;\r\n rating?: IRating;\r\n image?: string;\r\n productUrl?: string;\r\n recordId?: number;\r\n attributes?: AttributeValue[];\r\n}\r\nexport interface IPrice {\r\n locale: string;\r\n currencyCode: string;\r\n freePriceText: string;\r\n currentPrice?: IPriceRange;\r\n originalPrice?: IPriceRange;\r\n rangeFormatText?: string;\r\n savingsText?: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n}\r\n\r\nexport interface IRating {\r\n averageRating?: number;\r\n totalRatings?: number;\r\n ariaLabel?: string;\r\n}\r\n\r\nexport interface IPriceRange {\r\n startingValue: number;\r\n endingValue?: number;\r\n}\r\n\r\nexport function mapProductSearchResult(\r\n products: ProductSearchResult[],\r\n freePriceText: string,\r\n originalPriceText: string,\r\n currentPriceText: string,\r\n ratingAriaLabel: string,\r\n context: ICoreContext,\r\n CurrencyCode: string,\r\n category?: CategoryHierarchy\r\n): IProductPlacementDataItem[] {\r\n if (products && products.length > 0) {\r\n const productItems: IProductPlacementDataItem[] = [];\r\n products.map(product => {\r\n if (product && product !== undefined && product.RecordId !== undefined) {\r\n const productUrl = getProductPageUrlSync(product.Name || '', product.RecordId, context && context.actionContext, category);\r\n const item = {\r\n heading: product.Name,\r\n description: product.Description,\r\n price: mapProductSearchResultPrice(context.request, freePriceText, CurrencyCode, originalPriceText, currentPriceText, product.BasePrice, product.Price),\r\n rating: mapProductSearchResultRating(ratingAriaLabel, product.TotalRatings, product.AverageRating),\r\n image: product.PrimaryImageUrl,\r\n productUrl: productUrl,\r\n recordId: product.RecordId\r\n };\r\n productItems.push(item);\r\n }\r\n });\r\n return productItems;\r\n }\r\n return [];\r\n}\r\n\r\nfunction mapProductSearchResultPrice(\r\n requestContext: IRequestContext,\r\n freePriceText: string,\r\n currencyCode: string,\r\n originalPriceText: string,\r\n currentPriceText: string,\r\n productBasePrice?: number,\r\n productPrice?: number,\r\n): IPrice | undefined {\r\n if (productPrice !== undefined && requestContext) {\r\n return {\r\n locale: requestContext.locale,\r\n currencyCode: currencyCode,\r\n freePriceText: freePriceText,\r\n originalPriceText: originalPriceText,\r\n currentPriceText: currentPriceText,\r\n currentPrice: _mapNumberToIPriceRange(productPrice),\r\n originalPrice: _mapNumberToIPriceRange(productBasePrice)\r\n };\r\n }\r\n return undefined;\r\n}\r\n\r\nexport function mapProductCollection(\r\n products: FullProduct[],\r\n freePriceText: string,\r\n ratingAriaLabel: string,\r\n originalPriceText: string,\r\n currentPriceText: string,\r\n context: ICoreContext,\r\n category?: CategoryHierarchy\r\n): IProductPlacementDataItem[] {\r\n if(!products || products.length === 0) {\r\n return [];\r\n }\r\n\r\n const productItems: IProductPlacementDataItem[] = [];\r\n products.map(product => {\r\n if(product && product.ProductDetails) {\r\n const productUrl = getProductUrlSync(product.ProductDetails, context && context.actionContext, category);\r\n const item = {\r\n heading: product.ProductDetails.Name,\r\n description: product.ProductDetails.Description,\r\n price: mapProductPrice(product.ProductPrice, context.request, freePriceText, originalPriceText, currentPriceText),\r\n rating: mapProductRating(product.ProductRating, ratingAriaLabel),\r\n image: product.ProductDetails.PrimaryImageUrl,\r\n productUrl: productUrl,\r\n recordId: product.ProductDetails.RecordId,\r\n // @ts-ignore\r\n attributes: product.ProductAttributes\r\n };\r\n productItems.push(item);\r\n }\r\n });\r\n\r\n return productItems;\r\n}\r\n\r\nfunction mapProductPrice(\r\n productPrice: ProductPrice | undefined,\r\n requestContext: IRequestContext,\r\n freePriceText: string,\r\n originalPriceText: string,\r\n currentPriceText: string,\r\n): IPrice | undefined {\r\n if (productPrice && requestContext) {\r\n return {\r\n locale: requestContext.locale,\r\n currencyCode: productPrice.CurrencyCode ? productPrice.CurrencyCode : '',\r\n freePriceText: freePriceText,\r\n originalPriceText: originalPriceText,\r\n currentPriceText: currentPriceText,\r\n currentPrice: _mapNumberToIPriceRange(productPrice.CustomerContextualPrice),\r\n originalPrice: _mapNumberToIPriceRange(\r\n Math.max(productPrice.BasePrice || 0, productPrice.TradeAgreementPrice || 0, productPrice.AdjustedPrice || 0)\r\n )\r\n };\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction mapProductSearchResultRating(\r\n ariaLabel: string,\r\n productTotalRating?: number,\r\n productAverageRating?: number\r\n): IRating | undefined {\r\n if (productTotalRating && productAverageRating) {\r\n return {\r\n averageRating: productAverageRating,\r\n totalRatings: productTotalRating,\r\n ariaLabel: ariaLabel\r\n };\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction mapProductRating(\r\n productRating: ProductRating | undefined,\r\n ariaLabel: string\r\n): IRating | undefined {\r\n if (productRating) {\r\n return {\r\n averageRating: productRating.AverageRating || 0,\r\n totalRatings: productRating.TotalRatings || 0,\r\n ariaLabel: ariaLabel\r\n };\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction _mapNumberToIPriceRange(price: number | undefined): IPriceRange | undefined {\r\n if (price !== undefined) {\r\n return {\r\n startingValue: price\r\n };\r\n }\r\n return undefined;\r\n}\r\n","// ============================================================================\r\n// Renders a list of events\r\n// ============================================================================\r\nimport { getRichTextHtml, IDictionary } from '@msdyn365-commerce/core';\r\nimport moment from 'moment-timezone';\r\nimport * as React from 'react';\r\nimport { IProductAttributeProps } from './product-lightbox';\r\nimport { IPrice, IProductPlacementDataItem } from './product-placement-data-helper';\r\n\r\n// ============================================================================\r\n// INTERFACES AND CONSTANTS\r\n// ============================================================================\r\n\r\nexport interface IEventListRenderProps {\r\n events: IProductPlacementDataItem[];\r\n maximum?: number;\r\n noFutureEventsJSX: JSX.Element;\r\n timezone: string;\r\n soldOutText?: string;\r\n debugMode?: boolean;\r\n}\r\n\r\ntype maybeMoment = moment.Moment | undefined;\r\n\r\n// Internal interface for info on a single event\r\ninterface IFormattedEvent {\r\n id?: number;\r\n name?: string;\r\n description?: string;\r\n price?: IPrice;\r\n pdp?: string;\r\n category?: string;\r\n intro?: string;\r\n startDate?: maybeMoment;\r\n endDate?: maybeMoment;\r\n time?: string;\r\n location?: string;\r\n priceText?: string;\r\n purchaseUrl?: string;\r\n eventUrlTitle?: string;\r\n soldOut?: boolean;\r\n downloadPDFUrl?: string;\r\n productImage?: string;\r\n}\r\n\r\n// -------------------------------------------------------------\r\n// Hides errors by attempting to prevent ambigious values\r\n// -------------------------------------------------------------\r\nfunction eventSortKey(event: IFormattedEvent): string {\r\n const date: string = event.startDate!.format('X');\r\n\r\n return `${date}-${event.time}-${event.name}`;\r\n}\r\n\r\n// -------------------------------------------------------------\r\n// OLD, ambiguous method. Produces errors in some cases.\r\n// -------------------------------------------------------------\r\nfunction oldSortKey(event: IFormattedEvent): number {\r\n return +event.startDate!.format('X');\r\n}\r\n\r\n// =============================================================================\r\n// CLASS DEFINITION\r\n// =============================================================================\r\n/**\r\n * Event list render component\r\n */\r\nexport default class RenderEventList extends React.PureComponent {\r\n\r\n // ============================================================================\r\n // PUBLIC METHODS\r\n // ============================================================================\r\n\r\n // -------------------------------------------------------------\r\n // -------------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n return this._renderEventList();\r\n }\r\n\r\n // ============================================================================\r\n // JSX FRAGMENTS\r\n // ============================================================================\r\n\r\n // -------------------------------------------------------------\r\n // Render the event list\r\n // -------------------------------------------------------------\r\n private _renderEventList(): JSX.Element {\r\n const maxToDisplay = this.props.maximum || 999; // Default to a large number, but not ludicrously large\r\n\r\n // Format the event list\r\n let eventList: IFormattedEvent[] = this._formatList(this.props.events);\r\n\r\n // Clean up the list before display\r\n eventList = this._sortAndTrimList(eventList, maxToDisplay);\r\n\r\n // If the event list still has something to display after being trimmed\r\n // then show the list or display the no current events jsx message\r\n if (eventList.length === 0) {\r\n return this.props.noFutureEventsJSX;\r\n } else {\r\n return (\r\n
\r\n {eventList.map((event: IFormattedEvent) => (\r\n
\r\n {this._renderEvent(event)}\r\n
\r\n ))}\r\n
\r\n );\r\n }\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Render a single event\r\n // -------------------------------------------------------------\r\n // tslint:disable: react-no-dangerous-html\r\n private _renderEvent(event: IFormattedEvent): JSX.Element | null {\r\n return (\r\n \r\n
\r\n {`${event.name}\r\n
\r\n
\r\n {this._renderDateRange(event.startDate, event.endDate)}\r\n
{event.category}
\r\n {event.name}\r\n
\r\n
{event.location}
\r\n
{event.time}
\r\n
{event.priceText}
\r\n
\r\n Details\r\n
\r\n {/* \r\n
\r\n Download PDF\r\n
*/}\r\n {event.soldOut &&
{this.props.soldOutText}
}\r\n
\r\n \r\n );\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Render a single event\r\n // -------------------------------------------------------------\r\n private _renderDateRange(startDate: moment.Moment | undefined, endDate: moment.Moment | undefined): JSX.Element | null {\r\n\r\n // Early out if there's no dates\r\n if (!startDate && !endDate) {\r\n return null;\r\n }\r\n\r\n // Both: Display as range\r\n const isRange = (startDate && endDate);\r\n\r\n return (\r\n
\r\n\r\n {/* Single Date */}\r\n {!isRange &&\r\n
\r\n {this._renderDate(startDate!)}\r\n
\r\n }\r\n\r\n {/* Date Range */}\r\n {isRange &&\r\n
\r\n {this._renderDate(startDate!)}\r\n {/* No content: fill in with css */}\r\n {this._renderDate(endDate!)}\r\n
\r\n }\r\n
\r\n );\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // -------------------------------------------------------------\r\n private _renderDate(date: moment.Moment): JSX.Element {\r\n return (\r\n \r\n {this._renderMonth(date)}\r\n {this._renderDay(date)}\r\n {this._renderYear(date)}\r\n \r\n );\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Render a month in several different formats.\r\n // It's up to the css to hide unwanted versions.\r\n // -------------------------------------------------------------\r\n private _renderMonth(date: moment.Moment): JSX.Element {\r\n return (\r\n \r\n {date.format('M')}\r\n {date.format('MMM')}\r\n {date.format('MMMM')}\r\n \r\n );\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Render a year in several different formats.\r\n // It's up to the css to hide unwanted versions.\r\n // -------------------------------------------------------------\r\n private _renderYear(date: moment.Moment): JSX.Element {\r\n return (\r\n \r\n {date.format('YY')}\r\n {date.format('YYYY')}\r\n \r\n );\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Render a day in several different formats (Currently only one).\r\n // It's up to the css to hide unwanted versions.\r\n // -------------------------------------------------------------\r\n private _renderDay(date: moment.Moment): JSX.Element {\r\n return (\r\n \r\n {date.format('D')}\r\n \r\n );\r\n }\r\n\r\n // ============================================================================\r\n // PRIVATE METHODS\r\n // ============================================================================\r\n\r\n // -------------------------------------------------------------\r\n // Formats the product and attribute data into a more useful format\r\n // -------------------------------------------------------------\r\n private _formatList(list: IProductPlacementDataItem[]): IFormattedEvent[] {\r\n\r\n const fieldSources: IDictionary = {\r\n 'End Date': 'DateTimeOffsetValue',\r\n 'Start Date': 'DateTimeOffsetValue',\r\n 'Can add to cart': 'BooleanValue', // Boolean DataTypeValue: 6\r\n 'Sold Out': 'BooleanValue',\r\n\r\n default: 'TextValue'\r\n };\r\n\r\n return list.map((entry) => {\r\n // @ts-ignore\r\n const attributes = this._getAttributes(entry.attributes, fieldSources);\r\n\r\n if (this.props.debugMode) {\r\n console.log('Event Attributes', attributes);\r\n }\r\n\r\n const startDate = attributes['Start Date'] ? moment.tz(attributes['Start Date'], this.props.timezone) : undefined;\r\n const endDate = attributes['End Date'] ? moment.tz(attributes['End Date'], this.props.timezone) : undefined;\r\n const dates = this._dateLogic(startDate, endDate);\r\n return {\r\n id: entry.recordId,\r\n name: entry.heading,\r\n price: entry.price,\r\n pdp: entry.productUrl,\r\n productImage: entry.image,\r\n\r\n category: attributes['SLR Event Type'],\r\n intro: attributes.Introduction,\r\n description: attributes.Body, // PDP only\r\n startDate: dates.start,\r\n endDate: dates.end,\r\n time: attributes['Time Range'],\r\n location: attributes['SLR Event Location'],\r\n priceText: attributes['Event Price Info'],\r\n\r\n purchaseUrl: attributes['Event Purchase URL'],\r\n eventUrlTitle: attributes['Event URL Title'],\r\n downloadPDFUrl: attributes['Download PDF URL'],\r\n\r\n soldOut: attributes['Sold Out']\r\n };\r\n });\r\n\r\n /* OTHER ATTRIBUTES\r\n Event purchase\r\n Event Purchase URL\r\n Event URL Title\r\n Featured Y/N\r\n Video Caption\r\n Video Title\r\n */\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Converts the attribute list into a simple hash\r\n // -------------------------------------------------------------\r\n // tslint:disable-next-line:no-any\r\n private _getAttributes(attributes: IProductAttributeProps[], fieldSources: IDictionary): IDictionary {\r\n\r\n return attributes.reduce((output, attribute) => {\r\n if (attribute.Name) {\r\n const attributeSource = fieldSources[attribute.Name] || fieldSources.default;\r\n (output[attribute.Name] = attribute[attributeSource]);\r\n }\r\n\r\n return output;\r\n }, {}); // <--- I hate the `align` rule\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Date logic:\r\n // Only start date: Good\r\n // Only end date: Move to start date\r\n // Start and end are the same: Remove end date\r\n // Both: Display as range\r\n // -------------------------------------------------------------\r\n private _dateLogic(startDate: moment.Moment | undefined, endDate: moment.Moment | undefined): { start: maybeMoment; end: maybeMoment } {\r\n // Only end date: Move to start date\r\n if (endDate && !startDate) {\r\n startDate = endDate;\r\n endDate = undefined;\r\n }\r\n\r\n // Start and end are the same: Remove end date\r\n if (startDate && startDate.isSame(endDate, 'day')) {\r\n endDate = undefined;\r\n }\r\n\r\n return {\r\n start: startDate,\r\n end: endDate\r\n };\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Sort the list by date, then trim it.\r\n //\r\n // @FIXME/dg: These should ideally be handled by the server query\r\n // to minimize request size\r\n // -------------------------------------------------------------\r\n private _sortAndTrimList(eventList: IFormattedEvent[], maxToDisplay: number): IFormattedEvent[] {\r\n\r\n // subtracting 1 from the current date so that we are able to show events\r\n // on the day of; since we are using the isBefore method.\r\n const today = moment.tz(Date.now(), this.props.timezone)\r\n .startOf('day');\r\n\r\n // Filter out events with no dates (logic has already occurred)\r\n eventList = eventList.filter((event: IFormattedEvent) => {\r\n\r\n // ensure events have a starting date at least, end date is unreliable\r\n if (event.startDate) {\r\n\r\n // Remove events that have past\r\n return !this._isEventPast(event, today);\r\n }\r\n\r\n return false;\r\n });\r\n\r\n // Sort the list by date\r\n // @FIXME/dg: Band-aid version. Messy! Move to its own function if we keep this.\r\n if (eventList.length) {\r\n eventList = eventList.sort((event1, event2) => {\r\n const a = this.props.debugMode ? oldSortKey(event1) : eventSortKey(event1);\r\n const b = this.props.debugMode ? oldSortKey(event2) : eventSortKey(event2);\r\n\r\n if (a < b) {\r\n return -1;\r\n } else if (a > b) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n });\r\n }\r\n\r\n // Trim unwanted events\r\n if (eventList.length &&\r\n maxToDisplay &&\r\n (eventList.length > maxToDisplay)\r\n ) {\r\n eventList.splice(maxToDisplay);\r\n }\r\n\r\n return eventList;\r\n }\r\n\r\n // -------------------------------------------------------------\r\n // Determine if an event is passed the day given\r\n // -------------------------------------------------------------\r\n private _isEventPast(event: IFormattedEvent, date: moment.Moment): boolean {\r\n const { startDate, endDate } = event;\r\n\r\n // we want to use the date the references the events closure the closest\r\n const furthestDate = endDate || startDate!;\r\n return furthestDate.isBefore(date, 'day');\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 { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\r\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\r\nimport { mapProductCollection } from '../../Utilities/product-placement-data-helper';\r\nimport { IEventListData } from './event-list.data';\r\nimport { IEventListProps } from './event-list.props.autogenerated';\r\n\r\nimport RenderEventList from '../../Utilities/event-list-render';\r\n\r\n// ==============================================================================\r\n// CLASS DEFINITION\r\n// ==============================================================================\r\n/**\r\n *\r\n * EventList component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass EventList extends React.Component> {\r\n\r\n // =============================================================================\r\n // PUBLIC METHODS\r\n // =============================================================================\r\n\r\n // --------------------------------------------------------------\r\n // --------------------------------------------------------------\r\n public render(): JSX.Element {\r\n const { config, context, data } = this.props;\r\n\r\n const products: FullProduct[] = this._getEventListItems();\r\n\r\n if (products && products.length) {\r\n const eventList = mapProductCollection(\r\n products.filter(product => product.ProductDetails && product.ProductDetails.Name),\r\n 'Free',\r\n '',\r\n '',\r\n '',\r\n context,\r\n (data.category && data.category.result) || undefined\r\n );\r\n\r\n if (eventList && eventList.length !== 0) {\r\n return (\r\n \r\n );\r\n } else {\r\n console.log('Could not map product collection to product placement item succesfully');\r\n }\r\n }\r\n return this._renderNoEventsMessage();\r\n }\r\n\r\n // =============================================================================\r\n // JSX FRAGMENTS\r\n // =============================================================================\r\n\r\n // --------------------------------------------------------------\r\n // If no events are present, render this instead of the events\r\n // list\r\n // --------------------------------------------------------------\r\n private _renderNoEventsMessage(): JSX.Element {\r\n const { noEventsText } = this.props.config;\r\n\r\n const textToShow = noEventsText || 'No Events';\r\n\r\n return (\r\n // tslint:disable-next-line: react-no-dangerous-html\r\n \r\n );\r\n }\r\n\r\n // =============================================================================\r\n // PRIVATE METHODS\r\n // =============================================================================\r\n\r\n // --------------------------------------------------------------\r\n // Construct the event list data\r\n // --------------------------------------------------------------\r\n private _getEventListItems(): FullProduct[] {\r\n const { data } = this.props;\r\n let products: FullProduct[] = [];\r\n\r\n // TODO: May need to add refineSearch in future.\r\n // const refineSearchProducts = this.props.data.refineSearchProducts && this.props.data.refineSearchProducts.result;\r\n // if (refineSearchProducts && refineSearchProducts.refinementCriteria && refineSearchProducts.refinementCriteria.length) {\r\n // if (refineSearchProducts.productSearchResult && refineSearchProducts.productSearchResult.length) {\r\n // products = refineSearchProducts.productSearchResult;\r\n // }\r\n // }\r\n\r\n if (data.products && data.products.result && data.products.result.length > 0) {\r\n products = data.products.result;\r\n }\r\n\r\n return products;\r\n }\r\n}\r\n\r\nexport default EventList;","import { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { GetCheckoutCartInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { computed, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport { ICheckoutDateOfBirthData } from './checkout-date-of-birth.data';\r\nimport { ICheckoutDateOfBirthProps } from './checkout-date-of-birth.props.autogenerated';\r\n\r\ninterface ICheckoutDateOfBirthState {\r\n date: string | null;\r\n submitted: boolean;\r\n}\r\n\r\ninterface IProps extends ICheckoutDateOfBirthProps, IModuleStateProps { }\r\n\r\nconst MIN_AGE = 662695446000; // 21 years in ms\r\nconst MAX_BIRTHDAY = -30610195622000; // 1000-01-01 in ms\r\n\r\n/**\r\n * Checkout Terms and Conditions\r\n */\r\n// @ts-ignore\r\n@withModuleState\r\n@observer\r\nclass CheckoutDateOfBirth extends React.Component {\r\n @computed get isDataReady(): boolean {\r\n return (\r\n (this.props.data.checkoutState && this.props.data.checkoutState.result && this.props.data.checkoutState.status) === 'SUCCESS'\r\n );\r\n }\r\n\r\n public state: ICheckoutDateOfBirthState = {\r\n date: '',\r\n submitted: false\r\n };\r\n\r\n private inputRef: React.RefObject;\r\n\r\n constructor(props: IProps) {\r\n super(props);\r\n // debounded function seems to lose input so we'll use a ref\r\n this.inputRef = React.createRef();\r\n console.log('starting...');\r\n }\r\n\r\n public componentDidMount(): void {\r\n // @ts-ignore: Compiler not reconizing condition check for function params\r\n when(\r\n () => this.isDataReady,\r\n () => {\r\n this.init();\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const hasError = this.props.moduleState.hasError;\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 private init = (): void => {\r\n this.props.moduleState.init({\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n status: 'updating'\r\n });\r\n };\r\n\r\n private onEdit = (): void => {\r\n this.setState({ submitted: false });\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private onSubmit = (): void => {\r\n const enteredDOB = this.state.date || '';\r\n let oldEnough = false;\r\n try {\r\n const dobInMs = Date.parse(enteredDOB);\r\n // @ts-ignore\r\n const ageInMs = Date.now() - dobInMs;\r\n oldEnough = ageInMs > MIN_AGE && dobInMs > MAX_BIRTHDAY;\r\n } catch(e) {\r\n // failed to parse.\r\n }\r\n\r\n if (!oldEnough) {\r\n this.props.moduleState.setHasError(true);\r\n } else {\r\n // tslint:disable-next-line: no-floating-promises\r\n void this.addDOBToCart();\r\n this.props.moduleState.setHasError(false);\r\n this.props.moduleState.onReady();\r\n this.setState({ submitted: true });\r\n }\r\n };\r\n\r\n private onCancel = (): void => {\r\n this.props.moduleState.setHasError(false);\r\n this.props.moduleState.onReady();\r\n this.setState({ submitted: true });\r\n };\r\n\r\n private onChange = () => {\r\n const date = this.inputRef.current && this.inputRef.current.value;\r\n this.setState({date});\r\n };\r\n\r\n private addDOBToCart = async () => {\r\n const checkoutState = this.props.data.checkoutState && this.props.data.checkoutState.status === 'SUCCESS' && this.props.data.checkoutState.result;\r\n if (!checkoutState || !checkoutState.checkoutCart || !checkoutState.checkoutCart.cart || !checkoutState.checkoutCart.cart.ExtensionProperties || !this.state.date) {\r\n this.props.context.telemetry.error('Failed to add DOB to Cart. Unable to load cart');\r\n return;\r\n } else {\r\n const extensionValue = {\r\n StringValue: moment(this.state.date).format('MM/DD/YYYY')\r\n };\r\n const extensionProperties = checkoutState.checkoutCart.cart.ExtensionProperties as CommerceProperty[] | undefined;\r\n if(extensionProperties) {\r\n const property = extensionProperties.find((extension) => extension.Key === 'Birthday');\r\n if (!property) {\r\n extensionProperties.push({\r\n Key: 'Birthday',\r\n Value: extensionValue\r\n });\r\n } else {\r\n property.Value = extensionValue;\r\n }\r\n\r\n const updatedCart = await updateAsync({ callerContext: this.props.context.actionContext }, checkoutState.checkoutCart.cart);\r\n this.props.context.actionContext.update(new GetCheckoutCartInput(this.props.context.request.apiSettings), updatedCart);\r\n // tslint:disable-next-line: no-floating-promises\r\n void ((await this.props.data.checkoutState).checkoutCart).refreshCart({});\r\n }\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutDateOfBirth;\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 moment from 'moment';\r\nimport * as React from 'react';\r\n\r\nimport { RichText, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { WineClubOffersBusInput } from '../../dataActions/wine-club-offers-bus';\r\nimport { IOfferContainerData } from './offer-container.data';\r\nimport { IOfferContainerProps } from './offer-container.props.autogenerated';\r\n\r\n/**\r\n *\r\n * OfferContainer component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass OfferContainer extends React.PureComponent> {\r\n\r\n constructor(props: IOfferContainerProps) {\r\n super(props);\r\n props.context.actionContext.update(\r\n new WineClubOffersBusInput(),\r\n {\r\n offerTaken: false,\r\n offerAcceptedText: props.config.offerAcceptedText,\r\n wineClubId: props.config.wineClubId\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n isActive,\r\n startDate,\r\n endDate,\r\n offerExpired,\r\n className\r\n } = this.props.config;\r\n\r\n let contentJSX: JSX.Element | undefined;\r\n const dateLocation = this._interpretDateLocation(startDate, endDate);\r\n\r\n // don't render when declared inactive or is before\r\n if (!isActive || dateLocation === 'BEFORE') { return null; }\r\n\r\n // if current date is after, show expired JSX\r\n if (dateLocation === 'AFTER') {\r\n contentJSX = this._renderRichText(offerExpired || '');\r\n }\r\n\r\n // if all checks were passed and there wasn't any proper addition to the\r\n // content, render all the slots and use that as content instead\r\n if (!contentJSX) {\r\n contentJSX = this._renderSlotItems(this.props.slots.modules);\r\n }\r\n\r\n return (\r\n
\r\n {contentJSX}\r\n
\r\n );\r\n }\r\n\r\n private _renderRichText(text: RichText): JSX.Element {\r\n return (\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n // Determine whether the current date is between the start\r\n // and end dates.\r\n //\r\n // Start and end dates are optional, so only check if they\r\n // are present and valid.\r\n //------------------------------------------------------\r\n private _interpretDateLocation(startDate: string | undefined, endDate: string | undefined): 'BEFORE' | 'AFTER' | 'CURRENT' {\r\n const now = moment();\r\n\r\n // Check to see if it is currently before the given start date\r\n if (startDate) {\r\n const startDateMoment = moment(startDate, 'MM/DD/YYYY');\r\n if (startDateMoment.isValid() && now.isBefore(startDateMoment, 'day')) {\r\n return 'BEFORE';\r\n }\r\n }\r\n\r\n // Check to see if it is currently after the given end date\r\n if (endDate) {\r\n const endDateMoment = moment(endDate, 'MM/DD/YYYY');\r\n if (endDateMoment.isValid() && now.isAfter(endDateMoment, 'day')) {\r\n return 'AFTER';\r\n }\r\n }\r\n\r\n // We are inbetween both start and end date\r\n return 'CURRENT';\r\n }\r\n\r\n private _renderSlotItems(items: React.ReactNode[]): JSX.Element {\r\n return (\r\n \r\n {items.map((slot: React.ReactNode, index: number) => (\r\n \r\n {slot}\r\n \r\n ))}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default OfferContainer;\r\n"],"sourceRoot":""}