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EjfC,KAAK,EACLC,GAAI,YACJC,EAAG,gBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,6BAOAlB,EAF4B,wEACXQ,EAAQ,MAQzBR,EAF4B,oFACXQ,EAAQ,MAQzBR,EAF4B,qGACXQ,EAAQ,MAQzBR,EAF4B,0EACXQ,EAAQ,KAMjCzF,OAAOoG,aAAepG,OAAOoG,cAAgB,GAC7CpG,OAAOoG,aAAarB,QAAOvD,EAAAA,EAAA,GACpBxB,OAAOoG,aAAarB,SAAW,IAC/BD,EAAQC,SAGX/E,OAAOoG,aAAapB,YAAWxD,EAAAA,EAAA,GAC5BxB,OAAOoG,aAAapB,aAAe,IACnCF,EAAQE,c,mBC9FnBqB,EAAOC,QAAU5G,O,oBCAjB2G,EAAOC,QAAUC,W","sources":["webpack://bju-press/./src/modules/power-reviews/power-reviews.props.autogenerated.ts?7ebc","webpack://bju-press/./src/modules/power-reviews/power-reviews.tsx?3996","webpack://bju-press/./src/utilities/class-name-helper.ts?dd10","webpack://bju-press/./src/utilities/inject-helper.ts?0256","webpack://bju-press/./lib/power-reviews/module-registration.js?8e6b","webpack://bju-press/external var \"React\"?0d3b","webpack://bju-press/external var \"ReactDOM\"?853b"],"sourcesContent":["/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IPowerReviews contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum displayType {\r\n questionsReviews = 'questionsReviews',\r\n writeReview = 'writeReview',\r\n reviewSnippet = 'reviewSnippet'\r\n}\r\n\r\nexport interface IPowerReviewsConfig extends Msdyn365.IModuleConfig {\r\n displayType: displayType;\r\n url: string;\r\n apiKey: string;\r\n locale: string;\r\n merchantId: string;\r\n groupId: string;\r\n siteId: string;\r\n reviewPage: IReviewPageData;\r\n reviewSnippetLink?: IReviewSnippetLinkData;\r\n className?: string;\r\n}\r\n\r\nexport interface IReviewPageData {\r\n linkText?: string;\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IReviewSnippetLinkData {\r\n linkText?: string;\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n}\r\n\r\nexport interface IPowerReviewsProps extends Msdyn365.IModule {\r\n config: IPowerReviewsConfig;\r\n}\r\n","//==============================================================================\r\n// PowerReviews\r\n//\r\n// PowerReviews integration for product pages and product listing pages\r\n//==============================================================================\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { clsHelper } from '../../utilities/class-name-helper';\r\nimport { injectScript } from '../../utilities/inject-helper';\r\n\r\nimport { IPowerReviewsData } from './power-reviews.data';\r\nimport { IPowerReviewsProps, displayType } from './power-reviews.props.autogenerated';\r\n\r\n//==============================================================================\r\n// CLASS NAME UTILITY\r\n//==============================================================================\r\nconst BASE_CLASS = 'pr';\r\nconst cls = (fragment?: string) => clsHelper(BASE_CLASS, fragment, '-');\r\nconst prClass = {\r\n questionDisplay: cls('questiondisplay'),\r\n questionSnippet: cls('questionsnippet'),\r\n reviewDisplay: cls('reviewdisplay'),\r\n reviewSnippet: cls('reviewsnippet'),\r\n write: cls('write')\r\n};\r\n\r\n//==============================================================================\r\n// CLASS DEFINITION\r\n//==============================================================================\r\n/**\r\n * PowerReviews component\r\n * @extends {React.PureComponent>}\r\n */\r\n//==============================================================================\r\nclass PowerReviews extends React.PureComponent> {\r\n //==========================================================================\r\n // PUBLIC METHODS\r\n //==========================================================================\r\n //------------------------------------------------------\r\n // Invoked immediately after component is mounted\r\n //------------------------------------------------------\r\n public componentDidMount(): void {\r\n const { config, data } = this.props;\r\n\r\n if (typeof window !== 'undefined' && config.url) {\r\n injectScript(config.url);\r\n\r\n // @ts-ignore: pwr added through script\r\n window.pwr = window.pwr || function() {\r\n // @ts-ignore: pwr added through script\r\n (pwr.q = pwr.q || []).push(arguments);\r\n };\r\n\r\n const prCommon = {\r\n api_key: config.apiKey,\r\n locale: config.locale,\r\n merchant_group_id: config.groupId,\r\n merchant_id: config.merchantId\r\n };\r\n\r\n if (config.displayType === displayType.questionsReviews) {\r\n // @ts-ignore: pwr added through script\r\n pwr('render', {\r\n ...prCommon,\r\n page_id: `${data.product.result?.ItemId}_${config.siteId}`,\r\n review_wrapper_url: `${config.reviewPage?.linkUrl.destinationUrl}?pr_page_id=${data.product.result?.ItemId}_${config.siteId}`,\r\n //*** Start Feedless Product Code ***\r\n product: {\r\n name: data.product.result?.Name,\r\n url: window.location.href,\r\n image_url: data.product.result?.PrimaryImageUrl,\r\n description: data.product.result?.Description,\r\n category_name: data.categoryPaths.result?.length && data.categoryPaths.result[0].Name,\r\n price: data.product.result?.Price\r\n },\r\n //*** End Feedless Product Code ***\r\n components: {\r\n QuestionDisplay: prClass.questionDisplay,\r\n QuestionSnippet: prClass.questionSnippet,\r\n ReviewDisplay: prClass.reviewDisplay,\r\n ReviewSnippet: prClass.reviewSnippet\r\n }\r\n });\r\n }\r\n\r\n if (config.displayType === displayType.writeReview) {\r\n // @ts-ignore: pwr added through script\r\n pwr('render', {\r\n ...prCommon,\r\n on_submit: function() {\r\n window.scrollTo(0, 0);\r\n },\r\n components: {\r\n Write: prClass.write\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n // Render function\r\n //------------------------------------------------------\r\n public render(): JSX.Element {\r\n const { config } = this.props;\r\n\r\n return (\r\n
\r\n {config.displayType === displayType.questionsReviews && (\r\n <>\r\n
\r\n
\r\n \r\n )}\r\n {config.displayType === displayType.writeReview && (\r\n
\r\n )}\r\n {config.displayType === displayType.reviewSnippet && (\r\n
\r\n
\r\n {config.reviewSnippetLink &&\r\n \r\n {config.reviewSnippetLink.linkText}\r\n \r\n }\r\n
\r\n )}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default PowerReviews;\r\n","//==============================================================================\r\n// Class Name Helper\r\n//\r\n// Tool to standardize CSS class naming in module components and elements\r\n//==============================================================================\r\n\r\nexport function clsHelper(baseClass: string, fragment?: string, separator: string = '__'): string | undefined {\r\n return fragment ? `${baseClass}${separator}${fragment}` : undefined;\r\n}\r\n","//==============================================================================\r\n// Inject Helper\r\n//\r\n// Tool to inject scripts and stylesheets into the HTML header\r\n//==============================================================================\r\n\r\n//----------------------------------------------------------\r\n// Inject a script into the HTML header\r\n//----------------------------------------------------------\r\nexport function injectScript(url: string): void {\r\n // Create the element\r\n const script = document.createElement('script');\r\n script.src = url;\r\n\r\n // Inject the element\r\n document.head.appendChild(script);\r\n}\r\n\r\n//----------------------------------------------------------\r\n// Inject a sylesheet into the HTML header\r\n//----------------------------------------------------------\r\nexport function injectCss(url: string): void {\r\n // Create the element\r\n const css = document.createElement('link');\r\n css.rel = 'stylesheet';\r\n css.href = url;\r\n\r\n // Inject the element\r\n document.head.appendChild(css);\r\n}\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['power-reviews'] = {\n c: () => require('partner/modules/power-reviews/power-reviews.tsx'),\n $type: 'contentModule',\n da: [{name:'categoryPaths', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'power-reviews',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/power-reviews'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-category-paths');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-product-availabilities-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["displayType","cls","fragment","clsHelper","prClass","questionDisplay","questionSnippet","reviewDisplay","reviewSnippet","write","PowerReviews","React","componentDidMount","config","data","this","props","window","url","injectScript","pwr","q","push","arguments","prCommon","api_key","apiKey","locale","merchant_group_id","groupId","merchant_id","merchantId","_data$product$result","_config$reviewPage","_data$product$result2","_data$product$result3","_data$product$result4","_data$product$result5","_data$categoryPaths$r","_data$product$result6","questionsReviews","_objectSpread","page_id","product","result","ItemId","siteId","review_wrapper_url","reviewPage","linkUrl","destinationUrl","name","Name","location","href","image_url","PrimaryImageUrl","description","Description","category_name","categoryPaths","length","price","Price","components","QuestionDisplay","QuestionSnippet","ReviewDisplay","ReviewSnippet","writeReview","on_submit","scrollTo","Write","render","_config$reviewSnippet","className","classnames","id","reviewSnippetLink","title","linkText","ariaLabel","target","openInNewTab","undefined","rel","role","baseClass","separator","script","document","createElement","src","head","appendChild","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","module","exports","ReactDOM"],"sourceRoot":""}