{"version":3,"sources":["webpack:///src/modules/product-specification/components/product-specification-table-stucture.tsx?4b07","webpack:///src/modules/product-specification/product-specification.tsx?f393","webpack:///./src/modules/citta-journal-posts/citta-journal-posts.tsx?d814","webpack:///src/modules/product-specification/product-specification.view.tsx?bfbe","webpack:///src/index.ts?c6ae","webpack:///./src/data-actions/geo-location/bing-maps-locations.ts?dfb7","webpack:///./src/modules/citta-freight-charges/citta-freight-charges.tsx?b724","webpack:///./src/modules/citta-freight-charges/citta-freight-charges.view.tsx?30d5","webpack:///./src/modules/citta-journal-posts/citta-journal-posts.view.tsx?6e32"],"names":["ProductSpecificationTableRow","_ref","productName","cellData","className","React","scope","dangerouslySetInnerHTML","getRichTextHtml","ProductSpecification","constructor","props","super","handleHeadingChange","event","this","config","heading","text","target","value","_toggle","drawerListId","state","setState","isDrawerOpen","undefined","context","data","telemetry","catalogId","Msdyn365","request","validateCatalogId","reaction","product","result","RecordId","actionInput","AttributesForSelectedVariantInput","actionContext","requestContext","apiSettings","channelId","getAttributesForSelectedVariant","catch","error","message","debug","shouldComponentUpdate","nextProps","nextState","render","_heading$tag","productSpecificationData","length","isAccrodion","displayStyle","viewProps","_objectSpread","handleText","moduleProps","classnames","ProductSpecificationTableProps","tag","ProductSpecificationTableBodyProps","title","editProps","onEdit","productSpecificationResult","_createDrawerBody","_createTableBody","renderView","content","map","index","_renderProductCell","key","Name","accordionItemContainer","_product$Name","Module","Object","assign","Drawer","collapseProps","timeout","isOpen","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","onToggle","DataTypeValue","_renderCurrencyCell","_renderDateTimeCell","_renderDecimalCell","_renderIntegerCell","_renderTextCell","_renderTrueFalseCell","warning","CurrencyValue","CurrencyCode","_product$DateTimeOffs","DateTimeOffsetValue","toUTCString","IntegerValue","FloatValue","TextValue","BooleanValue","resources","trueValueText","falseValueText","__decorate","observer","Market","CittaJournalPosts","moduleClassName","_renderLoadMore","displayedJournals","allJournals","onClick","_loadMore","_onType","e","categoryFilter","list","_getFilteredJournals","toLowerCase","displayCount","slice","searchTerm","filter","journal","category","indexOf","subTitle","_setCategoryFilter","type","_renderCategoryFilter","categories","_renderSearch","onChange","placeholder","getMarket","url","arguments","indexOfCountry","market","split","NZ","toUpperCase","_getPostUrl","postUrl","requestUrl","href","_renderPosts","posts","post","imageUrl","src","alt","_formatDate","date","audience","journals","journalsFilteredByAudience","bind","componentDidMount","MsDyn365","isBrowser","window","decodeURI","location","search","urlParams","URLSearchParams","journalcategory","has","get","find","c","toLocaleLowerCase","container","document","querySelector","middle","children","Math","floor","scrollLeft","offsetLeft","offsetWidth","JournalsWrapper","loadMore","d","parseInt","newDisplayCount","ProductSpecificationView","rowdata","ArrayExtensions","hasElements","row","ObjectExtensions","isNullOrUndefined","Node","BingMapsLocationsInput","lat","lon","apiKey","endPoint","getCacheKey","latitude","longitude","getCacheObjectType","dataCacheType","serviceEndpoint","createObservableDataAction","action","async","input","ctx","trace","callbackString","crypto","getRandomValues","Uint32Array","encodeURI","Promise","resolve","script","createElement","setAttribute","body","removeChild","resourceSets","postalCode","address","appendChild","CittaFreightCharges","errorMessage","freightResponse","isError","_productFreightAttribute","app","freightValue","_showAvailablityText","_checkFreightAttributes","prodAttributes","productAttributes","filterAttributes","attribute","_handleChange","ref","_handleSearch","preventDefault","postalCodeInput","_PostalCodeInputRef","current","postalCodeInputErrorMessage1","_isValidPostalCode","response","_getItemFreightCharges","Result","Message","postalCodeInputErrorMessage2","_getNewFreightCharges","test","_closeModal","_openModal","onUpdateQuantityFreightCheck","productQuantityState","productQuantity","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","Quantity","currentQuantity","callerContext","dXC_GetFreightChargesForPDPAsync","bingAppKey","bingApiAppKey","bingApiEndpoint","bingApiEndPoint","searchInput","geoLocation","then","ChargesAmount","prevState","_getFormattedPrice","freightAmount","formattedPrice","cultureFormatter","formatCurrency","freight_estimatedShippingText","freightBasedOnCityName","freight_basedOnText","Button","id","freight_updateLocationLinkText","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","formHeadingText","postalCodeInputLabel","color","freight_postCode","freight_delivery","deliveryInfoBottom1","deliveryInfoBottom2","deliveryInfoBottom3","CittaFreightChargesView"],"mappings":";8FAAA,8DAyBO,MAAMA,EAAwEC,IAAA,IAAC,YAAEC,EAAW,SAAEC,EAAQ,UAAEC,GAAWH,EAAA,OACtHI,gBAAA,MAAID,UAAWA,GACXC,gBAAA,MAAIC,MAAM,OAEND,gBAAA,QAAME,wBAAyBC,YAAgBN,MAEnDG,gBAAA,UAAKF,M,qyBCsBb,IAAMM,EAAN,cAAmCJ,YAC/BK,YAAmBC,GACfC,MAAMD,GAqGH,KAAAE,oBAAuBC,IAC1BC,KAAKJ,MAAMK,OAAOC,QAASC,KAAOJ,EAAMK,OAAOC,OAsDlC,KAAAC,QAAWC,GAAqC,KACzDP,KAAKQ,MAAMD,eAAiBA,EAC5BP,KAAKS,SAAS,CAAEF,eAAcG,cAAc,IAE5CV,KAAKS,SAAS,CAAEF,kBAAcI,EAAWD,cAAc,KA/J3DV,KAAKQ,MAAQ,CACTE,cAAc,EACdH,kBAAcI,GAIf,0BACH,MAAM,QAAEC,EAAO,KAAEC,EAAI,UAAEC,GAAcd,KAAKJ,MACpCmB,EAAYC,IAAsBhB,KAAKJ,MAAMgB,QAAQK,SAC3DC,4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KACK6H,GAuWSA,a,yHCjXA0H,UA7B0D9V,IACrE,MAAM,wBAAEmR,EAAuB,qBAAEI,EAAoB,sBAAEE,EAAqB,wBAAEE,EAAuB,qBAAEE,EAAoB,oBACvHE,EAAmB,iBAAEE,EAAgB,iBAAEE,EAAgB,wBAAEf,EAAuB,6BAAEC,EAA4B,0BAAEC,EAAyB,qBAAEL,GAAyBjR,EACxK,OAAImS,EAEIzS,gBAAC4E,SAAMC,OAAAC,OAAA,GAAK2M,GACPF,EACGvR,gBAACwM,OAAI3H,OAAAC,OAAA,GAAK4M,GACLG,EACAE,EACAI,GAELnS,gBAACwM,OAAI3H,OAAAC,OAAA,GAAK4M,GACLO,GAETjS,gBAACwM,OAAI3H,OAAAC,OAAA,GAAK6M,GACLU,IAMTrS,gBAACwM,OAAI3H,OAAAC,OAAA,GAAK8M,GACLW,K,mGCvBDjS,aAGRN,gBAAC4E,SAAMC,OAAAC,OAAA,GAAKxE,EAAMsL,iBACbtL,EAAMiI,WACNjI,EAAMmK,OAEPzK,gBAAA,OAAKD,UAAU,YACVO,EAAM0J,UAEV1J,EAAMuL","file":"static/js/29.9a094a95f8cdf5d505a6.chunk.js","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getRichTextHtml } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\n/**\n * Product specification table row.\n */\nexport interface IProductSpecificationTableRow {\n productName?: string;\n cellData?: React.ReactNode;\n className?: string;\n}\n\n/**\n * Product specification table row component.\n * @param props - For product specification table row.\n * @param props.productName - Product name.\n * @param props.cellData - Cell data.\n * @param props.className - Class name.\n * @returns - Returns JSX element.\n */\nexport const ProductSpecificationTableRow: React.FC = ({ productName, cellData, className }) => (\n \n \n {/* eslint-disable-next-line react/no-danger */}\n \n \n {cellData}\n \n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Drawer, IModuleProps, INodeProps, Module } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { AttributesForSelectedVariantInput, getAttributesForSelectedVariant } from '../..';\nimport { ProductSpecificationTableRow } from './components/product-specification-table-stucture';\nimport { IProductSpecificationData } from './product-specification.data';\nimport { displayStyle, IProductSpecificationProps } from './product-specification.props.autogenerated';\n\n/**\n * Maintain Drawer State.\n */\nexport interface IProductSpecificationState {\n isDrawerOpen: boolean;\n drawerListId: number | undefined;\n}\n\n/**\n * Product specification view props.\n */\nexport interface IProductSpecificationViewProps extends IProductSpecificationProps<{}> {\n ProductSpecification: IModuleProps;\n ProductSpecificationTableProps: INodeProps;\n ProductSpecificationTableBodyProps: INodeProps;\n productSpecificationResult?: (JSX.Element | null)[];\n title?: React.ReactNode;\n isAccrodion?: boolean;\n handleText?(event: Msdyn365.ContentEditableEvent): void;\n}\n\n/**\n * Check for display style either accordion or table.\n */\nexport interface IProductSpecificationExtentedProps extends IProductSpecificationProps {\n displayStyle?: displayStyle;\n}\n\n/**\n *\n * ProductSpecification component.\n * @extends {React.Component>}\n */\n@observer\nclass ProductSpecification extends React.Component {\n public constructor(props: IProductSpecificationExtentedProps) {\n super(props);\n this.state = {\n isDrawerOpen: false,\n drawerListId: undefined\n };\n }\n\n public async componentDidMount(): Promise {\n const { context, data, telemetry } = this.props;\n const catalogId = Msdyn365.getCatalogId(this.props.context.request);\n validateCatalogId(catalogId);\n reaction(\n () => (data.product.result ? data.product.result.RecordId : null),\n () => {\n if (context && data.product.result) {\n const actionInput = new AttributesForSelectedVariantInput(\n data.product.result.RecordId,\n\n +context.actionContext.requestContext.apiSettings.channelId,\n data.product.result,\n catalogId\n );\n\n getAttributesForSelectedVariant(actionInput, this.props.context.actionContext).catch((error: Error) => {\n telemetry.error(error.message);\n telemetry.debug('Unable to update attributes for Product');\n telemetry.error(error.message);\n });\n }\n }\n );\n }\n\n public shouldComponentUpdate(nextProps: IProductSpecificationExtentedProps, nextState: IProductSpecificationState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n let data: IProductSpecificationData;\n try {\n data = this.props.data;\n } catch (error) {\n this.props.telemetry.error(`Something went wrong ------${error}`);\n return
{error}
;\n }\n\n if (!data.productSpecificationData.result || data.productSpecificationData.result.length <= 0) {\n this.props.telemetry.error('Product specification content is empty, module wont render.');\n return null;\n }\n\n const { heading, className } = this.props.config;\n const { productSpecificationData } = this.props.data;\n const isAccrodion = this.props.config.displayStyle === displayStyle.accordion;\n const viewProps = {\n ...this.props,\n handleText: this.handleHeadingChange,\n ProductSpecification: {\n moduleProps: this.props,\n className: classnames('ms-product-specification', className)\n },\n ProductSpecificationTableProps: isAccrodion\n ? {\n moduleProps: this.props,\n className: classnames('ms-product-specification__accordion', className)\n }\n : {\n className: classnames('ms-product-specification__table table-striped table-bordered'),\n tag: 'table'\n },\n isAccrodion,\n ProductSpecificationTableBodyProps: isAccrodion\n ? {}\n : {\n className: '',\n tag: 'tbody'\n },\n title: heading?.text && (\n \n ),\n\n productSpecificationResult: isAccrodion\n ? productSpecificationData && this._createDrawerBody(data)\n : productSpecificationData && this._createTableBody(data)\n } as IProductSpecificationViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle Heading Text Change.\n * @param event - Current event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n private _createTableBody(content: IProductSpecificationData): (JSX.Element | null)[] {\n return content.productSpecificationData.result!.map((product, index) => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n\n if (!cellData) {\n return null;\n }\n\n return (\n \n );\n });\n }\n\n private _createDrawerBody(content: IProductSpecificationData): (JSX.Element | null)[] {\n const accordionItemContainer: IModuleProps = {\n moduleProps: this.props,\n className: 'ms-product-specification-title'\n };\n return content.productSpecificationData.result!.map(product => {\n const cellData: JSX.Element | null = this._renderProductCell(product);\n if (!cellData) {\n return null;\n }\n return (\n \n \n
{cellData}
\n \n
\n );\n });\n }\n\n private readonly _toggle = (drawerListId: number | undefined) => (): void => {\n if (this.state.drawerListId !== drawerListId) {\n this.setState({ drawerListId, isDrawerOpen: true });\n } else {\n this.setState({ drawerListId: undefined, isDrawerOpen: false });\n }\n };\n\n private _renderProductCell(product: AttributeValue): JSX.Element | null {\n switch (product.DataTypeValue) {\n case 0: // None\n // Return span here instead of null so the row still shows\n return ;\n case 1: // Currency\n return this._renderCurrencyCell(product);\n case 2: // DateTime\n return this._renderDateTimeCell(product);\n case 3: // Decimal\n return this._renderDecimalCell(product);\n case 4: // Integer\n return this._renderIntegerCell(product);\n case 5: // Text\n return this._renderTextCell(product);\n case 6: // TrueFalse\n return this._renderTrueFalseCell(product);\n case 40: // Video\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case 41: // Image\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${product.DataTypeValue} so skipping line`);\n return null;\n }\n }\n\n private _renderCurrencyCell(product: AttributeValue): JSX.Element | null {\n if (product.CurrencyValue !== null && product.CurrencyValue !== undefined) {\n return (\n \n {product.CurrencyCode}\n {product.CurrencyValue}\n \n );\n }\n\n return null;\n }\n\n private _renderDateTimeCell(product: AttributeValue): JSX.Element | null {\n if (product.DateTimeOffsetValue?.toUTCString) {\n return {product.DateTimeOffsetValue.toUTCString()};\n }\n\n return null;\n }\n\n private _renderIntegerCell(product: AttributeValue): JSX.Element | null {\n if (product.IntegerValue !== null && product.IntegerValue !== undefined) {\n return {product.IntegerValue};\n }\n\n return null;\n }\n\n private _renderDecimalCell(product: AttributeValue): JSX.Element | null {\n if (product.FloatValue !== null && product.FloatValue !== undefined) {\n return {product.FloatValue};\n }\n\n return null;\n }\n\n private _renderTextCell(product: AttributeValue): JSX.Element | null {\n if (product.TextValue !== null && product.TextValue !== undefined) {\n // eslint-disable-next-line react/no-danger\n return ;\n }\n\n return null;\n }\n\n private _renderTrueFalseCell(product: AttributeValue): JSX.Element | null {\n // TODO 20369885 setting to default value is needed to work around a platform bug where\n // config string value does not get its default value.\n if (product.BooleanValue) {\n return {this.props.resources.trueValueText ? this.props.resources.trueValueText : 'Yes'};\n }\n return {this.props.resources.falseValueText ? this.props.resources.falseValueText : 'No'};\n }\n}\n\nexport default ProductSpecification;\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 MsDyn365 from '@msdyn365-commerce/core';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { ICittaJournalPostsData } from './citta-journal-posts.data';\r\nimport { ICittaJournalPostsProps } from './citta-journal-posts.props.autogenerated';\r\nimport {IGetJournalPostData } from '../../data-actions/journal/get-journal-posts';\r\n\r\nenum Market {\r\n NZ = 'NZL',\r\n AU = 'AUS',\r\n US = 'USA'\r\n}\r\n\r\nexport interface ICittaJournalPostsViewProps extends ICittaJournalPostsProps {\r\n JournalsWrapper: IModuleProps;\r\n journals: React.ReactNode;\r\n loadMore: React.ReactNode;\r\n search: React.ReactNode;\r\n categories: React.ReactNode;\r\n}\r\n\r\n// const Categories = {\r\n// behindtheproduct: 'Città Behind the product',\r\n// styling: 'Stying'\r\n// }\r\n\r\nexport interface ICittaJournalPostsState {\r\n allJournals: any;\r\n displayedJournals: any;\r\n displayCount: number;\r\n searchTerm: string;\r\n categoryFilter: string;\r\n}\r\n\r\n/**\r\n *\r\n * CittaJournalPosts component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CittaJournalPosts extends React.PureComponent, ICittaJournalPostsState> {\r\n private moduleClassName: string = 'journal-posts-wrapper';\r\n\r\n constructor(props: any) {\r\n super(props);\r\n const { audience } = props.config;\r\n const journals = props.data && props.data.journals && props.data.journals.result;\r\n let journalsFilteredByAudience = journals.posts && journals.posts.filter((post: any) => post.audience.indexOf(audience) != -1);\r\n\r\n this.state = {\r\n allJournals: journalsFilteredByAudience || [],\r\n displayedJournals: (journalsFilteredByAudience || []).slice(0, 6),\r\n displayCount: 6,\r\n searchTerm: '',\r\n categoryFilter: ''\r\n }\r\n this._loadMore = this._loadMore.bind(this);\r\n this._renderSearch = this._renderSearch.bind(this);\r\n this._renderCategoryFilter = this._renderCategoryFilter.bind(this);\r\n this._onType = this._onType.bind(this);\r\n this._getPostUrl = this._getPostUrl.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser && typeof window !== 'undefined') {\r\n const { categories } = this.props.config;\r\n const url: string = decodeURI(window.location.search);\r\n const urlParams = new URLSearchParams(url);\r\n const journalcategory = urlParams.has('journalcategory') ? urlParams.get('journalcategory') : '';\r\n const category = categories?.find((c: String) => c.toLocaleLowerCase() === journalcategory?.toLocaleLowerCase());\r\n category && this._setCategoryFilter(category)\r\n }\r\n\r\n let container = document.querySelector(\".journal-posts-wrapper-categories ul\");\r\n if (container) {\r\n const middle = container.querySelector(\"li.active\") || container.children[Math.floor((container.children.length) / 2)];\r\n // @ts-ignore\r\n container.scrollLeft = middle.offsetLeft + middle.offsetWidth / 2 - container.offsetWidth / 2;\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {displayedJournals, allJournals} = this.state;\r\n\r\n if (!allJournals || !allJournals.length) {\r\n //TODO: create a better page in here for no posts found or something\r\n return
No journals found at the moment
\r\n }\r\n\r\n const viewProps: ICittaJournalPostsViewProps = {\r\n ...(this.props as ICittaJournalPostsProps ),\r\n JournalsWrapper: {\r\n moduleProps: this.props,\r\n className: classnames(this.moduleClassName)\r\n },\r\n journals: this._renderPosts(displayedJournals),\r\n loadMore: this._renderLoadMore(),\r\n search: this._renderSearch(),\r\n categories: this._renderCategoryFilter(),\r\n };\r\n\r\n return this.props.renderView(viewProps);\r\n }\r\n\r\n private _formatDate(date: string): string {\r\n const d = date.split('-');\r\n return `${parseInt(d[2], 10)}.${parseInt(d[1], 10)}.${d[0]}`\r\n }\r\n\r\n private _renderLoadMore = () => {\r\n const {displayedJournals, allJournals } = this.state;\r\n if (displayedJournals.length >= allJournals.length) {\r\n return null;\r\n }\r\n return (\r\n
\r\n Load More\r\n
\r\n )\r\n }\r\n\r\n private _onType = (e: React.ChangeEvent) => {\r\n const { categoryFilter } = this.state;\r\n\r\n const newDisplayCount = 10;\r\n\r\n const list = this._getFilteredJournals(e.target.value.toLowerCase(), categoryFilter)\r\n \r\n this.setState({\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount),\r\n searchTerm: e.target.value,\r\n })\r\n }\r\n\r\n private _getFilteredJournals = (searchTerm: string, categoryFilter: string) => {\r\n const { allJournals } = this.state;\r\n\r\n let list = allJournals.filter((journal: IGetJournalPostData) => {\r\n if (categoryFilter && journal.category !== categoryFilter) {\r\n return null;\r\n }\r\n return journal.title.toLowerCase().indexOf(searchTerm) !== -1 || \r\n journal.subTitle.toLowerCase().indexOf(searchTerm) !== -1 \r\n })\r\n\r\n return list\r\n }\r\n\r\n private _setCategoryFilter = (type: string) => {\r\n const { searchTerm } = this.state;\r\n\r\n const newDisplayCount = 6;\r\n\r\n let list = this._getFilteredJournals(searchTerm, type);\r\n this.setState({\r\n categoryFilter: type,\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount)\r\n })\r\n }\r\n\r\n private _renderCategoryFilter = () => {\r\n const { categories } = this.props.config;\r\n const { categoryFilter } = this.state;\r\n\r\n return (\r\n
\r\n
    \r\n
  • this._setCategoryFilter('')}>All
  • \r\n {categories?.map(category => {\r\n return
  • this._setCategoryFilter(category)}>{category}
  • \r\n })}\r\n
\r\n
\r\n )\r\n }\r\n\r\n private _renderSearch = () => {\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n\r\n private _loadMore(): void {\r\n const { displayCount, searchTerm, categoryFilter } = this.state;\r\n\r\n const newDisplayCount = displayCount + 3;\r\n let list = this._getFilteredJournals(searchTerm, categoryFilter);\r\n this.setState({\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount)\r\n })\r\n }\r\n\r\n private getMarket = (url: string = ''): string => {\r\n let indexOfCountry = 3;\r\n if (url.indexOf('test.') > 0 || url.indexOf('cittab.') > 0) {\r\n indexOfCountry = 4;\r\n }\r\n let market = (url && url.length > 0) \r\n ? (url.indexOf('//') > -1 \r\n ? ((url.split('/')[indexOfCountry] === undefined || (url.split('/')[indexOfCountry].length > 2 && url.split('/')[indexOfCountry].toLowerCase() !== 'international' && url.split('/')[indexOfCountry].toLowerCase() !== 'us') || url.split('/')[indexOfCountry] === '') \r\n ? Market.NZ \r\n : url.split('/')[indexOfCountry].toUpperCase()) \r\n : Market.NZ) \r\n : '';\r\n\r\n return market;\r\n };\r\n\r\n private _getPostUrl = (postUrl: string) => {\r\n const url = this.props.context.request.url && this.props.context.request.url.requestUrl && this.props.context.request.url.requestUrl.href;\r\n\r\n if (postUrl.indexOf('https://') !== -1) {\r\n return postUrl;\r\n }\r\n\r\n const market = this.getMarket(url);\r\n\r\n if (market === 'AU') {\r\n return `\\/au${postUrl}`\r\n } else if (market.toLowerCase() === 'international' || market.toLowerCase() === 'us') { \r\n return `/${market.toLowerCase()}${postUrl}`\r\n }\r\n \r\n return postUrl;\r\n }\r\n\r\n private _renderPosts = (posts: IGetJournalPostData[]) => {\r\n if (!posts.length) {\r\n return
We can't find any journals to match that
\r\n }\r\n\r\n return posts.map((post: IGetJournalPostData) => {\r\n return (\r\n \r\n );\r\n })\r\n };\r\n}\r\n\r\nexport default CittaJournalPosts;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IProductSpecificationViewProps } from './product-specification';\n\nconst ProductSpecificationView: React.FC = props => {\n const { ProductSpecification, ProductSpecificationTableProps, ProductSpecificationTableBodyProps, productSpecificationResult } = props;\n const rowdata =\n productSpecificationResult &&\n ArrayExtensions.hasElements(productSpecificationResult) &&\n productSpecificationResult.filter(row => !ObjectExtensions.isNullOrUndefined(row));\n\n return rowdata && ArrayExtensions.hasElements(rowdata) ? (\n \n {props.title}\n \n {rowdata}\n \n \n ) : null;\n};\n\nexport default ProductSpecificationView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport getAttributesForSelectedVariant, { AttributesForSelectedVariantInput } from './dataActions/get-attributes-for-selected-variant';\nimport ProductSpecification from './modules/product-specification/product-specification';\nimport ProductSpecificationView from './modules/product-specification/product-specification.view';\n\nexport * from './modules/product-specification/components/product-specification-table-stucture';\nexport * from './modules/product-specification/product-specification';\nexport * from './modules/product-specification/product-specification.data';\nexport * from './modules/product-specification/product-specification.props.autogenerated';\nexport * from './modules/product-specification/product-specification.view';\nexport { AttributesForSelectedVariantInput, getAttributesForSelectedVariant, ProductSpecification, ProductSpecificationView };\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.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { Module } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport * as React from 'react';\r\nimport { ICittaJournalPostsViewProps } from './citta-journal-posts';\r\n\r\nexport default (props: ICittaJournalPostsViewProps) => {\r\n\r\n return (\r\n \r\n {props.categories}\r\n {props.search}\r\n \r\n
\r\n {props.journals}\r\n
\r\n {props.loadMore}\r\n
\r\n );\r\n};\r\n"],"sourceRoot":""}