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,EAAM+L,aAAc/L,EAAM5F,WAC3F,MAAO8E,GACLuN,QAAQC,IAAIxN,GAEhB,OAAOyN,MAAMC,QAAQ7R,GAAUA,EAAO,GAAKA,CAC/C,EAE+C+E,EAAAA,EAAAA,IAA2B,CACtEC,OAA2DnB,EAC3DoB,MAvBiB6M,GACVA","sources":["webpack://Citta2.0/./src/modules/citta-account-subscription/citta-account-subscription.tsx?2496","webpack://Citta2.0/./src/data-actions/geo-location/bing-maps-locations.ts?cfec","webpack://Citta2.0/./src/modules/citta-freight-charges/citta-freight-charges.tsx?aecb","webpack://Citta2.0/./src/modules/citta-unsubscribe/citta-unsubscribe.tsx?5df8","webpack://Citta2.0/./src/modules/citta-user-subscribed/citta-user-subscribed.tsx?9a50","webpack://Citta2.0/./src/modules/citta-account-subscription/citta-account-subscription.view.tsx?d603","webpack://Citta2.0/./src/modules/citta-freight-charges/citta-freight-charges.view.tsx?0bed","webpack://Citta2.0/./src/modules/citta-unsubscribe/citta-unsubscribe.view.tsx?a772","webpack://Citta2.0/./src/modules/citta-user-subscribed/citta-user-subscribed.view.tsx?cddd","webpack://Citta2.0/./src/data-actions/subscribe-email/subscribe-email-data.ts?c8e3"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\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 { Button, IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\n\r\nimport { ICittaAccountSubscriptionData } from './citta-account-subscription.data';\r\nimport { ICittaAccountSubscriptionProps } from './citta-account-subscription.props.autogenerated';\r\n\r\nimport { IDXC_SubscribeNewsletterRealtimeResponse } from '../../data-actions/generated/DataServiceEntities.g';\r\nimport { subscribeEmailAction, SubscribeEmailDataActionInput } from './../../data-actions/subscribe-email/subscribe-email-data';\r\n\r\nexport interface ICittaAccountSubscriptionViewProps extends ICittaAccountSubscriptionProps {\r\n hasAccountDetails: boolean;\r\n isProcessing: boolean;\r\n subUnsubButtton: React.ReactNode;\r\n subscribeNote: React.ReactNode;\r\n subscribeAlert: React.ReactNode;\r\n AccountSubscriptionWrapper: IModuleProps;\r\n subscribeResponse: React.ReactNode;\r\n AccountSubscriptionAttribute: INodeProps;\r\n AccountSubscriptionProcessing: INodeProps;\r\n AccountSubscriptionUnSubscribe: INodeProps;\r\n processingMessage: React.ReactNode;\r\n}\r\n\r\ninterface ICittaAccountSubscriptionState {\r\n alertMessage: string;\r\n alertClass: string;\r\n userEmail: string;\r\n isSubscribed: boolean;\r\n hasAccountDetails: boolean;\r\n isProcessing: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * CittaAccountSubscription component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CittaAccountSubscription extends React.PureComponent, ICittaAccountSubscriptionState> {\r\n constructor(props: ICittaAccountSubscriptionViewProps) {\r\n super(props);\r\n this._handleSubscribeClick = this._handleSubscribeClick.bind(this);\r\n this._handleUnsubscribeClick = this._handleUnsubscribeClick.bind(this);\r\n const email = this.props.data && this.props.data.accountInformation && this.props.data.accountInformation.result?.Email;\r\n const subscribed = this._getSubscriptionState();\r\n const hasDetails = email !== undefined && subscribed !== undefined;\r\n\r\n this.state = {\r\n alertMessage: '',\r\n alertClass: '',\r\n userEmail: email || '',\r\n isSubscribed: subscribed || false,\r\n hasAccountDetails: hasDetails,\r\n isProcessing: false\r\n };\r\n }\r\n\r\n public componentDidUpdate(prevProps: ICittaAccountSubscriptionViewProps): void {\r\n if (this.props.data !== prevProps.data) {\r\n const { result } = this.props.data.accountInformation;\r\n if (result) {\r\n const email: string = this.props.data.accountInformation.result?.Email || '';\r\n const subscribed: boolean = this._getSubscriptionState() || false;\r\n const hasDetails1 = email !== undefined && subscribed !== undefined;\r\n this.setState({ userEmail: email, isSubscribed: subscribed, hasAccountDetails: hasDetails1 });\r\n }\r\n }\r\n\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { hasAccountDetails, isProcessing } = this.state;\r\n const { config } = this.props;\r\n const CittaAccountSubscriptionViewProps = {\r\n ...this.props,\r\n AccountSubscriptionWrapper: {\r\n moduleProps: this.props,\r\n className: classnames('citta-account-subscription', config.className)\r\n },\r\n AccountSubscriptionAttribute: {\r\n className: 'citta-account-has-account'\r\n },\r\n AccountSubscriptionProcessing: {\r\n className: 'citta-account-subscription-processing'\r\n },\r\n AccountSubscriptionUnSubscribe: {\r\n className: 'citta-account-subscription-unsubscription'\r\n },\r\n subscribeResponse: this._getSubscribeResponse(),\r\n hasAccountDetails: hasAccountDetails,\r\n isProcessing: isProcessing,\r\n processingMessage: this._renderProcessing(),\r\n subUnsubButtton: this._renderButtons(),\r\n subscribeAlert: this._renderSubscribeAlert(),\r\n subscribeNote: this._renderSubscribeNote()\r\n };\r\n return this.props.renderView(CittaAccountSubscriptionViewProps) as React.ReactElement;\r\n }\r\n private _getSubscriptionState(): boolean | undefined {\r\n const accountInfo = this.props.data.accountInformation.result;\r\n if (accountInfo) {\r\n const attributes = accountInfo.Attributes;\r\n if (attributes && attributes.length > 0) {\r\n let isSubscribed;\r\n attributes.forEach(attr => {\r\n if (attr.Name === this.props.resources.optInAttributeName) {\r\n isSubscribed = attr.AttributeValue?.BooleanValue;\r\n }\r\n });\r\n return isSubscribed;\r\n }\r\n }\r\n return;\r\n }\r\n private _getSubscribeResponse(): React.ReactNode {\r\n const { isSubscribed, hasAccountDetails } = this.state;\r\n const { resources } = this.props;\r\n const message = hasAccountDetails\r\n ?

{resources.subscribtionText} {isSubscribed ? resources.subscribtionStatus : resources.noSubscribtionStatus}{resources.subscribtionMailText}

\r\n :

{resources.missingInfoMessage}

;\r\n\r\n return (\r\n
\r\n

{resources.emailHeadingText}

\r\n {message}\r\n
\r\n );\r\n }\r\n\r\n private _renderProcessing(): React.ReactNode {\r\n const { resources } = this.props;\r\n return (\r\n
\r\n

{resources.processingLabel}

\r\n
\r\n );\r\n }\r\n\r\n // Render subscribe/unsubscribe button\r\n private _renderButtons(): React.ReactNode {\r\n const { resources } = this.props;\r\n const { isSubscribed, isProcessing } = this.state;\r\n if (isSubscribed) {\r\n return (\r\n {isProcessing ? resources.processingLabel : resources.unsubscribeButtonLabel}\r\n \r\n );\r\n } else {\r\n return (\r\n {isProcessing ? resources.processingLabel : resources.subscribeButtonLabel}\r\n \r\n );\r\n }\r\n }\r\n\r\n // Set-subscription alert message\r\n private _renderSubscribeAlert(): React.ReactNode {\r\n const { alertMessage, alertClass } = this.state;\r\n const displayAlert: boolean = (alertMessage ? alertMessage !== '' : false);\r\n if (displayAlert) {\r\n return (\r\n
\r\n

{alertMessage}

\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private _renderSubscribeNote(): React.ReactNode {\r\n const { resources } = this.props;\r\n return (\r\n
\r\n

{resources.pleaseNoteMessage}

\r\n
\r\n );\r\n }\r\n\r\n private _handleSubscribeClick = async () => {\r\n await this._handleButtonClick(true);\r\n }\r\n\r\n private _handleUnsubscribeClick = async () => {\r\n await this._handleButtonClick(false);\r\n }\r\n\r\n private _handleButtonClick = async (subscribe: boolean) => {\r\n const { userEmail } = this.state;\r\n this.setState({\r\n isProcessing: true\r\n });\r\n // Update subscription state for user\r\n const response = await this._setSubscriptionState(userEmail, subscribe);\r\n if (response.Result && response.Message) {\r\n const isSuccess = this._isSuccess(subscribe, response.Message);\r\n this.setState({\r\n alertMessage: `${response.Message}`,\r\n alertClass: isSuccess ? 'alert-green' : 'alert-yellow',\r\n isProcessing: false\r\n });\r\n } else {\r\n this.setState({\r\n alertMessage: 'Error processing request',\r\n alertClass: 'alert-yellow',\r\n isProcessing: false\r\n });\r\n }\r\n }\r\n\r\n private async _setSubscriptionState(email: string, subscribed: boolean): Promise {\r\n try {\r\n return await subscribeEmailAction(new SubscribeEmailDataActionInput(email, subscribed), this.props.context.actionContext);\r\n } catch (e) {\r\n throw this.props.telemetry.error(`Something went wrong ------${e}`);\r\n }\r\n }\r\n\r\n private _isSuccess(subscribe: boolean, message: string): boolean {\r\n if (subscribe) {\r\n return message === 'Subscribed successfully.';\r\n } else {\r\n return message === 'Unsubscribed successfully.';\r\n }\r\n }\r\n}\r\n\r\nexport default CittaAccountSubscription;\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\r\nimport { BingMapsLocationsResult } from '../../models/bing-maps-data';\r\nimport { GeoLocationPostalCode } from '../../models/search-by-lat-lon-data';\r\n\r\n/**\r\n * Input class for the azure maps search fuzzy API\r\n */\r\nexport class BingMapsLocationsInput implements IActionInput {\r\n public latitude: string;\r\n public longitude: string;\r\n public serviceEndpoint: string;\r\n public apiKey?: string;\r\n\r\n constructor(lat: string, lon: string, apiKey: string, endPoint: string) {\r\n this.latitude = lat;\r\n this.longitude = lon;\r\n this.apiKey = apiKey;\r\n this.serviceEndpoint = endPoint;\r\n }\r\n\r\n public getCacheKey = () => `BingMapsLocationAPI-${this.latitude}-${this.longitude}`;\r\n public getCacheObjectType = () => 'BingMapsLocationAPIResponse';\r\n public dataCacheType = (): CacheType => 'none'; // Don't cache this. Its against bing maps TOS\r\n}\r\n\r\n/**\r\n * Calls azure maps search fuzzy API\r\n */\r\nexport async function getLocations(input: BingMapsLocationsInput, ctx: IActionContext): Promise {\r\n if (!input.apiKey) {\r\n ctx.trace(`[BingMapsLocations] No Bing Maps API key provided`);\r\n\r\n return undefined;\r\n }\r\n\r\n const callbackString = `bingMapsSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\r\n\r\n const requestUrl =\r\n `${encodeURI(input.serviceEndpoint)}/${encodeURI(input.latitude)},${encodeURI(input.longitude)}?key=${encodeURI(input.apiKey)}&jsonp=${callbackString}`;\r\n\r\n return new Promise((resolve) => {\r\n const script = document.createElement('script');\r\n script.setAttribute('type', 'text/javascript');\r\n script.setAttribute('src', requestUrl);\r\n\r\n window[callbackString] = (data: BingMapsLocationsResult) => {\r\n delete window[callbackString];\r\n document.body.removeChild(script);\r\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\r\n resolve({\r\n postalCode: data.resourceSets[0].resources[0].address.postalCode\r\n });\r\n }\r\n resolve(undefined);\r\n };\r\n document.body.appendChild(script);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getLocations,\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\nimport { Button, Heading, IModuleProps, INodeProps, Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { AttributeValue, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { dXC_GetFreightChargesForPDPAsync } from '../../data-actions/generated/DataActionExtension.g';\r\nimport { IDXC_GetFreightChargesServiceResponse, IDXC_ItemLine } from '../../data-actions/generated/DataServiceEntities.g';\r\nimport geoLocation, { BingMapsLocationsInput } from '../../data-actions/geo-location/bing-maps-locations';\r\nimport { IGetFreightChargesServiceResponse } from '../../models/GetFreightChargesServiceResponse';\r\nimport { ICittaFreightChargesData } from './citta-freight-charges.data';\r\nimport { ICittaFreightChargesProps } from './citta-freight-charges.props.autogenerated';\r\n\r\ninterface IFreightChargeState {\r\n errorMessage: string;\r\n isOpen: boolean;\r\n postalCode?: string;\r\n latitude: string;\r\n longitude: string;\r\n freightResponse?: IGetFreightChargesServiceResponse;\r\n isError: boolean;\r\n}\r\n\r\nexport interface ICittaFreightChargesViewProps extends ICittaFreightChargesProps {\r\n ProductFreightContainer: IModuleProps;\r\n ProductFreightAttribute: INodeProps;\r\n ProductNoFreightAttribute: INodeProps;\r\n ProductFreightAttributeModal: INodeProps;\r\n productFreightAmount: React.ReactNode;\r\n productFreightMessage: React.ReactNode;\r\n productFreightCalculate: React.ReactNode;\r\n productFreightUpdate: React.ReactNode;\r\n productFreightModel: React.ReactNode;\r\n productNoFreight: React.ReactNode;\r\n freightAttribute: boolean;\r\n freightResponseCheck: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * CittaFreightCharges component\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CittaFreightCharges extends React.PureComponent, IFreightChargeState> {\r\n\r\n public state: IFreightChargeState = {\r\n errorMessage: '',\r\n isOpen: false,\r\n postalCode: '',\r\n latitude: '',\r\n longitude: '',\r\n freightResponse: undefined,\r\n isError: false\r\n };\r\n\r\n private _productFreightAttribute: string = this.props.context.app.config.freightValue && this.props.context.app.config.freightValue.toUpperCase() || 'FREIGHT ITEM';\r\n private _PostalCodeInputRef: React.RefObject;\r\n private _showAvailablityText: boolean = false;\r\n\r\n constructor(props: ICittaFreightChargesProps) {\r\n super(props);\r\n this._PostalCodeInputRef = React.createRef();\r\n this._closeModal = this._closeModal.bind(this);\r\n this._openModal = this._openModal.bind(this);\r\n this._handleSearch = this._handleSearch.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n reaction(\r\n () => this.props.config.onUpdateQuantityFreightCheck && this.props.data.productQuantityState.result && this.props.data.productQuantityState.result.productQuantity && this.props.data.productQuantityState.result.productQuantity,\r\n () => {\r\n if (this.props.config.onUpdateQuantityFreightCheck && this.props.data.productQuantityState.result && this.props.data.productQuantityState.result.productQuantity && this.props.data.productQuantityState.result.productQuantity) {\r\n this._getNewFreightCharges(this.state.postalCode).catch(e => {\r\n this.props.telemetry.error(`Something went wrong ------${e}`);\r\n });\r\n }\r\n }\r\n );\r\n\r\n // tslint:disable-next-line: no-this-assignment\r\n const that = this;\r\n const freightAttribute: AttributeValue[] | undefined = this.props.data.productAttributes.result;\r\n if (freightAttribute && this._checkFreightAttributes()) {\r\n if (navigator && navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(\r\n async position => {\r\n this.setState({ latitude: position.coords.latitude.toString(), longitude: position.coords.longitude.toString() });\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges();\r\n this.setState({ isOpen: false, freightResponse: response, errorMessage: '' });\r\n },\r\n error => {\r\n if (error.code === error.PERMISSION_DENIED) {\r\n that.setState({ isOpen: false, errorMessage: '' });\r\n }\r\n });\r\n }\r\n } else {\r\n this.setState({ isOpen: false, freightResponse: undefined, errorMessage: '' });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const config = this.props.config;\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const freightAttributeCheck = this._checkFreightAttributes();\r\n let freightResponseCheck: boolean = false;\r\n if (responseObj && this.state.postalCode && !this.state.isError) {\r\n freightResponseCheck = true;\r\n }\r\n const CittaFreightChargesViewProps = {\r\n ...this.props,\r\n ProductFreightContainer: {\r\n moduleProps: this.props,\r\n className: classnames('product-freight-charges', config.className)\r\n },\r\n ProductFreightAttribute: {\r\n className: 'product-freight'\r\n },\r\n ProductFreightAttributeModal: {\r\n className: ''\r\n },\r\n ProductNoFreightAttribute: {\r\n className: ''\r\n },\r\n productFreightAmount: this._renderProductFreightAmount(),\r\n productFreightMessage: this._renderProductFreightMessage(),\r\n productFreightCalculate: this._renderProductFreightCalculate(),\r\n productFreightUpdate: this._renderProductFreightUpdate(),\r\n productFreightModel: this._renderProductFreightModal(),\r\n productNoFreight: this._renderProductNoFreight(),\r\n freightAttribute: freightAttributeCheck,\r\n freightResponseCheck: freightResponseCheck\r\n };\r\n return this.props.renderView(CittaFreightChargesViewProps) as React.ReactElement;\r\n }\r\n\r\n private _checkFreightAttributes = (): boolean => {\r\n const prodAttributes: AttributeValue[] | undefined = this.props && this.props.data && this.props.data.productAttributes && this.props.data.productAttributes.result;\r\n if (prodAttributes && prodAttributes.length) {\r\n const filterAttributes = prodAttributes.filter(\r\n attribute => attribute.Name && attribute.Name.toUpperCase() === this._productFreightAttribute\r\n );\r\n if (filterAttributes && filterAttributes.length) {\r\n if (!filterAttributes[0].BooleanValue) {\r\n this._showAvailablityText = true;\r\n }\r\n return filterAttributes[0].BooleanValue || false;\r\n } else {\r\n this._showAvailablityText = false;\r\n return false;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n private _handleChange = (ref: React.RefObject) => (event: React.ChangeEvent) => {\r\n this.setState({ errorMessage: '' });\r\n }\r\n\r\n private _handleSearch = async (e: React.MouseEvent | React.KeyboardEvent | React.FormEvent): Promise => {\r\n e.preventDefault();\r\n const postalCodeInput = this._PostalCodeInputRef && this._PostalCodeInputRef.current ? this._PostalCodeInputRef.current.value : '';\r\n if (postalCodeInput.length > 4) {\r\n this.setState({ errorMessage: this.props.config.postalCodeInputErrorMessage1! });\r\n } else if (!this._isValidPostalCode(postalCodeInput)) {\r\n this.setState({ errorMessage: this.props.config.postalCodeInputErrorMessage2! });\r\n } else {\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges(postalCodeInput);\r\n if (response.Result === 'false') {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n } else if (response && response.Result) {\r\n this.setState({ errorMessage: '', freightResponse: response, postalCode: postalCodeInput, isError: false });\r\n } else if (response && !response.Result) {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n }\r\n }\r\n }\r\n\r\n private _getNewFreightCharges = async (postalCode?: string): Promise => {\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges(postalCode);\r\n if (response.Result === 'false') {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n } else if (response && response.Result) {\r\n this.setState({ errorMessage: '', freightResponse: response, isError: false });\r\n } else if (response && !response.Result) {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n }\r\n }\r\n\r\n private _getItemFreightCharges(postalCode?: string): Promise {\r\n const itemId = this.props && this.props.data && this.props.data.product && this.props.data.product.result ? this.props.data.product.result.ItemId : '';\r\n const response: IGetFreightChargesServiceResponse = { ChargesAmount: 0 };\r\n const itemLine: IDXC_ItemLine = { ItemId: itemId, Quantity: this.props.data.currentQuantity.result };\r\n const ctx: IContext = { callerContext: this.props.context.actionContext };\r\n\r\n if (!postalCode) {\r\n const bingAppKey = this.props && this.props.config && this.props.config.bingApiAppKey ? this.props.config.bingApiAppKey : '';\r\n const bingApiEndpoint = this.props && this.props.config && this.props.config.bingApiEndPoint || '';\r\n const searchInput: BingMapsLocationsInput = new BingMapsLocationsInput(this.state.latitude, this.state.longitude, bingAppKey, bingApiEndpoint);\r\n geoLocation(searchInput, this.props.context.actionContext).then(\r\n (result) => {\r\n if (result) {\r\n postalCode = result.postalCode;\r\n this.setState({ postalCode: postalCode });\r\n dXC_GetFreightChargesForPDPAsync(ctx, postalCode!, itemLine).then(\r\n (responseObj) => {\r\n if (responseObj) {\r\n if (responseObj.Result === 'false') {\r\n this.setState({ errorMessage: responseObj.Message!, isError: true });\r\n } else {\r\n this.setState({ errorMessage: '', freightResponse: responseObj, isError: false });\r\n }\r\n } else {\r\n this.setState({ isError: true });\r\n }\r\n }\r\n );\r\n } else {\r\n postalCode = '';\r\n return;\r\n }\r\n });\r\n } else {\r\n this.setState({ postalCode: postalCode });\r\n return dXC_GetFreightChargesForPDPAsync(ctx, postalCode, itemLine);\r\n }\r\n return Promise.resolve(response);\r\n }\r\n\r\n private _closeModal(): void {\r\n this.setState(prevState => ({\r\n isOpen: !prevState.isOpen\r\n }));\r\n }\r\n private _openModal(): void {\r\n this.setState(prevState => ({\r\n isOpen: !prevState.isOpen\r\n }));\r\n }\r\n\r\n private _isValidPostalCode = (postalCode: string): boolean => {\r\n const regex = /^[0-9]+[0-9]*$/;\r\n return regex.test(postalCode);\r\n }\r\n\r\n private _getFormattedPrice(freightAmount: number): React.ReactNode {\r\n const formattedPrice = this.props.context.cultureFormatter.formatCurrency(freightAmount);\r\n return (\r\n {formattedPrice}\r\n );\r\n }\r\n\r\n private _renderProductFreightAmount(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n if (responseObj) {\r\n return (\r\n
\r\n {this._getFormattedPrice(responseObj.ChargesAmount)} {this.props.resources.freight_estimatedShippingText}\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private _renderProductFreightMessage(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const resources = this.props.resources;\r\n const postalCode = this.state.postalCode || '';\r\n const freightBasedOnCityName = responseObj && postalCode ? `${resources.freight_basedOnText}: ${postalCode}` : '';\r\n return (\r\n
{freightBasedOnCityName}
\r\n );\r\n }\r\n\r\n private _renderProductFreightUpdate(): React.ReactNode {\r\n const resources = this.props.resources;\r\n return (\r\n
\r\n \r\n {resources.freight_updateLocationLinkText}\r\n \r\n
\r\n );\r\n }\r\n\r\n private _renderProductFreightCalculate(): React.ReactNode {\r\n const resources = this.props.resources;\r\n return (\r\n
\r\n \r\n {resources.freight_updateLocationLinkAltText}\r\n \r\n
\r\n );\r\n }\r\n private _renderProductNoFreight(): React.ReactNode | null {\r\n const { config, resources } = this.props;\r\n const showAvailablityTextConfig = config.freightCheck ? config.freightCheck : false;\r\n // Show availability based in freight attribute as configured in appsetting and module configuration\r\n if (showAvailablityTextConfig && this._showAvailablityText) {\r\n const availableForLabelText = resources.freight_availableForLabel ? resources.freight_availableForLabel : 'Available for';\r\n const availableForValue = config.availableFor ? config.availableFor : 'Click & Collect';\r\n return (\r\n
\r\n {availableForLabelText}\r\n {availableForValue}\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private _renderProductFreightModal(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const { config, resources } = this.props;\r\n return (\r\n \r\n {config.modalHeader}\r\n \r\n
\r\n
\r\n \r\n

{config.postalCodeInputLabel}

\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n {this.state.errorMessage ?
\r\n {this.state && this.state.errorMessage ?\r\n \r\n {this.state.errorMessage}\r\n : null\r\n }\r\n
: null}\r\n {responseObj ?\r\n
\r\n
\r\n
\r\n

{resources.freight_postCode}

\r\n

{this.state.postalCode ? this.state.postalCode : ''}

\r\n
\r\n
\r\n

{resources.freight_delivery}

\r\n

{responseObj ? this._getFormattedPrice(responseObj.ChargesAmount) : null}

\r\n
\r\n
\r\n
\r\n

{config.deliveryInfoBottom1}

\r\n

{config.deliveryInfoBottom2}

\r\n

{config.deliveryInfoBottom3}

\r\n
\r\n
: null}\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n\r\n}\r\n\r\nexport default CittaFreightCharges;\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 { Button, Heading, IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IDXC_SubscribeNewsletterRealtimeResponse } from '../../data-actions/generated/DataServiceEntities.g';\r\nimport { subscribeEmailAction, SubscribeEmailDataActionInput } from './../../data-actions/subscribe-email/subscribe-email-data';\r\nimport { ICittaUnsubscribeData } from './citta-unsubscribe.data';\r\nimport { ICittaUnsubscribeProps } from './citta-unsubscribe.props.autogenerated';\r\n\r\nexport interface ICittaUnsubscribeViewProps extends ICittaUnsubscribeProps {\r\n unsubscribeContainer: IModuleProps;\r\n alertMessage?: React.ReactNode;\r\n unsubscribeHeading?: React.ReactNode;\r\n unsubscribeInput?: React.ReactNode;\r\n unsubscribeButton?: React.ReactNode ;\r\n}\r\n\r\ninterface ICittaUnsubscribeState {\r\n alertMessage: string;\r\n alertClass: string;\r\n inputEmail: string;\r\n}\r\n\r\n/**\r\n *\r\n * CittaUnsubscribe component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CittaUnsubscribe extends React.PureComponent, ICittaUnsubscribeState> {\r\n constructor(props: ICittaUnsubscribeViewProps) {\r\n super(props);\r\n this._handleButtonClick = this._handleButtonClick.bind(this);\r\n this._handleInputChange = this._handleInputChange.bind(this);\r\n\r\n this.state = {\r\n alertMessage: '',\r\n alertClass: '',\r\n inputEmail: ''\r\n };\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const viewProps: ICittaUnsubscribeViewProps = {\r\n ...(this.props as ICittaUnsubscribeProps),\r\n unsubscribeContainer: {\r\n moduleProps: this.props,\r\n className: 'container citta-unsubscribe'\r\n },\r\n alertMessage: this._renderAlertMessage(),\r\n unsubscribeHeading: this._renderUnsubscribeHeading(),\r\n unsubscribeInput: this._renderUnsubscribeInput(),\r\n unsubscribeButton: this._renderUnsubscribeButton()\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private _handleInputChange = (event: any) => {\r\n this.setState({\r\n inputEmail: event.target.value\r\n });\r\n }\r\n\r\n private _handleButtonClick = async () => {\r\n const response = await this._callUnsubscribeAPI(this.state.inputEmail);\r\n if (response.Result && response.Message) {\r\n this.setState({\r\n alertMessage: `${response.Message}`,\r\n alertClass: response.Message === 'Unsubscribed successfully.' ? 'alert-green' : 'alert-yellow'\r\n });\r\n }\r\n }\r\n\r\n private async _callUnsubscribeAPI(email: string): Promise {\r\n try {\r\n return await subscribeEmailAction(new SubscribeEmailDataActionInput(email, false), this.props.context.actionContext);\r\n } catch (e) {\r\n throw this.props.telemetry.error(`Something went wrong ------${e}`);\r\n }\r\n }\r\n\r\n private _renderUnsubscribeHeading(): React.ReactNode {\r\n const { unsubscribeHeading } = this.props.config;\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _renderAlertMessage(): React.ReactNode {\r\n const { alertMessage, alertClass } = this.state;\r\n const displayAlert: boolean = (alertMessage ? alertMessage !== '' : false);\r\n return (\r\n <>\r\n {displayAlert ?
\r\n

{alertMessage}

\r\n
: null}\r\n \r\n );\r\n }\r\n\r\n private _renderUnsubscribeInput(): React.ReactNode {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n private _renderUnsubscribeButton(): React.ReactNode {\r\n const { resources } = this.props;\r\n return (\r\n {resources.buttonText}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default CittaUnsubscribe;","/*---------------------------------------------------------------------------------------------\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 CittaTelemetry from '../../common/telemetry/citta-telemetry';\r\nimport { subscribeEmailAction, SubscribeEmailDataActionInput } from '../../data-actions/subscribe-email/subscribe-email-data';\r\nimport { ICittaUserSubscribedData } from './citta-user-subscribed.data';\r\nimport { ICittaUserSubscribedProps } from './citta-user-subscribed.props.autogenerated';\r\n\r\nexport interface ICittaUserSubscribedViewProps extends ICittaUserSubscribedProps {}\r\n\r\n/**\r\n *\r\n * CittaUserSubscribed component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CittaUserSubscribed extends React.PureComponent> {\r\n private cittaTelemetry: CittaTelemetry;\r\n\r\n constructor(props: ICittaUserSubscribedProps) {\r\n super(props);\r\n this.cittaTelemetry = new CittaTelemetry(this.props.context.app.config.cittaInstrumentationKey);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const url = decodeURI(window.location.search);\r\n const urlParams = new URLSearchParams(url);\r\n urlParams.delete('token'); // laybuy\r\n urlParams.delete('orderToken'); // afterpay\r\n urlParams.delete('sessionid'); // payment express\r\n\r\n this._logMessage(`Citta user subscribed loaded ${urlParams.toString()}`);\r\n\r\n /* tslint:disable:no-string-literal */\r\n const isNewUser = (this.props.context.request && this.props.context.request.user && this.props.context.request.user['userClaims'] &&\r\n this.props.context.request.user['userClaims'][this.props.config.newUserKey || 'IsNewUser'] &&\r\n this.props.context.request.user['userClaims'][this.props.config.newUserKey || 'IsNewUser'] === 'true') ? true : false;\r\n const isSubscribedToNewsletter = (this.props.context.request && this.props.context.request.user && this.props.context.request.user['userClaims'] &&\r\n this.props.context.request.user['userClaims'][this.props.config.subscriptionKey || 'SubscribeToNewsletter'] &&\r\n this.props.context.request.user['userClaims'][this.props.config.subscriptionKey || 'SubscribeToNewsletter'] === 'true') ? true : false;\r\n const userEmail = this.props.context.request.user && this.props.context.request.user.emailAddress || '';\r\n\r\n if (isNewUser && isSubscribedToNewsletter) {\r\n try {\r\n await subscribeEmailAction(new SubscribeEmailDataActionInput(userEmail, isSubscribedToNewsletter), this.props.context.actionContext);\r\n } catch(e) {\r\n this.props.telemetry.error(`Something went wrong ------${e}`);\r\n }\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const moduleprops = {\r\n ...this.props\r\n };\r\n return this.props.renderView(moduleprops) as React.ReactElement;\r\n }\r\n\r\n private _logMessage(message: string): void {\r\n const {\r\n Id,\r\n TotalItems\r\n } = this.props.data.activeCart.result!;\r\n\r\n this.cittaTelemetry.trace(`CartId:${Id} TotalItem:${TotalItems} - ${message}`);\r\n }\r\n}\r\n\r\nexport default CittaUserSubscribed;\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\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ICittaAccountSubscriptionViewProps } from './citta-account-subscription';\r\n\r\nconst CittaAccountSubscriptionView: React.FC = props => {\r\n const {\r\n AccountSubscriptionWrapper,\r\n AccountSubscriptionAttribute,\r\n AccountSubscriptionProcessing,\r\n AccountSubscriptionUnSubscribe,\r\n subscribeResponse,\r\n subUnsubButtton,\r\n isProcessing,\r\n hasAccountDetails,\r\n processingMessage,\r\n subscribeAlert,\r\n subscribeNote } = props;\r\n return (\r\n \r\n {subscribeResponse}\r\n {hasAccountDetails &&\r\n \r\n {isProcessing ?\r\n \r\n {processingMessage}\r\n :\r\n \r\n {subUnsubButtton}\r\n {subscribeAlert}\r\n {subscribeNote}\r\n }\r\n \r\n }\r\n \r\n );\r\n};\r\n\r\nexport default CittaAccountSubscriptionView;\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 { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ICittaFreightChargesViewProps } from './citta-freight-charges';\r\n\r\nconst CittaFreightChargesView: React.FC = props => {\r\n const { ProductFreightContainer, productFreightAmount, productFreightMessage, productFreightCalculate, productFreightUpdate,\r\n productFreightModel, productNoFreight, freightAttribute, ProductFreightAttribute, ProductFreightAttributeModal, ProductNoFreightAttribute, freightResponseCheck } = props;\r\n if (freightAttribute) {\r\n return (\r\n \r\n {freightResponseCheck ?\r\n \r\n {productFreightAmount}\r\n {productFreightMessage}\r\n {productFreightUpdate}\r\n :\r\n \r\n {productFreightCalculate}\r\n }\r\n \r\n {productFreightModel}\r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {productNoFreight}\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default CittaFreightChargesView;\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 { Module } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ICittaUnsubscribeViewProps } from './citta-unsubscribe';\r\n\r\nexport default (props: ICittaUnsubscribeViewProps) => {\r\n const { unsubscribeContainer, alertMessage, unsubscribeHeading, unsubscribeInput, unsubscribeButton } = props;\r\n return (\r\n \r\n {alertMessage}\r\n {unsubscribeHeading}\r\n {unsubscribeInput}\r\n {unsubscribeButton}\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 { ICittaUserSubscribedViewProps } from './citta-user-subscribed';\r\n\r\nexport default (props: ICittaUserSubscribedViewProps) => {\r\n return (null);\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 { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\r\nimport { dXC_SubscribeEmailAsync } from '../generated/DataActionExtension.g';\r\nimport { IDXC_SubscribeNewsletterRealtimeResponse } from '../generated/DataServiceEntities.g';\r\n\r\n/**\r\n * SubmitSubscribeFormDataActionInput Input Action\r\n */\r\n\r\nexport class SubscribeEmailDataActionInput implements IActionInput {\r\n public emailAddress: string;\r\n public subscribe: boolean;\r\n\r\n // Construct the input needed to run the action\r\n constructor(emailAddress: string, subscribe: boolean) {\r\n this.emailAddress = emailAddress;\r\n this.subscribe = subscribe;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => 'SubscribeEmail2020';\r\n public getCacheObjectType = () => 'SubscribeEmail';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: SubscribeEmailDataActionInput): IActionInput => {\r\n return args;\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nexport async function subscribeEmailAction(\r\n input: SubscribeEmailDataActionInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // Input only needs token\r\n let result: IDXC_SubscribeNewsletterRealtimeResponse = {};\r\n try {\r\n result = await dXC_SubscribeEmailAsync({ callerContext: ctx }, input.emailAddress, input.subscribe);\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n return Array.isArray(result) ? result[0] : result;\r\n}\r\n\r\nexport const ISubscribeEmailDataActionAction = createObservableDataAction({\r\n action: >subscribeEmailAction,\r\n input: createInput\r\n});\r\n"],"names":["CittaAccountSubscription","React","constructor","props","_this$props$data$acco","super","_handleSubscribeClick","async","this","_handleButtonClick","_handleUnsubscribeClick","userEmail","state","setState","isProcessing","response","_setSubscriptionState","subscribe","Result","Message","isSuccess","_isSuccess","alertMessage","alertClass","bind","email","data","accountInformation","result","Email","subscribed","_getSubscriptionState","hasDetails","undefined","isSubscribed","hasAccountDetails","componentDidUpdate","prevProps","_this$props$data$acco2","hasDetails1","render","config","CittaAccountSubscriptionViewProps","_objectSpread","AccountSubscriptionWrapper","moduleProps","className","classnames","AccountSubscriptionAttribute","AccountSubscriptionProcessing","AccountSubscriptionUnSubscribe","subscribeResponse","_getSubscribeResponse","processingMessage","_renderProcessing","subUnsubButtton","_renderButtons","subscribeAlert","_renderSubscribeAlert","subscribeNote","_renderSubscribeNote","renderView","accountInfo","attributes","Attributes","length","forEach","attr","_attr$AttributeValue","Name","resources","optInAttributeName","AttributeValue","BooleanValue","message","subscribtionText","subscribtionStatus","noSubscribtionStatus","subscribtionMailText","missingInfoMessage","emailHeadingText","processingLabel","Button","color","onClick","disabled","unsubscribeButtonLabel","subscribeButtonLabel","pleaseNoteMessage","subscribeEmailAction","SubscribeEmailDataActionInput","context","actionContext","e","telemetry","error","BingMapsLocationsInput","lat","lon","apiKey","endPoint","getCacheKey","latitude","longitude","getCacheObjectType","dataCacheType","serviceEndpoint","createObservableDataAction","action","input","ctx","trace","callbackString","crypto","getRandomValues","Uint32Array","requestUrl","encodeURI","Promise","resolve","script","document","createElement","setAttribute","window","body","removeChild","resourceSets","postalCode","address","appendChild","CittaFreightCharges","errorMessage","isOpen","freightResponse","isError","_productFreightAttribute","app","freightValue","toUpperCase","_showAvailablityText","_checkFreightAttributes","prodAttributes","productAttributes","filterAttributes","filter","attribute","_handleChange","ref","event","_handleSearch","preventDefault","postalCodeInput","_PostalCodeInputRef","current","value","postalCodeInputErrorMessage1","_isValidPostalCode","_getItemFreightCharges","postalCodeInputErrorMessage2","_getNewFreightCharges","test","_closeModal","_openModal","reaction","onUpdateQuantityFreightCheck","productQuantityState","productQuantity","catch","that","navigator","geolocation","getCurrentPosition","position","coords","toString","code","PERMISSION_DENIED","responseObj","freightAttributeCheck","freightResponseCheck","CittaFreightChargesViewProps","ProductFreightContainer","ProductFreightAttribute","ProductFreightAttributeModal","ProductNoFreightAttribute","productFreightAmount","_renderProductFreightAmount","productFreightMessage","_renderProductFreightMessage","productFreightCalculate","_renderProductFreightCalculate","productFreightUpdate","_renderProductFreightUpdate","productFreightModel","_renderProductFreightModal","productNoFreight","_renderProductNoFreight","freightAttribute","itemLine","ItemId","product","Quantity","currentQuantity","callerContext","dXC_GetFreightChargesForPDPAsync","bingAppKey","bingApiAppKey","bingApiEndpoint","bingApiEndPoint","searchInput","geoLocation","then","ChargesAmount","prevState","_getFormattedPrice","freightAmount","formattedPrice","cultureFormatter","formatCurrency","freight_estimatedShippingText","freightBasedOnCityName","freight_basedOnText","id","freight_updateLocationLinkText","title","href","outline","freight_updateLocationLinkAltText","freightCheck","availableForLabelText","freight_availableForLabel","availableForValue","availableFor","Modal","autoFocus","fade","horizontalPosition","verticalPosition","zIndex","toggle","applicationNode","lightboxClassName","ModalHeader","modalHeader","ModalBody","name","role","autoComplete","onSubmit","Heading","text","formHeadingText","tag","postalCodeInputLabel","type","onChange","freight_postCode","freight_delivery","deliveryInfoBottom1","deliveryInfoBottom2","deliveryInfoBottom3","__decorate","observer","CittaUnsubscribe","_handleInputChange","inputEmail","target","_callUnsubscribeAPI","viewProps","unsubscribeContainer","_renderAlertMessage","unsubscribeHeading","_renderUnsubscribeHeading","unsubscribeInput","_renderUnsubscribeInput","unsubscribeButton","_renderUnsubscribeButton","headingTag","displayAlert","placeholder","buttonText","CittaUserSubscribed","cittaTelemetry","CittaTelemetry","cittaInstrumentationKey","url","decodeURI","location","search","urlParams","URLSearchParams","delete","_logMessage","isNewUser","request","user","newUserKey","isSubscribedToNewsletter","subscriptionKey","emailAddress","moduleprops","Id","TotalItems","activeCart","Module","Object","assign","Node","dXC_SubscribeEmailAsync","console","log","Array","isArray","args"],"sourceRoot":""}