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AA,IAAqB,IAAIT,EAAAA,GAA8B+B,EAAWsR,GAA2B9S,KAAKkB,MAAMkF,QAAQC,eACxH,MAAMC,GACJtG,KAAKkB,MAAMqF,UAAU/F,MAAM,8BAA8B8F,KAGrE,CAEOnD,SACH,MAAM6P,uWAAW1P,CAAA,GACVtD,KAAKkB,OAEZ,OAAOlB,KAAKkB,MAAMsD,WAAWwO,EACjC,CAEQP,YAAYpN,GAChB,MAAM,GACF4N,EAAE,WACFC,GACAlT,KAAKkB,MAAMoB,KAAK6Q,WAAW9S,OAE/BL,KAAK+R,eAAe3K,MAAM,UAAU6L,eAAgBC,OAAgB7N,IACxE,EAGJ,wDC/DA,QAAgBnE,GACJ","sources":["webpack://Citta2.0/./src/data-actions/subscribe-email/subscribe-email-data.ts?c8e3","webpack://Citta2.0/./src/modules/citta-account-subscription/citta-account-subscription.tsx?2496","webpack://Citta2.0/./src/modules/citta-account-subscription/citta-account-subscription.view.tsx?d603","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-freight-charges/citta-freight-charges.view.tsx?0bed","webpack://Citta2.0/./src/modules/citta-unsubscribe/citta-unsubscribe.tsx?5df8","webpack://Citta2.0/./src/modules/citta-unsubscribe/citta-unsubscribe.view.tsx?a772","webpack://Citta2.0/./src/modules/citta-user-subscribed/citta-user-subscribed.tsx?9a50","webpack://Citta2.0/./src/modules/citta-user-subscribed/citta-user-subscribed.view.tsx?cddd"],"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 { 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","/*---------------------------------------------------------------------------------------------\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","/*!\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","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.\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. 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.\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. 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\n\r\nimport { ICittaUserSubscribedViewProps } from './citta-user-subscribed';\r\n\r\nexport default (props: ICittaUserSubscribedViewProps) => {\r\n return (null);\r\n};"],"names":["SubscribeEmailDataActionInput","constructor","emailAddress","subscribe","getCacheKey","getCacheObjectType","dataCacheType","this","async","subscribeEmailAction","input","ctx","result","dXC_SubscribeEmailAsync","callerContext","error","console","log","Array","isArray","createObservableDataAction","action","args","CittaAccountSubscription","React","props","_this$props$data$acco","super","_handleSubscribeClick","_handleButtonClick","_handleUnsubscribeClick","userEmail","state","setState","isProcessing","response","_setSubscriptionState","Result","Message","isSuccess","_isSuccess","alertMessage","alertClass","bind","email","data","accountInformation","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","context","actionContext","e","telemetry","Module","Object","assign","Node","BingMapsLocationsInput","lat","lon","apiKey","endPoint","latitude","longitude","serviceEndpoint","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","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","moduleprops","Id","TotalItems","activeCart"],"sourceRoot":""}