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AAVA,EAAK,GAAa,GAC7BA,EAAK,GAAgB,GAAVA,EAAK,GAAa,IAGzBR,EACF,IAAK,IAAIW,EAAK,EAAGA,EAAK,KAAMA,EAC1BX,EAAI5+C,EAAIu/C,GAAMH,EAAKG,GAIvB,OAAOX,GAAOU,EAAYF","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-azureblobstorage-secureurl.action.ts?c040","webpack://Msdyn365.Commerce.Online/./src/actions/get-decryption-keys.action.ts?e2dc","webpack://Msdyn365.Commerce.Online/./src/actions/list-page-state.action.ts?b9a9","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/web-vitals/dist/web-vitals.js?1850","webpack://Msdyn365.Commerce.Online/../../../../src/_server/inteceptors/ttl-cache.ts?e0fd","webpack://Msdyn365.Commerce.Online/../../../../src/_server/inteceptors/request-vectorizer.ts?c150","webpack://Msdyn365.Commerce.Online/../../../../src/_server/inteceptors/rs-logging-interceptor.ts?662d","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/link-actions/page-type-context-by-id.ts?6c79","webpack://Msdyn365.Commerce.Online/../../../src/hydrators/process-page-response.ts?c773","webpack://Msdyn365.Commerce.Online/../../../src/hydrators/link-hydrator.ts?6237","webpack://Msdyn365.Commerce.Online/../../../src/store/page-context.ts?7400","webpack://Msdyn365.Commerce.Online/../../../src/utils/session-storage-utils.ts?6e42","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/utils.js?c36d","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/Cookies.js?2bbb","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/universal-cookie/es6/index.js?87b9","webpack://Msdyn365.Commerce.Online/../../../src/utils/cookie-utils.ts?31b7","webpack://Msdyn365.Commerce.Online/../../../src/utils/resolve-segments-utils.ts?6007","webpack://Msdyn365.Commerce.Online/../../../src/_client/client-render.tsx?dd81","webpack://Msdyn365.Commerce.Online/../../../src/app-initialization/initialization.ts?f0ba","webpack://Msdyn365.Commerce.Online/../../../src/app-initialization/render-component.tsx?9b51","webpack://Msdyn365.Commerce.Online/../../../src/app-initialization/client-initialization.ts?84a7","webpack://Msdyn365.Commerce.Online/../../../src/app-initialization/utils.ts?39fc","webpack://Msdyn365.Commerce.Online/../../../src/components/add-module-control.tsx?59cd","webpack://Msdyn365.Commerce.Online/../../../src/components/module-client-render-component.tsx?9466","webpack://Msdyn365.Commerce.Online/../../../src/components/add-module-wrapper.tsx?05b8","webpack://Msdyn365.Commerce.Online/../../../src/components/render-view.tsx?751d","webpack://Msdyn365.Commerce.Online/../../../src/components/error-module.tsx?67fa","webpack://Msdyn365.Commerce.Online/../../../src/components/safe-render-module.tsx?04c3","webpack://Msdyn365.Commerce.Online/../../src/consts.ts?a6b5","webpack://Msdyn365.Commerce.Online/../../../src/app-initialization/models.ts?a775","webpack://Msdyn365.Commerce.Online/../../../src/data/load-data.ts?fc90","webpack://Msdyn365.Commerce.Online/../../../src/utils/data-action-extension-helper.ts?35ec","webpack://Msdyn365.Commerce.Online/../../../src/utils/link-utils.ts?3f81","webpack://Msdyn365.Commerce.Online/../../../src/hydrators/hydrator-action-inputs.ts?51eb","webpack://Msdyn365.Commerce.Online/../../../src/utils/product-list-utils.ts?20d3","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/utils/inventory-util.ts?0972","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-category.action.ts?6ed5","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-recentlyviewed.action.ts?f746","webpack://Msdyn365.Commerce.Online/../../../src/hydrators/get-simple-products.ts?1a66","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-recommendation.action.ts?6f98","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-relationship-id.action.ts?6e59","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-promotions.action.ts?412e","webpack://Msdyn365.Commerce.Online/../../../../src/hydrators/product-list-actions/products-by-search.action.ts?f730","webpack://Msdyn365.Commerce.Online/../../../src/hydrators/product-list-hydrator.ts?e2b4","webpack://Msdyn365.Commerce.Online/../../../src/store/authoring-edit-helper.ts?e511","webpack://Msdyn365.Commerce.Online/../../../../src/_server/error/HttpException.ts?621a","webpack://Msdyn365.Commerce.Online/../../../../src/_server/error/HttpRedirectException.ts?19b2","webpack://Msdyn365.Commerce.Online/../../../src/utils/helpers.ts?7637","webpack://Msdyn365.Commerce.Online/../../../src/attribute-renderers/commerce-insights-attribute-renderer.ts?5c87","webpack://Msdyn365.Commerce.Online/../../../src/attribute-renderers/exp-attribute-renderer.ts?e5ad","webpack://Msdyn365.Commerce.Online/../../../../src/interfaces/events/TelemetryEvent.ts?3ff3","webpack://Msdyn365.Commerce.Online/../../../src/interfaces/ITelemetry.ts?2d8f","webpack://Msdyn365.Commerce.Online/../../../src/interfaces/ITelemetryCommon.ts?7e00","webpack://Msdyn365.Commerce.Online/../../../src/event-loggers/commerce-insights-logger.ts?2559","webpack://Msdyn365.Commerce.Online/../../../src/events/client-render.ts?7f03","webpack://Msdyn365.Commerce.Online/../../../src/events/http-service.ts?0d69","webpack://Msdyn365.Commerce.Online/../../../src/events/web-vitals.ts?20b0","webpack://Msdyn365.Commerce.Online/../../../src/helpers/common.ts?627b","webpack://Msdyn365.Commerce.Online/../../../src/telemetry/telemetry-base.ts?5b2a","webpack://Msdyn365.Commerce.Online/../../../src/telemetry/internal-telemetry.ts?bc2b","webpack://Msdyn365.Commerce.Online/../../../src/telemetry/static-telemetry.ts?5995","webpack://Msdyn365.Commerce.Online/../../../src/loggers/logging-helper.ts?d958","webpack://Msdyn365.Commerce.Online/../../../src/telemetry/telemetry.ts?920f","webpack://Msdyn365.Commerce.Online/../../../src/privacy/dynamics-privacy-helper.ts?4c7c","webpack://Msdyn365.Commerce.Online/../../../src/loggers/app-insights-helper.ts?cafe","webpack://Msdyn365.Commerce.Online/../../../src/loggers/client-app-insights-js-logger.ts?67fa","webpack://Msdyn365.Commerce.Online/../../../src/loggers/generic-console-logger.ts?d348","webpack://Msdyn365.Commerce.Online/../../../src/strings/exceptions.ts?c950","webpack://Msdyn365.Commerce.Online/../../../src/strings/messages.ts?2613","webpack://Msdyn365.Commerce.Online/../../../src/strings/client-render.ts?6638","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/runtime-internal/node_modules/cookie/index.js?7cab","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/telemetry-internal/node_modules/uuid/lib/bytesToUuid.js?b010","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/telemetry-internal/node_modules/uuid/lib/rng-browser.js?9aca","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/telemetry-internal/node_modules/uuid/v4.js?a402"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CommerceProperty, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { getDocumentBlobSecureUrlAsync } from '../customProxy/retailExtension/DataActionExtension.g';\r\n\r\n/**\r\n * GetAzureblobstorageSecureurl Input Action\r\n */\r\nexport class GetAzureblobstorageSecureurlInput implements Msdyn365.IActionInput {\r\n constructor(context: IContext, orderId: string, documentName: string, uniqueId: string) {\r\n this.orderId = orderId;\r\n this.documentName = documentName;\r\n this.context = context;\r\n this.uniqueId = uniqueId;\r\n }\r\n public uniqueId: string;\r\n public orderId: string;\r\n public documentName?: string;\r\n public context: IContext;\r\n public getCacheKey = () => `BLOBSECUREURL`;\r\n public getCacheObjectType = () => 'BLOBSECUREURL';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\nexport interface IGetAzureblobstorageSecureurlData {\r\n Status: boolean;\r\n SecureBlobUrl: string;\r\n ExtensionProperties?: CommerceProperty[] | undefined;\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\nasync function action(input: GetAzureblobstorageSecureurlInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n const response = await getDocumentBlobSecureUrlAsync(input.context, input.orderId, input.documentName || '', input.uniqueId);\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'GetAzureblobstorageSecureurl'\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport class GetDecryptionKeysInput implements Msdyn365.IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => 'DecryptionKeysCache';\r\n public getCacheObjectType = () => 'DecryptionKeysCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\nexport interface IActionGetDecryptionKeysData {\r\n EncryptionEnable: string | undefined;\r\n EncryptionAesKey: string | undefined;\r\n EncryptionAesIV: string | undefined;\r\n currentTime?: string;\r\n lastUpdateTime?: string;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetDecryptionKeysInput();\r\n};\r\nasync function Action(input: GetDecryptionKeysInput, ctx: Msdyn365.IActionContext): Promise {\r\n const encryptionEnable: Msdyn365.ISecretValue | undefined = await Msdyn365.msdyn365Commerce.secretManager?.getSecretValue(\r\n 'encryptionEnable',\r\n ctx.requestContext.apiSettings.baseUrl\r\n );\r\n console.log({ encryptionEnable });\r\n const encryptionAesKey: Msdyn365.ISecretValue | undefined = await Msdyn365.msdyn365Commerce.secretManager?.getSecretValue(\r\n 'encryptionAesKey',\r\n ctx.requestContext.apiSettings.baseUrl\r\n );\r\n const encryptionAesIV: Msdyn365.ISecretValue | undefined = await Msdyn365.msdyn365Commerce.secretManager?.getSecretValue(\r\n 'encryptionAesIV',\r\n ctx.requestContext.apiSettings.baseUrl\r\n );\r\n\r\n if (encryptionEnable?.value === 'true') {\r\n const cookie = new Cookies();\r\n const currentTime = new Date();\r\n const storedCurrentTime = cookie.get('currentTime');\r\n if (!storedCurrentTime || isTimeToUpdate(currentTime, new Date(storedCurrentTime))) {\r\n await updateKeys(cookie, currentTime, encryptionAesKey, encryptionAesIV);\r\n }\r\n // Retrieve keys from cookies after update\r\n const EncryptionAesKey = cookie.get('EncryptionAesKey');\r\n const EncryptionAesIV = cookie.get('EncryptionAesIV');\r\n const updatedCurrentTime = cookie.get('currentTime');\r\n const lastUpdateTime = cookie.get('lastUpdateTime');\r\n return {\r\n EncryptionAesKey,\r\n EncryptionAesIV,\r\n EncryptionEnable: encryptionEnable?.value,\r\n currentTime: updatedCurrentTime,\r\n lastUpdateTime: lastUpdateTime\r\n };\r\n } else {\r\n // If encryption is not enabled, remove the cookies\r\n const cookie = new Cookies();\r\n cookie.remove('currentTime');\r\n cookie.remove('expireTime');\r\n cookie.remove(input.getCacheKey());\r\n return {\r\n EncryptionEnable: encryptionEnable?.value,\r\n EncryptionAesKey: '',\r\n EncryptionAesIV: '',\r\n currentTime: '',\r\n lastUpdateTime: ''\r\n };\r\n }\r\n}\r\n\r\nfunction isTimeToUpdate(currentTime: Date, storedTime: Date): boolean {\r\n const elapsedMinutes = (currentTime.getTime() - storedTime.getTime()) / (1000 * 60);\r\n return elapsedMinutes >= 2;\r\n}\r\nasync function updateKeys(\r\n cookie: Cookies,\r\n currentTime: Date,\r\n encryptionAesKey: Msdyn365.ISecretValue | undefined,\r\n encryptionAesIV: Msdyn365.ISecretValue | undefined\r\n): Promise {\r\n const currentTimeString = currentTime.toISOString();\r\n // Set new values in cookies\r\n cookie.set('EncryptionAesKey', encryptionAesKey?.value);\r\n cookie.set('EncryptionAesIV', encryptionAesIV?.value);\r\n cookie.set('currentTime', currentTimeString);\r\n cookie.set('lastUpdateTime', currentTimeString);\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >Action,\r\n id: 'GetDecryptionKeys',\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { ProductPrice, ProductRefinerValue, SimpleProduct, SortingInfo, SalesInvoiceLine } from '@msdyn365-commerce/retail-proxy';\r\nimport { observable } from 'mobx';\r\n\r\nimport { listPageType } from '@msdyn365-commerce-modules/search-result-container/src/modules/search-result-container/actions/index';\r\n\r\n/**\r\n * ListPageState class.\r\n */\r\nexport class ListPageState {\r\n @observable public activeFilters: ProductRefinerValue[] | null = null;\r\n\r\n @observable public activeProducts: SalesInvoiceLine[] = [];\r\n\r\n @observable public sortingCritera: SortingInfo | null = null;\r\n\r\n @observable public currentPageNumber: number | null = null;\r\n\r\n @observable public refiners: IProductRefinerHierarchy[] | null = null;\r\n\r\n @observable public totalProductCount: number | undefined;\r\n\r\n @observable public pageSize: number = 10;\r\n\r\n @observable public pageType: listPageType = 'Unknown';\r\n\r\n @observable public featureProduct: SimpleProduct | null = null;\r\n\r\n @observable public productPrices: ProductPrice[] | undefined = [];\r\n}\r\n\r\n/**\r\n * ListPageStateInput - action input.\r\n */\r\nexport class ListPageStateInput implements IActionInput {\r\n public getCacheKey = () => 'ListPageState';\r\n\r\n public getCacheObjectType = () => 'ListPageState';\r\n\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport async function listPageStateAction(input: ListPageStateInput, ctx: IActionContext): Promise {\r\n return new ListPageState();\r\n}\r\n\r\n/**\r\n * Create new input for create action.\r\n * @param inputData\r\n */\r\nexport const createListPageInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ListPageStateInput();\r\n};\r\n\r\n/**\r\n * ListPageState - create action.\r\n */\r\nexport default createObservableDataAction({\r\n action: >listPageStateAction,\r\n input: createListPageInput\r\n});\r\n","var e,n,t,i,r,a=-1,o=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),i=\"navigate\";a>=0?i=\"back-forward-cache\":t&&(document.prerendering||u()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":t.type&&(i=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},d=function(e,n,t,i){var r,a;return function(o){n.value>=0&&(o||i)&&((a=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){var n=function(n){\"pagehide\"!==n.type&&\"hidden\"!==document.visibilityState||e(n)};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},v=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},L=[1800,3e3],w=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"FCP\"),a=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTimei.value&&(i.value=r,i.entries=a,t())},u=s(\"layout-shift\",c);u&&(t=d(e,i,b,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){r=0,i=f(\"CLS\",0),t=d(e,i,b,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A={passive:!0,capture:!0},I=new Date,P=function(i,r){e||(e=r,n=i,t=new Date,k(removeEventListener),F())},F=function(){if(n>=0&&n1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){P(e,n),r()},i=function(){r()},r=function(){removeEventListener(\"pointerup\",t,A),removeEventListener(\"pointercancel\",i,A)};addEventListener(\"pointerup\",t,A),addEventListener(\"pointercancel\",i,A)}(n,e):P(n,e)}},k=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,M,A)}))},D=[100,300],x=function(t,r){r=r||{},C((function(){var a,c=E(),u=f(\"FID\"),l=function(e){e.startTimen.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};J[i.id]=i,G.push(i)}G.sort((function(e,n){return n.latency-e.latency})),G.splice(10).forEach((function(e){delete J[e.id]}))}},Q=function(e,n){n=n||{},C((function(){var t;q();var i,r=f(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&K(e),\"first-input\"===e.entryType)&&(!G.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&K(e))}));var n,t=(n=Math.min(G.length-1,Math.floor(z()/50)),G[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},c=s(\"event\",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=d(e,r,j,n.reportAllChanges),c&&(\"PerformanceEventTiming\"in window&&\"interactionId\"in PerformanceEventTiming.prototype&&c.observe({type:\"first-input\",buffered:!0}),p((function(){a(c.takeRecords()),r.value<0&&z()>0&&(r.value=0,r.entries=[]),i(!0)})),o((function(){G=[],_=O(),r=f(\"INP\"),i=d(e,r,j,n.reportAllChanges)})))}))},U=[2500,4e3],V={},W=function(e,n){n=n||{},C((function(){var t,i=E(),r=f(\"LCP\"),a=function(e){var n=e[e.length-1];n&&n.startTimeperformance.now())return;t.value=Math.max(a-u(),0),t.entries=[r],i(!0),o((function(){t=f(\"TTFB\",0),(i=d(e,t,X,n.reportAllChanges))(!0)}))}}))};export{b as CLSThresholds,L as FCPThresholds,D as FIDThresholds,j as INPThresholds,U as LCPThresholds,X as TTFBThresholds,S as getCLS,w as getFCP,x as getFID,Q as getINP,W as getLCP,Z as getTTFB,S as onCLS,w as onFCP,x as onFID,Q as onINP,W as onLCP,Z as onTTFB};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport interface ITTLCacheOptions {\n removalThresholdInMs?: number;\n intervalForRemovalInMs?: number;\n}\n\nexport type TOnRemoveCallback = (removedKey: string) => void;\n/**\n * Cache with TTL and polling to remove items from it, default implementaiton is to only poll on server\n */\nexport class TTLCache {\n // threshold for removal, 5mins\n public readonly removalThresholdInMs: number;\n\n // frequency of cleaning, 2mins -- this is the period it'll look for keys older than removalThresholdInMs\n public readonly intervalForRemovalInMs: number;\n\n // internal cache\n private _cache: Map;\n\n constructor(options?: ITTLCacheOptions) {\n this.removalThresholdInMs = (options && options.removalThresholdInMs) || 300000;\n this.intervalForRemovalInMs = (options && options.intervalForRemovalInMs) || 120000;\n this._cache = new Map();\n\n if (process.env.CURRENT_ENVIRONMENT === 'node') {\n // interval trigger to clear the map -- only on server\n setInterval(() => this._cleanCache(), this.intervalForRemovalInMs);\n }\n }\n\n /**\n * Gets a value from cache\n *\n * @param {string} key the key\n * @returns {(TValue | undefined)} the value, if it exists\n */\n public get(key: string): TValue | undefined {\n const value = this._cache.get(key);\n if (value) {\n return value[0];\n }\n }\n\n /**\n * Set a value\n *\n * @param {string} key the key\n * @param {TValue} value the value\n */\n public set(key: string, value: TValue, onRemoveCallback?: TOnRemoveCallback): void {\n const now = Date.now();\n this._cache.set(key, [value, now, onRemoveCallback]);\n }\n\n public clear(): void {\n this._cache.clear();\n }\n\n // cleans up the map implementation\n private _cleanCache(): void {\n const now = Date.now();\n const keys = this._cache.keys();\n for (const key of keys) {\n const value = this._cache.get(key);\n if (value && value.length > 1 && now - value[1] > this.removalThresholdInMs) {\n this._cache.delete(key);\n if (typeof value[2] === 'function') {\n value[2](key);\n }\n }\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { TTLCache } from './ttl-cache';\n\nexport interface IRequestVectorizerOptions {\n removalThresholdInMs?: number;\n intervalForRemovalInMs?: number;\n}\n\n/**\n * Class which handles vectorizing requests\n */\nclass RequestVectorizer {\n // differentiate vectors generated client/server side\n public static SEP: string = process.env.CURRENT_ENVIRONMENT === 'node' ? '.' : '/';\n private _cache: TTLCache;\n\n constructor(options?: IRequestVectorizerOptions) {\n this._cache = new TTLCache(options);\n // binds\n this.next = this.next.bind(this);\n }\n\n /**\n * The next request in the sequence\n *\n * @param {string} requestId\n * @returns {string} the next vectorized request\n */\n public next(requestId: string): string {\n const value = this._cache.get(requestId);\n const nextValue = value === undefined ? 0 : value + 1;\n this._cache.set(requestId, nextValue);\n return `${requestId}${RequestVectorizer.SEP}${nextValue}`;\n }\n}\nconst RequestVectorizerInstance = new RequestVectorizer();\nexport { RequestVectorizerInstance, RequestVectorizer };\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IEventRetailServerRequestProperties, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\nimport { isEmpty as _isEmpty } from 'lodash';\nimport url from 'url';\nimport { TelemetryClient } from 'applicationinsights';\nimport { RequestVectorizerInstance } from './request-vectorizer';\nimport { TTLCache } from './ttl-cache';\n\n/**\n * Regular expression to match content inside round braces\n */\nconst regexGetRoundBraces = /\\(.+?\\)/gm;\n\n/**\n * Default client error\n */\nconst DEFAULT_ERROR_STATUS_CODE = 418;\n\n/**\n * Formats commerce URL parts used in retail server calls with odata formatting\n *\n * @param inputString The input string to replace\n * @param replaceString The replacement value, default of `(~)`.\n */\nexport const replaceIdentifiers = (inputString: string | undefined, replaceString?: string) => {\n return (inputString || '').replace(regexGetRoundBraces, replaceString || `(~)`);\n};\n\n/**\n * Helper mapping lowercase keys to real keys in an object. Note this returns the keys only, mapping\n * lower case key to the actual cased key name in the dictionary\n *\n * e.g.\n *\n * HelloWorld will be returned as 'helloworld' allowing you to look up 'helloworld' to get HelloWorld to index into the real dictionary\n * @param objectDictionary the object dictionary\n */\nexport const toLowerCaseDict = (objectDictionary): { [lowerCaseKeyName: string]: string } => {\n return Object.keys(objectDictionary || {}).reduce(\n (prevValue, current) => ({ ...prevValue, [current.toLocaleLowerCase()]: current }),\n {}\n );\n};\n\nconst ttlRequestCache = new TTLCache();\n\n/**\n * Error retail se interceptor for axios\n *\n * @param config The request cofiguration\n * @param status The response status code\n * @param requestCache The optional request cache to use (mostly for testing)\n */\n\nexport const RSErrorResponseHandler = (\n config: AxiosRequestConfig,\n status: number,\n requestCache?: TTLCache\n) => {\n if (!requestCache) {\n requestCache = ttlRequestCache;\n }\n const headers = config && config.headers;\n let requestId;\n let activityId;\n if (headers) {\n const lowercaseHeaders = toLowerCaseDict(headers);\n requestId = lowercaseHeaders.requestid && headers[lowercaseHeaders.requestid];\n activityId = lowercaseHeaders.activityid && headers[lowercaseHeaders.activityid];\n }\n const statusCode = status ? status : DEFAULT_ERROR_STATUS_CODE;\n const properties = requestCache.get(requestId);\n if (properties) {\n const elapsedTime = StaticTelemetry.stopTimer(requestId);\n const parsedUrl = url.parse((config && (config.url || config.baseURL)) || '');\n StaticTelemetry.trackDependency({\n duration: elapsedTime,\n method: (properties.m || 'unknown').toUpperCase(),\n name: properties.e,\n resultCode: statusCode,\n success: status < 400,\n url: parsedUrl,\n target: parsedUrl.hostname,\n properties: {\n requestId,\n activityId,\n empty: false\n },\n dependencyName: 'RetailServer'\n });\n }\n};\n\n/**\n * Response interceptor for axios\n *\n * @param response The resposne\n * @param requestCache The optional request cache to use (mostly for testing)\n */\nexport const RSResponseInterceptor = (response: AxiosResponse, requestCache?: TTLCache) => {\n if (!requestCache) {\n requestCache = ttlRequestCache;\n }\n // try get properties from request based on requestid header\n let requestId;\n let activityId;\n if (process.env.CURRENT_ENVIRONMENT !== 'node') {\n // on web we need to check config\n const headers = response && response.config && response.config.headers;\n if (headers) {\n const lowercaseHeaders = toLowerCaseDict(headers);\n requestId = lowercaseHeaders.requestid && headers[lowercaseHeaders.requestid];\n activityId = lowercaseHeaders.activityid && headers[lowercaseHeaders.activityid];\n }\n } else {\n requestId = response && response.headers && response.headers.requestid;\n activityId = response && response.headers && response.headers.activityid;\n }\n const properties = requestCache.get(requestId);\n if (properties) {\n const elapsedTime = StaticTelemetry.stopTimer(requestId);\n const { config, status, request } = response;\n const parsedUrl = url.parse((config && (config.url || config.baseURL)) || '');\n StaticTelemetry.trackDependency({\n duration: elapsedTime,\n method: (properties.m || (request && request.method) || 'unknown').toUpperCase(),\n name: properties.e,\n resultCode: status,\n success: status < 400,\n url: parsedUrl,\n target: parsedUrl.hostname,\n properties: {\n requestId,\n activityId,\n empty: _isEmpty(response.data),\n ...(properties.ahs && { authTokenSize: properties.ahs })\n },\n dependencyName: 'RetailServer'\n });\n }\n\n return response;\n};\n\n/**\n * Captures outgoing calls to retail server\n */\nexport const RSRequestInterceptor = (request: AxiosRequestConfig) => {\n if (!request || !request.headers) {\n return request;\n }\n const requestHeaders = request.headers;\n const caseInsensitiveHeaderMap = toLowerCaseDict(requestHeaders);\n\n // check if it's an outgoing request to retail server\n\n if (caseInsensitiveHeaderMap.oun && request.url) {\n // get the API endpoint\n const parsedUrl = url.parse(request.url, false);\n const apiEndPoint = replaceIdentifiers(parsedUrl.pathname);\n\n // associate with the request-id vector\n const requestIdVector = requestHeaders[caseInsensitiveHeaderMap['request-id']] || '';\n\n const authorizationHeader: string = (requestHeaders[caseInsensitiveHeaderMap['authorization']] || '').toString();\n let authorizationHeaderLength = 0;\n\n if (authorizationHeader && authorizationHeader.toLowerCase().indexOf('bearer') > -1) {\n const authArray = authorizationHeader.split(' ');\n if (authArray.length > 1) {\n authorizationHeaderLength = authArray[1].length;\n }\n }\n\n // associate with the requestid (non-vectored)\n const caseInsensitiveRequestIdHeaderName = caseInsensitiveHeaderMap.requestid || 'requestid';\n const currentRequestId = requestHeaders[caseInsensitiveRequestIdHeaderName] || 'undefined';\n const requestId = RequestVectorizerInstance.next(currentRequestId.toString());\n\n StaticTelemetry.startTimer(requestId);\n\n const properties: IEventRetailServerRequestProperties = {\n // method\n m: request.method!,\n // endpoint\n e: apiEndPoint,\n // request vector\n rv: requestIdVector.toString(),\n // request id\n r: requestId\n };\n\n if (authorizationHeader) {\n // Authorization header size\n properties.ahs = authorizationHeaderLength.toString();\n }\n\n // add to cache\n ttlRequestCache.set(requestId, properties, () => {\n StaticTelemetry.stopTimer(requestId);\n });\n\n request.headers[caseInsensitiveRequestIdHeaderName] = requestId;\n }\n\n return request;\n};\n\nexport const RSRequestInterceptorErrorHandler = (error: AxiosError) => {\n if (error.request) {\n RSRequestInterceptor(error.request);\n }\n\n throw error;\n};\n\nexport const RSResponseInterceptorErrorHandler = (error: AxiosError) => {\n if (error.response) {\n RSResponseInterceptor(error.response);\n } else if (error.config) {\n RSErrorResponseHandler(error.config, DEFAULT_ERROR_STATUS_CODE);\n }\n\n throw error;\n};\nexport const DataBaseType = {\n RequestData: 'RequestData',\n RemoteDependencyData: 'RemoteDependencyData',\n ExceptionData: 'ExceptionData'\n};\n\nexport const copyEventsToSecondaryInstance = (secondaryTelemetryInstance: TelemetryClient) => (envelope, context) => {\n const { data } = envelope;\n if (data.baseType === DataBaseType.RequestData) {\n secondaryTelemetryInstance.trackRequest({\n name: data.baseData.name,\n url: data.baseData.url,\n source: data.baseData.source,\n duration: data.baseData.duration,\n resultCode: data.baseData.duration,\n success: data.baseData.success\n });\n }\n if (data.baseType === DataBaseType.RemoteDependencyData) {\n secondaryTelemetryInstance.trackDependency({\n dependencyTypeName: data.baseData.dependencyTypeName,\n target: data.baseData.target,\n name: data.baseData.name,\n data: data.baseData.data,\n duration: data.baseData.duration,\n resultCode: data.baseData.resultCode,\n success: data.baseData.success\n });\n }\n if (data.baseType === DataBaseType.ExceptionData) {\n secondaryTelemetryInstance.trackException({\n exception: JSON.parse(JSON.stringify(data.baseData)).exceptions[0]\n });\n }\n return true;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport msdyn365Commerce, {\n getFriendlyName,\n getParameterizeFeatureFlagsWithRequestContext,\n IAction,\n IActionContext,\n IParameterizeFeatureFlags,\n parameterize,\n checkVersionForFeature,\n getCatalogIdForSdk\n} from '@msdyn365-commerce/core-internal';\nimport { getCategoriesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CategoriesDataActions.g';\nimport { getByIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { Category, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CategoryLinkInput, IPageTypeContext, ProductLinkInput } from '../hydrator-action-inputs';\n\ntype CategoryWithNeutralizedName = Category & { NeutralizedName?: string };\n/**\n * Computes a root category's SLUG\n *\n * @param rootCategory The category for which you want to determine the slug\n * @param ctx Action context\n */\nexport const getCategorySlug = (\n rootCategory: CategoryWithNeutralizedName,\n categories: CategoryWithNeutralizedName[],\n parameterizeFeatureFlags?: IParameterizeFeatureFlags,\n context?: IActionContext\n): string => {\n let slug: string = parameterize(rootCategory.Name, undefined, parameterizeFeatureFlags, rootCategory.NeutralizedName);\n let currentCategory: Category = rootCategory;\n while (currentCategory.ParentCategory) {\n const parentId = currentCategory.ParentCategory;\n const parentCategory: CategoryWithNeutralizedName | undefined = categories.find((category: Category) => {\n if (category.RecordId) {\n return category.RecordId === parentId;\n }\n return false;\n });\n if (!parentCategory) {\n break;\n }\n\n let parentCategoryWithLocalizedName = parentCategory;\n if (context && isUrlLocalizationEnabled(parameterizeFeatureFlags)) {\n const localName = getFriendlyName(context.requestContext.locale, parentCategory.NameTranslations);\n parentCategoryWithLocalizedName = { ...parentCategory };\n parentCategoryWithLocalizedName.NeutralizedName = parentCategory.Name;\n parentCategoryWithLocalizedName.Name = localName || parentCategoryWithLocalizedName.NeutralizedName;\n }\n\n slug = `${parameterize(\n parentCategoryWithLocalizedName.Name,\n undefined,\n parameterizeFeatureFlags,\n parentCategoryWithLocalizedName.NeutralizedName\n )}/${slug}`;\n currentCategory = parentCategoryWithLocalizedName;\n }\n return slug.length > 0 ? `/${slug}` : '';\n};\n\nconst isUrlLocalizationEnabled = (parameterizeFeatureFlags?: IParameterizeFeatureFlags) => {\n return (\n (msdyn365Commerce.platformSettings && msdyn365Commerce.platformSettings.enableUrlLocalization) ||\n (parameterizeFeatureFlags && parameterizeFeatureFlags.enableUrlLocalization)\n );\n};\n\n/**\n * Returns an object containing information used to by the URL builder to build\n * the formatted product or category URL\n * =\n * @param input Action input\n * @param context Action context\n */\nconst getPageTypeContextById = async (input: ProductLinkInput | CategoryLinkInput, context: IActionContext): Promise => {\n // If product ID exits get the product details for that product\n const pageTypeContext: IPageTypeContext = {};\n if (input instanceof ProductLinkInput && input.productId) {\n try {\n const product: SimpleProduct = await getByIdAsync({ callerContext: context }, input.productId, input.channelId);\n if (!(product && product.Name)) {\n throw new Error(`Unable to retrieve product details for product id: ${input.productId}`);\n }\n pageTypeContext.product = { Name: product.Name || '', RecordId: product.RecordId };\n } catch (err) {\n context.telemetry.error(err);\n throw new Error(`Unable run getById action. Error: ${err}`);\n }\n }\n const catalogFeature = checkVersionForFeature('catalogFeature');\n const catalogid = (catalogFeature && getCatalogIdForSdk(context.requestContext, 0)) || undefined;\n\n // Get the category details for the passed category id\n // @ts-ignore old retail proxy contract does not have catalogid.\n return getCategoriesAsync({ callerContext: context }, input.channelId, catalogid)\n .then((categories: Category[]) => {\n // Find the category by id from the list of returned categories\n const rootCategory: Category | undefined = categories.find((category: Category) => {\n if (category.RecordId) {\n return category.RecordId === input.categoryId;\n }\n return false;\n });\n if (!rootCategory) {\n throw new Error(`Unable to retrieve category details for category id: ${input.categoryId}`);\n }\n const localName = getFriendlyName(context.requestContext.locale, rootCategory.NameTranslations);\n const rootCategoryWithNeutralizedName = { ...rootCategory };\n rootCategoryWithNeutralizedName.NeutralizedName = rootCategory.Name;\n rootCategoryWithNeutralizedName.Name = localName || rootCategoryWithNeutralizedName.NeutralizedName;\n // Compute the found category's slug\n const parameterizeFeatureFlags: IParameterizeFeatureFlags = getParameterizeFeatureFlagsWithRequestContext(\n context.requestContext\n );\n const slug = getCategorySlug(rootCategoryWithNeutralizedName, categories, parameterizeFeatureFlags, context);\n pageTypeContext.category = { Slug: slug, RecordId: rootCategoryWithNeutralizedName.RecordId };\n return Promise.resolve(pageTypeContext);\n })\n .catch(err => {\n // In the event of an error return just the category id\n context.telemetry.error(err);\n throw new Error(`Unable to run getCategories action. Error: ${err}`);\n });\n};\n\nexport const getPageTypeContextByIdAction = createObservableDataAction({\n action: >getPageTypeContextById\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, IModuleContract } from '@msdyn365-commerce/core-internal';\nimport { PROCESS_TYPE } from '../consts';\nimport { IProductListMetaData, IServerLink } from './hydrator-action-inputs';\nimport { hydrateLink } from './link-hydrator';\nimport { hydrateProductList } from './product-list-hydrator';\n\nconst TYPE_KEY = 'type';\nconst LIST_TYPE_KEY = 'listType';\n\n/**\n * Recusrively traverses a module's config properties to find link/list types to transform\n *\n * @param obj The current object\n * @param context The current action context\n */\nconst searchForComplexType = (\n obj: unknown,\n context: IActionContext,\n moduleId?: string,\n propertyToMapInConfig?: string\n): Promise[] => {\n const promisesArray: Promise[] = [];\n if (!obj) {\n return promisesArray;\n }\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n promisesArray.push(...searchForComplexType(obj[i], context, moduleId, propertyToMapInConfig));\n }\n } else if (typeof obj === 'object' && obj) {\n const children = Object.keys(obj);\n\n // Link scenario ('type' is defined)\n if (obj[TYPE_KEY]) {\n promisesArray.push(hydrateLink(obj, context));\n // ProductList scenario ('list_type') is defined\n } else if (obj[LIST_TYPE_KEY]) {\n promisesArray.push(hydrateProductList(obj, context, moduleId, propertyToMapInConfig));\n } else if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n promisesArray.push(...searchForComplexType(obj[children[i]], context, moduleId, children[i]));\n }\n }\n }\n\n return promisesArray;\n};\n\n/**\n * Entry point, processes a page response and looks for link and list types\n * to transform\n *\n * @param pageResponse The inital page response\n * @param context The current action context\n */\nexport const processComplexDataTypes = async (\n lazyloadAllDataActions: boolean,\n processType: string,\n pageSlots: IModuleContract[],\n context: IActionContext\n) => {\n const promisesArray = processComplexDataTypesAsync(lazyloadAllDataActions, processType, pageSlots, context);\n if (promisesArray) {\n await Promise.all(promisesArray);\n }\n};\n\nexport const processComplexDataTypesAsync = (\n lazyLoadAllDataActions: boolean,\n processType: string,\n pageSlots: IModuleContract[],\n context: IActionContext\n) => {\n if (pageSlots && pageSlots.length) {\n const promisesArray: Promise[] = [];\n let lazyLoadAllModuleQueryString; // Query string switch to lazyLoad all modules\n const requestContext = context.requestContext;\n const requestContextFeatures = requestContext.features;\n const clientRenderModules = 'clientRender_modules';\n const clientRenderAllModuleQueryString = 'client_render_all_modules';\n\n // Feature switch for lazyLoading render and data action currently for product collection module\n let lazyLoadModuleFeature = requestContextFeatures[clientRenderModules];\n\n // Query param to lazyLoad all modules\n if (requestContext.query && requestContext.query.clientRenderAllModuleQueryString) {\n lazyLoadAllModuleQueryString = requestContext.query[clientRenderAllModuleQueryString];\n }\n\n // If request is coming from the editor then, turn off all lazyloading feature\n if (requestContext.params && requestContext.params.isEditor && requestContext.params.isEditor === true) {\n lazyLoadModuleFeature = false;\n lazyLoadAllModuleQueryString = 'false';\n lazyLoadAllDataActions = false;\n }\n\n for (let i = 0; i < pageSlots.length; i++) {\n const currModule = pageSlots[i];\n const currModuleConfig = currModule.config;\n let clientRenderConfigSwitch; // Module config switch for lazyLoading render and data action for product collection module\n\n if (typeof currModuleConfig === 'object' && currModuleConfig) {\n lazyLoadAllModuleQueryString === 'true' ? (currModuleConfig[`clientRender`] = true) : clientRenderConfigSwitch;\n if (currModuleConfig.hasOwnProperty('clientRender')) {\n // When the lazyLoading feature switch is false, turn the lazyloading config switch to false\n if (lazyLoadModuleFeature === false) {\n currModuleConfig[`clientRender`] = false;\n }\n clientRenderConfigSwitch = currModuleConfig[`clientRender`];\n }\n }\n\n if ((lazyLoadAllDataActions || clientRenderConfigSwitch) && processType === PROCESS_TYPE.client) {\n // When lazyLoad_all feature switch is true or lazyload Module config switch is true and processComplexDataType call is from client, do hydration\n promisesArray.push(...searchForComplexType(currModuleConfig, context, currModule.id));\n } else if (!lazyLoadAllDataActions && !clientRenderConfigSwitch && processType === PROCESS_TYPE.server) {\n // When lazyLoad_all feature switch is OFF, lazyload Module config switch is OFF and processComplexDataType call is from server, do hydration\n promisesArray.push(...searchForComplexType(currModuleConfig, context, currModule.id));\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n context.runAllActionsInQueue();\n return promisesArray;\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { appendQueryParams, getCatalogIdForSdk, getUrlSync, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_LINK_ACTION } from '@msdyn365-commerce/telemetry-internal';\nimport { CategoryLinkInput, IPageTypeContext, IServerLink, ProductLinkInput } from './hydrator-action-inputs';\nimport { getPageTypeContextByIdAction } from './link-actions/page-type-context-by-id';\n\n/**\n * Takes a Link object from the Page Response and uses URL Builder to construct a destination url and transform the\n * existing link structure to expose two porperties type and destinationUrl\n *\n * @param linkObject The current link object being modified\n * @param context The current action context\n */\nexport const hydrateLink = async (linkObject: IServerLink, context: IActionContext) => {\n let destinationUrl: string | undefined;\n let hostname: string | undefined = context?.requestContext?.url?.requestUrl?.hostname;\n const locale = !context.requestContext.features.disable_hydrator_link_locale ? context.requestContext.locale : '';\n // In each switch case if the required information is not present to construct the URL\n // The object will be return unmodified\n switch (linkObject.type) {\n // In the case of internal and external links, no transform is needed\n // If destination url is present set the destination url and break\n case 'internalLink':\n case 'externalLink':\n if (linkObject.destinationUrl) {\n // Append the pass through query parameters\n const queryParams = (context.requestContext && context.requestContext.query) || {};\n const featureContext = context?.requestContext?.features;\n // If add_external_link_domain switch is set to true, we pass hostname as empty string which will add domain qsp to all external and internal link\n hostname = featureContext?.add_external_link_domain ? '' : hostname;\n if (featureContext?.skip_external_link_catalogid) {\n destinationUrl = appendQueryParams(linkObject.destinationUrl, queryParams, hostname, true);\n } else {\n destinationUrl = appendQueryParams(linkObject.destinationUrl, queryParams, hostname);\n }\n\n break;\n }\n return;\n case 'productLink':\n // To build the url for a productLink we need the product and category ids\n if (linkObject.productId && linkObject.categoryId) {\n // Grab the route context using the action\n let routeContext: IPageTypeContext;\n try {\n const catalogId = getCatalogIdForSdk(context.requestContext, 0);\n routeContext = await getPageTypeContextByIdAction(\n new ProductLinkInput(\n context.requestContext.apiSettings,\n linkObject.categoryId,\n linkObject.productId,\n catalogId,\n locale\n ),\n context\n );\n // Create the URL and break\n destinationUrl = getUrlSync('product', context, routeContext);\n } catch (err) {\n context.telemetry.error(EXCEPTION_LINK_ACTION);\n context.telemetry.exception(err);\n linkObject.destinationUrl = '';\n linkObject.error = EXCEPTION_LINK_ACTION;\n return;\n }\n break;\n }\n return;\n case 'categoryLink':\n // To build the url for the categoryLink we need the category id\n if (linkObject.categoryId) {\n // Grab the route context using the action\n let routeContext: IPageTypeContext;\n try {\n routeContext = await getPageTypeContextByIdAction(\n new CategoryLinkInput(context.requestContext.apiSettings, linkObject.categoryId, null, locale),\n context\n );\n // Create the URL and break\n destinationUrl = getUrlSync('category', context, routeContext);\n } catch (err) {\n context.telemetry.error(EXCEPTION_LINK_ACTION);\n context.telemetry.exception(err);\n linkObject.destinationUrl = '';\n linkObject.error = EXCEPTION_LINK_ACTION;\n return;\n }\n break;\n }\n return;\n default:\n // If it is not one of these types or does not contain the information required for the link\n // building do not modify the data\n return;\n }\n\n // Set the computed destinationUrl and delete the other properties\n linkObject.destinationUrl = destinationUrl;\n delete linkObject.categoryId;\n delete linkObject.productId;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport msdyn365Commerce, {\n IDictionary,\n IFeatureVersions,\n IModule,\n IModuleContract,\n IPageResponse,\n IPlatformSettings,\n IRequestContext,\n IResourceManager,\n isAuthoringEditEnabled,\n isEmptyOrNullObject\n} from '@msdyn365-commerce/core-internal';\nimport { AsyncResult, isAsyncResult } from '@msdyn365-commerce/retail-proxy';\nimport { EXCEPTION_BADPAGECONTEXT, EXCEPTION_INITIALDATAFAIL, ITelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { isObservableArray, toJS, transaction } from 'mobx';\nimport { IModuleBinder } from '../app-initialization/models';\nimport {\n CACHE_SETTING,\n MODULE_ACTION_KEY,\n MODULE_CACHE_KEY,\n MODULE_CONFIG_ERRORS_KEY,\n MODULE_CONFIG_KEY,\n MODULE_DATA_KEY,\n MODULE_DEFERRED_KEY,\n MODULE_RESOURCES_KEY,\n MSDYN365_WYSIWYG_CANADDMODULE,\n MSDYN365_WYSIWYG_DISABLED_PROPS\n} from '../consts';\nimport { getParentModuleName, isModuleEntryPointsEnabled } from '../utils/helpers';\nimport { getWrappedProxyObject } from './authoring-edit-helper';\n\n/**\n * Interface containing module metadata that pageContext holds\n *\n * Any change to this interface should result an accompanying change to the moduleList\n * Fast JSON stringify constructor in base-page-utils.ts\n */\ninterface IModuleMetaData {\n id: string;\n typeName: string;\n dataActions: unknown;\n}\n\ninterface IActionMetaData {\n name: string;\n entity: string;\n inputs: string[];\n}\n\n/**\n * Class to hold the page view model, areas and regions\n */\nexport class PageContext {\n public requestContext: IRequestContext;\n public pageRoot: IModuleContract & { theme: string };\n public requestCache: ICache;\n private _moduleList: IModuleMetaData[] = [];\n private _themeModulesList: string[] = [];\n private _clientPlatformSetting: IPlatformSettings = {};\n private _environmentVariable: IDictionary = {};\n private _versionDependentFeatureInfo: IFeatureVersions = {};\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(pageData: IPageResponse | any, requestContext: IRequestContext, requestCache: ICache, resourceManager?: IResourceManager) {\n if (isEmptyOrNullObject(pageData)) {\n throw new Error(EXCEPTION_BADPAGECONTEXT);\n }\n this.requestContext = requestContext;\n // set c1AccessToken to null so that its not sent down to client\n this.requestContext.user.c1AccessToken = undefined;\n this.requestCache = requestCache;\n this.pageRoot = pageData.pageRoot;\n this._versionDependentFeatureInfo = msdyn365Commerce.getVersionDependentFeatureInfo;\n\n if (typeof window === 'undefined') {\n this._putRequestedModulesInCacheOnServer(pageData, resourceManager);\n }\n\n this._initThemeModulesList();\n this.setEnvironmentVariableForCLient();\n }\n\n public moduleList(): IModule[][] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = this._moduleList.reduce((resultArray: any[], item, index) => {\n const chunkIndex = Math.floor(index / Number(5));\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = []; // start a new chunk\n }\n resultArray[chunkIndex].push(item);\n\n return resultArray;\n }, []);\n return result;\n }\n\n /**\n * Returns callback function that returns module rendering metadata for a given module asynchronously\n */\n get modules(): (name: string) => IModule {\n return (name: string) => {\n return this._constructModuleMetaData(name);\n };\n }\n\n /**\n * Get all the modules listed in the PageContext from the cache\n */\n\n public async allModules(requestContext: IRequestContext, moduleList: IModule[]): Promise {\n if (requestContext?.features?.loadData_optimization) {\n return moduleList.map(moduleMetaData => {\n return this.modules(moduleMetaData.id);\n });\n } else {\n return this._moduleList.map(moduleMetaData => {\n return this.modules(moduleMetaData.id);\n });\n }\n }\n\n public setAppCacheEntries(appCacheEntries: string[]): void {\n this.requestCache.put({ typeName: CACHE_SETTING, key: 'APP_CACHE_ENTRIES' }, { item: appCacheEntries });\n }\n\n public setPlatformSettingsForClient(platformSettings: IPlatformSettings): void {\n this._clientPlatformSetting.clientSideDataActionTimeoutInMs = platformSettings?.clientSideDataActionTimeoutInMs || undefined;\n this._clientPlatformSetting.shouldUseInstanceCache = !!platformSettings?.clientSideDataActionTimeoutInMs;\n this._clientPlatformSetting.disableActionRegOptimization = true;\n this._clientPlatformSetting.imageFallbackOptimize = platformSettings?.imageFallbackOptimize || false;\n this._clientPlatformSetting.enableModuleEntryPoints = isModuleEntryPointsEnabled(platformSettings);\n this._clientPlatformSetting.enableImageOptimizeEvents = !!platformSettings?.enableImageOptimizeEvents;\n this._clientPlatformSetting.enableModuleCssOptimization = platformSettings?.enableModuleCssOptimization || false;\n this._clientPlatformSetting.clientTimeoutMapInMs = platformSettings?.clientTimeoutMapInMs || {};\n this._clientPlatformSetting.secondaryInstrumentationKey = platformSettings?.secondaryInstrumentationKey;\n /* if (platformSettings?.disableActionRegOptimization === true) {\n this._clientPlatformSetting.disableActionRegOptimization = true;\n }*/\n }\n\n public setEnvironmentVariableForCLient = () => {\n const environment = msdyn365Commerce.getAllEnvironmentVariable();\n this._environmentVariable = environment;\n };\n\n public getPlatformSettingsForClient(): IPlatformSettings {\n return this._clientPlatformSetting;\n }\n\n public getVersionDependentFeatureInfo(): IFeatureVersions {\n return this._versionDependentFeatureInfo;\n }\n\n /**\n * Checkis if the given module is deferred module\n * @param name name of the module\n */\n public deferred(name: string): Boolean {\n return !!this.requestCache.getValue({ typeName: MODULE_DEFERRED_KEY, key: name });\n }\n\n public getResourceTextForPlaceholderPreview(): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resourceItem = this.requestCache.get({ typeName: MODULE_RESOURCES_KEY, key: 'PLACE-HOLDER-FOR-CONTAINER-PREVIEW' });\n if (resourceItem && resourceItem.item && resourceItem.item.clickToConfigure) {\n return resourceItem.item.clickToConfigure;\n } else {\n return 'Click here to configure';\n }\n }\n\n /**\n * Marks module as deferred\n * @param name name of the module\n */\n public markModuleAsDeferred(name: string): void {\n this.requestCache.put(\n { typeName: MODULE_DEFERRED_KEY, key: name },\n {\n item: true\n }\n );\n }\n\n /**\n * Inserts requested modules into cache on client side\n * @param pageData page data object\n * @param telemetry telemetry object\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public async putRequestedModulesInCacheOnClient(pageData: any, telemetry: ITelemetry): Promise {\n if (isEmptyOrNullObject(pageData.requestCache) || isEmptyOrNullObject(pageData.requestCache.internalCache)) {\n throw new Error(EXCEPTION_INITIALDATAFAIL);\n }\n\n for (const cacheType of Object.keys(pageData.requestCache.internalCache)) {\n const cacheBasedOnType = pageData.requestCache.internalCache[cacheType];\n if (!isEmptyOrNullObject(cacheBasedOnType)) {\n for (const cachekey of Object.keys(cacheBasedOnType)) {\n const cacheItem = cacheBasedOnType[cachekey];\n\n if (pageData?.requestContext?.features?.loadData_optimization) {\n setTimeout(() => {\n this._rehydrateAsyncResults(cacheItem, cacheType, cachekey);\n }, 0);\n } else {\n this._rehydrateAsyncResults(cacheItem, cacheType, cachekey);\n }\n\n // Awaiting a rejected promise will throw, so we need to catch those errors.\n try {\n await cacheItem.item;\n } catch (e) {\n telemetry.debug(`Error while hyrdating cache item, Type: ${cacheBasedOnType}, Key: ${cachekey}`);\n }\n\n if (cacheType === MODULE_CACHE_KEY) {\n const moduleItem = cacheItem.item;\n this._moduleList.push({\n id: moduleItem.id,\n typeName: moduleItem.typeName,\n dataActions: moduleItem.dataActions || []\n });\n }\n }\n }\n }\n }\n\n /**\n * Populates data actions results from cache\n * @param cacheObjectType entity type\n * @param cacheKey cache key\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _populateDataActionResultFromCache(cacheObjectType: string, cacheKey: string): any {\n const cachedValueBasedOnInput = this.requestCache.getValue({ typeName: cacheObjectType, key: cacheKey });\n if (!cachedValueBasedOnInput) {\n return;\n }\n\n // Ref resolution for promises needs to be delayed until the value is available\n if (isAsyncResult(cachedValueBasedOnInput)) {\n return transaction(() => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n cachedValueBasedOnInput.then(promiseResult => {\n // Directly set the result because we want a synchronous change\n cachedValueBasedOnInput.result = this._resolveCacheRef(cacheObjectType, promiseResult);\n });\n return cachedValueBasedOnInput;\n });\n }\n\n return this._resolveCacheRef(cacheObjectType, cachedValueBasedOnInput);\n }\n\n /**\n * Resolves cache reference for the given entity type\n * @param cacheObjectType entity type that is cached\n * @param cacheRefInfo cache ref key\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _resolveCacheRef(cacheObjectType: string, cacheRefInfo: object): any {\n if (typeof cacheRefInfo !== 'object' || cacheRefInfo['$ref'] !== true) {\n return cacheRefInfo;\n }\n const result = cacheRefInfo['key']\n .map(key => {\n const value = this.requestCache.getValue({ typeName: cacheObjectType, key });\n if (value) {\n return value;\n }\n })\n .filter(Boolean);\n return result && result.length > 0 ? (cacheRefInfo['isCollection'] ? result : result[0]) : null;\n }\n\n /**\n * Inserts requested modules in cache to prepare the initialData that will be sent to client\n * @param pageData pageData object with list of modules\n * @param resourceManager resourceManager that contains the localized strings\n */\n private _putRequestedModulesInCacheOnServer(pageData: IPageResponse, resourceManager?: IResourceManager): void {\n const isEditor = (this.requestContext.params && this.requestContext.params.isEditor) || false;\n const themeName = this.requestContext.params?.theme;\n for (let i = 0; i < pageData.slots.length; ++i) {\n const moduleInstance = pageData.slots[i];\n const moduleId = moduleInstance.id;\n this._moduleList.push({\n id: moduleInstance.id,\n typeName: moduleInstance.typeName,\n dataActions: moduleInstance.dataActions\n });\n\n this.requestCache.put(\n { typeName: MODULE_CACHE_KEY, key: moduleId },\n {\n item: { id: moduleInstance.id, typeName: moduleInstance.typeName }\n }\n );\n this.requestCache.put({ typeName: MODULE_CONFIG_KEY, key: moduleId }, { item: moduleInstance.config });\n this.requestCache.put({ typeName: MODULE_CONFIG_ERRORS_KEY, key: moduleId }, { item: moduleInstance.configErrors });\n this.requestCache.put({ typeName: MODULE_DATA_KEY, key: moduleId }, { item: moduleInstance.data });\n this.requestCache.put({ typeName: MODULE_ACTION_KEY, key: moduleId }, { item: moduleInstance.dataActions });\n this.requestCache.put({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: moduleId }, { item: [] });\n this.requestCache.put({ typeName: MSDYN365_WYSIWYG_CANADDMODULE, key: moduleId }, { item: [] });\n\n if (resourceManager && !isEditor) {\n this.requestCache.put(\n { typeName: MODULE_RESOURCES_KEY, key: moduleInstance.typeName },\n { item: resourceManager.getModuleResources(moduleInstance.typeName, themeName, this.requestContext.locale) }\n );\n }\n }\n // In editor mode, put the resources for all modules for the current locale into the cache\n if (isEditor && resourceManager && this.requestContext.features.enableAuthoringRemoveAndAddModule) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bindings = (msdyn365Commerce).getAllModuleBinder();\n bindings.forEach((moduleBinder: IModuleBinder) => {\n this.requestCache.put(\n { typeName: MODULE_RESOURCES_KEY, key: moduleBinder.name },\n { item: resourceManager.getModuleResources(moduleBinder.name, themeName, this.requestContext.locale) }\n );\n });\n }\n }\n\n /**\n * Initializes theme modules list that need to be loaded on the client\n */\n private _initThemeModulesList(): void {\n this._themeModulesList = [];\n\n if (this.requestContext.params.theme) {\n this._themeModulesList.push(this.requestContext.params.theme);\n this._themeModulesList.push(getParentModuleName(this.requestContext.params.theme));\n }\n }\n\n /**\n * Function which rehydrate Async Results.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _rehydrateAsyncResults(cacheItem: any, cacheType: string, cachekey: string): void {\n // AsyncResults sent from server to client get serialized into basic JS objects,\n // They need to be \"rehydrated\" into actual AsyncResults to enable full functionality\n if (cacheItem.item && cacheItem.item._type && cacheItem.item._type === 'AsyncResult') {\n const metadata = cacheItem.item.metadata || {};\n if (cacheItem.item.status && cacheItem.item.status === 'SUCCESS') {\n cacheItem.item = AsyncResult.resolve(cacheItem.item.result);\n } else {\n cacheItem.item = AsyncResult.reject(cacheItem.item.error || 'Unable to parse data action');\n }\n cacheItem.item.metadata = metadata;\n }\n\n this.requestCache.put({ typeName: cacheType, key: cachekey }, { item: cacheItem.item });\n }\n\n /**\n * Construct module MetaData\n * @param name moduleName\n * @returns\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _constructModuleMetaData(name: string): any {\n const cacheItem = this.requestCache.getValue({ typeName: MODULE_CACHE_KEY, key: name });\n if (!cacheItem) {\n throw new Error(`requested module id [${name}] is not found in module dictionary of pageconfig`);\n }\n\n const data = { ...(this.requestCache.getValue({ typeName: MODULE_DATA_KEY, key: name }) || {}) };\n const actions = this.requestCache.getValue({ typeName: MODULE_ACTION_KEY, key: name });\n const resources = this.requestCache.getValue>({ typeName: MODULE_RESOURCES_KEY, key: cacheItem.typeName });\n\n // toJS method\n if (actions) {\n // ToJS converts observable object to JS object.\n const actionMetaDataList = toJS(actions);\n if (actionMetaDataList) {\n for (const action of actionMetaDataList) {\n if (action.entity && action.inputs) {\n data[action.name] =\n Array.isArray(action.inputs) || isObservableArray(action.inputs)\n ? action.inputs.map((cacheKey: string) => this._populateDataActionResultFromCache(action.entity, cacheKey))\n : this._populateDataActionResultFromCache(action.entity, action.inputs);\n } else {\n data[action.name] = AsyncResult.reject('Action Input Creation Failure');\n }\n }\n }\n }\n\n const config = this.requestCache.getValue>({ typeName: MODULE_CONFIG_KEY, key: name }) || {};\n return {\n ...cacheItem,\n data: data,\n config:\n !(typeof window === 'undefined') && isAuthoringEditEnabled(this.requestContext)\n ? getWrappedProxyObject(config, name, cacheItem.typeName)\n : config,\n configErrors: this.requestCache.getValue({ typeName: MODULE_CONFIG_ERRORS_KEY, key: name }),\n resources: resources || {},\n disabledProperties: this.requestCache.getValue({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: name }) || [],\n slotsForAddModule: this.requestCache.getValue({ typeName: MSDYN365_WYSIWYG_CANADDMODULE, key: name }) || []\n };\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { ISessionStorageContext, ISessionStorageValue } from '@msdyn365-commerce/core-internal';\nimport { CookieContext } from './cookie-utils';\n\n/**\n * Context for session storage handling\n *\n * @export\n * @class CookieContext\n */\nexport class SessionStorageContext implements ISessionStorageContext {\n private _cookieContext: CookieContext;\n\n constructor(_cookieContext: CookieContext) {\n this._cookieContext = _cookieContext;\n }\n\n /**\n * Gets the value stored in the session storage.\n * Returns an empty object if no such value exists.\n *\n * @param {string} key - The key string.\n */\n public getDataFromStorage = (key: string): object => {\n if (key) {\n return this.get(key).value || {};\n }\n return {};\n };\n\n /**\n * Sets a new key pair value in the session storage.\n *\n * @param {string} key - The key string.\n * @param {object} value - The data object.\n */\n public setDataInStorage = (key: string, value: object): void => {\n if (key && value) {\n this.set(key, value);\n }\n };\n\n /**\n * Gets the checkout cart stored in the session storage.\n * Returns an empty object if no such value exists.\n *\n * @param {string} key - The key string.\n */\n public getCheckoutCartData = (key: string): object => {\n if (key) {\n return key ? this.getDataFromStorage(this.getCheckoutCartKey(key)) : {};\n }\n return {};\n };\n\n /**\n * Sets checkout cart value in the session storage.\n *\n * @param {string} key - The key string.\n * @param {object} value - The cart data object.\n */\n public setCheckoutCartData = (key: string, value: object): void => {\n if (key && value) {\n this.setDataInStorage(this.getCheckoutCartKey(key), value);\n }\n };\n\n /**\n * Remove session storage by giving key\n *\n * @param {string} key - The key string.\n */\n public removeDataFromStorage = (key: string): void => {\n if (key) {\n this.remove(key);\n }\n };\n\n /**\n * Remove checkout cart data from the session storage by giving key\n *\n * @param {string} key - The key string. If key is not provided clear all data from session storage that contais the checkout cart key prefix.\n */\n public removeCheckoutCartData = (key?: string): void => {\n if (key) {\n this.removeDataFromStorage(this.getCheckoutCartKey(key));\n } else {\n const keyList = Object.keys(sessionStorage);\n keyList.map(k => {\n if (k.startsWith(`${msdyn365Commerce.checkoutCartKeyPrefix}-`)) {\n this.removeDataFromStorage(k);\n }\n });\n }\n };\n\n /**\n * Get session storage value.\n * If server side, no-op.\n *\n * @param {string} key - The key string\n * @return {ISessionStorageValue} value with status\n */\n private get = (key: string): ISessionStorageValue => {\n if (key && msdyn365Commerce.isBrowser) {\n const objString = sessionStorage.getItem(key);\n if (objString) {\n const obj = JSON.parse(objString);\n return { name: key, value: obj, status: obj ? 'FOUND' : 'NOT_FOUND' };\n }\n }\n return { name: key, value: undefined, status: 'NOT_FOUND' };\n };\n\n /**\n * Set session storage data.\n * If server side, no-op.\n *\n * @param {string} key - The key string\n * @param {T} value - The session storage value\n */\n private set = (key: string, value: T): void => {\n if (key && msdyn365Commerce.isBrowser) {\n sessionStorage.setItem(key, JSON.stringify(value));\n }\n };\n\n /**\n * Remove session storage data by giving key\n * If server side, no-op.\n *\n * @param {string} key - The key string\n */\n private remove = (key: string): void => {\n if (key && msdyn365Commerce.isBrowser) {\n sessionStorage.removeItem(key);\n }\n };\n\n /**\n * Build the checkout cart key for the session storage\n */\n private getCheckoutCartKey = (key: string): string => {\n const checkoutCartCookie = this._cookieContext.getCheckoutCartCookie();\n if (checkoutCartCookie) {\n return `${msdyn365Commerce.checkoutCartKeyPrefix}-${checkoutCartCookie}-${key}`;\n }\n return '';\n };\n}\n","import * as cookie from 'cookie';\r\nexport function hasDocumentCookie() {\r\n // Can we get/set cookies on document.cookie?\r\n return typeof document === 'object' && typeof document.cookie === 'string';\r\n}\r\nexport function cleanCookies() {\r\n document.cookie.split(';').forEach(function (c) {\r\n document.cookie = c\r\n .replace(/^ +/, '')\r\n .replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/');\r\n });\r\n}\r\nexport function parseCookies(cookies, options) {\r\n if (typeof cookies === 'string') {\r\n return cookie.parse(cookies, options);\r\n }\r\n else if (typeof cookies === 'object' && cookies !== null) {\r\n return cookies;\r\n }\r\n else {\r\n return {};\r\n }\r\n}\r\nexport function isParsingCookie(value, doNotParse) {\r\n if (typeof doNotParse === 'undefined') {\r\n // We guess if the cookie start with { or [, it has been serialized\r\n doNotParse =\r\n !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '\"');\r\n }\r\n return !doNotParse;\r\n}\r\nexport function readCookie(value, options) {\r\n if (options === void 0) { options = {}; }\r\n var cleanValue = cleanupCookieValue(value);\r\n if (isParsingCookie(cleanValue, options.doNotParse)) {\r\n try {\r\n return JSON.parse(cleanValue);\r\n }\r\n catch (e) {\r\n // At least we tried\r\n }\r\n }\r\n // Ignore clean value if we failed the deserialization\r\n // It is not relevant anymore to trim those values\r\n return value;\r\n}\r\nfunction cleanupCookieValue(value) {\r\n // express prepend j: before serializing a cookie\r\n if (value && value[0] === 'j' && value[1] === ':') {\r\n return value.substr(2);\r\n }\r\n return value;\r\n}\r\n","var __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nimport * as cookie from 'cookie';\r\nimport { hasDocumentCookie, parseCookies, readCookie } from './utils';\r\nvar Cookies = /** @class */ (function () {\r\n function Cookies(cookies, options) {\r\n var _this = this;\r\n this.changeListeners = [];\r\n this.HAS_DOCUMENT_COOKIE = false;\r\n this.cookies = parseCookies(cookies, options);\r\n new Promise(function () {\r\n _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\r\n }).catch(function () { });\r\n }\r\n Cookies.prototype._updateBrowserValues = function (parseOptions) {\r\n if (!this.HAS_DOCUMENT_COOKIE) {\r\n return;\r\n }\r\n this.cookies = cookie.parse(document.cookie, parseOptions);\r\n };\r\n Cookies.prototype._emitChange = function (params) {\r\n for (var i = 0; i < this.changeListeners.length; ++i) {\r\n this.changeListeners[i](params);\r\n }\r\n };\r\n Cookies.prototype.get = function (name, options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n return readCookie(this.cookies[name], options);\r\n };\r\n Cookies.prototype.getAll = function (options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n var result = {};\r\n for (var name_1 in this.cookies) {\r\n result[name_1] = readCookie(this.cookies[name_1], options);\r\n }\r\n return result;\r\n };\r\n Cookies.prototype.set = function (name, value, options) {\r\n var _a;\r\n if (typeof value === 'object') {\r\n value = JSON.stringify(value);\r\n }\r\n this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, value, options);\r\n }\r\n this._emitChange({ name: name, value: value, options: options });\r\n };\r\n Cookies.prototype.remove = function (name, options) {\r\n var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\r\n this.cookies = __assign({}, this.cookies);\r\n delete this.cookies[name];\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, '', finalOptions);\r\n }\r\n this._emitChange({ name: name, value: undefined, options: options });\r\n };\r\n Cookies.prototype.addChangeListener = function (callback) {\r\n this.changeListeners.push(callback);\r\n };\r\n Cookies.prototype.removeChangeListener = function (callback) {\r\n var idx = this.changeListeners.indexOf(callback);\r\n if (idx >= 0) {\r\n this.changeListeners.splice(idx, 1);\r\n }\r\n };\r\n return Cookies;\r\n}());\r\nexport default Cookies;\r\n","import Cookies from './Cookies';\r\nexport default Cookies;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { ICookieContext, ICookieContextOptions, ICookieValue } from '@msdyn365-commerce/core-internal';\nimport { Cart } from '@msdyn365-commerce/retail-proxy';\nimport Cookies, { CookieSetOptions } from 'universal-cookie';\nimport { USER_CONSENT_GIVEN_EVENT } from '../consts';\n\nexport interface ICookieSetOptions extends CookieSetOptions {\n isEssential?: boolean;\n}\n\nexport const enum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nexport const enum AccountSelectionTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\nconst UserConsentCookieName: string = '_msdyn365___ucc_';\n\n/**\n * Context for cookie handling\n *\n * @export\n * @class CookieContext\n */\nexport class CookieContext implements ICookieContext {\n private _cookies: Cookies;\n private _setCookieList: (() => void)[] = [];\n private _serverCookieList: string[] = [];\n private _clientCookieList: string[] = [];\n private _options: ICookieContextOptions;\n\n /**\n * Returns a cookies class from the selected cookie store. If the express server\n * is passed the cookie header will be used otherwise the global cookie store will be used.\n * @param options Optional ICookieContextOptions.\n */\n constructor(options?: ICookieContextOptions, cookieString?: string) {\n this._options = { isConsentRequired: true, ...options };\n if (cookieString) {\n this._cookies = new Cookies(cookieString);\n } else if (msdyn365Commerce.isBrowser) {\n this._cookies = new Cookies(document && document.cookie);\n } else {\n this._cookies = new Cookies(\n this._options.req &&\n this._options.req.headers &&\n (this._options.req.headers['x-msdyn365-cookie'] || this._options.req.headers.cookie)\n );\n }\n }\n\n /**\n * Get Cookie Value\n *\n * @param {string} cookieName - A string cookie name\n * @return {ICookieValue} cookie value with status\n */\n public get = (cookieName: string, isEssential?: boolean): ICookieValue => {\n if (isEssential || this.isConsentGiven()) {\n const cookieValue = this._cookies.get(cookieName);\n return { name: cookieName, value: cookieValue, status: cookieValue ? 'FOUND' : 'NOT_FOUND' };\n }\n\n return { name: cookieName, value: undefined, status: 'NO_CONSENT' };\n };\n\n /**\n * Set Cookie\n *\n * @param {string} cookieName - A string cookie name\n * @param {T} cookieValue - A cookie value\n * @param {ICookieSetOptions} options cookie options same as document.cookie\n */\n public set = (cookieName: string, cookieValue: T, options?: ICookieSetOptions): void => {\n const sameSiteRequiredFlag = this._options.sameSiteRequired;\n let cookieOptionsWithDefaults: ICookieSetOptions;\n\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false };\n\n if (sameSiteRequiredFlag === true) {\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false, sameSite: 'none', ...options };\n } else {\n if (options) {\n const filteredOptions: ICookieSetOptions = {};\n for (const [key, value] of Object.entries(options)) {\n if (key.toLowerCase() !== 'samesite') {\n filteredOptions[key] = value;\n }\n }\n cookieOptionsWithDefaults = { path: '/', secure: true, isEssential: false, ...filteredOptions };\n }\n }\n\n if (cookieOptionsWithDefaults.isEssential || this.isConsentGiven()) {\n // Set the cookie if client side\n if (msdyn365Commerce.isBrowser) {\n this._cookies.set(cookieName, cookieValue, cookieOptionsWithDefaults);\n const clientCookieString = this.createCookieString(cookieName, cookieValue, cookieOptionsWithDefaults);\n this._clientCookieList.push(clientCookieString);\n return;\n }\n // If server side, convert the cookie into a header string and push it onto an array\n const serverCookieString = this.createCookieString(cookieName, cookieValue, cookieOptionsWithDefaults);\n this._serverCookieList.push(serverCookieString);\n } else {\n this._setCookieList.push(() => {\n this._cookies.set(cookieName, cookieValue, cookieOptionsWithDefaults);\n });\n }\n };\n\n /**\n * Gets the value stored in the cart cookie that contains the\n * cart context and information. Returns an empty string if no such value exists.\n *\n */\n public getCartCookie = (): string => {\n return this.get(msdyn365Commerce.CartCookie, true).value || '';\n };\n\n public getTargetIdCookie = (): string => {\n return this.get('_msdyn365___tuid_', true).value || '';\n };\n\n /**\n * Sets the cart cookie with a new expiry time time of one year\n * from the current date\n *\n * @param cart The object containing the current cart information\n * @param isAuthenticated Boolean representing whether current user is authenticated or not\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setCartCookie = (cart: Cart, isAuthenticated: boolean, setAlways: boolean = false): void => {\n const prefix = isAuthenticated ? CartTokenPrefix.Auth : CartTokenPrefix.Anon;\n const cartCookieOptions: ICookieSetOptions = { isEssential: true, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${cart.Id}`;\n const existingCart = this.getCartCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCart === cookieValue) {\n return;\n }\n\n if (this._options.cartExpirationInDays) {\n // 86400000 is 1 day in ms\n cartCookieOptions.expires = new Date(Date.now() + this._options.cartExpirationInDays * 86400000);\n }\n this.set(msdyn365Commerce.CartCookie, cookieValue, cartCookieOptions);\n };\n\n /**\n * Gets the value stored in the checkout cart cookie that contains the\n * checkout cart context and information. Returns an empty string if no such value exists.\n */\n public getCheckoutCartCookie = (): string => {\n return this.get(msdyn365Commerce.checkoutCartCookie, true).value || '';\n };\n\n /**\n * Sets the checkout cart cookie with a new expiry time time of one year\n * from the current date\n *\n * @param cart The object containing the current checkout cart information\n * @param isAuthenticated Boolean representing whether current user is authenticated or not\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setCheckoutCartCookie = (cart: Cart, isAuthenticated: boolean, setAlways: boolean = false): void => {\n const prefix = isAuthenticated ? CartTokenPrefix.Auth : CartTokenPrefix.Anon;\n const checkoutCartCookieOptions: ICookieSetOptions = { isEssential: true, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${cart.Id}`;\n const existingCookie = this.getCheckoutCartCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCookie === cookieValue) {\n return;\n }\n\n if (this._options.cartExpirationInDays) {\n // 86400000 is 1 day in ms\n checkoutCartCookieOptions.expires = new Date(Date.now() + this._options.cartExpirationInDays * 86400000);\n }\n this.set(msdyn365Commerce.checkoutCartCookie, cookieValue, checkoutCartCookieOptions);\n };\n\n /**\n * Remove checkout cart cookie.\n */\n public removeCheckoutCartCookie = (): void => {\n this.remove(msdyn365Commerce.checkoutCartCookie);\n };\n\n /**\n * Gets the value stored in the account selection cookie that contains the\n * account selection context and information. Returns an empty string if no such value exists.\n */\n public getAccountSelectionCookie = (): string => {\n return this.get(msdyn365Commerce.accountSelectionCookie, true).value || '';\n };\n\n /**\n *\n * @param isOBORequest Boolean representing whether if current user is on behalf of or not.\n * @param customerAccountNumber customer account number.\n * @param setAlways Boolean representing if the cookie should be set regardless of whether the cookie exists or not\n */\n public setAccountSelectionCookie = (isOBORequest: boolean, customerAccountNumber: string, setAlways: boolean = false): void => {\n const prefix = isOBORequest ? AccountSelectionTokenPrefix.Auth : AccountSelectionTokenPrefix.Anon;\n const accountSelectionCookieOptions: ICookieSetOptions = { isEssential: false, secure: true, sameSite: 'none' };\n const cookieValue = `${prefix}:${customerAccountNumber}`;\n const existingCookie = this.getAccountSelectionCookie();\n\n // Unless explicity overridden using setAlways flag, do not set the cookie if the cookie value is the same as existing cookie value\n if (!setAlways && existingCookie === cookieValue) {\n return;\n }\n this.set(msdyn365Commerce.accountSelectionCookie, cookieValue, accountSelectionCookieOptions);\n };\n\n /**\n * Remove account selection cookie.\n */\n public removeAccountSelectionCookie = (): void => {\n this.remove(msdyn365Commerce.accountSelectionCookie);\n };\n\n /**\n * Remove cookie\n *\n */\n public remove = (cookieName: string): void => {\n return this._cookies.remove(cookieName, { path: '/' });\n };\n\n /**\n * Get whether consent is given or not\n *\n */\n public isConsentGiven = (): boolean => {\n return this._options.isConsentRequired ? !!this._cookies.get(UserConsentCookieName) : true;\n };\n\n /**\n * Set consent cookie\n *\n */\n public setConsentCookie = (): void => {\n const sameSiteRequiredFlag = this._options.sameSiteRequired;\n const cookieOptionsWithDefaults: ICookieSetOptions = { path: '/', maxAge: 31536000, secure: true };\n\n if (sameSiteRequiredFlag) {\n cookieOptionsWithDefaults.sameSite = 'none';\n }\n\n this._cookies.set(UserConsentCookieName, Date.now(), cookieOptionsWithDefaults);\n const clientCookieString = this.createCookieString(UserConsentCookieName, 'now', cookieOptionsWithDefaults);\n this._clientCookieList.push(clientCookieString);\n\n this._setCookieList.forEach(setCookieFunction => setCookieFunction());\n if (process.env.CURRENT_ENVIRONMENT === 'web') {\n document.dispatchEvent(new Event(USER_CONSENT_GIVEN_EVENT));\n }\n };\n\n /**\n * Remove consent cookie\n *\n */\n public deleteConsentCookie = (): void => {\n return this._cookies.remove(UserConsentCookieName);\n };\n\n /**\n * Returns the list of server side cookies to set\n * only if currently executing server side\n */\n get serverCookies(): string[] {\n return msdyn365Commerce.isBrowser ? [] : Object.assign([], this._serverCookieList);\n }\n\n /**\n * Returns the list of client side cookies to set\n */\n get clientCookie(): string[] {\n return msdyn365Commerce.isBrowser ? Object.assign([], this._clientCookieList) : [];\n }\n\n private createCookieString = (cookieName: string, cookieValue: T, cookieOptionsWithDefaults: ICookieSetOptions): string => {\n let cookieString = `${cookieName}=${cookieValue}`;\n if (cookieOptionsWithDefaults) {\n const optionsString = this._appendCookieOptions(cookieOptionsWithDefaults);\n if (optionsString) {\n cookieString = `${cookieString}; ${optionsString}`;\n }\n }\n return cookieString;\n };\n\n private _appendCookieOptions = (options: ICookieSetOptions): string => {\n const cookieOptions: string[] = [];\n if (options.path) {\n cookieOptions.push(`Path=${options.path}`);\n }\n if (options.expires) {\n cookieOptions.push(`Expires=${options.expires}`);\n }\n if (options.maxAge) {\n cookieOptions.push(`Max-Age=${options.maxAge}`);\n }\n if (options.domain) {\n cookieOptions.push(`Domain=${options.domain}`);\n }\n if (options.secure) {\n cookieOptions.push(`Secure`);\n }\n if (options.httpOnly) {\n cookieOptions.push(`HttpOnly`);\n }\n if (options.sameSite) {\n cookieOptions.push(`SameSite=${options.sameSite}`);\n }\n return cookieOptions.length !== 0 ? cookieOptions.join('; ') : '';\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport axios from 'axios';\nimport { IRequestContext, msdyn365Commerce, IRequestContextForSegment } from '@msdyn365-commerce/core-internal';\nimport { IInternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\n\ninterface ISegmentProvider {\n providerId: string;\n segmentIds: string[];\n}\n\nconst REQUEST_CONTEXT_PROPERTIES_FOR_SEG = ['clientIPAddress', 'cookieString', 'cookie', 'query', 'params', 'apiSettings', 'features'];\n\nexport const resolveMissingSegmentsOnClient = (requestContext: IRequestContext, userId: string, telemetry: IInternalTelemetry) => {\n if (!requestContext || !requestContext.missingSegments || requestContext.missingSegments.length) {\n return;\n }\n let domain = requestContext.canonicalDomain || '';\n if (msdyn365Commerce.isBrowser) {\n domain = window.location.hostname;\n }\n const missingSegments: ISegmentProvider[] = [];\n const neededMissingSegments = requestContext.missingSegments;\n Object.keys(neededMissingSegments).forEach((providerId: string) => {\n const segmentProvider: ISegmentProvider = {\n providerId: providerId,\n segmentIds: neededMissingSegments[providerId]\n };\n missingSegments.push(segmentProvider);\n });\n // if there is no misisng segments. return.\n if (missingSegments.length === 0) {\n return;\n }\n // add cookie string. So we are able to re-construct cookie obj when oneRf call Node to resolve segments.\n requestContext.cookieString = (document && document.cookie) || '';\n const segmentRequestId = requestContext.segmentRequestId;\n const missingSegmentResolvingUrl = `https://${domain}/_msdyn365/getsegment`;\n\n // only maintain selected properties of requestContext.\n const segRequestContext: IRequestContextForSegment = {};\n REQUEST_CONTEXT_PROPERTIES_FOR_SEG.forEach((property: string) => {\n if (property in requestContext && !!requestContext[property]) {\n segRequestContext[property] = requestContext[property];\n }\n });\n\n const requestContextObject = requestContext?.features?.disable_segment_requestContext ? requestContext : segRequestContext;\n\n axios({\n method: 'post',\n url: missingSegmentResolvingUrl,\n data: {\n segmentProviderList: missingSegments,\n userId: userId,\n requestContext: requestContextObject,\n ...(segmentRequestId && { segmentRequestId: segmentRequestId })\n }\n })\n // after post request, oneRf will process the request. Node will not receive any response.\n .then()\n .catch(err => telemetry.log(LogLevel.Error, `Error in resolving segments from AJAX call for ${domain}`, { exception: err }));\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ActionContext, CLIENT_HYDRATE_KEY, CLIENT_HYDRATE_TYPE } from '@msdyn365-commerce/action-internal';\nimport { RequestCache, ICacheKey, ICache } from '@msdyn365-commerce/cache-internal';\nimport {\n CoreContext,\n CultureInfoFormatter,\n IActionContext,\n IAny,\n ICoreContext,\n IDictionary,\n IGeneric,\n IModule,\n IModuleContract,\n IMSDyn365Window,\n IPartnerThemeSettings,\n IRequestContext,\n IRequestContextUrl,\n IVariants,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport {\n ClientAppInsightsJSLogger,\n LoggerType,\n EVENT_CLIENT_RENDER_START,\n EVENT_CLIENT_RENDER_STOP,\n CONTENT_SECURITY_POLICY_ERROR,\n EVENT_WEB_VITALS_CLS,\n EVENT_WEB_VITALS_FCP,\n EVENT_WEB_VITALS_FID,\n EVENT_WEB_VITALS_INP,\n EVENT_WEB_VITALS_LCP,\n EVENT_WEB_VITALS_TTFB,\n EXCEPTION_CLIENT_CACHE_HYDRATE,\n EXCEPTION_LOAD_DATA_EXCEPTION,\n EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION,\n expAttributeRenderer,\n GenericConsoleLogger,\n IEventClientRenderMetrics,\n IEventClientRenderProperties,\n IEventClientWebVitalsCLSMetrics,\n IEventId,\n IEventTime,\n ITelemetry,\n LogLevel,\n MESSAGE_CLIENT_RENDER_ERROR,\n StaticTelemetry,\n Telemetry,\n TelemetryEvent,\n InternalTelemetry,\n TSuccessNumber\n} from '@msdyn365-commerce/telemetry-internal';\nimport axios from 'axios';\nimport 'lazysizes';\nimport 'lazysizes/plugins/attrchange/ls.attrchange';\n// eslint-disable-next-line import/no-unassigned-import\nimport 'lazysizes/plugins/bgset/ls.bgset';\nimport { partition as _partition } from 'lodash';\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { onCLS, onFCP, onFID, onLCP, onINP, onTTFB } from 'web-vitals';\nimport {\n RSRequestInterceptor,\n RSRequestInterceptorErrorHandler,\n RSResponseInterceptor,\n RSResponseInterceptorErrorHandler\n} from '../_server/inteceptors/rs-logging-interceptor';\nimport SafeRenderModule from '../components/safe-render-module';\nimport {\n CLIENT_RENDER_COMPLETE_EVENT,\n CLIENT_RENDER_START_EVENT,\n DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT,\n LAYOUT_MOUNT_POINT,\n PROCESS_TYPE,\n MODULE_CONFIG_KEY,\n CLIENT_ENTRY_POINTS_TYPE\n} from '../consts';\nimport { loadData } from '../data/load-data';\nimport { processComplexDataTypes } from '../hydrators/process-page-response';\nimport { IDisabledProperties } from '../store/authoring-edit-helper';\nimport { PageContext } from '../store/page-context';\nimport {\n getCurrencyCodeFromContext,\n isLazyRenderModuleEnabled,\n optimizedGetAllModules,\n shouldOptimizeHydrate,\n timeSliceLongJSTask\n} from '../utils/helpers';\nimport { SessionStorageContext } from '../utils/session-storage-utils';\nimport { CookieContext } from './../utils/cookie-utils';\nimport { resolveMissingSegmentsOnClient } from './../utils/resolve-segments-utils';\n\ntype windowinitialData = IGeneric;\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interface ClientWindow extends IMSDyn365Window {\n ___initialData___: windowinitialData;\n cache: RequestCache;\n }\n}\n\ndeclare let window: ClientWindow;\n\naxios.interceptors.request.use(RSRequestInterceptor, RSRequestInterceptorErrorHandler);\naxios.interceptors.response.use(RSResponseInterceptor, RSResponseInterceptorErrorHandler);\n\nconst CLIENT_HYDRATE_CACHE_KEY: ICacheKey = {\n key: CLIENT_HYDRATE_KEY,\n typeName: CLIENT_HYDRATE_TYPE\n};\n\nexport const getRequestContext = (storeData: windowinitialData): IRequestContext => {\n const requestContext: IRequestContext = storeData.requestContext;\n\n // See if cookie compliance is disabled at the site level\n const disableCookieCompliance =\n (requestContext.app && requestContext.app.platform && requestContext.app.platform.disableCookieCompliance) || false;\n const cartSessionExpiration =\n (requestContext.app && requestContext.app.platform && requestContext.app.platform.cartSessionExpiration) || 0;\n const cookies = new CookieContext({\n isConsentRequired: !disableCookieCompliance,\n cartExpirationInDays: cartSessionExpiration,\n sameSiteRequired: requestContext.sameSiteRequired\n });\n\n try {\n // merge the query params from url back to request context in case if the page response is cached\n const urlSearchParams = new URLSearchParams(window.location.search);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const entries = Object.fromEntries((urlSearchParams as any).entries());\n Object.keys(entries || {}).map(param => {\n if (requestContext.query && !requestContext.query[param]) {\n requestContext.query[param] = entries[param] || '';\n }\n });\n } catch (e) {\n console.error('merging query parameters from url failed');\n }\n\n if (requestContext.telemetrySettings && storeData['_clientPlatformSetting']) {\n requestContext.telemetrySettings.operationalInsightsInstrumentationKey =\n storeData['_clientPlatformSetting'].secondaryInstrumentationKey;\n }\n requestContext.cookies = cookies;\n requestContext.sessionStorage = new SessionStorageContext(cookies);\n requestContext.headers = Object.freeze({});\n requestContext.url.requestUrl =\n typeof requestContext.url.requestUrl === 'string' ? new URL(requestContext.url.requestUrl) : requestContext.url.requestUrl;\n return requestContext;\n};\n\nconst setClientHydrateContext = (requestCache: ICache) => {\n requestCache.put(CLIENT_HYDRATE_CACHE_KEY, { item: true });\n};\n\nconst resetClientHydrateContext = (requestCache: ICache) => {\n requestCache.del(CLIENT_HYDRATE_CACHE_KEY);\n};\n\nconst getPathName = (requestContextUrl: IRequestContextUrl): string => {\n if (requestContextUrl && requestContextUrl.requestUrl && requestContextUrl.requestUrl.pathname) {\n return requestContextUrl.requestUrl.pathname;\n }\n return '';\n};\n\nconst isPaymentVerification = (requestContext: IRequestContext): boolean => {\n return requestContext.query?.pv === '1';\n};\n\nconst isCheckoutRoute = (requestContext: IRequestContext): boolean => {\n return (\n requestContext.app &&\n requestContext.app.routes &&\n requestContext.app.routes.checkout &&\n requestContext.app.routes.checkout.destinationUrl &&\n getPathName(requestContext.url) === requestContext.app.routes.checkout.destinationUrl\n );\n};\n\nconst activateExperiments = (requestContext: IRequestContext): void => {\n // Activate experiment if an experimentation connector has been registered and active experiments are provided\n // In a preview scenario, OneRF will not send a user ID and which we will not active the experiment\n if (\n msdyn365Commerce.experimentationConnector &&\n requestContext.features.experimentation &&\n requestContext.experiments &&\n requestContext.experiments.userId &&\n requestContext.experiments.activeExperiments &&\n requestContext.experiments.activeExperiments.length > 0\n ) {\n const experimentInfo = requestContext.experiments;\n // Split the experiment list into two lists, one whose experiments are coupled with a module and one whose experiments are not\n const [experimentsWithoutModuleId, experimentsWithModuleId] = _partition(experimentInfo.activeExperiments, (value: IVariants) => {\n return !value.moduleId;\n });\n // Activate experiments not tied to a module id\n msdyn365Commerce.experimentationConnector.provider.activateExperiment(experimentInfo.userId, experimentsWithoutModuleId, {\n Type: requestContext.device.Type\n });\n\n // Activate experiments once 30% of the module is visible\n const options: IntersectionObserverInit = {\n threshold: 0.3\n };\n const experimentMap: IDictionary = {};\n const experimentObserver = new IntersectionObserver((entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n entries.forEach((entry: IntersectionObserverEntry) => {\n if (entry.isIntersecting && entry.intersectionRatio >= 0.3) {\n const activatedExpId = entry.target.getAttribute(`data-exp`);\n if (activatedExpId) {\n // Find the experiment/variant combo associated with the experiment to activate\n msdyn365Commerce.experimentationConnector?.provider.activateExperiment(\n experimentInfo.userId,\n [experimentMap[activatedExpId]],\n {\n Type: requestContext.device.Type\n }\n );\n }\n // Once we the element has come into the view for the first time, we can stop observing it\n observer.unobserve(entry.target);\n }\n });\n }, options);\n for (let i = 0; i < experimentsWithModuleId.length; i++) {\n const currentExperiment = experimentsWithModuleId[i];\n const target = document.querySelector(`[data-exp=\"id:${currentExperiment.experimentId}\"]`);\n if (target) {\n experimentMap[`id:${currentExperiment.experimentId}`] = currentExperiment;\n experimentObserver.observe(target);\n }\n }\n }\n};\n\n/**\n * Method to hydrate the markup returned by server on the client.\n * @param requestContext request context object\n * @param pageContext page context object\n * @param coreContext core context object\n */\nconst hydrateClient = (requestContext: IRequestContext, pageContext: PageContext, coreContext: ICoreContext) => {\n const pageRoot = pageContext.pageRoot;\n const body = pageRoot.modules && pageRoot.modules.body;\n const props = body && body.length > 0 ? body[0] : pageRoot;\n const defaultPageConfig =\n (!!!requestContext?.features?.disable_moduleConfig_optimize &&\n pageContext.requestCache.getValue({ typeName: MODULE_CONFIG_KEY, key: props.id })) ||\n props.config;\n try {\n ReactDOM.hydrate(\n \n \n ,\n document.getElementById(LAYOUT_MOUNT_POINT)\n );\n } catch (err) {\n // If in dev mode or debug mode, throw the error so it's visible on the page.\n if ((process.env.NODE_ENV === 'development' || requestContext.params.isDebug) && !requestContext.params.isEditor) {\n throw err;\n // In editor mode, catch the error but don't throw so that the page doesn't freeze up\n } else if (requestContext.params.isEditor) {\n console.log(`Error running editor (client) render: ${err}`);\n }\n }\n};\n\n/**\n * Method to initialize authoring helper and register event to receive list of disabled properties when rendered in the context of site builder\n * @param requestContext request context object\n * @param pageContext page context object\n * @param coreContext core context object\n * @param actionContext action context object\n * @param moduleTelemetry module telemetry object\n */\nconst initAuthoringHelper = (\n requestContext: IRequestContext,\n pageContext: PageContext,\n coreContext: ICoreContext,\n actionContext: IActionContext,\n moduleTelemetry\n) => {\n const themeSettings: IPartnerThemeSettings = window.___initialData___.themeSettings ? window.___initialData___.themeSettings : {};\n\n return import('../utils/authoring-tools-helper').then(m => {\n const AuthoringToolsHelper = m.AuthoringToolsHelper;\n const authoringHelper = new AuthoringToolsHelper(actionContext, themeSettings, coreContext, pageContext, moduleTelemetry);\n window._msdyn365.authoringHelper = authoringHelper;\n\n const _msdyn365Data = window._msdyn365;\n _msdyn365Data.authoringHelper = authoringHelper;\n\n if (requestContext.params.isEditor) {\n // @ts-ignore\n document.addEventListener('_msdyn365_client_disabled_properties', (dpEvent: { detail: IDisabledProperties }) => {\n if (dpEvent && dpEvent.detail && dpEvent.detail) {\n Object.keys(dpEvent.detail.modules).map(key => {\n authoringHelper.updateDisabledProperties(key, dpEvent.detail.modules[key]);\n });\n }\n });\n }\n });\n};\n\nexport function clientRender(): void {\n const storeData = window.___initialData___;\n if (!storeData || typeof storeData !== 'object') {\n console.error(MESSAGE_CLIENT_RENDER_ERROR);\n return;\n }\n const removePlaceholderModules = (modulesDictionary: { [slot: string]: IModuleContract[] }) => {\n Object.keys(modulesDictionary || {}).forEach(slot => {\n modulesDictionary[slot] = modulesDictionary[slot].filter(a => a.typeName !== 'place-holder-for-container-preview');\n modulesDictionary[slot].forEach(module => module.modules && removePlaceholderModules(module.modules));\n });\n };\n const requestContext = getRequestContext(storeData);\n if (requestContext.params.isEditor) {\n removePlaceholderModules(storeData.pageRoot.modules);\n }\n\n // if request is not POST or is not a checkout route or is not a payment verification, clear all checkout session storage data.\n // TODO: Explore a way to move this logic to SSK\n if (!requestContext.requestFormData || !isCheckoutRoute(requestContext) || !isPaymentVerification(requestContext)) {\n requestContext.sessionStorage.removeCheckoutCartData();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const appCache = (msdyn365Commerce as any).getAppCache(requestContext);\n const pageContext = new PageContext(storeData, requestContext, appCache);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__msdyn365__ = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window as any).__msdyn365__.pageContext = pageContext;\n\n // Get the 1DS instance from the browser client. Initialized as part of base-page\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const oneDSWeb: any = window['oneDSWeb'];\n\n // Get the registered experiment listener\n const expListener = msdyn365Commerce.experimentationConnector?.listener;\n\n // Get application insights instrumentation key\n const appInsightsInstrumentationKey = requestContext.telemetrySettings.instrumentationKey || '';\n let msftClientAppInsightsJSLogger;\n if (appInsightsInstrumentationKey !== '') {\n msftClientAppInsightsJSLogger = new ClientAppInsightsJSLogger(\n LoggerType.MSFTApplicationInsightsLogger,\n appInsightsInstrumentationKey\n );\n }\n\n // Get operational insights instrumentation key\n const operationalInsightsInstrumentationKey = requestContext.telemetrySettings.operationalInsightsInstrumentationKey || '';\n let operationalClientAppInsightsJSLogger;\n if (operationalInsightsInstrumentationKey !== '') {\n operationalClientAppInsightsJSLogger = new ClientAppInsightsJSLogger(\n LoggerType.OperationalApplicationInsightsLogger,\n operationalInsightsInstrumentationKey\n );\n }\n\n // Set up internal SDK telemetry\n const internalTelemetry = StaticTelemetry;\n internalTelemetry.enableDataAnalytics(requestContext.features.enableDataAnalytics);\n internalTelemetry.registerWebAnalyticsPlugin(oneDSWeb);\n internalTelemetry.registerAttributeRenderer(expAttributeRenderer);\n if (appInsightsInstrumentationKey !== '') {\n internalTelemetry.registerTraceLogger({\n traceLogger: msftClientAppInsightsJSLogger\n });\n }\n\n internalTelemetry.setTelemetryRequestContext({\n siteId: '[[Placeholder]]',\n channelId: requestContext.channel?.RecordId ? requestContext.channel.RecordId.toString() : 'Unavailable',\n pageType: requestContext.urlTokens.pageType,\n pageId: pageContext.pageRoot.id\n });\n\n const correlationId = Telemetry.generateGuid();\n logWebVitals(internalTelemetry, correlationId);\n\n const targetId = requestContext?.tuid;\n if (targetId) {\n resolveMissingSegmentsOnClient(requestContext, targetId, internalTelemetry);\n }\n\n // Set up external module telemetry\n const moduleTelemetry = new Telemetry();\n moduleTelemetry.enableDataAnalytics(requestContext.features.enableDataAnalytics);\n moduleTelemetry.registerWebAnalyticsPlugin(oneDSWeb);\n moduleTelemetry.registerAttributeRenderer(expAttributeRenderer);\n if (operationalInsightsInstrumentationKey) {\n moduleTelemetry.registerTraceLogger({\n traceLogger: operationalClientAppInsightsJSLogger\n });\n }\n\n // If experimentaiton listener set up, add to event logging framework\n if (expListener && requestContext.features.experimentation) {\n internalTelemetry.registerExpLogger(expListener);\n\n moduleTelemetry.registerExpLogger(expListener);\n }\n\n // If in debug mode, add console loggers\n if (requestContext.params.isDebug) {\n internalTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: requestContext.params.isDebug } });\n moduleTelemetry.registerTraceLogger({ traceLogger: GenericConsoleLogger, options: { isDebug: requestContext.params.isDebug } });\n }\n\n const contentSecurityPolicy = requestContext.app && requestContext.app?.contentSecurityPolicy;\n\n // Logging CSP error only when CSP is enabled and enableReportOnlyMode is false\n if (contentSecurityPolicy && !contentSecurityPolicy?.disableContentSecurityPolicy && !contentSecurityPolicy?.enableReportOnlyMode) {\n const randomNumberGenerator = Math.floor(Math.random() * 100);\n\n document.addEventListener('securitypolicyviolation', e => {\n const cspReport = JSON.stringify({\n 'blocked-uri': e.blockedURI,\n 'document-uri': e.documentURI,\n 'original-policy': e.originalPolicy,\n 'violated-directive': e.violatedDirective\n });\n\n // Only logging all CSP errors for 25% of page request\n if (randomNumberGenerator < 25) {\n internalTelemetry.log(LogLevel.Error, CONTENT_SECURITY_POLICY_ERROR, { customTags: [cspReport] });\n }\n });\n }\n\n pageContext\n .putRequestedModulesInCacheOnClient(storeData, moduleTelemetry)\n .catch(error => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_CLIENT_CACHE_HYDRATE, { exception: error });\n })\n .finally(async () => {\n await timeSliceLongJSTask(requestContext);\n\n window._msdyn365 = {\n requestContext: requestContext,\n telemetry: internalTelemetry\n };\n\n const actionContext = new ActionContext({\n id: 'Client Action Context',\n requestContext: requestContext,\n requestCache: pageContext.requestCache,\n telemetry: moduleTelemetry,\n appCache: null,\n spawnChildOnExecute: true\n });\n\n if (requestContext.params.isDebug) {\n window._msdyn365.cache = pageContext.requestCache;\n }\n const coreContext: ICoreContext = {\n actionContext: actionContext,\n app: requestContext.app,\n // @ts-ignore -- we don't actually have this prop defined on the interface\n internalTelemetry: internalTelemetry,\n telemetry: moduleTelemetry,\n request: requestContext,\n cultureFormatter: new CultureInfoFormatter(\n requestContext.locale,\n getCurrencyCodeFromContext(requestContext),\n requestContext.query\n )\n };\n let allModules: IModule[] = [];\n await timeSliceLongJSTask(requestContext);\n if (requestContext?.features?.loadData_optimization) {\n allModules = await optimizedGetAllModules(pageContext, requestContext);\n } else {\n allModules = await pageContext.allModules(requestContext, []);\n }\n\n const allowDispatchEvent = requestContext?.params?.isEditor || requestContext?.features?.enable_verbose_logs ? true : false;\n if (shouldOptimizeHydrate(requestContext)) {\n await optimizeClientHydrate(\n requestContext,\n pageContext,\n coreContext,\n actionContext,\n allModules,\n moduleTelemetry,\n internalTelemetry,\n correlationId\n );\n } else {\n if (requestContext.params.isEditor) {\n await initAuthoringHelper(requestContext, pageContext, coreContext, actionContext, moduleTelemetry);\n }\n\n // Fire event to let tooling know render starts. Tools on receiving this event, calls\n // initialziation and passes the rendering helper class instance that can be used by SDK to\n // get any information/context w.r.t tools\n if (allowDispatchEvent) {\n const event = new Event(CLIENT_RENDER_START_EVENT);\n document.dispatchEvent(event);\n }\n\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(EVENT_CLIENT_RENDER_START, {\n id: correlationId\n });\n internalTelemetry.startTimer(correlationId);\n }\n\n let initialPromise: Promise = Promise.resolve();\n const LAZYLOAD_ALL_SWITCH: boolean = requestContext.features.lazyload_all;\n\n initialPromise = initialPromise.then(async () => {\n try {\n return processComplexDataTypes(LAZYLOAD_ALL_SWITCH, PROCESS_TYPE.client, allModules, actionContext);\n } catch (error) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION, { exception: error });\n }\n });\n\n initialPromise.finally(() => {\n // put client hydrate flag into request cache.\n setupClientHydrateFlag(pageContext.requestCache);\n loadData(allModules, requestContext, internalTelemetry, moduleTelemetry, pageContext.requestCache, null)\n .then(() => {\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(\n EVENT_CLIENT_RENDER_STOP,\n {\n id: correlationId\n },\n {\n success: 1,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n }\n })\n .catch(error => {\n if (allowDispatchEvent) {\n internalTelemetry.trackEvent(\n EVENT_CLIENT_RENDER_STOP,\n {\n id: correlationId\n },\n {\n success: 0,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n }\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOAD_DATA_EXCEPTION, { exception: error });\n })\n .finally(() => {\n // remove client hydrate flag from request cache.\n resetClientHydrateContext(pageContext.requestCache);\n // Gets a reference to the same Telemetry, so that we can route existing log calls to new back-end without changing front-end API\n\n if (!shouldOptimizeHydrate(requestContext)) {\n hydrateClient(requestContext, pageContext, coreContext);\n }\n msdyn365Commerce.setClientHydrate(false);\n // Add the page view exp event id to the page level div\n const pageName = requestContext.telemetryPageName || requestContext.url.requestUrl.pathname;\n document.getElementById(LAYOUT_MOUNT_POINT)?.setAttribute('data-exp-event-id', `${pageName}.PageView`);\n // Activate any active experiments on the page\n activateExperiments(requestContext);\n\n // TODO (matt, 6/15/20): Manually firing page view event, undo once 1DS forwarding to framework implemented\n internalTelemetry.logEvent(TelemetryEvent.PageView, {\n title: requestContext.telemetryPageName || requestContext.url.requestUrl.pathname\n });\n\n if (allowDispatchEvent) {\n // Fire event to let tooling know render is complete\n const deprecatedEvent = new Event(DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT);\n document.dispatchEvent(deprecatedEvent);\n\n document.dispatchEvent(new Event(CLIENT_RENDER_COMPLETE_EVENT));\n }\n });\n });\n }\n });\n\n // TODO (matt, 6/15/20): Manually firing page view event, undo once 1DS forwarding to framework implemented\n internalTelemetry.logEvent(TelemetryEvent.PageView, {\n title: requestContext.telemetryPageName || requestContext.url.requestUrl.pathname\n });\n}\n\nconst setupClientHydrateFlag = (requestCache: ICache) => {\n setClientHydrateContext(requestCache);\n msdyn365Commerce.setClientHydrate(true);\n};\n\nconst optimizeClientHydrate = async (\n requestContext: IRequestContext,\n pageContext: PageContext,\n coreContext: ICoreContext,\n actionContext: ActionContext,\n allModules: IModule[],\n moduleTelemetry: ITelemetry,\n internalTelemetry: InternalTelemetry,\n correlationId: string\n) => {\n try {\n // Await on instance data actions, other data actions are run asynchronously\n setupClientHydrateFlag(pageContext.requestCache);\n\n let modulesRenderedOnServer = allModules;\n if (isLazyRenderModuleEnabled(requestContext)) {\n modulesRenderedOnServer = allModules.filter(m => {\n const cacheItem = pageContext.requestCache.get({ typeName: CLIENT_ENTRY_POINTS_TYPE, key: m.typeName })?.item;\n return !cacheItem;\n });\n }\n await timeSliceLongJSTask(requestContext);\n\n await loadData(modulesRenderedOnServer, requestContext, internalTelemetry, moduleTelemetry, pageContext.requestCache, null);\n resetClientHydrateContext(pageContext.requestCache);\n const allowDispatchEvent = requestContext?.params?.isEditor || requestContext?.features?.enable_verbose_logs ? true : false;\n\n // Fire event to let tooling know render starts. Tools on receiving this event, calls\n // initialziation and passes the rendering helper class instance that can be used by SDK to\n // get any information/context w.r.t tools\n if (allowDispatchEvent) {\n const event = new Event(CLIENT_RENDER_START_EVENT);\n document.dispatchEvent(event);\n }\n\n if (requestContext?.features?.enable_verbose_logs) {\n internalTelemetry.trackEvent(EVENT_CLIENT_RENDER_START, {\n id: correlationId\n });\n internalTelemetry.startTimer(correlationId);\n }\n\n // hydrate client without waiting on all the data actions to complete\n hydrateClient(requestContext, pageContext, coreContext);\n msdyn365Commerce.setClientHydrate(false);\n\n if (allowDispatchEvent) {\n trackEvent(internalTelemetry, correlationId, EVENT_CLIENT_RENDER_STOP, 1);\n }\n\n if (requestContext.params.isEditor) {\n await initAuthoringHelper(requestContext, pageContext, coreContext, actionContext, moduleTelemetry);\n }\n\n const LAZYLOAD_ALL_SWITCH: boolean = requestContext.features.lazyload_all;\n\n try {\n await processComplexDataTypes(LAZYLOAD_ALL_SWITCH, PROCESS_TYPE.client, allModules, actionContext);\n } catch (error) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION, { exception: error });\n }\n\n // Add the page view exp event id to the page level div\n const pageName = requestContext.telemetryPageName || requestContext.url.requestUrl.pathname;\n document.getElementById(LAYOUT_MOUNT_POINT)?.setAttribute('data-exp-event-id', `${pageName}.PageView`);\n // Activate any active experiments on the page\n activateExperiments(requestContext);\n\n if (allowDispatchEvent) {\n // Fire event to let tooling know render is complete\n const deprecatedEvent = new Event(DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT);\n document.dispatchEvent(deprecatedEvent);\n document.dispatchEvent(new Event(CLIENT_RENDER_COMPLETE_EVENT));\n }\n } catch (error) {\n if (requestContext.features.enable_verbose_logs) {\n trackEvent(internalTelemetry, correlationId, EVENT_CLIENT_RENDER_STOP, 0);\n }\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOAD_DATA_EXCEPTION, { exception: error });\n }\n};\n\nconst trackEvent = (internalTelemetry: InternalTelemetry, correlationId: string, eventName: string, success: TSuccessNumber) => {\n internalTelemetry.trackEvent(\n eventName,\n {\n id: correlationId\n },\n {\n success,\n time: internalTelemetry.stopTimer(correlationId)\n }\n );\n};\n\nconst logWebVitals = (internalTelemetry: InternalTelemetry, correlationId: string) => {\n onCLS(metric => {\n internalTelemetry.trackEvent(\n EVENT_WEB_VITALS_CLS,\n { id: correlationId },\n { value: metric.value }\n );\n });\n onFCP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_FCP, { id: correlationId }, { time: metric.value });\n });\n onFID(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_FID, { id: correlationId }, { time: metric.value });\n });\n onLCP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_LCP, { id: correlationId }, { time: metric.value });\n });\n onTTFB(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_TTFB, { id: correlationId }, { time: metric.value });\n });\n onINP(metric => {\n internalTelemetry.trackEvent(EVENT_WEB_VITALS_INP, { id: correlationId }, { time: metric.value });\n });\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAny, IGeneric, MSDyn365Commerce, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { IBinding, IModuleBinder, IMSDyn365CommerceWithPrototype } from './models';\n\nexport const initializeApp = (bindings: IBinding) => {\n /**\n * Why we are using 'Prototype'. MSDyn365Commerce is defined in core packages and used in modules and C1 development.\n * whereas all registration, build information, commerce details etc available in runtime-internal package.\n * prototype help us declaring properties in core package and implementation in runtime-internal package.\n *\n * Following properties are not accessible by module or c1 developer.\n */\n (MSDyn365Commerce).prototype.bindings = bindings;\n\n (MSDyn365Commerce).prototype.moduleBinder = function(name: string): IModuleBinder {\n return this.bindings && this.bindings.modules && this.bindings.modules[name && name.toLowerCase()];\n };\n\n (MSDyn365Commerce).prototype.viewBinder = function(name: string): React.FC {\n return this.bindings && this.bindings.views && this.bindings.views[name];\n };\n\n (MSDyn365Commerce).prototype.componentBinder = function(name: string): React.FC {\n return this.bindings && this.bindings.components && this.bindings.components[name];\n };\n\n (MSDyn365Commerce).prototype.getPartnerOverrideAction = function(id: string): Function {\n return this.bindings && this.bindings.partnerDataActions && this.bindings.partnerDataActions[id];\n };\n\n (MSDyn365Commerce).prototype.dataAction = function(name: string): Function {\n return (\n (this.bindings && this.bindings.partnerDataActions && this.bindings.partnerDataActions[name]) ||\n (this.bindings && this.bindings.dataActions && this.bindings.dataActions[name])\n );\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (MSDyn365Commerce).prototype.getConnector = function(name: string): any {\n return this.bindings && this.bindings.connectors && this.bindings.connectors[name];\n };\n\n (MSDyn365Commerce).prototype.getAllModuleBinder = function(): IModuleBinder[] {\n return this.bindings && this.bindings.modules && Object.values(this.bindings.modules);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Returns an npm package source.\n (MSDyn365Commerce).prototype.perfAnalysisBinder = function(): any {\n return this.bindings?.perfAnalysisLibBinding;\n };\n\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._env = process.env.NODE_ENV;\n };\n\n (>msdyn365Commerce).updatePrivateVariable();\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport { IComponent, IComponentProps, ICoreContext, IModule, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport { asSystemMetadata, EXCEPTION_NOMODULEBINDER, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React from 'react';\nimport * as path from 'path';\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { getModuleName, getPageInsightsCacheKey, isPageInsightsEnabled } from '../utils/helpers';\nimport { PAGE_INSIGHTS_COMPONENTS_KEY } from '../consts';\n\nexport interface IModuleWithView extends IModule {\n View: React.FunctionComponent;\n}\n\nconst getModuleBinder = (typeName: string) => ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).moduleBinder(typeName);\n\nconst getBinder = (lookupKey: string, moduleName: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const view = ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).componentBinder(lookupKey);\n if (view) {\n if (pageInsightsEnabled) {\n const componentInsightsKey = getPageInsightsCacheKey(PAGE_INSIGHTS_COMPONENTS_KEY);\n const componentInsights = requestCache.get<{}>(componentInsightsKey)?.item || {};\n componentInsights[`${moduleName}`] = `${lookupKey.replace(/\\|/g, '/')}.component.tsx`;\n requestCache.put(componentInsightsKey, { item: componentInsights });\n }\n\n return { key: lookupKey, view };\n }\n return undefined;\n};\n\n/* component will be read in following hierarchy\n 1) __local__/__local__|views/theme1/BuyBox/Components/PriceComponent\n 2) __local__/__local__|views/theme1/Components/PriceComponent\n 3) @msdyn-365-commerce-modules/theme1/views/BuyBox/Components/PriceComponent\n 4) @msdyn-365-commerce-modules/theme1/views/Components/PriceComponent\n */\nconst lookupFunc = (moduleBinder, themeBinder, name, requestCache: ICache, pageInsightsEnabled: boolean) => {\n name = name.toLowerCase();\n return (\n (themeBinder &&\n (getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `__local__|__local__|themes|${themeBinder.name}|views|components|${moduleBinder.name}|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|components|${moduleBinder.name}|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n getBinder(\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ))) ||\n getBinder(\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n )\n );\n};\n\n/**\n * Component will be read from the module\n * @msdyn-365-commerce-modules/BuyBox/views/BuyBox/Components/PriceComponent\n */\nconst defaultComponentLookupFunc = (moduleBinder, name: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const parentModuleBinder = getModuleBinder(getModuleName(moduleBinder.parentDefinitionPath));\n\n return (\n getBinder(\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|views|${moduleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ) ||\n (parentModuleBinder &&\n getBinder(\n `${parentModuleBinder.moduleNamespace}|${parentModuleBinder.packageName}|views|${parentModuleBinder.name}|components|${name}`,\n moduleBinder.name,\n requestCache,\n pageInsightsEnabled\n ))\n );\n};\n\nconst getComponent = (name, moduleBinder, themeBinder, context: ICoreContext) => {\n if (!moduleBinder) {\n return { view: null };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cache: ICache = (msdyn365Commerce as any).getAppCache(context.actionContext.requestContext);\n const pageInsightsEnabled = isPageInsightsEnabled(context.request.params);\n const cacheKey: ICacheKey = {\n key: `${name}|${moduleBinder.name}|${themeBinder ? themeBinder.name : 'no-theme'}`,\n typeName: '__ComponentCacheKey__'\n };\n const lookupKey = cache.getValue(cacheKey);\n const actionContextData: any = context.actionContext;\n const requestCache: ICache = actionContextData.requestCache;\n\n if (lookupKey) {\n context.telemetry.log(LogLevel.Debug, `lookup key for component [${cacheKey.key}] found at - [${lookupKey}]`);\n !msdyn365Commerce.isBrowser && actionContextData.requestCache.put(cacheKey, { item: lookupKey });\n return getBinder(lookupKey, moduleBinder.name, requestCache, pageInsightsEnabled) || { view: null };\n }\n\n let component = lookupFunc(moduleBinder, themeBinder, name, requestCache, pageInsightsEnabled);\n\n // If no component found in the theme, search in parent theme (in case of inherited theme)\n if (!component && themeBinder) {\n const parentThemeName = getModuleName(themeBinder.parentDefinitionPath);\n const parentThemeBinder = getModuleBinder(parentThemeName);\n component = lookupFunc(moduleBinder, parentThemeBinder, name, requestCache, pageInsightsEnabled);\n }\n\n // If no component file found, fall back to module's default component\n if (!component) {\n component = defaultComponentLookupFunc(moduleBinder, name, requestCache, pageInsightsEnabled);\n }\n\n if (component) {\n context.telemetry.log(LogLevel.Debug, `lookup key for component [${cacheKey.key}] found at - [${component.key}]`);\n cache.put(cacheKey, { item: component.key });\n actionContextData.requestCache.put(cacheKey, { item: component.key });\n return component;\n }\n\n return { view: null };\n};\n\nexport const createComponent = >(name: string, componentObj: T) => (props: IComponentProps) => {\n props.context.telemetry.log(LogLevel.Debug, `rendering component-'${name}' within module-'${props.id}-${props.typeName}'`);\n const moduleBinder = getModuleBinder(props.typeName);\n if (!moduleBinder) {\n props.context.telemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(props.typeName)] });\n return null;\n }\n let componentName = path.basename(__filename);\n if (componentName) {\n componentName = componentName.replace('.component.tsx', '');\n componentName = componentName.replace('.component.js', '');\n }\n\n const themeBinder = getModuleBinder(props.context.actionContext.requestContext.params.theme);\n let componentView = getComponent(componentName, moduleBinder, themeBinder, props.context);\n if (!componentView.view) {\n componentView = getComponent(name, moduleBinder, themeBinder, props.context);\n }\n const { view } = componentView;\n const mergedComponent = view ? { ...((componentObj as unknown) as object), ...view } : componentObj;\n const Component = mergedComponent.component;\n const propsDictionary = props as any;\n if (propsDictionary.addChunk && view) {\n propsDictionary.addChunk(view.cn);\n }\n\n return ;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, RequestCache } from '@msdyn365-commerce/cache-internal';\nimport {\n IAny,\n IExperimentationConnector,\n IGeneric,\n IRequestContext,\n MSDyn365Commerce,\n msdyn365Commerce,\n skipConsoleWarn\n} from '@msdyn365-commerce/core-internal';\nimport { initializeApp } from './initialization';\nimport { IBinding, IMSDyn365CommerceWithPrototype } from './models';\nimport { createComponent } from './render-component';\nimport { initBindings } from './utils';\n\ninterface IConnectors {\n experimentation: IExperimentationConnector;\n}\n\nconst requestCache: ICache = new RequestCache();\n\n/**\n * Helper method to inject createComponent method from runtime-internal.\n * We add a dummy createComponent method initially to avoid running into circular lookup of\n * ecommerce components\n */\nconst addCreateComponentHook = () => {\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this.createComponent = createComponent;\n };\n (>msdyn365Commerce).updatePrivateVariable();\n};\n\nexport const initializeClientApp = async (bindings: IBinding, connectors: IConnectors) => {\n skipConsoleWarn();\n addCreateComponentHook();\n initializeApp(bindings);\n const clientPlatformSettings = (window).___initialData___ && (window).___initialData___._clientPlatformSetting;\n await initBindings(bindings, clientPlatformSettings && clientPlatformSettings.enableModuleEntryPoints);\n\n (MSDyn365Commerce).prototype.updatePrivateVariable = function(): void {\n const appDatabv = (window).___appData___ && (window).___appData___.bv;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._buildVersion = appDatabv;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._experimentationConnector = connectors?.experimentation;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._platformSettings = clientPlatformSettings;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._versionDependentFeatureInfo = (window).___initialData___ && (window).___initialData___._versionDependentFeatureInfo;\n\n // @ts-ignore -- accessing a private class variable which is a valid JS\n this._environmentVariable = (window).___initialData___ && (window).___initialData___._environmentVariable;\n };\n (>msdyn365Commerce).updatePrivateVariable();\n\n (MSDyn365Commerce).prototype.getAppCache = (requestContext: IRequestContext) => requestCache;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport path from 'path';\nimport { IBinding, IModuleBinder, IModuleBinderPartial } from './models';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const initBindings = async (bindings: IBinding, isModuleEntryPointsEnabled: boolean) => {\n await Promise.all(\n Object.keys(bindings.modules).map(async moduleKey => {\n const originalBinder: IModuleBinderPartial = (bindings.modules[moduleKey]);\n try {\n const binder: IModuleBinder = {};\n let fetchComponent;\n if (!isModuleEntryPointsEnabled) {\n fetchComponent = await originalBinder.c();\n }\n binder.component = isModuleEntryPointsEnabled\n ? function load() {\n return originalBinder.c();\n }\n : fetchComponent.default;\n binder.moduleDirectory = originalBinder.md;\n binder.dataActions = originalBinder.da;\n binder.packageName = originalBinder.p;\n binder.name = originalBinder.n;\n binder.definitionPath = path.join(originalBinder.md, `${originalBinder.n}.definition.json`);\n binder.parentDefinitionPath = originalBinder.pdp;\n binder.isNodeModule = originalBinder.iNM;\n binder.moduleNamespace = originalBinder.ns;\n binder.chunkName = `${originalBinder.ns}-${originalBinder.p}-${originalBinder.n}`;\n bindings.modules[moduleKey] = binder;\n } catch (e) {\n console.error(`failed to load module chunk :: ${moduleKey}`, e);\n }\n })\n );\n\n await Promise.all(\n Object.keys(bindings.views).map(async viewKey => {\n const viewComponent: any = bindings.views[viewKey];\n try {\n let fetchViewComponent;\n if (!isModuleEntryPointsEnabled) {\n fetchViewComponent = isModuleEntryPointsEnabled ? viewComponent.c() : await viewComponent.c();\n }\n (bindings.views[viewKey]).component = isModuleEntryPointsEnabled\n ? function load() {\n return viewComponent.c();\n }\n : fetchViewComponent.default;\n } catch (e) {\n console.error(`failed to load view chunk :: ${viewKey}`, e);\n }\n })\n );\n\n await Promise.all(\n Object.keys(bindings.components).map(async componentKey => {\n const ecommerceComponent: any = bindings.components[componentKey];\n try {\n const fetchEComComponent = await ecommerceComponent.c();\n (bindings.components[componentKey]).component = fetchEComComponent.default;\n } catch (e) {\n console.error(`failed to load component chunk :: ${componentKey}`, e);\n }\n })\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React from 'react';\nimport { getRenderingHelper } from '../utils/helpers';\n\nexport type IAddModuleProps = {\n moduleId: string;\n slotId: string;\n enabled: boolean;\n mode: AddControlMode;\n index?: number;\n slotName?: string;\n parentId?: string;\n};\n\nexport enum AddControlMode {\n EmptySlot,\n Sibling\n}\nexport interface IAddModuleState {\n moduleId: string;\n}\n\n/**\n * Editable field component, containing all the logic for inline editable properties in editorial preview\n * Current support: text, image\n */\nexport class AddModuleControl extends React.Component {\n public constructor(props: IAddModuleProps) {\n super(props);\n this.state = {\n moduleId: props.moduleId\n };\n }\n public render(): JSX.Element | null {\n if (!this.props.enabled) {\n return null;\n }\n const localizedStrings = {\n insertModule:\n this.getLocalizedStringsfromTools('insertModule') !== ''\n ? this.getLocalizedStringsfromTools('insertModule')\n : 'Insert module',\n insertFragment:\n this.getLocalizedStringsfromTools('insertFragment') !== ''\n ? this.getLocalizedStringsfromTools('insertFragment')\n : 'Insert fragment',\n moveNotAllowed:\n this.getLocalizedStringsfromTools('moveNotAllowed') !== ''\n ? this.getLocalizedStringsfromTools('moveNotAllowed')\n : 'Move not allowed'\n };\n\n const button = (tooltip: string) => {\n return (\n \n
\n \n \n \n
\n
\n \n \n
\n \n );\n };\n if (this.props.mode === AddControlMode.Sibling) {\n return (\n
\n
\n
{button(`Add a module to ${this.props.slotName || this.props.slotId}`)}
\n
\n
\n );\n } else {\n const parentData = this.props.parentId ? `,p:${this.props.parentId}` : '';\n return (\n
\n
\n
{button(`Configure ${this.props.slotName || this.props.slotId}`)}
\n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n {localizedStrings.insertModule}\n {localizedStrings.insertFragment}\n {localizedStrings.moveNotAllowed}\n
\n
\n
\n );\n }\n }\n\n public toggleMenuDisplay = () => {\n const button = document.getElementById(this.getAddButtonId());\n const menu = document.getElementById(this.getAddButtonMenuId());\n if (button && menu) {\n if (menu.style.display === 'block') {\n menu.style.display = 'none';\n } else {\n menu.style.display = 'block';\n }\n }\n };\n\n public hideMenuDisplay = () => {\n const button = document.getElementById(this.getAddButtonId());\n const menu = document.getElementById(this.getAddButtonMenuId());\n if (button && menu) {\n menu.style.display = 'none';\n }\n };\n\n public getAddButtonId = () => {\n return this.props.index\n ? `add-${this.props.moduleId}-${this.props.slotId}-${this.props.index}`\n : `add-${this.props.moduleId}-${this.props.slotId}`;\n };\n\n public onKeyPressMenu = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.toggleMenuDisplay();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public onKeyPressAddModule = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.addModule();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public onKeyPressAddFragment = (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n this.addFragment();\n } else if (event.key === 'Escape') {\n this.hideMenuDisplay();\n }\n };\n\n public getAddButtonMenuId = () => {\n return this.props.index\n ? `add-menu-${this.props.moduleId}-${this.props.slotId}-${this.props.index}`\n : `add-menu-${this.props.moduleId}-${this.props.slotId}`;\n };\n\n public addModule = () => {\n this.toggleMenuDisplay();\n const helper = getRenderingHelper();\n if (helper) {\n helper.addModule(this.props.moduleId, this.props.slotId, this.props.index || 0);\n }\n };\n\n public addFragment = () => {\n this.toggleMenuDisplay();\n const helper = getRenderingHelper();\n if (helper) {\n helper.addFragment(this.props.moduleId, this.props.slotId, this.props.index || 0);\n }\n };\n\n public getLocalizedStringsfromTools = (stringName: string): string => {\n const helper = getRenderingHelper();\n if (helper && typeof helper.getLocalizedString === 'function') {\n return helper.getLocalizedString(stringName);\n }\n return '';\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 React from 'react';\nimport { IAny, IGeneric, msdyn365Commerce, IDictionary, IModule } from '@msdyn365-commerce/core-internal';\nimport path from 'path';\nimport { RequestCache } from '@msdyn365-commerce/cache-internal';\nimport { IModuleBinder, IModuleBinderPartial } from '../app-initialization/models';\nimport { loadData } from '../data/load-data';\nimport { CLIENT_ENTRY_POINTS_TYPE } from '../consts';\nimport { optimizedGetAllModules } from '../utils/helpers';\n\nexport type TAsyncClientRenderComponentProps = IGeneric & {\n typeName: string;\n requestCache: RequestCache;\n renderModuleAttributes: (props: IGeneric) => IDictionary;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentRef: React.RefObject>;\n renderView: React.FC;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mappedProps: any;\n lazyLoadHandler: () => void;\n scriptInitCompleted: boolean;\n};\n\n/**\n *\n */\nexport class AsyncClientRenderComponent extends React.Component {\n constructor(props) {\n super(props);\n }\n\n public loadScriptAsync = async (moduleChunk: string): Promise => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n document.body.appendChild(script);\n script.type = 'text/javascript';\n script.onload = () => {\n resolve();\n };\n script.onerror = e => {\n console.error(`failed to load module chunk :: ${moduleChunk}`, e);\n };\n script.src = `${moduleChunk}`;\n script.async = false;\n script.defer = false;\n });\n };\n\n public waitAndInitializeModule = async (retryCount: number): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bindings = (window as any).__bindings__;\n const registeredModules = bindings.modules;\n\n // lets make sure the script execution is complete before attemtping to render the module\n if (!registeredModules[this.props.mappedProps.typeName] && retryCount < 5) {\n setTimeout(() => this.waitAndInitializeModule(++retryCount), 500);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const pageContext = (window as any).__msdyn365__.pageContext;\n let allModules: IModule[] = [];\n if (pageContext?.requestContext?.features?.loadData_optimization) {\n allModules = await optimizedGetAllModules(pageContext, pageContext.requestContext);\n } else {\n allModules = await pageContext.allModules(pageContext.requestContext, []);\n }\n const currentModuleArray = allModules.filter(m => m.typeName === this.props.mappedProps.typeName);\n const currentModule = currentModuleArray && currentModuleArray.length > 0 ? currentModuleArray[0] : undefined;\n\n if (!currentModule) {\n return;\n }\n\n // reassign the data actions from window bindings to reflect new data actions from client module\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (msdyn365Commerce as any).bindings.dataActions = bindings.dataActions;\n await loadData(\n [currentModule],\n this.props.mappedProps.context.request,\n this.props.mappedProps.internalTelemetry,\n this.props.mappedProps.internalTelemetry,\n this.props.requestCache,\n null,\n []\n );\n this.props.lazyLoadHandler();\n };\n\n public componentDidMount = async (): Promise => {\n if (msdyn365Commerce.isBrowser) {\n if (this.props.scriptInitCompleted) {\n return this.waitAndInitializeModule(0);\n }\n\n const clientModuleChunks = this.props.requestCache.get({\n typeName: CLIENT_ENTRY_POINTS_TYPE,\n key: this.props.typeName\n })\n ? this.props.requestCache.get({ typeName: CLIENT_ENTRY_POINTS_TYPE, key: this.props.typeName })?.item\n : [];\n\n if (!clientModuleChunks || clientModuleChunks.length === 0) {\n return this.waitAndInitializeModule(0);\n } else {\n const chunksToBeAdded: string[] = [];\n clientModuleChunks?.map(chunk => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const scriptElements = document.getElementsByTagName('script') as any;\n let chunkExistsOnPage = false;\n\n for (const scriptEl of scriptElements) {\n if (scriptEl.src.includes(chunk)) {\n chunkExistsOnPage = true;\n }\n }\n\n if (!chunkExistsOnPage) {\n chunksToBeAdded.push(chunk);\n }\n });\n\n if (chunksToBeAdded.length === 0) {\n // if chunk exists on page, we can render the module with wait time for script execution to avoid race condition(in case if the script exeuction is incomplete)\n return this.waitAndInitializeModule(0);\n }\n\n // add the chunks to the page and render module after script load event\n await Promise.all(\n (chunksToBeAdded || []).map(async moduleChunk => {\n return this.loadScriptAsync(moduleChunk);\n })\n );\n\n return this.waitAndInitializeModule(0);\n }\n }\n };\n\n public render = (): React.ReactNode | null => {\n if (!this.props.scriptInitCompleted) {\n return
;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registrationBindings = (window as any).__bindings__;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registeredModules = (msdyn365Commerce as any).bindings.modules;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const isModuleEntryPointsEnabled = platformSettings && platformSettings.enableModuleEntryPoints;\n if (!registrationBindings.modules[this.props.typeName]) {\n return
;\n }\n\n Object.keys(registrationBindings.modules || []).map(moduleTypeName => {\n if (!registeredModules[moduleTypeName]) {\n const rawModuleRegistrationObj: IModuleBinderPartial = registrationBindings.modules[moduleTypeName];\n const newModuleRegistrationObj: IModuleBinder = {} as IModuleBinder;\n newModuleRegistrationObj.component = isModuleEntryPointsEnabled\n ? function load() {\n return rawModuleRegistrationObj.c();\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n : (rawModuleRegistrationObj.c() as any).default;\n newModuleRegistrationObj.moduleDirectory = rawModuleRegistrationObj.md;\n newModuleRegistrationObj.dataActions = rawModuleRegistrationObj.da;\n newModuleRegistrationObj.packageName = rawModuleRegistrationObj.p;\n newModuleRegistrationObj.name = rawModuleRegistrationObj.n;\n newModuleRegistrationObj.definitionPath = path.join(\n rawModuleRegistrationObj.md,\n `${rawModuleRegistrationObj.n}.definition.json`\n );\n newModuleRegistrationObj.parentDefinitionPath = rawModuleRegistrationObj.pdp;\n newModuleRegistrationObj.isNodeModule = rawModuleRegistrationObj.iNM;\n newModuleRegistrationObj.moduleNamespace = rawModuleRegistrationObj.ns;\n newModuleRegistrationObj.chunkName = `${rawModuleRegistrationObj.ns}-${rawModuleRegistrationObj.p}-${rawModuleRegistrationObj.n}`;\n registeredModules[moduleTypeName] = newModuleRegistrationObj;\n }\n });\n\n const moduleBinder = registeredModules[this.props.typeName];\n const Component = isModuleEntryPointsEnabled ? moduleBinder?.component()?.default : moduleBinder.component;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const registeredViews = (msdyn365Commerce as any).bindings.views;\n Object.keys(registrationBindings.viewDictionary || []).map(viewRegistrationKey => {\n if (!registeredViews[viewRegistrationKey]) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const rawViewRegistrationObj: any = registrationBindings.viewDictionary[viewRegistrationKey];\n const newViewComponent = isModuleEntryPointsEnabled\n ? function load() {\n return rawViewRegistrationObj.c();\n } // eslint-disable-next-line @typescript-eslint/no-explicit-any\n : rawViewRegistrationObj.c().default;\n registeredViews[viewRegistrationKey] = {};\n registeredViews[viewRegistrationKey].component = newViewComponent;\n }\n });\n\n return (\n \n );\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAny, IGeneric } from '@msdyn365-commerce/core-internal';\nimport React from 'react';\nimport { AddModuleControl, IAddModuleProps } from './add-module-control';\nimport SafeRenderModuleWithContext from './safe-render-module';\n\nexport type IAddModuleWrapperProps = {\n id: string;\n safeRenderProps: IGeneric;\n addModuleProps: IAddModuleProps;\n};\n/**\n * Add module wrapper component: Wraps the safe render component and add module control component inside a div tag to properly render modules with its respective add sibling box on site builder.\n */\nexport class AddModuleWrapper extends React.Component {\n public constructor(props: IAddModuleWrapperProps) {\n super(props);\n }\n public render(): JSX.Element {\n const { safeRenderProps, addModuleProps, ...props } = this.props;\n return (\n
\n \n \n
\n );\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport { getPerformanceUtils, ICoreContext, IModule, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport { asSystemMetadata, EXCEPTION_NOMODULEBINDER, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React from 'react';\n\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { PAGE_INSIGHTS_VIEWS_KEY } from '../consts';\nimport { getModuleBinder, getModuleName, getPageInsightsCacheKey, isPageInsightsEnabled } from '../utils/helpers';\n\nexport interface IModuleWithView extends IModule {\n View: React.FunctionComponent;\n}\n\nconst getViewBinder = (moduleName: string, viewLookupKey: string, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const view = ((msdyn365Commerce as unknown) as IMSDyn365CommerceExtension).viewBinder(viewLookupKey);\n if (view) {\n if (pageInsightsEnabled) {\n const viewCacheKey = getPageInsightsCacheKey(PAGE_INSIGHTS_VIEWS_KEY);\n const viewInsights = requestCache.get<{}>(viewCacheKey)?.item || {};\n viewInsights[`${moduleName}`] = `${viewLookupKey.replace(/\\|/g, '/')}.view.tsx`;\n requestCache.put(viewCacheKey, { item: viewInsights });\n }\n\n return { key: viewLookupKey, view };\n }\n return undefined;\n};\n\n/**\n * View will be read in following hierarchy\n * 1) __local__|__local__|themes|theme1|views|product-tile OR @msdyn-365-commerce-modules|theme1|modules|theme1|views|product-tile\n * 2) __local__|__local__|modules|product-tile|product-tile OR @msdyn-365-commerce-modules|product-tile|modules|product-tile|product-tile\n */\nconst viewLookupFunc = (moduleBinder, themeBinder, requestCache: ICache, pageInsightsEnabled: boolean) =>\n themeBinder &&\n (getViewBinder(\n moduleBinder.name,\n `__local__|__local__|themes|${themeBinder.name}|views|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ) ||\n getViewBinder(\n moduleBinder.name,\n `${themeBinder.moduleNamespace}|${themeBinder.packageName}|modules|${themeBinder.name}|views|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ));\n\n/**\n * View will be read from the module\n * __local__|__local__|modules|product-tile|product-tile OR @msdyn-365-commerce-modules|product-tile|modules|product-tile|product-tile\n */\nconst defaultViewLookupFunc = (moduleBinder, requestCache: ICache, pageInsightsEnabled: boolean) => {\n const parentModuleBinder = getModuleBinder(getModuleName(moduleBinder.parentDefinitionPath));\n\n return (\n getViewBinder(\n moduleBinder.name,\n `${moduleBinder.moduleNamespace}|${moduleBinder.packageName}|modules|${moduleBinder.name}|${moduleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ) ||\n (parentModuleBinder &&\n getViewBinder(\n moduleBinder.name,\n `${parentModuleBinder.moduleNamespace}|${parentModuleBinder.packageName}|modules|${parentModuleBinder.name}|${parentModuleBinder.name}`,\n requestCache,\n pageInsightsEnabled\n ))\n );\n};\n\nconst getView = (moduleBinder, themeBinder, context: ICoreContext) => {\n if (!moduleBinder) {\n return { view: null };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const cache: ICache = (msdyn365Commerce as any).getAppCache(context.actionContext.requestContext);\n const viewCacheKey: ICacheKey = {\n key: `${moduleBinder.name}|${themeBinder ? themeBinder.name : 'no-theme'}`,\n typeName: '__ViewCacheKey__'\n };\n const viewLookupKey = cache.getValue(viewCacheKey);\n const pageInsightsEnabled = isPageInsightsEnabled(context.request.params);\n\n const actionContextData: any = context.actionContext;\n const requestCache: ICache = actionContextData.requestCache;\n if (viewLookupKey) {\n !msdyn365Commerce.isBrowser && actionContextData.requestCache.put(viewCacheKey, { item: viewLookupKey });\n return getViewBinder(moduleBinder.name, viewLookupKey, requestCache, pageInsightsEnabled) || { view: null };\n }\n\n let viewLookup = viewLookupFunc(moduleBinder, themeBinder, requestCache, pageInsightsEnabled);\n\n // If no component found in the theme, search in parent theme (in case of inherited theme)\n if (!viewLookup && themeBinder) {\n const parentThemeName = getModuleName(themeBinder.parentDefinitionPath);\n const parentThemeBinder = getModuleBinder(parentThemeName);\n viewLookup = viewLookupFunc(moduleBinder, parentThemeBinder, requestCache, pageInsightsEnabled);\n }\n\n // If no view file found, fall back to module's default view\n if (!viewLookup) {\n viewLookup = defaultViewLookupFunc(moduleBinder, requestCache, pageInsightsEnabled);\n }\n\n if (viewLookup) {\n cache.put(viewCacheKey, { item: viewLookup.key });\n actionContextData.requestCache.put(viewCacheKey, { item: viewLookup.key });\n return viewLookup;\n }\n\n return { view: null };\n};\n\nconst renderViewForModule: React.FC = (props: T): React.ReactElement | null => {\n props.telemetry.log(LogLevel.Debug, `rendering view-'${props.typeName}' with id-'${props.id}'`);\n const moduleBinder = getModuleBinder(props.typeName);\n if (!moduleBinder) {\n props.context.telemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(props.typeName)] });\n return null;\n }\n\n const themeBinder = getModuleBinder(props.context.actionContext.requestContext.params.theme);\n const { view } = getView(moduleBinder, themeBinder, props.context);\n\n if (!view) {\n return props.context.actionContext.requestContext.params.isDebug ? (\n
\n

View not found - location searched at

\n

{`views/${moduleBinder.name}.view.tsx`}

\n

\n {themeBinder\n ? `views/${themeBinder.name}/${moduleBinder.name}.view.tsx`\n : `No theme [${props.context.actionContext.requestContext.params.theme}] found at local/src`}\n

\n

\n {themeBinder\n ? `${\n themeBinder.moduleNamespace !== '__local__'\n ? `${themeBinder.moduleNamespace}/${themeBinder.packageName}/`\n : ''\n }modules/${themeBinder.name}/views/${moduleBinder.name}.view.tsx`\n : `No theme [${props.context.actionContext.requestContext.params.theme}] found at node_modules`}\n

\n

{`${\n moduleBinder.moduleNamespace !== '__local__' ? `${moduleBinder.moduleNamespace}/${moduleBinder.packageName}/` : ''\n }modules/${moduleBinder.name}/${moduleBinder.name}.view.tsx`}

\n
\n ) : null;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const Component = platformSettings && platformSettings.enableModuleEntryPoints ? view?.component()?.default : view.component;\n // @ts-ignore\n if (props.addChunk) {\n // @ts-ignore\n props.addChunk(view.cn);\n }\n return ;\n};\n\nexport const renderView: React.FC = (props: T): React.ReactElement | null => {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, props.context.actionContext);\n\n const renderId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreRenderViewPerformanceHook({\n moduleId: props.id,\n moduleTypeName: props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n const node = renderViewForModule(props);\n\n performanceUtils?.performanceUtilsPackage.runPostRenderViewPerformanceHook({\n moduleId: props.id,\n moduleTypeName: props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n return node;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary, IModule } from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_ERROR_CLIENT_BOUNDARY, InternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get } from 'lodash';\nimport React, { useMemo } from 'react';\nimport { MODULE_CONFIG_ERRORS_KEY } from '../consts';\nimport { renderView } from './render-view';\nimport { TSafeRenderModuleProps, TSafeRenderModuleState } from './safe-render-module';\n\ntype ErrorType = 'empty' | 'unregistered' | 'error';\n\ninterface IErrorModuleProps extends IModule {\n id: string;\n errorType: ErrorType;\n error: Error;\n message?: string;\n}\n\nconst getStandardErrorModuleMarkup = (props: IErrorModuleProps) => {\n return (\n
\n
{props.id}' threw exception
\n
\n

\n

\n {props.error && props.error.toString()}\n

\n

\n

\n {props.message}\n

\n
\n
\n );\n};\n\n/**\n * The error module\n */\nexport const ErrorModule: React.SFC = (props: IErrorModuleProps) => {\n const params = _get(props, 'context.request.params', {});\n const { isDebug } = params;\n return isDebug || process.env.NODE_ENV === 'development' ? useMemo(() => getStandardErrorModuleMarkup(props), [props]) : null;\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const renderErrorOrPlaceHolderModules = (\n err: Error,\n internalTelemetry: InternalTelemetry,\n mappedProps: any,\n state: TSafeRenderModuleState,\n props: TSafeRenderModuleProps,\n isEditor: boolean,\n renderModuleAttributes: (props: { [x: string]: any }) => IDictionary\n): JSX.Element | undefined => {\n if (!isEditor) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_ERROR_CLIENT_BOUNDARY, { exception: err });\n return (\n \n );\n }\n /* The following logic helps us retry rendering the component if it previously failed in editor scenario\n There are two cases where we should render the placeholder instead of trying to render the component when authoring\n\n 1. If error state is set because the module threw an error from rendering.\n In this case the module will have an entry in the cache for errors that was set in componentShouldUpdate.\n When a module is ready to retry rendering, clearing it's MODULE_CONFIG_ERRORS_KEY entry will force a retry.\n Should the component fail to render again, the state and cache entry will be re-updated with error(s)\n\n 2. If the module has known config errors, then we should show the placeholder div\n\n */\n let moduleError = props.store.requestCache.get({ typeName: MODULE_CONFIG_ERRORS_KEY, key: props.id });\n if (state.error && moduleError.item && moduleError.item.length > 0) {\n moduleError = [{ property: props.id, message: err.message }];\n } else if (mappedProps.configErrors && mappedProps.configErrors.length > 0) {\n moduleError = mappedProps.configErrors;\n }\n // In an editor scenario, if add/remove module without server refresh feature is enabled\n // SDK will have to place the placeholder module instead of OneRF\n if (\n isEditor &&\n moduleError &&\n moduleError.length > 0 &&\n _get(props, ['context', 'request', 'features', 'enableAuthoringRemoveAndAddModule'], false)\n ) {\n // error module doesnt render 'click here to configure' placeholder module anymore\n // an empty div with module markers data-i attributes is rendered instead\n const dataInfo = [`id:${mappedProps.id}`];\n mappedProps.slotId && dataInfo.push(`s:${mappedProps.slotId}`);\n mappedProps.parentId && dataInfo.push(`p:${mappedProps.parentId}`);\n mappedProps.typeName && dataInfo.push(`t:${mappedProps.typeName}`);\n return
;\n }\n return undefined;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n CoreContext,\n getPerformanceUtils,\n IAddModuleSlot,\n IAny,\n IDictionary,\n IGeneric,\n IModule,\n IModuleContract,\n isAuthoringEditEnabled,\n msdyn365Commerce,\n SDK_FRAGMENT_NAME,\n WithContext\n} from '@msdyn365-commerce/core-internal';\nimport LazyLoad from 'react-lazy-load';\nimport {\n asSystemMetadata,\n EXCEPTION_MISSINGMODULECONFIG,\n EXCEPTION_MODULERENDERFAIL,\n EXCEPTION_NOMODULEBINDER,\n EXCEPTION_UNREGISTEREDMODULEID,\n InternalTelemetry,\n ITelemetry,\n LogLevel\n} from '@msdyn365-commerce/telemetry-internal';\nimport { get as _get } from 'lodash';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\nimport { AsyncClientRenderComponent } from './module-client-render-component';\nimport {\n LAYOUT_MOUNT_POINT,\n MODULE_CONFIG_ERRORS_KEY,\n MODULE_LAYOUT_FIELD,\n SERVER_RENDER_ERROR_CACHE_KEY,\n MODULE_CONFIG_KEY\n} from '../consts';\nimport { PageContext } from '../store/page-context';\nimport { AddControlMode, AddModuleControl } from './add-module-control';\nimport { AddModuleWrapper } from './add-module-wrapper';\nimport { ErrorModule, renderErrorOrPlaceHolderModules } from './error-module';\nimport { renderView } from './render-view';\nimport { isLazyRenderModuleEnabled } from '../utils/helpers';\n\ntype ErrorInfo = {\n componentStack: string;\n};\n\nexport type TSafeRenderModuleState = {\n error?: Error;\n info?: ErrorInfo;\n isRegistered?: boolean;\n isConfigured?: boolean;\n isLazyLoaded?: boolean;\n mounted?: boolean;\n};\n\n/**\n * Known types on the props\n */\nexport type TSafeRenderModuleProps = IGeneric & {\n telemetry: ITelemetry;\n internalTelemetry: InternalTelemetry;\n};\n\n/**\n * Component to render module\n */\n@observer\nexport class SafeRenderModule extends React.Component {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private componentRef: React.RefObject>;\n private shouldDisplayErrors: boolean = false;\n private isRenderAttrributeCalled: boolean = false;\n private disableSSRErrorChecks?: boolean = false;\n private renderCallsCounter = 0;\n private mobxShouldComponentUpdate;\n\n public static getDerivedStateFromError(error: Error): TSafeRenderModuleState {\n return { error: error };\n }\n\n constructor(props: TSafeRenderModuleProps) {\n super(props);\n\n this.state = {\n error: undefined,\n info: undefined,\n isConfigured: true,\n isRegistered: true,\n mounted: false\n };\n this.componentRef = React.createRef();\n this.shouldDisplayErrors = props && props.context ? props.context.request.params.isDebug : true;\n\n // If App Setting to disable server-side rendering error checks is true then instead of rendering each module\n // separately and potentially containing each one in an error-boundary in case of an error,\n // safe-render-module will instead render all modules together in one pass for improved performance.\n this.disableSSRErrorChecks = props.context && props.app && props.app.platform && props.app.platform.disableServerSideErrorChecking;\n\n // In the event that this is being rendered in editor or debug mode we will override this setting to render each individual module separately\n // to catch module errors at the cost of performance\n this.disableSSRErrorChecks =\n this.disableSSRErrorChecks && !props.context.request.params.isDebug && !props.context.request.params.isEditor;\n\n this.props.internalTelemetry.log(\n LogLevel.Debug,\n `Safe Render module constructor type-'{typeName}' with id-'{id} and is ${\n this.disableSSRErrorChecks ? 'not ' : ''\n }running in error check mode.'`,\n {\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n }\n );\n\n this.mobxShouldComponentUpdate = this.shouldComponentUpdate;\n this.shouldComponentUpdate = this.customShouldComponentUpdate;\n }\n\n public componentDidMount(): void {\n if (!this.state.mounted) {\n this.setState({ mounted: true });\n }\n\n if (this.isRenderAttrributeCalled) {\n return;\n }\n\n this._setErrorStates();\n this._setDataAttributes();\n\n this._initializePerformanceComponent();\n }\n\n public customShouldComponentUpdate(nextProps: TSafeRenderModuleProps, nextState: TSafeRenderModuleState): boolean {\n if (this._isEditorial()) {\n if (nextState.error) {\n this.props.store.requestCache.put(\n { typeName: MODULE_CONFIG_ERRORS_KEY, key: this.props.id },\n { item: [{ property: this.props.id, message: nextState.error.message }] }\n );\n }\n }\n\n return this.mobxShouldComponentUpdate(nextProps, nextState);\n }\n\n public componentDidUpdate(): void {\n if (this.isRenderAttrributeCalled) {\n return;\n }\n\n this._setErrorStates();\n this._setDataAttributes();\n }\n\n public componentDidCatch(error: Error, info: ErrorInfo): void {\n this.setState({ error, info });\n }\n\n public render(): JSX.Element | null {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, this.props.context.actionContext);\n\n const renderId = performanceUtils?.performanceUtilsPackage.Random.Guid.generateGuid();\n\n performanceUtils?.performanceUtilsPackage.runPreRenderPerformanceHook({\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n\n renderId: renderId,\n renderCallIndex: ++this.renderCallsCounter,\n\n internalCache: performanceUtils.cache\n });\n\n const node = this._renderModule();\n\n performanceUtils?.performanceUtilsPackage.runPostRenderPerformanceHook({\n moduleId: this.props.id,\n moduleTypeName: this.props.typeName,\n\n renderId: renderId,\n\n internalCache: performanceUtils.cache\n });\n\n return node;\n }\n\n private _initializePerformanceComponent(): void {\n const performanceUtils = getPerformanceUtils(msdyn365Commerce, this.props.context.actionContext);\n performanceUtils?.performanceUtilsPackage.initializePerformance(\n () => performanceUtils.cache,\n () => this.props.context.actionContext\n );\n }\n\n // eslint-disable-next-line complexity\n private _renderModule(): JSX.Element | null {\n const config = this.props.config;\n const { internalTelemetry } = this.props;\n internalTelemetry.log(LogLevel.Debug, `Safe Render module render type-'{typeName}' with id-'{id}'`, {\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n });\n const isMounted = this.state.mounted;\n const mappedProps = mapStateToProps(this.props.store, this.props, isMounted);\n const { id, typeName } = mappedProps && mappedProps.id ? mappedProps : this.props;\n const configErrors = mappedProps.configErrors;\n\n // in development mode, check if there is any server render error for module. If so, render error module so developer can address the issue.\n if (process.env.NODE_ENV === 'development' && !this.props.store.requestContext.features.disable_render_module_server_error) {\n const serverRenderError =\n this.props.store.requestCache?.internalCache && this.props.store.requestCache.internalCache[SERVER_RENDER_ERROR_CACHE_KEY];\n\n if (serverRenderError) {\n const moduleWithError = serverRenderError[this.getModuleServerRenderCacheKeyName(this.props.id, this.props.typeName)];\n if (moduleWithError && moduleWithError.item) {\n return (\n \n );\n }\n }\n }\n\n const Component = mappedProps.component as React.ComponentClass;\n const lazyRenderModuleEnabled = isLazyRenderModuleEnabled(this.props.store.requestContext);\n\n // the component is missing and lazy loading isn't turned on (Either entirely OR for this specific module)\n if (!Component && (!lazyRenderModuleEnabled || !config?.clientRender)) {\n const message = internalTelemetry.stringFormat(EXCEPTION_UNREGISTEREDMODULEID, [id, typeName]);\n internalTelemetry.log(LogLevel.Error, message);\n return (\n \n );\n }\n\n const err = this.state.error || (configErrors && configErrors.length && new Error(configErrors.map(x => x.message).join(', ')));\n if (err) {\n const element = renderErrorOrPlaceHolderModules(\n err,\n internalTelemetry,\n mappedProps,\n this.state,\n this.props,\n this._isEditorial(),\n this.renderModuleAttributes\n );\n if (element) {\n return element;\n }\n }\n\n if (process.env.CURRENT_ENVIRONMENT === 'node') {\n if (config && config.hasOwnProperty('clientRender') && config.clientRender && !this._isEditorial()) {\n if (lazyRenderModuleEnabled) {\n return
;\n }\n\n return ;\n } else {\n return this._doServerSideRender(mappedProps, Component, internalTelemetry);\n }\n } else if (!this.state.mounted && this.props.store.deferred(this.props.id)) {\n // module needs two passes\n return null;\n } else if (config && config.hasOwnProperty('clientRender') && config.clientRender && !this._isEditorial()) {\n if (lazyRenderModuleEnabled) {\n if (this.state.isLazyLoaded) {\n return (\n \n );\n }\n return (\n \n \n \n );\n } else if (this.state.mounted) {\n return (\n \n );\n } else {\n return ;\n }\n }\n\n return (\n \n );\n }\n\n private lazyLoadHandler = () => {\n this.setState({ isLazyLoaded: true });\n };\n\n private renderModuleAttributes = (props: IGeneric): IDictionary => {\n this.isRenderAttrributeCalled = true;\n\n if (!props || !props.id) {\n return {};\n }\n\n // Construct telemetry attributes for module\n const telemetryId: string = props.friendlyName || props.id;\n const telemetryAttributes: IDictionary =\n this.props.internalTelemetry && this.props.internalTelemetry.setTelemetryAttribute\n ? this.props.internalTelemetry.setTelemetryAttribute(telemetryId)\n : {};\n\n const moduleAttributes: IDictionary = { 'data-m-t': props.typeName, ...telemetryAttributes };\n if (this.shouldDisplayErrors || this._isEditorial()) {\n moduleAttributes['data-i'] = this._setDataInfoAttribute(props);\n }\n\n if (props.platform && typeof props.platform === 'object') {\n Object.keys(props.platform).forEach(key => {\n moduleAttributes[`data-m-${key}`] = props.platform[key];\n });\n }\n\n // If a module is associated with an experiment, add this attribtue to track when to activate the experiment\n if (props.context.request && props.context.request.experiments?.moduleIdToExperimentIdMap) {\n if (props.context.request.experiments.moduleIdToExperimentIdMap[props.id]) {\n moduleAttributes[`data-exp`] = `id:${props.context.request.experiments.moduleIdToExperimentIdMap[props.id]}`;\n }\n }\n // In editor scenario, Authoring will update the module layout by sending us updates on\n // the MODULE_LAYOUT_FIELD in the config object\n\n if (this._isEditorial() && props.config && props.config[MODULE_LAYOUT_FIELD]) {\n moduleAttributes[`data-m-layout`] = props.config[MODULE_LAYOUT_FIELD];\n }\n\n return moduleAttributes;\n };\n\n /**\n * Set the data info attribute to be added to the modules\n * @param props The module props.\n */\n private _setDataInfoAttribute(props: IGeneric): string {\n const dataInfo = [`id:${props.id}`];\n props.slotId && dataInfo.push(`s:${props.slotId}`);\n props.parentId && dataInfo.push(`p:${props.parentId}`);\n props.typeName && dataInfo.push(`t:${props.typeName}`);\n props.friendlyName && dataInfo.push(`fn:${props.friendlyName}`);\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(props.typeName);\n if (moduleBinder) {\n moduleBinder.$type && dataInfo.push(`mt:${moduleBinder.$type}`);\n }\n props.errorType && dataInfo.push(`e:${props.errorType}`);\n return `{${dataInfo.join(',')}}`;\n }\n\n /**\n * isEditor\n * Determines if request is coming from the editor\n */\n private _isEditorial(): boolean {\n return _get(this.props, ['context', 'request', 'params', 'isEditor'], false);\n }\n\n /**\n * Creates data info string to be used by cms e.g '{id:prop-id,s:content,p:parent-id}'\n */\n private _generateDataInfo(): string {\n const dataInfo = [`id:${this.props.id}`];\n this.props.slotId && dataInfo.push(`s:${this.props.slotId}`);\n this.props.parentId && dataInfo.push(`p:${this.props.parentId}`);\n this.props.typeName && dataInfo.push(`t:${this.props.typeName}`);\n this.props.friendlyName && dataInfo.push(`fn:${this.props.friendlyName}`);\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(this.props.typeName);\n if (moduleBinder) {\n moduleBinder.$type && dataInfo.push(`mt:${moduleBinder.$type}`);\n }\n\n // Error scenarios\n // 1. Empty module\n // 2. Unregistered module\n // 3. Generic error\n !this.state.isConfigured && dataInfo.push('e:empty');\n !this.state.isRegistered && dataInfo.push('e:unregistered');\n this.state.error && dataInfo.push('e:error');\n\n return `{${dataInfo.join(',')}}`;\n }\n\n /**\n * Conducts the server side render and returns the result.\n * If disable SSR Error Checking flag is turned on, the React Element is returned immediately,\n * otherwise the render result is calculated using renderToString to catch errors\n * and defer modules (used for editor and debug scenarios)\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _doServerSideRender(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n mappedProps: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: React.ComponentClass<{}, any>,\n internalTelemetry: InternalTelemetry\n ): JSX.Element {\n let renderHtmlString: string;\n const renderHtml = (\n \n \n \n );\n if (this.disableSSRErrorChecks) {\n // In non editorial or non debug mode and if app setting to disable server side error checking is turned on\n // return the JSX directly without computing the render result to save time and compute cost\n return renderHtml;\n } else {\n try {\n // eslint-disable-next-line\n renderHtmlString = require('react-dom/server').renderToString(renderHtml);\n if (!renderHtmlString.length) {\n // module returned null\n this.props.store.markModuleAsDeferred(this.props.id);\n }\n } catch (e) {\n this.addFailingModuleServerRenderToCache(e);\n\n internalTelemetry.log(LogLevel.Error, `Safe Render module Failed to render type-'{typeName}' with id-'{id}'`, {\n exception: e,\n values: [asSystemMetadata(this.props.typeName), asSystemMetadata(this.props.id)]\n });\n return (\n \n );\n }\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: renderHtmlString } });\n }\n }\n\n private addFailingModuleServerRenderToCache(error: any) {\n const cacheKey = this.buildModuleServerRenderCacheKey(this.props.id, this.props.typeName);\n const cacheItem = {\n item: {\n moduleId: this.props.id,\n moduleType: this.props.typeName,\n errorName: error && error.name,\n errorMessage: error && error.message,\n errorStack: error && error.stack\n }\n };\n\n this.props.store.requestCache.put(cacheKey, cacheItem);\n }\n\n private buildModuleServerRenderCacheKey(moduleId: string, moduleType: string): ICacheKey {\n return {\n key: this.getModuleServerRenderCacheKeyName(moduleId, moduleType),\n typeName: SERVER_RENDER_ERROR_CACHE_KEY\n };\n }\n\n private getModuleServerRenderCacheKeyName(moduleId: string, moduleType: string): string {\n return `${moduleId}:${moduleType}`.toUpperCase();\n }\n\n /**\n * Assignes data-i and data-t attributes to child component if isEditor is enabled\n */\n private _setDataAttributes(): void {\n let refNode;\n if (this._isEditorial()) {\n // If type name only exists on the props then this module is not registered.\n if (this.state.error || !this.state.isRegistered || !this.state.isConfigured) {\n refNode = document.getElementById(this.props.id);\n } else if (this.componentRef.current) {\n /* eslint-disable react/no-find-dom-node */\n refNode = this.props.root\n ? document.getElementById(LAYOUT_MOUNT_POINT)\n : (ReactDOM.findDOMNode(this.componentRef.current) as Element);\n }\n }\n\n if (refNode && typeof refNode.setAttribute === 'function') {\n refNode.setAttribute('data-i', this._generateDataInfo());\n }\n }\n\n private _setErrorStates(): void {\n const isMounted = this.state.mounted;\n const mappedProps = mapStateToProps(this.props.store, this.props, isMounted);\n\n // Registration check\n const isRegistered = !!mappedProps.component;\n if (isRegistered !== this.state.isRegistered) {\n this.setState({ ...this.state, isRegistered: isRegistered });\n return;\n }\n\n // Configuration check\n const isConfigured = !(mappedProps.configErrors && mappedProps.configErrors.length > 0);\n if (isConfigured !== this.state.isConfigured) {\n this.setState({ ...this.state, isConfigured: isConfigured });\n return;\n }\n }\n}\n\nexport const getRenderSlotComponent = (\n requestCache: any,\n parentProps: IGeneric,\n moduleConfigs: IModuleContract[],\n slotId: string,\n addSiblingIndices?: number[],\n isMounted?: boolean\n): React.ReactNode[] => {\n if (!moduleConfigs) {\n return [];\n }\n\n const canAddAtIndex = (index: number) => {\n return addSiblingIndices ? addSiblingIndices.indexOf(index + 1) >= 0 : false;\n };\n // if addSiblingIndices is not undefined, we add the AddModuleControl components between each module; but in hidden state if index value isnt provider\n // this prevents re-rendering of the module when the AddModuleControl components are enabled/disabled\n // in preview mode, addSiblingIndices will be undefined and we will only render the modules\n return moduleConfigs.map((moduleConfig: IModuleContract, index: number) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const config =\n (!!!parentProps?.store?.requestContext?.features?.disable_moduleConfig_optimize &&\n requestCache.getValue({ typeName: MODULE_CONFIG_KEY, key: moduleConfig.id })) ||\n moduleConfig.config;\n return addSiblingIndices && isMounted ? (\n \n ) : (\n \n );\n });\n};\n\n/**\n * Maps the application state to the modules props\n * @param state The application state\n * @param ownProps The props for the specific module\n */\nexport const mapStateToProps = (store: PageContext, props: TSafeRenderModuleProps, isMounted?: boolean): IModule> => {\n try {\n const { internalTelemetry } = props;\n const moduleConfig = getModuleConfig(store, props.id);\n const requestCache = store.requestCache;\n if (!moduleConfig) {\n internalTelemetry.log(\n LogLevel.Error,\n internalTelemetry.stringFormat(EXCEPTION_MISSINGMODULECONFIG, [props.id, props.typeName])\n );\n return {} as IModule>;\n }\n\n // TODO - following statements introducing side effect in render method (props should not change in render). Please take a look after public preview\n // Pull value out of stuff that came from cache (doing this gives us reactivity via MobX)\n Object.keys(moduleConfig.data).forEach(key => {\n if (moduleConfig.data[key] && moduleConfig.data[key].Item) {\n moduleConfig.data[key] = moduleConfig.data[key].Item;\n }\n });\n\n const moduleBinder = (msdyn365Commerce as any).moduleBinder(moduleConfig.typeName);\n if (!moduleBinder && !isLazyRenderModuleEnabled(store.requestContext)) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_NOMODULEBINDER, { values: [asSystemMetadata(moduleConfig.typeName)] });\n return {} as IModule>;\n }\n const enableAddModuleControls = isAuthoringEditEnabled(store.requestContext);\n const platformSettings = (msdyn365Commerce as any).platformSettings;\n const componentBinder =\n platformSettings && platformSettings.enableModuleEntryPoints\n ? moduleBinder && moduleBinder?.component()?.default\n : moduleBinder && moduleBinder.component;\n\n return {\n ...props,\n ...moduleConfig,\n component: componentBinder,\n slots: enableAddModuleControls\n ? getSlotDictionary(requestCache, props, moduleConfig.slotsForAddModule, isMounted)\n : getSlotDictionary(requestCache, props)\n };\n } catch (e) {\n props.internalTelemetry.log(LogLevel.Error, props.internalTelemetry.stringFormat(EXCEPTION_MODULERENDERFAIL, [props.id]), {\n exception: e\n });\n return {} as IModule>;\n }\n};\n\nconst getModuleConfig = (store: PageContext, moduleId: string): IModule => {\n return store.modules(moduleId);\n};\n\nconst getSlotDictionary = (\n requestCache: any,\n props: IGeneric,\n slotsForAddModule?: IAddModuleSlot[],\n isMounted?: boolean\n): IDictionary => {\n const slotDictionary: IDictionary = {};\n const { modules } = props;\n const slotsWithAddModuleControls = (slotsForAddModule || []).filter(a => !a.index && a.slotName);\n const addSiblingIndexDictionary: { [key: string]: number[] } = {};\n (slotsForAddModule || [])\n .filter(a => a.index && !a.slotName)\n .forEach(a => {\n addSiblingIndexDictionary[a.slotId] = a.index || [];\n });\n // removes placeholder 'click here to configure' modules\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getNonPlaceholderModules = (mods: any[]) => {\n return mods.filter(a => a.typeName !== 'place-holder-for-container-preview');\n };\n if (modules) {\n Object.keys(modules).forEach((key: string) => {\n slotDictionary[key] = getRenderSlotComponent(\n requestCache,\n props,\n getNonPlaceholderModules(modules[key]),\n key,\n slotsForAddModule ? addSiblingIndexDictionary[key] || [] : undefined,\n isMounted\n );\n });\n }\n slotsWithAddModuleControls.forEach((slot: IAddModuleSlot) => {\n if (isMounted && (!modules || !modules[slot.slotId] || getNonPlaceholderModules(modules[slot.slotId]).length === 0)) {\n slotDictionary[slot.slotId] = [\n \n ];\n }\n });\n return slotDictionary;\n};\n\nconst SafeRenderModuleWithContext = WithContext(SafeRenderModule);\nexport default SafeRenderModuleWithContext;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Default mount point name\n */\nexport const LAYOUT_MOUNT_POINT = 'renderPage';\n\n/**\n * Default Proxy Address\n */\nexport const DEFAULT_PROXY_HOST = 'http://127.0.0.1';\n\n/**\n * Default Proxy Port\n */\nexport const DEFAULT_PROXY_PORT = 8888;\n\n/**\n * Default request timeout in ms (1m default);\n */\nexport const DEFAULT_REQUEST_TIMEOUT: number = parseInt(process.env.REQUEST_TIMEOUT || '60000', 10);\n\nexport const GLIMPSE_LOGGER_NAME = '__INTERNAL_GLIPMPSE_LOGGER_!@';\nexport const PAGE_LOGGER_NAME = '__PAGE_LOGGER__';\n\n/**\n * appCacheSetting Name\n */\n\nexport const CACHE_SETTING = '__CACHE_SETTINGS';\n\n/**\n * const for client entry points type\n */\nexport const CLIENT_ENTRY_POINTS_TYPE = '__CEP__';\n\n/**\n * PDP PageType Name\n */\nexport const PDP_PAGE_NAME = 'product';\n\n/**\n * Product recommendtion list\n */\nexport const PRODUCT_RECOMMENDATION_LIST = 'pal';\n\n/**\n * Frequently bought together recommendation list\n */\nexport const FREQUENTLY_BOUGHT_TOGETHER_LIST = 'fbt';\n\n/**\n * Picks for you recommendation list\n */\nexport const PICKS_FOR_YOU_LIST = 'picks';\n\n/**\n * Category PageType Name\n */\nexport const CATEGORY_PAGE_NAME = 'category';\n\n/**\n * List PageType Name\n */\nexport const LIST_PAGE_NAME = 'list';\n\n/*\n * Cache key for module\n */\nexport const MODULE_CACHE_KEY: string = '__M';\n\n/**\n * Cache key for module config\n */\nexport const MODULE_CONFIG_KEY: string = '__MC';\n\n/**\n * Cache key for module disabled properties\n */\nexport const MSDYN365_WYSIWYG_DISABLED_PROPS = '__MDP';\n\n/**\n * Cache key for module disabled properties\n */\nexport const MSDYN365_WYSIWYG_CANADDMODULE = '__MCA';\n\n/**\n * Cache key for module config errors\n */\nexport const MODULE_CONFIG_ERRORS_KEY: string = '__MCE';\n\n/**\n * Cache key for module data\n */\nexport const MODULE_DATA_KEY: string = '__MD';\n\n/**\n * Cache key for module resources\n */\nexport const MODULE_RESOURCES_KEY: string = '__MR';\n\n/**\n * Cache key for module action\n */\nexport const MODULE_ACTION_KEY: string = '__MA';\n\n/**\n * Cache key for module deferred render\n */\nexport const MODULE_DEFERRED_KEY: string = '__MDR';\n\n/**\n * Cache key for module view cache\n */\nexport const MODULE_VIEW_CACHE_KEY = '__VIEWCACHEKEY__';\n\n/**\n * Cache key for module render to string result\n */\nexport const MODULE_RENDER_RESULT_CACHE_KEY = '__MODULE_RENDER_RESULT__';\n\n/**\n * Server Render Error Cache key type\n */\nexport const SERVER_RENDER_ERROR_CACHE_KEY = '__SERVER_RENDER_ERROR__';\n\n/**\n * Cache key for page render results\n */\nexport const PAGE_RENDER_RESULT_CACHE_KEY = '__PAGE_RENDER_RESULT__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_VIEWS_KEY = '__VIEW_INSIGHTS__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_COMPONENTS_KEY = '__COMPONENT_INSIGHTS__';\n\n/**\n * Cache key for page insights view extensions\n */\nexport const PAGE_INSIGHTS_ACTIONS_KEY = '__ACTION_INSIGHTS__';\n\n/**\n * Cache key for page insights retail api data\n */\nexport const PAGE_INSIGHTS_API_KEY = '__API_INSIGHTS__';\n\n/**\n * The Prefix for the module lazyload feature switch\n */\nexport const LAZYLOAD_SWITCH_PREFIX = 'lazyload_';\n\n/**\n * DEPRECATED Client Render Complete Event Name\n */\nexport const DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT = '_msdyn365_client_render_complete';\n\n/**\n * Client Data Update Event Name\n */\nexport const CLIENT_DATA_UPDATE_EVENT = '_msdyn365_client_data_update';\n\n/**\n * Client Render Complete Event Name\n */\nexport const CLIENT_RENDER_START_EVENT = '_msdyn365_client_render_start';\n\n/**\n * Client Render Complete Event Name\n */\nexport const CLIENT_RENDER_COMPLETE_EVENT = '_msdyn365_client_render_complete';\n\n/**\n * Event that fires when Authoring module or fragment add operation completes rendering\n */\nexport const AUTHORING_ADD_RENDER_COMPLETE_EVENT = '_msdyn365_authoring_add_render_complete';\n\n/**\n * User Consent Given Event Name\n */\nexport const USER_CONSENT_GIVEN_EVENT = '_msdyn365_user_consent_given';\n\n/**\n * Field name of the module layout that authoring sends\n */\nexport const MODULE_LAYOUT_FIELD = 'msdyn365__moduleLayout';\n\n/**\n * Process type enum\n */\nexport const enum PROCESS_TYPE {\n server = 'server',\n client = 'client'\n}\n/**\n * The retail server base URL request header key.\n */\nexport const RETAIL_SERVER_BASE_URL_HEADER_KEY = `x-rs-base-url`;\n/**\n * Error message for when the provider get experiments function fails.\n */\nexport const PROVIDER_GET_EXPERIMENTS_FAIL = 'Provider get experiments call failed. Retail Server Base URL: \"{retailServerBaseUrl}\"';\n\n/**\n * Error message for when the retail server api call fail.\n */\nexport const GET_FEATURE_STATES_API_CALL_FAIL = 'The retail server getFeatureStatesAsync API call failed.';\n\n/**\n * Error message for when the internal get feature states data action fail.\n */\nexport const GET_FEATURE_STATES_INTERNAL_DATA_ACTION_FAIL = 'The internal get feature states data action failed.';\n\n/**\n * Error message for when the internal get feature states data action fail.\n */\nexport const ERROR_PROCESSING_APP_SETTINGS = 'Error processing application settings.';\n\n/**\n * Error message for missing required chunks\n */\nexport const ERROR_MISSING_REQUIRED_CHUNKS = `Failed to get required chunks for module '{moduleId}' of type '{moduleType}'. List of missing chunks: '{listOfMissingChunks}'`;\n\n/**\n * The feature states.\n */\nexport const FEATURE_STATE = {\n ON: 'ON',\n OFF: 'OFF'\n};\n\n/**\n * Application settings configs feature management properties.\n */\nexport const APP_SETTINGS_CONFIG_PROPS = {\n DISABLED_WITH_FEATURE_FLAGS: 'disabledWithFeatureFlags',\n HIDDEN_WITH_FEATURE_FLAGS: 'hiddenWithFeatureFlags',\n DISABLED: 'disabled',\n HIDDEN: 'hidden'\n};\n\n/**\n * Cache type name for module css chunks\n */\nexport const MODULE_CSS_CACHE_TYPENAME = '__ModuleCssChunks__';\n\n/**\n * Cache key name for module css chunks\n */\nexport const MODULE_CSS_CACHE_KEY = 'module-css-chunks';\n\n/**\n * Cache key name for module css chunks\n */\nexport const INLINE_MODULE_CSS_CACHE_KEY = 'inline-module-css-chunks';\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport {\n IDataActionOptions,\n IDictionary,\n IRequestContext,\n IResourceManager,\n IThemeModule,\n MSDyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\n\nexport interface IDataAction {\n moduleName?: string;\n id: string;\n name: string;\n path: string;\n runOn: ActionRuntime;\n options?: IDataActionOptions;\n}\n\nexport enum ActionRuntime {\n server,\n client,\n serverOnly\n}\n\nexport interface IModuleDefinition {\n name: string;\n}\n\nexport interface IModuleBinder {\n $type: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentAsync: () => Promise;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: any;\n dataActions: IDataAction[];\n definitionExtensions?: string[];\n definitionPath: string;\n isNodeModule: boolean;\n moduleNamespace: string;\n chunkName: string;\n name: string;\n packageName: string;\n pages?: IDictionary;\n parentDefinitionPath: string;\n path: string;\n segments: string[];\n moduleDirectory: string;\n themeSettings: string;\n}\n\nexport interface IModuleBinderPartial {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n c: () => Promise;\n mn: string;\n md: string;\n da: IDataAction[];\n p: string;\n n: string;\n pdp: string;\n iNM: boolean;\n ns: string;\n}\n\nexport interface IPrototype {\n prototype: IMSDyn365CommerceExtension;\n}\n\ninterface IDAPIBindings {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n modules: IDictionary;\n themes: IThemeModule[];\n}\n\nexport interface IBinding {\n modules: IDictionary;\n dataActions: IDictionary;\n partnerDataActions: IDictionary;\n views: IDictionary;\n components: IDictionary;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n connectors: IDictionary;\n dapi: IDAPIBindings;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- NPM package source.\n perfAnalysisLibBinding: any;\n}\n\nexport interface IMSDyn365CommerceExtension {\n bindings: IBinding;\n appCache: IDictionary;\n resourceManager: IResourceManager;\n getResourceManager(): IResourceManager;\n getPartnerOverrideAction(id: string): Function;\n dataAction(name: string): Function;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getConnector(name: string): any;\n getAppCache(requestContext: IRequestContext): ICache;\n moduleBinder(name: string): IModuleBinder;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n viewBinder(name: string): any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n componentBinder(name: string): any;\n getAllModuleBinder(): IModuleBinder[];\n updatePrivateVariable(): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Returns NPM package source.\n perfAnalysisBinder(): any;\n}\n\nexport type IMSDyn365CommerceWithPrototype = typeof MSDyn365Commerce & IPrototype;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ActionContext, addLocaleInformation, IRefreshConfigs } from '@msdyn365-commerce/action-internal';\nimport { ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n IAction,\n IActionInput,\n IDataActionOptions,\n IDictionary,\n IModuleContract,\n IRequestContext,\n msdyn365Commerce\n} from '@msdyn365-commerce/core-internal';\nimport {\n asSystemMetadata,\n EXCEPTION_DATAACTION_EXECUTION,\n EXCEPTION_LOADDATA_ACTION_0,\n EXCEPTION_LOADDATA_ACTION_1,\n EXCEPTION_LOADDATA_ACTION_2,\n InternalTelemetry,\n ITelemetry,\n LogLevel,\n MESSAGE_CREATE_INPUT_LOADDATA\n} from '@msdyn365-commerce/telemetry-internal';\nimport { ActionRuntime, IDataAction } from '../app-initialization/models';\nimport { LAZYLOAD_SWITCH_PREFIX, PAGE_INSIGHTS_ACTIONS_KEY } from '../consts';\nimport { combineExtendedDataActionToModule } from '../utils/data-action-extension-helper';\nimport { getPageInsightsCacheKey, isPageInsightsEnabled, timeSliceLongJSTask } from '../utils/helpers';\n\nexport interface IDataActionMetadata {\n dataActionFunction: IAction;\n inputs: IActionInput[];\n name: string;\n runOn: ActionRuntime;\n id: string;\n options?: IDataActionOptions;\n}\n\n/**\n * Method which stores temporary async results in the cache for actions which\n * will be run at a later time\n * @param tempMetadataList The list of actions which need temporary AsyncResults\n * @param requestCache The request cache\n */\nconst storeTemporaryAsyncResults = (tempMetadataList: IDataActionMetadata[], requestCache: ICache): void => {\n const tempResultCacheItem = { item: { _type: 'AsyncResult', status: 'LOADING', runOn: 'client' } };\n\n // Insert fake temporary AsyncResults for actions that will be deferred to client\n tempMetadataList.forEach(tempMetadata => {\n // Non-observable and instance actions should not get a temp promise\n const firstInput = Array.isArray(tempMetadata.inputs) ? tempMetadata.inputs[0] : tempMetadata.inputs;\n if (\n !tempMetadata.dataActionFunction.prototype.isObservable ||\n !tempMetadata.inputs ||\n (firstInput && firstInput.dataCacheType && firstInput.dataCacheType() === 'instance')\n ) {\n return;\n }\n\n if (!Array.isArray(tempMetadata.inputs)) {\n tempMetadata.inputs = [tempMetadata.inputs];\n }\n\n tempMetadata.inputs.forEach(tempInput => {\n // Don't add temp promise if there is a mock or if the resolved data has already been inserted into the cache\n if (\n requestCache.get({ key: `${tempInput.getCacheObjectType()}:${tempInput.getCacheKey()}`, typeName: '__MOCK' }) ===\n undefined &&\n requestCache.get({ key: `${tempInput.getCacheKey()}`, typeName: tempInput.getCacheObjectType() }) === undefined\n ) {\n requestCache.put({ key: tempInput.getCacheKey(), typeName: tempInput.getCacheObjectType() }, tempResultCacheItem);\n }\n });\n });\n};\n\n/**\n * Runs all the data actions specificed in module definitions present on the page\n */\nexport const loadData = async (\n modules: IModuleContract[],\n context: IRequestContext,\n internalTelemetry: InternalTelemetry,\n moduleTelemetry: ITelemetry,\n requestCache: ICache,\n appCache: ICache | null,\n complexDataTypesPromises?: Promise[]\n): Promise => {\n if (!modules || modules.length === 0) {\n return [];\n }\n\n const dataActionMetadataList: IDataActionMetadata[] = [];\n const lazyLoadModuleIds: { [index: string]: boolean } = {};\n const tempMetadataList: IDataActionMetadata[] = [];\n\n // Note: What modules will need to be lazyloaded due to feature switches\n storeLazyloadModuleId(context, lazyLoadModuleIds);\n loadDataProcessing(modules, lazyLoadModuleIds, context, internalTelemetry, dataActionMetadataList, tempMetadataList, requestCache);\n storeTemporaryAsyncResults(tempMetadataList, requestCache);\n\n await timeSliceLongJSTask(context);\n\n if (dataActionMetadataList.length === 0) {\n // When there is no data actions, we still need to resolve complexTypePromises\n if (complexDataTypesPromises) {\n await Promise.all(complexDataTypesPromises);\n }\n return [];\n }\n\n const actionContext = new ActionContext({\n id: 'T1',\n requestContext: context,\n requestCache: requestCache,\n expectedActionCount: dataActionMetadataList.length,\n telemetry: moduleTelemetry,\n appCache\n });\n\n const promises = processDataActionMetadataList(actionContext, dataActionMetadataList, internalTelemetry);\n\n if (complexDataTypesPromises) {\n promises.push(...complexDataTypesPromises);\n }\n\n await Promise.all(promises);\n\n return actionContext.getRefreshActions();\n};\n\nconst fetchDataActionWithActionid = (lookupId: string) => {\n const dataActionFunction = (msdyn365Commerce).dataAction(lookupId);\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.inputFunc &&\n typeof dataActionFunction.default.prototype.inputFunc === 'function'\n ) {\n return dataActionFunction;\n }\n return null;\n};\n\nconst loadDataProcessing = (\n modules: IModuleContract[],\n lazyLoadModuleIds: IDictionary,\n context: IRequestContext,\n internalTelemetry: InternalTelemetry,\n dataActionMetadataList: IDataActionMetadata[],\n tempMetadataList: IDataActionMetadata[],\n requestCache: ICache\n) => {\n modules.forEach((moduleContract: IModuleContract) => {\n const moduleConfig = moduleContract.config;\n if (typeof moduleConfig === 'object' && moduleConfig && moduleConfig['clientRender'] === true) {\n lazyLoadModuleIds[moduleContract.id] = true;\n }\n\n const moduleBinderInitial = (msdyn365Commerce).moduleBinder(moduleContract.typeName);\n\n const moduleBinder = context.params.theme\n ? combineExtendedDataActionToModule(moduleBinderInitial, moduleContract.typeName, context.params.theme)\n : moduleBinderInitial;\n\n if (moduleBinder && moduleBinder.dataActions && moduleBinder.dataActions.length > 0) {\n moduleBinder.dataActions.forEach((dataAction: IDataAction) => {\n const lookupId = dataAction.id || dataAction.path;\n if (dataAction.name && lookupId) {\n let dataActionFunction = (msdyn365Commerce).dataAction(lookupId);\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.id\n ) {\n const newLookUpId = dataActionFunction.default.prototype.id;\n // if the dataAction function's id is different with lookup id, try to fetch the dataAction based on its id again.\n if (newLookUpId !== lookupId) {\n dataActionFunction = fetchDataActionWithActionid(newLookUpId) || dataActionFunction;\n }\n }\n if (\n dataActionFunction &&\n dataActionFunction.default &&\n dataActionFunction.default.prototype &&\n dataActionFunction.default.prototype.inputFunc &&\n typeof dataActionFunction.default.prototype.inputFunc === 'function'\n ) {\n try {\n processModuleDataAction(\n dataActionFunction,\n context,\n moduleContract,\n dataAction,\n dataActionMetadataList,\n internalTelemetry,\n lazyLoadModuleIds,\n tempMetadataList,\n requestCache\n );\n } catch (e) {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOADDATA_ACTION_0, {\n exception: new Error(EXCEPTION_LOADDATA_ACTION_1),\n values: [asSystemMetadata(dataAction.name || 'unnamed'), asSystemMetadata(moduleContract.id || 'unnamed')]\n });\n }\n } else {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_LOADDATA_ACTION_2, {\n exception: new Error(EXCEPTION_LOADDATA_ACTION_1),\n values: [asSystemMetadata(dataAction.path || 'unnamed'), asSystemMetadata(moduleContract.id || 'unnamed')]\n });\n }\n }\n });\n internalTelemetry.log(\n LogLevel.Debug,\n internalTelemetry.stringFormat(MESSAGE_CREATE_INPUT_LOADDATA, [\n (moduleContract.dataActions || []).map(d => d.name).join(' | '),\n moduleContract.typeName,\n moduleContract.id\n ])\n );\n }\n });\n};\n\nconst processModuleDataAction = (\n dataActionFunction,\n context: IRequestContext,\n moduleContract: IModuleContract,\n dataAction: IDataAction,\n dataActionMetadataList: IDataActionMetadata[],\n internalTelemetry: InternalTelemetry,\n lazyLoadModuleIds: IDictionary,\n tempMetadataList: IDataActionMetadata[],\n requestCache: ICache\n) => {\n let inputs;\n try {\n inputs = dataActionFunction.default.prototype.inputFunc({\n requestContext: context,\n config: moduleContract.config,\n data: moduleContract.data\n });\n const isArray = Array.isArray(inputs);\n moduleContract.dataActions = moduleContract.dataActions || [];\n addLocaleInformation(inputs, context.locale);\n moduleContract.dataActions.push({\n name: dataAction.name,\n entity: isArray ? inputs[0].getCacheObjectType() : inputs.getCacheObjectType(),\n inputs: isArray ? inputs.map((input: IActionInput) => input.getCacheKey()) : inputs.getCacheKey()\n });\n } catch (e) {\n internalTelemetry.log(LogLevel.Debug, 'Unable to create input for Module: {id}, Action: {name}', {\n values: [asSystemMetadata(moduleContract.id), asSystemMetadata(dataAction.name)]\n });\n moduleContract.dataActions = moduleContract.dataActions || [];\n moduleContract.dataActions.push({\n name: dataAction.name,\n entity: undefined,\n inputs: undefined\n });\n }\n\n const dataActionInsightsKey = getPageInsightsCacheKey(PAGE_INSIGHTS_ACTIONS_KEY);\n const pageInsightsEnabled = isPageInsightsEnabled(context.params);\n const dataActionsInsights = requestCache.get<{ Server: {}; Client: {} }>(dataActionInsightsKey)?.item || { Server: {}, Client: {} };\n if (inputs && dataAction) {\n // Add run on information to data action input\n inputs.runOn = convertRunOnToString(dataAction.runOn);\n }\n if (\n msdyn365Commerce.isBrowser ||\n (!context.features.lazyload_all &&\n (dataAction.runOn === ActionRuntime.server || dataAction.runOn === ActionRuntime.serverOnly) &&\n !lazyLoadModuleIds[moduleContract.id] &&\n !lazyLoadModuleIds[moduleContract.typeName])\n ) {\n if (pageInsightsEnabled) {\n dataActionsInsights.Server[moduleContract.typeName] = dataActionsInsights.Server[moduleContract.typeName] || {};\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] =\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] || {};\n dataActionsInsights.Server[moduleContract.typeName][dataAction.name] = dataAction.id || dataAction.path;\n requestCache.put(dataActionInsightsKey, { item: dataActionsInsights });\n }\n\n dataActionMetadataList.push({\n name: dataAction.name,\n runOn: dataAction.runOn,\n id: dataAction.id,\n inputs: inputs,\n dataActionFunction: dataActionFunction.default,\n ...(dataAction.options && { options: dataAction.options })\n });\n } else {\n if (pageInsightsEnabled) {\n dataActionsInsights.Client[moduleContract.typeName] = dataActionsInsights.Client[moduleContract.typeName] || {};\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] =\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] || {};\n dataActionsInsights.Client[moduleContract.typeName][dataAction.name] = dataAction.id || dataAction.path;\n requestCache.put(dataActionInsightsKey, { item: dataActionsInsights });\n }\n\n // If the data action is supposed to be run server only it should never\n // be placed in the temporary list that will eventually run client side.\n if (dataAction.runOn !== ActionRuntime.serverOnly) {\n tempMetadataList.push({\n name: dataAction.name,\n runOn: dataAction.runOn,\n id: dataAction.id,\n inputs: inputs,\n dataActionFunction: dataActionFunction.default\n });\n }\n }\n};\n\n//\nconst storeLazyloadModuleId = (renderingContext: IRequestContext, lazyLoadModuleIds: IDictionary) => {\n if (renderingContext.features) {\n Object.keys(renderingContext.features).forEach(switchName => {\n if (switchName.startsWith(LAZYLOAD_SWITCH_PREFIX) && renderingContext.features[switchName]) {\n lazyLoadModuleIds[switchName.replace(LAZYLOAD_SWITCH_PREFIX, '')] = true;\n }\n });\n }\n};\n\nexport const processDataActionMetadataList = (\n actionContext: ActionContext,\n dataActionMetadataList: IDataActionMetadata[],\n internalTelemetry: InternalTelemetry\n) => {\n return dataActionMetadataList\n .map(async (dataActionMetadata: IDataActionMetadata) => {\n // all client side actions are lazy loaded inorder not to interfere with the client hydrate.\n // therefore only return those promises that are non-observable and instance actions\n if (process.env.CURRENT_ENVIRONMENT === 'web') {\n await timeSliceLongJSTask(actionContext?.requestContext);\n const promise = actionContext\n .chainAction(dataActionMetadata.dataActionFunction, dataActionMetadata.inputs, dataActionMetadata.options)\n .catch(e => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_DATAACTION_EXECUTION, {\n values: [asSystemMetadata(dataActionMetadata.id || dataActionMetadata.name)],\n exception: (e && e.error) || e\n });\n });\n\n // We still need to await non-observable client-side data actions (public-preview)\n if (!dataActionMetadata.dataActionFunction.prototype.isObservable) {\n return promise;\n }\n\n // we should await on observable 'instance' actions that are configured to runOn 'server'\n if (\n actionContext.requestContext.features &&\n !actionContext.requestContext.features.disable_inst_action_await &&\n isServerInstanceAction(dataActionMetadata)\n ) {\n return promise;\n }\n } else {\n return actionContext\n .chainAction(dataActionMetadata.dataActionFunction, dataActionMetadata.inputs, dataActionMetadata.options)\n .catch(e => {\n internalTelemetry.log(LogLevel.Error, EXCEPTION_DATAACTION_EXECUTION, {\n values: [asSystemMetadata(dataActionMetadata.id || dataActionMetadata.name)],\n exception: (e && e.error) || e\n });\n });\n }\n })\n .filter(Boolean);\n};\n\nconst isServerInstanceAction = (dataActionMetadata: IDataActionMetadata) => {\n const firstInput = Array.isArray(dataActionMetadata.inputs) ? dataActionMetadata.inputs[0] : dataActionMetadata.inputs;\n return (\n dataActionMetadata.runOn === ActionRuntime.server &&\n dataActionMetadata.dataActionFunction.prototype.isObservable &&\n firstInput &&\n firstInput.dataCacheType &&\n firstInput.dataCacheType() === 'instance'\n );\n};\n\nexport const convertRunOnToString = (runtime: ActionRuntime) => {\n switch (runtime) {\n case ActionRuntime.client:\n return 'client';\n case ActionRuntime.server:\n return 'server';\n case ActionRuntime.serverOnly:\n return 'serverOnly';\n default:\n return 'server';\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleBinder } from '../app-initialization/models';\nimport { getModuleBinder } from '../utils/helpers';\n\nconst dataActionCustimizedMerge = (originDataAction, newDataAction, customizer) =>\n originDataAction\n .filter(originAction => !newDataAction.find(newAction => originAction[customizer] === newAction[customizer]))\n .concat(newDataAction);\n\nexport const combineExtendedDataActionToModule = (originalModuleBinder: IModuleBinder, moduleName: string, themeName: string) => {\n const themeBinder = getModuleBinder(themeName);\n if (!themeBinder || !originalModuleBinder) {\n return originalModuleBinder;\n }\n\n if (themeBinder.dataActions.length === 0) {\n return originalModuleBinder;\n }\n const themeDataActionsForModule = themeBinder.dataActions.filter(\n dataAction => dataAction.moduleName && dataAction.moduleName === moduleName\n );\n\n const moduleDataActions = originalModuleBinder.dataActions ? originalModuleBinder.dataActions : [];\n originalModuleBinder.dataActions = dataActionCustimizedMerge(moduleDataActions, themeDataActionsForModule, 'name');\n return originalModuleBinder;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\n\n/**\n * Generates a cache key from the given ApiSettings object\n */\nexport const getCacheKey = (apiSettings: ICommerceApiSettings, catalogId?: number) => {\n if (!apiSettings) {\n return '';\n }\n\n return `${apiSettings.channelId}-${apiSettings.oun}-${catalogId || 0} `;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, getCatalogIdForSdk, IActionContext, IActionInput, ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { getCacheKey } from '../utils/link-utils';\n\n/**\n * Links coming from OneRF will have the following structure\n */\nexport interface IServerLink {\n type: string;\n productId?: number;\n categoryId?: number;\n destinationUrl?: string;\n error?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [x: string]: any;\n}\n\n/**\n * Used by the URL builder to construct the formatted\n * category or product link\n */\nexport interface IPageTypeContext {\n category?: {\n Slug: string;\n RecordId: number;\n };\n product?: {\n Name: string;\n RecordId: number;\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed because type pageTypeContext in url builder allows additional properties\n [x: string]: any;\n}\n\n/**\n * Input Class for ProductLink related actions\n */\nexport class ProductLinkInput implements IActionInput {\n public categoryId: number;\n public productId: number | undefined;\n public channelId: number;\n public catalogId?: number;\n private apiSettings: ICommerceApiSettings;\n private locale: string;\n\n constructor(apiSettings: ICommerceApiSettings, categoryId: number, productId?: number, catalogId?: number | null, locale?: string) {\n this.categoryId = categoryId;\n this.productId = productId;\n this.channelId = apiSettings.channelId;\n this.apiSettings = apiSettings;\n this.catalogId = catalogId || 0;\n this.locale = locale || '';\n }\n\n public getCacheKey = () => `${getCacheKey(this.apiSettings, this.catalogId)}-${this.categoryId}-${this.productId}-${this.locale}`;\n public getCacheObjectType = () => 'ProductLink';\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * Input Class for CategoryLink related actions\n */\nexport class CategoryLinkInput implements IActionInput {\n public categoryId: number;\n public channelId: number;\n public catalogId?: number;\n private apiSettings: ICommerceApiSettings;\n private locale: string;\n\n constructor(apiSettings: ICommerceApiSettings, categoryId: number, catalogId?: number | null, locale?: string) {\n this.categoryId = categoryId;\n this.channelId = apiSettings.channelId;\n this.apiSettings = apiSettings;\n this.catalogId = catalogId || 0;\n this.locale = locale || '';\n }\n\n public getCacheKey = () => `${getCacheKey(this.apiSettings, this.catalogId)}-${this.categoryId}-${this.locale}`;\n public getCacheObjectType = () => 'CategoryLink';\n public dataCacheType = (): CacheType => 'application';\n}\n\n/**\n * ProductList metadata passed from CMS used to hydrate product list\n */\nexport interface IProductListMetaData {\n listType: string;\n productIds?: number[];\n categoryIds?: number[];\n discountIds?: string[];\n searchText?: string;\n includePageContext?: boolean;\n includeDescendentCategoryChildren?: boolean;\n includeCart?: boolean;\n personalization?: boolean;\n recommendationListId?: string;\n relationshipId?: string;\n pageSize?: number;\n}\n\n// Enum Representing all supported ProductList types\nexport enum ProductListType {\n algo,\n editorial,\n productByCategory,\n productBySearch,\n recommendation,\n relatedProducts,\n recentlyViewedProducts,\n promotional\n}\n\n/**\n * Input Class for ProductList related actions\n */\nexport class ProductListInput implements IActionInput {\n public listMetadata: IProductListMetaData;\n public channelId: number;\n public catalogId: number;\n private _cacheType: CacheType;\n private _cacheObjectType: string;\n private _cacheKey: string;\n\n constructor(listMetadata: IProductListMetaData, actionContext: IActionContext) {\n const requestContext = actionContext.requestContext;\n const catalogIdNumber = getCatalogIdForSdk(requestContext, 0);\n\n this.listMetadata = listMetadata;\n this.catalogId = catalogIdNumber ?? 0;\n this.channelId = requestContext.apiSettings.channelId;\n this._cacheObjectType = `ProductList-${listMetadata.listType}`;\n\n const query = requestContext.query || {};\n const skipToken = query.skip;\n const context = JSON.stringify(requestContext.urlTokens);\n const locale = actionContext.requestContext.locale || 'unknown';\n const baseCacheKey = `${this.channelId}-${this.catalogId}-${locale}-${JSON.stringify(listMetadata)}-${skipToken || ''}`;\n\n switch (ProductListType[listMetadata.listType]) {\n case ProductListType.productBySearch:\n // application cache if not reading from context\n this._cacheType = listMetadata.searchText ? 'application' : 'request';\n this._cacheKey = listMetadata.searchText ? baseCacheKey : `${baseCacheKey}-${query.q || ''}`;\n break;\n case ProductListType.productByCategory:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.categoryIds && listMetadata.categoryIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.relatedProducts:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.productIds && listMetadata.productIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.promotional:\n this._cacheType = 'application';\n this._cacheKey = listMetadata.discountIds && listMetadata.discountIds.length ? baseCacheKey : `${baseCacheKey}-${context}`;\n break;\n case ProductListType.editorial:\n case ProductListType.algo:\n case ProductListType.recommendation:\n default:\n this._cacheType = listMetadata.includeCart || listMetadata.personalization ? 'request' : 'application';\n this._cacheKey = `${baseCacheKey}-${context}`;\n }\n }\n\n public getCacheKey = () => this._cacheKey;\n public getCacheObjectType = () => this._cacheObjectType;\n public dataCacheType = (): CacheType => this._cacheType;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Generates a Image URL based on data return from retail server\n * @param imageUrl The image url returned by Retail Server\n * @param ctx The request context\n */\nexport const generateImageUrl = (imageUrl: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\n if (imageUrl) {\n // Images hosted in CMS include schema\n if (imageUrl.startsWith('http')) {\n return imageUrl;\n }\n\n // Images hosted in Retail Server must be encoded and joined with the base image url\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\n } else {\n // d365Commerce.telemetry.warning(`Unable to generate a proper Image URL for Product: ${product.RecordId}`);\n return undefined;\n }\n};\n\n/**\n * Generates a Image URL for a product based on data return from retail server\n * @param product The Product returned by Retail Server\n * @param ctx The request context\n */\nexport const getProductImageUrls = (\n products: SimpleProduct[] | ProductSearchResult[],\n apiSettings: ICommerceApiSettings\n): SimpleProduct[] | ProductSearchResult[] => {\n const productsWithImageUrls: SimpleProduct[] | ProductSearchResult[] = [];\n\n products &&\n products.forEach(product => {\n if (product && product.RecordId) {\n product.PrimaryImageUrl = generateImageUrl(product.PrimaryImageUrl, apiSettings);\n productsWithImageUrls.push(product);\n }\n });\n\n return productsWithImageUrls;\n};\n\n/**\n * Uses the order in which the product ids were returned from the reco call to order\n * the results from the product hydration call\n *\n * @param itemIdOrder The order of product ids to observe\n * @param unorderedProductSearchResults Unordered set of hydrated products\n */\nexport const orderProductSearchResults = (\n itemIdOrder: number[],\n unorderedProductSearchResults: ProductSearchResult[]\n): ProductSearchResult[] => {\n return itemIdOrder.reduce((result: ProductSearchResult[], itemId: number) => {\n const product = unorderedProductSearchResults.find(element => element.RecordId === itemId);\n if (product) {\n result.push(product);\n }\n return result;\n }, []);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * This setting defines inventory filtering options.\n */\nexport enum ProductListInventoryFilteringOptions {\n /**\n * Filter out all products out of stock.\n */\n HideOOS = 'hideOOS',\n\n /**\n * Sort products by availability, OOS goes last.\n */\n SortOOS = 'sortOOS',\n\n /**\n * No filtering selected.\n */\n Default = 'default'\n}\n\n/**\n * Get inventory sorting value based on channelInventoryConfiguration\n *\n * @param context The current action context\n * @param channelInventoryConfiguration The channelInventoryConfiguration\n */\nexport const getInventorySorting = channelInventoryConfiguration => {\n let sorting;\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n const sortColumnName = `Attr_${channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId}`;\n sorting = {\n Columns: [\n {\n ColumnName: sortColumnName,\n IsDescending: true\n }\n ]\n };\n }\n return sorting;\n};\n\n/**\n * Returns inventory in stock sortable refiner value.\n * @param channelInventoryConfiguration - The channelInventoryConfiguration.\n * @returns Refiners.\n */\nexport const getInventoryInStockSortableRefinerValue = channelInventoryConfiguration => {\n if (channelInventoryConfiguration && channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId) {\n return {\n RefinerRecordId: channelInventoryConfiguration.ProductAvailabilitySortableAttributeRecordId,\n DataTypeValue: 6,\n LeftValueBoundString: 'true',\n RightValueBoundString: 'true',\n UnitText: '',\n RowNumber: 0,\n Count: 0,\n ExtensionProperties: [],\n RefinerSourceValue: 1\n };\n }\n return undefined;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CATEGORY_PAGE_NAME } from '../../consts';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext): Promise => {\n let categoryId: number;\n const urlTokens = context.requestContext.urlTokens;\n\n // If the category ID has been provided from the list metadata use it, otherwise grab the category ID from context\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\n categoryId = input.listMetadata.categoryIds[0];\n } else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\n categoryId = +urlTokens.recordId;\n } else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\n categoryId = +urlTokens.categories[0];\n } else {\n // Unable to determine category from list meta data or context\n throw new Error('CategoryId Missing for ProductsByCategory List');\n }\n context.telemetry.debug(`Category Id input to ProductsByCategory action : ${categoryId}`);\n const productSearchCriteria: ProductSearchCriteria = {\n Context: {\n ChannelId: +input.channelId,\n CatalogId: +input.catalogId\n },\n CategoryIds: [categoryId],\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n let channelInventoryConfiguration = {};\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: context });\n }\n\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n return searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by ProductByCategory action', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running ProductByCategory action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByCategoryListAction = createObservableDataAction({\n action: >getProductsByCategoryList,\n id: '@msdyn365-commerce/products-by-category'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { getCatalogIdForSdk, IAction, IActionContext, ICookieContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport {\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport { RecentlyViewedProductItem } from './base';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByRecentlyViewedList = async (input: ProductListInput, ctx: IActionContext): Promise => {\n const searchCriteriaInput: ProductSearchCriteria = {};\n const cookieContext: ICookieContext = ctx.requestContext.cookies;\n const catalogId = getCatalogIdForSdk(ctx.requestContext, null);\n searchCriteriaInput.Context = {\n ChannelId: ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n };\n searchCriteriaInput.IncludeAttributes = false;\n searchCriteriaInput.SkipVariantExpansion = true;\n const cookieName: string = '_msdyn365___recently_viewed_products';\n const cookieValue = cookieContext.get(cookieName).value;\n const productIds = cookieValue?.filter(value => value.catalogId === catalogId).map(value => value.productId) || [0];\n searchCriteriaInput.Ids = productIds;\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n let channelInventoryConfiguration = {};\n if (\n ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: ctx });\n }\n\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n searchCriteriaInput.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n if (ctx.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n return searchByCriteriaAsync(\n {\n callerContext: ctx,\n queryResultSettings\n },\n searchCriteriaInput\n )\n .then((products: ProductSearchResult[]) => {\n ctx.telemetry.debug('Products returned by ProductByRecentlyViewed action', products);\n return getProductImageUrls(products, ctx.requestContext.apiSettings);\n })\n .catch(error => {\n ctx.telemetry.error(`Error running ProductByRecentlyViewed action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRecentlyViewedListAction = createObservableDataAction({\n action: >getProductsByRecentlyViewedList,\n id: '@msdyn365-commerce/products-by-recently-viewed'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n AsyncResult,\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n ICommerceApiSettings,\n IDictionary\n} from '@msdyn365-commerce/core';\nimport { DataServiceQuery, executeAction, IContext, IDataServiceRequest, IQueryResultSettings } from '@msdyn365-commerce/retail-proxy';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { getProductImageUrls } from '../utils/product-list-utils';\n\nconst buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, catalogId: Number | null): string => {\n return `${base}-chanId:${apiSettings.channelId}-catId:${catalogId}`;\n};\n\n/**\n * Product Input\n */\nexport class ProductInput implements IActionInput {\n public productId: number;\n public channelId: number;\n public catalogId: number | null;\n private apiSettings: ICommerceApiSettings;\n\n constructor(productId: number | string, apiSettings: ICommerceApiSettings, catalogId: number | null) {\n this.apiSettings = apiSettings;\n this.productId = +productId;\n this.channelId = apiSettings.channelId;\n this.catalogId = catalogId;\n }\n\n public getCacheKey = () => buildCacheKey(`RecordId-${this.productId.toString()}`, this.apiSettings, this.catalogId);\n public getCacheObjectType = () => 'SimpleProduct';\n public dataCacheType = (): CacheType => 'application';\n}\n\nfunction productsQuery(recordId?: number): DataServiceQuery {\n const key = recordId ? { RecordId: recordId } : null;\n return new DataServiceQuery('Products', 'Product', 'ProductClass', key);\n}\n\nfunction createGetByIdsInput(\n queryResultSettings: IQueryResultSettings,\n channelId: number,\n productIds: number[],\n catalogId: number | null\n): IDataServiceRequest {\n const query = productsQuery().resultSettings(queryResultSettings);\n return query.createDataServiceRequestForOperation(\n 'GetByIds',\n true,\n 'SimpleProductClass',\n 'true',\n { bypassCache: 'none', returnEntity: 'SimpleProduct' },\n { channelId: channelId, productIds: productIds, catalogId: catalogId }\n );\n}\n\nfunction getByIdsAsyncAction(\n context: IContext,\n channelId: number,\n productIds: number[],\n catalogId: number | null\n): AsyncResult {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const request = createGetByIdsInput(context.queryResultSettings, channelId, productIds, catalogId);\n return executeAction(request, context);\n}\n\n/**\n * Calls the Retail API and returns the product based on the passed ProductInput\n */\nexport async function getSimpleProductsAction(inputs: ProductInput[], ctx: IActionContext): Promise {\n if (!inputs || !Array.isArray(inputs) || inputs.length === 0) {\n ctx.trace('[getSimpleProductsAction] Invalid or empty inputs passed.');\n return [];\n }\n\n const productIdMapping: IDictionary = {};\n const productIds = inputs.map((input, idx) => {\n productIdMapping[input.productId] = idx;\n return input.productId;\n });\n\n return getByIdsAsyncAction({ callerContext: ctx }, inputs[0].channelId, productIds, inputs[0].catalogId).then(products => {\n if (!products) {\n return [];\n }\n const mappedProducts = (getProductImageUrls(products, ctx.requestContext.apiSettings)).reduce(\n (memo: SimpleProduct[], product: SimpleProduct | undefined) => {\n if (!product) {\n return memo;\n }\n const idx = productIdMapping[product.RecordId];\n memo[idx] = product;\n return memo;\n },\n []\n );\n\n // NOTE: This is not an ideal fix, but will resolve all current issues\n return inputs.map(input => {\n const foundProduct = mappedProducts.find(product => product && product.RecordId === input.productId);\n return foundProduct || {};\n });\n });\n}\n\nexport default createObservableDataAction({\n action: >getSimpleProductsAction,\n id: '@msdyn365-commerce/get-simple-products',\n isBatched: true\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { getCustomerActionDataAction, GetCustomerInput } from '@msdyn365-commerce/core';\nimport { getCatalogIdForSdk, IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { IContext } from '@msdyn365-commerce/retail-proxy';\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { getElementsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/RecommendationsDataActions.g';\nimport {\n Cart,\n Customer,\n ProductSearchCriteria,\n ProductSearchResult,\n QueryResultSettings,\n RecommendationCriteria,\n RecommendedElement\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CATEGORY_PAGE_NAME, FREQUENTLY_BOUGHT_TOGETHER_LIST, PDP_PAGE_NAME, PICKS_FOR_YOU_LIST } from '../../consts';\nimport { getProductImageUrls, orderProductSearchResults } from '../../utils/product-list-utils';\nimport { ProductInput } from '../get-simple-products';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nconst actionInputError = (missingType: string) => {\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRecommendationId action`);\n};\n\nconst enum CartTokenPrefix {\n Auth = 't',\n Anon = 'p'\n}\n\n/**\n * Constructs the category context for a recommendation call. If page context is selected the category dervided from page context\n * (current page) will be used. If instead a spefic category is chosen as context that category will be used instead.\n *\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\n * @param input The ProductListInput provided to the action\n * @param context The current action context\n */\nconst getCategoryIdForReco = (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\n let categoryIds: number[] = [];\n\n if (input.listMetadata.includePageContext || !input.listMetadata.categoryIds || input.listMetadata.categoryIds.length === 0) {\n const urlTokens = context.requestContext.urlTokens;\n\n if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME) {\n if (urlTokens.recordId) {\n categoryIds = [+urlTokens.recordId];\n }\n }\n } else {\n // Use category from a specific context if provided\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\n categoryIds = input.listMetadata.categoryIds;\n }\n }\n\n recommendationCriteria.CategoryIds = categoryIds;\n};\n\n/**\n * Fetches the current active cart to be used when cart context\n * is selected for a reco list\n *\n * @param ctx The current action context\n */\nconst getCart = async (ctx: IActionContext): Promise => {\n let cart;\n if (ctx.requestContext && ctx.requestContext.cookies) {\n const cookies = ctx.requestContext && ctx.requestContext.cookies;\n const cartCookie = cookies.getCartCookie();\n const cartCookieParts = cartCookie.split(':');\n if (cartCookieParts && cartCookieParts.length === 2) {\n if (\n (ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\n (!ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\n ) {\n const readCart = await readAsync({ callerContext: ctx }, cartCookieParts[1]);\n if (readCart && readCart.Id) {\n cart = readCart;\n }\n }\n }\n }\n return cart;\n};\n\n/**\n * Constructs the product context for a recommendation call. If cart context is selected, products currently in the active cart will\n * be used as the product ids for the recommendation call. Otherwise, if page context is selected the product derived from page context will be used.\n * Finally, if specific context is selected, a product id will be given to us from the ProductListInput which will be used to seed the product id for the reco call.\n *\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\n * @param input The ProductListInput provided to the action\n * @param context The current action context\n */\nconst getProductIdForReco = async (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\n let productIds: number[] = [];\n // If include cart is set true, fetch the product ids in the cart to append to the product ID list for the recommendation call\n if (input.listMetadata.includeCart) {\n const cart = await getCart(context);\n if (cart && cart.CartLines) {\n const validCartLines = cart.CartLines.filter(element => element.ProductId !== undefined);\n const cartProductIds = validCartLines.map(product => product.ProductId);\n context.telemetry.debug(`Products in cart: ${cartProductIds}`);\n // If the cart isn't empty, assign the products in the cart to the productIds for seeding\n if (cartProductIds && cartProductIds.length > 0) {\n productIds = cartProductIds;\n }\n }\n } else if (input.listMetadata.includePageContext || !input.listMetadata.productIds || input.listMetadata.productIds.length === 0) {\n const urlTokens = context.requestContext.urlTokens;\n\n if (urlTokens && urlTokens.recordId && urlTokens.pageType && urlTokens.pageType.toLowerCase() === PDP_PAGE_NAME) {\n productIds = [+urlTokens.recordId];\n }\n } else {\n // Use the product from specfic context\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\n productIds = [input.listMetadata.productIds[0]];\n }\n }\n\n return productIds;\n};\n\nconst getProductsByNewSearchByCriteria = async (\n input: ProductListInput,\n callerContext: IContext,\n channelInventoryConfiguration\n): Promise => {\n const context = callerContext.callerContext;\n const customer: Customer = await getCustomerActionDataAction(new GetCustomerInput(context.requestContext.apiSettings, ''), context);\n const customerAccountNumber = customer?.AccountNumber || context.requestContext.user.customerAccountNumber;\n const searchCriteria: ProductSearchCriteria = {\n // @ts-ignore\n CustomerAccountNumber: customerAccountNumber,\n RecommendationListId: input.listMetadata.recommendationListId,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n\n // after 9.24 version, we dont need to use two retail server call - getElement + searchByCriteria to get all recommendation products.\n // we just need to use searchByCriteria.\n\n const sequentialCallForRecoProducts = versionGte(rsVersion, '9.24');\n if (sequentialCallForRecoProducts && !context.requestContext?.features?.disable_sequential_call_for_recoProducts) {\n try {\n getCategoryIdForReco(searchCriteria, input, context);\n searchCriteria.Ids = await getProductIdForReco(searchCriteria, input, context);\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n searchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n let productSearchResults = await searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n searchCriteria\n );\n if (productSearchResults.length) {\n let productSearchResultsTmp: ProductSearchResult[] = [];\n productSearchResultsTmp = productSearchResults.filter(item => {\n // @ts-ignore\n const isVariantProduct = !item.IsMasterProduct && item.MasterProductId !== 0;\n return !isVariantProduct;\n });\n productSearchResults = productSearchResultsTmp;\n // If the ProductSearchResult API finds the products then populate the product image urls and return\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\n if (productSearchResults.length > 0) {\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\n return productSearchResults;\n }\n }\n } catch (e) {\n // In case of an error fall back to legacy flow\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\n }\n }\n return [];\n};\n\nexport const getProductsByRecommendationList = async (input: ProductListInput, context: IActionContext): Promise => {\n // If the recommendation list is picks for you and the user is not signed do not make the reco API call and return empty list of products\n const customerAccountNumber =\n context.requestContext && context.requestContext.user && context.requestContext.user.customerAccountNumber;\n if (input.listMetadata.recommendationListId === PICKS_FOR_YOU_LIST && !customerAccountNumber) {\n return [];\n }\n\n const recommendationCriteria: RecommendationCriteria = {};\n const proxyContext: IContext = { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } };\n recommendationCriteria.CatalogId = input.catalogId;\n\n let reccomendationListId;\n if (input.listMetadata.recommendationListId) {\n reccomendationListId = input.listMetadata.recommendationListId;\n } else {\n actionInputError(`recommendationListId (from listmetadata)`);\n }\n recommendationCriteria.ProductIds = await getProductIdForReco(recommendationCriteria, input, context);\n\n if ((input.listMetadata.personalization || reccomendationListId === PICKS_FOR_YOU_LIST) && customerAccountNumber) {\n recommendationCriteria.CustomerAccountNumber = customerAccountNumber;\n proxyContext.bypassCache = 'get';\n }\n\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const isHideAndSortByInventoryAvailabilitySupported = versionGte(rsVersion, '9.37');\n let channelInventoryConfiguration = {};\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS ||\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n const StoreOperationsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g');\n channelInventoryConfiguration = await StoreOperationsDataActions.getInventoryConfigurationAsync({ callerContext: context });\n }\n }\n\n const products = await getProductsByNewSearchByCriteria(input, proxyContext, channelInventoryConfiguration);\n if (products.length > 0) {\n return products;\n }\n\n context.telemetry.debug(`Recommendation Criteria: ${JSON.stringify(recommendationCriteria)}`);\n\n // For FBT lists, a product or category seed must be provided or the request will error out. So we check to see if any have been provided and return empty list if none have\n if (reccomendationListId === FREQUENTLY_BOUGHT_TOGETHER_LIST) {\n if (\n recommendationCriteria.ProductIds &&\n recommendationCriteria.ProductIds.length === 0 &&\n recommendationCriteria.CategoryIds &&\n recommendationCriteria.CategoryIds.length === 0\n ) {\n return [];\n }\n }\n\n return getElementsAsync(proxyContext, reccomendationListId, recommendationCriteria)\n .then(async (recommendedElements: RecommendedElement[]) => {\n if (recommendedElements) {\n const productInputs: ProductInput[] = [];\n const productTypeId: string[] = [];\n const catalogIdNumber = getCatalogIdForSdk(context.requestContext, null);\n // Grab all the elements that are products and store the product ids\n for (let i = 0; i < recommendedElements.length; i++) {\n const element = recommendedElements[i];\n // Element type value of 1 indicates product type\n if (element.ElementId && element.ElementTypeValue === 1) {\n productInputs[i] = new ProductInput(+element.ElementId, context.requestContext.apiSettings, catalogIdNumber);\n productTypeId[i] = element.ElementId;\n }\n }\n context.telemetry.debug(`Running recommendation action for list ${input.listMetadata.recommendationListId}`);\n context.telemetry.debug(`Number of products returned: ${productTypeId.length}`);\n context.telemetry.debug('Product ids returned', productTypeId);\n\n if (productInputs.length) {\n const itemIds: number[] = productInputs.map(value => value.productId);\n const productSearchCriteria: ProductSearchCriteria = {\n Ids: itemIds,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n if (isHideAndSortByInventoryAvailabilitySupported) {\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS\n ) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (\n context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS\n ) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n }\n\n try {\n let productSearchResults = await searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n );\n // If the ProductSearchResult API finds the products then populate the product image urls and return\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\n if (productSearchResults.length > 0) {\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\n return productSearchResults;\n }\n } catch (e) {\n // In case of an error fall back to legacy flow\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\n }\n }\n }\n return [];\n })\n .catch(error => {\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRecommendationListAction = createObservableDataAction({\n action: >getProductsByRecommendationList,\n id: '@msdyn365-commerce/products-by-recommendation'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { getRelatedProductsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\n\nconst actionInputError = (missingType: string) => {\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRelationship action`);\n};\n\nexport const getProductsByRelationshipIdList = async (input: ProductListInput, context: IActionContext): Promise => {\n let productId;\n let relationshipId;\n // Grab the product ID from the list meta data or context\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\n productId = input.listMetadata.productIds[0];\n } else if (context.requestContext.urlTokens && context.requestContext.urlTokens.itemId) {\n productId = +context.requestContext.urlTokens.itemId;\n } else {\n actionInputError('productId');\n }\n // The relationship ID must be provided with the list meta data\n if (input.listMetadata.relationshipId) {\n relationshipId = +input.listMetadata.relationshipId;\n } else {\n actionInputError('relationshipId');\n }\n context.telemetry.debug(`Product Id input to productByRelationship action: ${productId}`);\n context.telemetry.debug(`Relationship Id input to productByRelationship action: ${relationshipId}`);\n\n return getRelatedProductsAsync(\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\n productId,\n input.channelId,\n input.catalogId,\n relationshipId\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by getRelatedProducts action', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running getRelatedProducts action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsByRelationshipIdListAction = createObservableDataAction({\n action: >getProductsByRelationshipIdList,\n id: '@msdyn365-commerce/products-by-relationship-id'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { GetCustomerInput, createObservableDataAction, getCustomerActionDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext, versionGte } from '@msdyn365-commerce/core-internal';\nimport { Customer, ProductSearchCriteria, ProductSearchResult, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\nimport {\n getInventorySorting,\n getInventoryInStockSortableRefinerValue,\n ProductListInventoryFilteringOptions\n} from '../utils/inventory-util';\n\nexport const getProductsByPromotionList = async (input: ProductListInput, context: IActionContext): Promise => {\n const rsVersion =\n !process.env.MSDyn365Commerce_RSVERSION || process.env.MSDyn365Commerce_RSVERSION === '--'\n ? '0.0'\n : process.env.MSDyn365Commerce_RSVERSION;\n const APIEnabedVersion = versionGte(rsVersion, '9.48');\n if (!APIEnabedVersion) {\n return [];\n }\n\n // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires -- Need for GetProductPromotions API.,\n const productsDataActions = require('@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g');\n\n // If the Discount Offer Id is not verified.\n if (!input.listMetadata.discountIds || (input.listMetadata.discountIds && input.listMetadata.discountIds.length === 0)) {\n context.telemetry.debug('Discount Offer Id should be verified');\n throw new Error('Discount Offer Id should be verified');\n }\n\n const queryResultSettings: QueryResultSettings = {\n Paging: {\n Top: input.listMetadata.pageSize || 10\n }\n };\n\n const customer: Customer = await getCustomerActionDataAction(new GetCustomerInput(context.requestContext.apiSettings, ''), context);\n const customerAccountNumber = customer?.AccountNumber || context.requestContext.user.customerAccountNumber;\n\n const productSearchCriteria: ProductSearchCriteria = {\n Ids: input.listMetadata.productIds,\n // @ts-ignore\n CustomerAccountNumber: customerAccountNumber,\n RecommendationListId: input.listMetadata.recommendationListId,\n Context: {\n ChannelId: +context.requestContext.apiSettings.channelId,\n CatalogId: +input.catalogId\n },\n SkipVariantExpansion: true,\n IncludeAttributes: true\n };\n\n const channelInventoryConfiguration = {};\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\n const inventoryInStockRefinerValue = getInventoryInStockSortableRefinerValue(channelInventoryConfiguration);\n if (inventoryInStockRefinerValue) {\n productSearchCriteria.Refinement = [inventoryInStockRefinerValue];\n }\n }\n\n /**\n * Sort by inventory availability:\n * For other type expect editorial: it's supported since 9.37.\n * For editorial list type: it's supported since 9.44 since it depends on fix from retail server which is fixed on 9.44. But logic here is the same as other types.\n */\n if (context.requestContext.app.config?.productListInventoryDisplay === ProductListInventoryFilteringOptions.SortOOS) {\n const sorting = getInventorySorting(channelInventoryConfiguration);\n if (sorting) {\n queryResultSettings.Sorting = sorting;\n }\n }\n\n return (\n productsDataActions\n .getProductPromotionsAsync(\n {\n callerContext: context,\n queryResultSettings: queryResultSettings\n },\n input.listMetadata.discountIds,\n {\n HeaderContext: {\n ChannelId: context.requestContext.apiSettings.channelId,\n CustomerAccountNumber: customerAccountNumber\n },\n LineContexts: [\n {\n CatalogId: input.catalogId\n }\n ]\n }\n )\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ProductPromotion is introduced in 9.48 in retail proxy.\n .then((productPromotions: any[]) => {\n if (productPromotions.length > 0) {\n const productIds: number[] = productPromotions.map(p => p.ProductId);\n productSearchCriteria.Ids = productIds;\n return productsDataActions.searchByCriteriaAsync(\n {\n callerContext: context,\n queryResultSettings\n },\n productSearchCriteria\n );\n } else {\n throw new Error(`No product retrieved for configured discounts: ${input.listMetadata.discountIds}`);\n }\n })\n .then((productSearchResult: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by getProductsByPromotionList action', productSearchResult);\n return getProductImageUrls(productSearchResult, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running getProductsByPromotionList action: ${error}`);\n throw new Error(error);\n })\n );\n};\n\nexport const getProductsByPromotionListAction = createObservableDataAction({\n action: >getProductsByPromotionList,\n id: '@msdyn365-commerce/products-by-promotion'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\nimport { searchByTextAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { getProductImageUrls } from '../../utils/product-list-utils';\nimport { ProductListInput } from '../hydrator-action-inputs';\n\nexport const getProductsBySearchList = async (input: ProductListInput, context: IActionContext): Promise => {\n let searchText: string;\n if (input.listMetadata.searchText) {\n searchText = input.listMetadata.searchText;\n } else if (context.requestContext.query && context.requestContext.query && context.requestContext.query.q) {\n searchText = context.requestContext.query.q;\n } else {\n throw new Error(\n 'Search text missing for ProductsBySearch. Query string ?q={searchText} or search text in list meta data must be present.'\n );\n }\n\n return searchByTextAsync(\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\n input.channelId,\n input.catalogId,\n searchText\n )\n .then((products: ProductSearchResult[]) => {\n context.telemetry.debug('Products returned by productsBySearch action:', products);\n return getProductImageUrls(products, context.requestContext.apiSettings);\n })\n .catch(error => {\n context.telemetry.error(`Error running productsBySearch action: ${error}`);\n throw new Error(error);\n });\n};\n\nexport const getProductsBySearchListAction = createObservableDataAction({\n action: >getProductsBySearchList,\n id: '@msdyn365-commerce/products-by-search'\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { IActionContext, IDictionary, IObservableAction } from '@msdyn365-commerce/core-internal';\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport { IProductList } from '@msdyn365-commerce/retail-proxy/dist/data-types';\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { EXCEPTION_PRODUCT_LIST_ACTION, INVALID_PRODUCT_LIST_TYPE } from '@msdyn365-commerce/telemetry-internal';\nimport { toJS } from 'mobx';\nimport { set as _set } from 'lodash';\nimport { MODULE_CONFIG_KEY } from '../consts';\nimport { IProductListMetaData, ProductListInput, ProductListType } from './hydrator-action-inputs';\nimport { getProductsByCategoryListAction } from './product-list-actions/products-by-category.action';\nimport { getProductsByRecentlyViewedListAction } from './product-list-actions/products-by-recentlyviewed.action';\nimport { getProductsByRecommendationListAction } from './product-list-actions/products-by-recommendation.action';\nimport { getProductsByRelationshipIdListAction } from './product-list-actions/products-by-relationship-id.action';\nimport { getProductsByPromotionListAction } from './product-list-actions/products-by-promotions.action';\nimport { getProductsBySearchListAction } from './product-list-actions/products-by-search.action';\nimport { shouldOptimizeHydrate } from '../utils/helpers';\n\n/**\n * Method to hydrate a product list from metadata provided by CMS\n * @param listMetaData The metadata for the product list from CMS\n */\nexport const hydrateProductList = async (\n listMetaData: IProductListMetaData,\n context: IActionContext,\n moduleId?: string,\n propertyToMapInConfig?: string\n): Promise => {\n let action: IObservableAction | undefined;\n const productListMetaData = (listMetaData);\n productListMetaData.products = [];\n\n switch (ProductListType[listMetaData.listType]) {\n case ProductListType.productBySearch:\n action = getProductsBySearchListAction;\n break;\n case ProductListType.productByCategory:\n action = getProductsByCategoryListAction;\n break;\n case ProductListType.relatedProducts:\n action = getProductsByRelationshipIdListAction;\n break;\n case ProductListType.recentlyViewedProducts:\n action = getProductsByRecentlyViewedListAction;\n break;\n case ProductListType.promotional:\n action = getProductsByPromotionListAction;\n break;\n case ProductListType.editorial:\n case ProductListType.algo:\n case ProductListType.recommendation:\n action = getProductsByRecommendationListAction;\n break;\n default:\n context.telemetry.error(INVALID_PRODUCT_LIST_TYPE, listMetaData.listType);\n productListMetaData.listMetadata = { error: INVALID_PRODUCT_LIST_TYPE };\n }\n\n if (action !== undefined) {\n return action(new ProductListInput(listMetaData, context), context)\n .then(productList => {\n productListMetaData.products = productList ?? [];\n productListMetaData.products = productListMetaData.products.filter(item => item && item.Name);\n updateListDataInRequestCache(context, productList, moduleId, propertyToMapInConfig);\n })\n .catch(error => {\n context.telemetry.error(EXCEPTION_PRODUCT_LIST_ACTION);\n context.telemetry.exception(error);\n productListMetaData.listMetadata = { error: EXCEPTION_PRODUCT_LIST_ACTION };\n updateListDataInRequestCache(context, productListMetaData.products, moduleId, propertyToMapInConfig);\n });\n }\n\n return;\n};\n\n/**\n * update list data in request cache when client optimize hydrate is enabled. This\n * @param context\n * @param products\n * @param moduleId\n * @param propertyToMapInConfig\n */\nconst updateListDataInRequestCache = (\n context: IActionContext,\n products: ProductSearchResult[],\n moduleId?: string,\n propertyToMapInConfig?: string\n) => {\n if (msdyn365Commerce.isBrowser && shouldOptimizeHydrate(context.requestContext) && moduleId && propertyToMapInConfig) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const requestCache: ICache = (context).requestCache;\n const cacheValue = requestCache.get>({\n typeName: MODULE_CONFIG_KEY,\n key: moduleId\n });\n if (cacheValue) {\n const config = toJS(cacheValue.item);\n config[propertyToMapInConfig].products = products;\n _set(config, [propertyToMapInConfig], config[propertyToMapInConfig]);\n requestCache.put({ typeName: MODULE_CONFIG_KEY, key: moduleId }, { item: config });\n }\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICache } from '@msdyn365-commerce/cache-internal';\nimport { EditError, IDictionary, IModuleContract, PROPERTY_INIT } from '@msdyn365-commerce/core-internal';\nimport { CLIENT_DATA_UPDATE_EVENT, MSDYN365_WYSIWYG_DISABLED_PROPS } from '../consts';\n\nconst MODULE_NAME_PATH = '__MODULE_NAME__';\n\nconst MODULE_TYPE_PATH = '__MODULE_TYPE__';\n\nconst PARENT_PROP_PATH = '__PARENT_PROP__';\n\nexport interface IDisabledProperties {\n modules: IDictionary;\n}\n\nexport const getWrappedProxyObject = (config: IDictionary<{}>, moduleName: string, typeName: string) => {\n if (typeof window === 'undefined') {\n return config;\n }\n\n return getProxyHandler(config, moduleName, typeName);\n};\n\n/**\n * Get parent module id\n */\nexport const disableChildModules = (parentModule: IModuleContract, requestCache: ICache) => {\n const slotKeys = Object.keys(parentModule.modules || []);\n for (let i = 0; i < slotKeys.length; ++i) {\n const childModules: IModuleContract[] = parentModule.modules![slotKeys[i]];\n for (let j = 0; j < childModules.length; ++j) {\n requestCache.put({ typeName: MSDYN365_WYSIWYG_DISABLED_PROPS, key: childModules[j].id }, { item: ['*'] });\n disableChildModules(childModules[j], requestCache);\n }\n }\n};\n\n/**\n * helper function to find module from page contract\n * @param moduleId module to be searched\n * @param pageRoot page root object\n */\nexport const findModule = (moduleId: string, pageRoot: IModuleContract): IModuleContract | undefined => {\n if (pageRoot.id === moduleId) {\n return pageRoot;\n }\n\n const slotKeys = Object.keys(pageRoot.modules || []);\n for (let i = 0; i < slotKeys.length; ++i) {\n const childModules: IModuleContract[] = pageRoot.modules![slotKeys[i]];\n for (let j = 0; j < childModules.length; ++j) {\n const res = findModule(moduleId, childModules[j]);\n if (res) {\n return res;\n }\n }\n }\n\n return undefined;\n};\n\n/**\n * Returns proxy object with get and set traps\n */\nconst getProxyHandler = (config: IDictionary<{}>, moduleName: string, moduleType: string): unknown => {\n const handler: ProxyHandler> = {\n get(target: IDictionary<{}>, key: string): IDictionary<{}> | string {\n // store current module name on the proxy object\n if (!target[MODULE_NAME_PATH]) {\n target[MODULE_NAME_PATH] = moduleName;\n }\n\n if (!target[MODULE_TYPE_PATH]) {\n target[MODULE_TYPE_PATH] = moduleType;\n }\n\n if (typeof target[key] === 'object' && target[key] !== null) {\n // store current prop path as parent and return new proxy (for objects)\n target[key][PARENT_PROP_PATH] = target[PARENT_PROP_PATH] ? `${target[PARENT_PROP_PATH]}.${key}` : key;\n return new Proxy(target[key], handler);\n } else {\n return target[key];\n }\n },\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(target: IDictionary<{}>, key: string, newValue: any): boolean {\n let disabledProperties: string[] = [];\n const moduleId = target[MODULE_NAME_PATH];\n const typeName: string = target[MODULE_TYPE_PATH];\n\n if (!moduleId || !typeName) {\n return true;\n }\n\n let propertyPath = [key];\n\n if (target[PARENT_PROP_PATH]) {\n const parentPath = (target[PARENT_PROP_PATH]).split('.');\n propertyPath = key === '$type' ? parentPath : parentPath.concat([key]);\n }\n\n // Check for disabled properties only during component initialization\n // MSDYN365_WYSIWYG_INIT is triggered on component mount and whenever\n // there is a change in component props (componentWillReceiveProps)\n if (newValue === '__MSDYN365_WYSIWYG_INIT__') {\n disabledProperties = (window)._msdyn365.authoringHelper.getDisabledProperties(moduleId);\n\n if ((disabledProperties || []).length > 0) {\n // if the value is '*' all properties are disabled\n if (disabledProperties.length === 1 && disabledProperties[0] === '*') {\n throw new EditError('cannot set disabled property');\n }\n\n const fullPath = propertyPath.join('.');\n // properties disabled in template are disabled at root property path - and will only contain part of the updated property's full path\n // e.g. disabledProperties = ['heading','links'], updatedProperty = 'heading.text' and 'links.1.linkText' are disabled\n // we check for fullPath.startsWith(`${p}.`) to handle cases where 'heading' prop is disabled and edited property is 'headingLink'\n if (disabledProperties.filter(p => fullPath === p || fullPath.startsWith(`${p}.`)).length > 0) {\n throw new EditError('cannot set disabled property');\n }\n }\n\n // for events that are called as part of initialization, do no set any value\n // as the initialization is to check if a property is disabled\n const requiredProperties: string[] = getRequiredProperties(typeName) || [];\n throw new EditError('cannot set disabled property', PROPERTY_INIT, requiredProperties.includes(propertyPath.join('.')));\n }\n\n // If we reached here, it means component is not disabled, lets just\n // notify the site builder\n document.dispatchEvent(\n new CustomEvent(CLIENT_DATA_UPDATE_EVENT, {\n detail: { moduleId, value: newValue, property: propertyPath }\n })\n );\n return true;\n }\n };\n\n return new Proxy(config, handler);\n};\n\n/**\n * helper method to get required properties\n */\nconst getRequiredProperties = (typeName: string) => {\n if (!(typeof window === undefined)) {\n const authoringHelper = (window)._msdyn365.authoringHelper;\n return authoringHelper && authoringHelper.renderingHelper && authoringHelper.renderingHelper.moduleRequiredProperties(typeName);\n }\n\n return [];\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Http specific errors\n */\nexport class HttpException extends Error {\n public static Name: string = 'HttpException';\n // TODO: type these\n public statusCode: number;\n\n /**\n * Error class for representing server errors\n * @param code HTTP status code\n * @param message Http status message\n */\n constructor(code: number, message?: string) {\n super(message);\n this.statusCode = code;\n this.name = HttpException.Name;\n\n // As of Typescript 2.1 if we extend the Error object the prototype must be set explicitly\n // See: https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n Object.setPrototypeOf(this, HttpException.prototype);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { HttpException } from './HttpException';\n\n/**\n * HTTP error for 302 redirects\n */\nexport class HttpRedirectException extends HttpException {\n public static Name: string = 'HttpRedirectException';\n public location: string;\n\n constructor(location: string) {\n super(302);\n this.location = location;\n this.name = HttpRedirectException.Name;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ICacheItem, ICache, ICacheKey } from '@msdyn365-commerce/cache-internal';\nimport {\n IDictionary,\n IParsedQSP,\n IRenderingHelper,\n IRequestContext,\n msdyn365Commerce,\n SDK_FRAGMENT_NAME,\n SDK_FRAGMENT_NAME_REGEX,\n checkVersionForFeature,\n IPlatformSettings,\n IRenderingContext,\n IModule,\n IRequestContextParams\n} from '@msdyn365-commerce/core-internal';\nimport { EXCEPTION_EXPECTED501, IInternalTelemetry, StaticTelemetry } from '@msdyn365-commerce/telemetry-internal';\nimport { NextFunction, Request, Response } from 'express';\nimport * as fs from 'fs';\nimport { getCurrency } from 'locale-currency';\nimport { escape } from 'lodash';\nimport * as path from 'path';\nimport { ReactElement } from 'react';\nimport { renderToString } from 'react-dom/server';\nimport { Stream } from 'stream';\nimport { IRefreshConfigs, REFRESH_ACTIONS_CACHE_KEY } from '@msdyn365-commerce/action-internal';\nimport { toJS } from 'mobx';\nimport { THEME_MODULE } from '../_server/Definition/moduleDefinition';\nimport { HttpException } from '../_server/error';\nimport { IMSDyn365CommerceExtension } from '../app-initialization/models';\nimport { PageContext } from '../store/page-context';\n\nexport const MODULE_ERROR_TYPE_NAME_FOR_CACHE: string = '__ME';\nexport const EMPTY_MODULE_RESULT_VALUE = 'empty-module-result';\nexport const UNREGISTERED_MODULE_VALUE = 'unregistered-module';\n\n// Used to deprecate older modules starting SSK V2\nexport const SSK2_VERSION = '2.0.0';\n\n/**\n * Creates and returns an ICacheKey object for storing\n * results of module render errors inside the RequestCache\n *\n * @param id The id of the module that encountered an error\n */\nexport const createCacheKeyForModuleError = (id: string): ICacheKey => {\n return { typeName: MODULE_ERROR_TYPE_NAME_FOR_CACHE, key: id };\n};\n\n/**\n * Creates and returns an ICacheItem object that inidcates\n * a module render result was null or empty\n */\nexport const createCacheValueForEmptyModule = (): ICacheItem => {\n return { item: EMPTY_MODULE_RESULT_VALUE };\n};\n\n/**\n * Creates and returns an ICacheItem object that inidcates\n * a module was unregistered and thus not rendered\n */\nexport const createCacheValueForUnregisteredModule = (): ICacheItem => {\n return { item: UNREGISTERED_MODULE_VALUE };\n};\n\n/**\n * Utility function to async check if file exists\n * @param filePath file path to check\n */\nexport const fileExists = async (filePath: string, telemetry: IInternalTelemetry) => {\n return new Promise((resolve: (pathToFileThatExists?: string) => void, reject: () => void) => {\n if (!filePath) {\n resolve(undefined);\n }\n\n fs.access(filePath, fs.constants.R_OK, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n resolve(undefined);\n }\n resolve(filePath);\n });\n });\n};\n\n/**\n * Utility function to access the site builder rendering helper\n */\nexport const getRenderingHelper = (): IRenderingHelper | undefined => {\n return (window)._msdyn365.authoringHelper && (window)._msdyn365.authoringHelper.renderingHelper;\n};\n\n/**\n * Converts a readable stream (that has yet to emit 'data') to a string\n *\n * @param stream Stream-like object\n */\nexport const streamToString = (stream: Stream): Promise => {\n return new Promise((resolve: (streamAsString: string) => void) => {\n const stringParts: string[] = [];\n stream.on('data', (buffer: Buffer) => {\n stringParts.push(buffer.toString());\n });\n stream.on('end', () => {\n resolve(stringParts.join(''));\n });\n });\n};\n\n/**\n * Checks is value is truthy\n * @param value value to check\n */\nexport const isTruthy = (value: number | boolean | string | undefined | null) => {\n if (value === undefined || value === null) {\n return false;\n }\n switch (String(value).toLocaleLowerCase()) {\n case '1':\n case 'true':\n case 'yes':\n return true;\n case '0':\n case 'false':\n case 'no':\n case 'undefined':\n case '':\n return false;\n default:\n return !!value;\n }\n};\n\n/**\n * Checks optional QSP value and returns as a structured type\n *\n * @param qspValue QSP value to check\n */\nexport const parseToQSPObject = (qspValue: TValue): IParsedQSP => {\n return {\n hasValue: qspValue !== undefined,\n isTruthy: isTruthy(String(qspValue)),\n value: qspValue\n };\n};\n\n/**\n * Server has allowed list of QSPs, so QSPs going through Server have be put beind a allowed list of QSP such as item.\n *\n * Example:\n * In localhost, we'll have `?debug=true` but when running through Server, this is equivalent to ?item=debug:true\n *\n * This method also supports parsing out a comma separated item list, makes assumption that everything is properly URIEncoded\n * e.g. ?item=debug:true,foo:bar,bar:123\n *\n * @param itemQueryString the `item` query string value\n */\nexport const parseItemQSP = (itemQueryString: string | undefined | null): IDictionary => {\n const result: IDictionary = {};\n if (itemQueryString === undefined || itemQueryString === null) {\n return result;\n }\n const decodedUriParts = decodeURIComponent(itemQueryString).split(',');\n decodedUriParts.forEach((qsp: string) => {\n const qspParts = qsp.split(':');\n if (qspParts && qspParts.length === 2) {\n const [key, value] = qspParts;\n if (key.length && value.length) {\n result[key] = value;\n }\n }\n });\n return result;\n};\n\nexport const LinkTag = (baseUrl: string, preloadAttribute: string, staticFlushQuery: string) => (src: string) =>\n ``;\n\nexport const CommentTag = (comment: string | object) => {\n if (typeof comment === 'object') {\n return Object.keys(comment)\n .map(key => ``)\n .join('');\n }\n return ``;\n};\n\n/**\n * Wraps express routes and makes sure to catch & rethrow any errors.\n * Actual handling will be done by the handlerServerError method that logs error and sends response\n * @param fn Function for wrapped route\n */\nexport const safeRoute = fn => (...args: any[]) =>\n fn(...args).catch((error: Error) => {\n args[2] && args[2](error);\n });\n\n/**\n * Sample helper\n * @param res Response\n */\nexport const throwHelper = (req: Request, res: Response, next: NextFunction, message: string) => {\n throw new HttpException(501, StaticTelemetry.stringFormat(EXCEPTION_EXPECTED501, [message]));\n};\n\nexport const getAbsoluteUri = (req): string => {\n return `${req.protocol}://${req.get('host')}${req.originalUrl}`;\n};\n\nexport const isPageInsightsEnabled = (params: IRequestContextParams): boolean => {\n return params?.pageInsights === 'all' || params?.pageInsights === 'info' || params?.pageInsights === 'error';\n};\n\n/**\n * Wrapped render to string method that replaces the SDK Fragment element with nothing\n * used as a drop-in for renderToString on elements where we blindly set innerHTML.\n *\n * @param element the element to render\n */\nexport const patchedRenderToString = (element: ReactElement, disableServerSideErrorChecking: boolean) => {\n const renderResult = renderToString(element);\n if (disableServerSideErrorChecking && !renderResult.startsWith(`<${SDK_FRAGMENT_NAME}`)) {\n return renderResult;\n }\n return renderResult.replace(SDK_FRAGMENT_NAME_REGEX, '');\n};\n\n/**\n * Checks if client side hydration should happen before loadData\n * @param requestContext Request context object\n */\nexport const shouldOptimizeHydrate = (requestContext: IRequestContext) => {\n const clientRenderOptimizationEnabled = requestContext.features && requestContext.features.optimize_client_hydrate;\n const clientRenderQsp = requestContext.query && requestContext.query.optimize_hydrate === 'true';\n return (clientRenderOptimizationEnabled || clientRenderQsp) && checkVersionForFeature('optimize_client_hydrate');\n};\n\nexport const CurrencyCodeIdentifier = 'cc';\nexport const getCurrencyCodeFromContext = (requestContext: IRequestContext) => {\n return (\n (requestContext && requestContext.query && requestContext.query[CurrencyCodeIdentifier]) ||\n (requestContext.cookies && requestContext.cookies.get(CurrencyCodeIdentifier).value) ||\n (requestContext.channel && requestContext.channel.Currency) ||\n getCurrency(requestContext.locale)\n );\n};\n\n/**\n * Extracts the name of the module from the path to its definition file\n * @param definitionPath path to the definition file\n */\nexport const getModuleName = (definitionPath: string) => {\n if (!definitionPath || definitionPath === '') {\n return '';\n }\n\n return path.basename(definitionPath, THEME_MODULE.DEFINITION_FILE);\n};\n\nexport const getPageInsightsCacheKey = (key: string): ICacheKey => {\n return {\n key,\n typeName: 'string'\n };\n};\n\n/**\n * Returns the binder object for the given module\n * @param typeName name of the module\n */\nexport const getModuleBinder = (typeName: string) => ((msdyn365Commerce)).moduleBinder(typeName);\n\n/**\n * Returns name of the parent module for given module name\n * @param moduleName name of the module\n */\nexport const getParentModuleName = (moduleName: string) => {\n const moduleBinder = getModuleBinder(moduleName);\n\n if (!moduleBinder) {\n return '';\n }\n\n return getModuleName(moduleBinder.parentDefinitionPath);\n};\n\n/**\n * helper to read actions to be refreshed from request cache.\n * @param requestCache request cache where refresh actions are stored\n * @returns list of refresh action configs\n */\nexport const getAllActionsToBeRefreshed = (requestCache: ICache) => {\n let allRefreshActions: IRefreshConfigs[] = [];\n const refreshActionsFromCache = requestCache.get(REFRESH_ACTIONS_CACHE_KEY);\n if (refreshActionsFromCache) {\n allRefreshActions = toJS(refreshActionsFromCache.item);\n }\n\n return allRefreshActions;\n};\n\nexport const isLazyRenderModuleEnabled = (requestContext: IRequestContext | IRenderingContext): boolean => {\n if ((requestContext)?.params?.isEditor || isTruthy((requestContext)?.query?.editorial)) {\n return false;\n }\n\n if (requestContext?.query?.disable_lazy_render_support) {\n return false;\n }\n\n return (\n isModuleEntryPointsEnabled(msdyn365Commerce.platformSettings || {}, requestContext) &&\n requestContext?.features?.disable_lazy_render_support !== true\n );\n};\n\nexport const isModuleEntryPointsEnabled = (\n platformSettings: IPlatformSettings,\n requestContext?: IRequestContext | IRenderingContext\n): boolean => {\n if (requestContext?.query?.enableModuleEntryPoints) {\n return true;\n }\n return platformSettings.enableModuleEntryPoints === true;\n};\n\n/**\n * Helper function which utilizes time slicing Settimeout method in a promise which helps in breaking long running JS task on the main thread.\n * Use with caution: a setTimeout promise creates a microtask which the event loop prioritizes execution which can again block the main thread more and increase LCP / TBT.\n *\n * @param requestContext\n */\nexport const timeSliceLongJSTask = async (requestContext: IRequestContext) => {\n if (requestContext?.features?.loadData_optimization) {\n await new Promise(resolve => setTimeout(resolve, 0));\n }\n};\n\nexport const optimizedGetAllModules = async (pageContext: PageContext, requestContext: IRequestContext): Promise => {\n const allModulesListArray: IModule[][] = [];\n const moduleList = pageContext.moduleList();\n for (let i = 0; i < moduleList.length; i++) {\n await timeSliceLongJSTask(requestContext);\n const result = await pageContext.allModules(requestContext, moduleList[i]);\n allModulesListArray.push(result);\n }\n return allModulesListArray.flat();\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDataAttributeRenderer } from '../interfaces';\nimport { IDictionary } from '../interfaces/IDictionary';\n\n/**\n * Commerce Insights attribute renderer that generates a 'data-m' telemetry attribute\n */\nexport const commerceInsightsAttributeRenderer: IDataAttributeRenderer = (\n telemetryId: string,\n additionalTelemetryData?: object\n): IDictionary => {\n let properties: string = '';\n\n if (additionalTelemetryData) {\n for (const prop of Object.entries(additionalTelemetryData)) {\n properties += `,\"${prop[0]}\":\"${prop[1]}\"`;\n }\n }\n\n return {\n 'data-bi-id': `${telemetryId}`,\n 'data-m': `{\"tid\":\"${telemetryId}\"${properties}}`\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDataAttributeRenderer } from '../interfaces';\nimport { IDictionary } from '../interfaces/IDictionary';\n\nconst pageName = 'pgname';\nconst moduleName = 'mname';\nconst eventType = 'etype';\n\n/**\n * Commerce Insights attribute renderer that generates a 'data-m' telemetry attribute\n */\nexport const expAttributeRenderer: IDataAttributeRenderer = (\n telemetryId: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalTelemetryData?: any\n): IDictionary => {\n if (additionalTelemetryData && pageName in additionalTelemetryData && moduleName in additionalTelemetryData) {\n let eventName = `${additionalTelemetryData[pageName]}.${additionalTelemetryData[moduleName]}.${telemetryId}`;\n if (additionalTelemetryData[eventType]) {\n eventName += `.${additionalTelemetryData[eventType]}`;\n }\n return {\n 'data-exp-event-id': eventName\n };\n } else {\n return {};\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICartInfo, ICustomEvent, IPageViewInfo, IProductTransaction } from '../../interfaces';\n\n/***\n * Enum type to represent supported telemetry events.\n */\nexport enum TelemetryEvent {\n PageView = 'PageView',\n ProductPageView = 'ProductPageView',\n AddToCart = 'AddToCart',\n RemoveFromCart = 'RemoveFromCart',\n UpdateInCart = 'UpdateInCart',\n CheckOut = 'CheckOut',\n Purchase = 'Purchase',\n Custom = 'Custom'\n}\n\n/***\n * Union type of content types accepted by the logEvent() API.\n */\nexport type TelemetryEventContent =\n | IPageViewInfo // PageView\n | ICartInfo // ProductPageView, AddToCart, RemoveFromCart, UpdateInCart, CheckOut\n | IProductTransaction // Purchase\n | ICustomEvent; // Custom\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { ITelemetryCommon, ITelemetryModuleContext, LogLevel } from '../interfaces';\nimport { TelemetryLogOptions } from '../telemetry';\n\nexport const NumericLogLevel = {\n trace: 0,\n debug: 1,\n information: 2,\n warning: 3,\n error: 4,\n critical: 5,\n none: -1\n};\n\n/*\n * Type definition for a log\n */\nexport type ILog = { logLevel: LogLevel; message: string };\n\n/**\n * Interface exposing methods for trace logging, telemetry event logging, and data attribute rendering\n * @property trace {Function} - Logs the given message at a Trace level\n * @property debug {Function} - Logs the given message at a Debug level\n * @property information {Function} - Logs the given message at a Information level\n * @property warning {Function} - Logs the given message at a Warning level\n * @property error {Function} - Logs the given message at a Error level\n * @property critical {Function} - Logs the given message at a Critical level\n * @property exception {Function} - Logs the given error object\n */\nexport interface ITelemetry extends ITelemetryCommon {\n /**\n * Logs a structured message at the given log level, with optional custom tags and/or an exception\n * @param logLevel LogLevel of the message\n * @param messageTemplate String to log, denoting placeholders with {placeholder}\n * @param logOptions Contains arguments to replace placeholders, custom tags for log, and optional error object\n */\n log(logLevel: LogLevel, messageTemplate: string, logOptions?: TelemetryLogOptions): void;\n\n /**\n * Logs a trace message with the Trace log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n trace(message: string, ...args: any): void;\n /**\n * Logs a trace message with the Debug log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n debug(message: string, ...args: any): void;\n /**\n * Logs a trace message with the Information log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n information(message: string, ...args: any): void;\n /**\n * Logs a trace message with the Warning log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n warning(message: string, ...args: any): void;\n /**\n * Logs a trace message with the Error log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n error(message: string, ...args: any): void;\n /**\n * Logs a trace message with the Critical log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n critical(message: string, ...args: any): void;\n\n /**\n * Logs an Error object as an exception\n * @param error The Error object to log\n */\n exception(error: Error): void;\n\n /**\n * Sets the portion of the telemetry context that will be attached to all logs for a module\n * @param moduleContext Part of the telemetry context that lasts during a module rendering\n */\n setTelemetryModuleContext(moduleContext: ITelemetryModuleContext): () => ITelemetry;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IDictionary, ITelemetryRequestContext, ITrackDependency, TelemetryEvent, TelemetryEventContent } from '../interfaces';\n\nexport enum LogLevel {\n /**\n * For information that's typically valuable only for debugging. These messages may contain sensitive application data and so shouldn't be enabled in a production environment. Disabled by default.\n */\n Trace = 'trace',\n /**\n * For information that may be useful in development and debugging. Example: Entering method Configure with flag set to true. Enable Debug level logs in production only when troubleshooting, due to the high volume of logs.\n */\n Debug = 'debug',\n /**\n * For tracking the general flow of the app. These logs typically have some long-term value. Example: Request received for path /api/todo\n */\n Information = 'information',\n /**\n * For abnormal or unexpected events in the app flow.\n * These may include errors or other conditions that don't cause the app to stop but might need to be investigated. Handled exceptions are a common place to use the Warning log level. Example: FileNotFoundException for file quotes.txt.\n */\n Warning = 'warning',\n /**\n * For errors and exceptions that cannot be handled.\n * These messages indicate a failure in the current activity or operation (such as the current HTTP request), not an app-wide failure. Example log message: Cannot insert record due to duplicate key violation.\n */\n Error = 'error',\n /**\n * For failures that require immediate attention. Examples: data loss scenarios, out of disk space.\n */\n Critical = 'critical',\n None = 'none'\n}\n\n/**\n * Common interface shared by internal telemetry and telemetry client\n */\n\nexport interface ITelemetryCommon {\n /**\n * Log a metric\n * @param name metric name\n * @param value metriv value\n */\n trackMetric(name: string, value: number): void;\n\n /**\n * Log an event\n * @param trackEventOptions Event data\n */\n trackEvent>, TMeasurements = Partial>>(\n name: string,\n properties?: TProperties,\n measurements?: TMeasurements\n ): void;\n\n /**\n * Track a dependency\n *\n * @param {ITrackDependency} options the dependency options\n */\n trackDependency(options: ITrackDependency): void;\n\n /**\n * Sets the portion of the telemetry context that will be attached to all logs for a request\n * @param requestContext Part of the telemetry context that lasts the entire request\n */\n setTelemetryRequestContext(requestContext: ITelemetryRequestContext): void;\n\n /**\n * Log an event\n * @param eventType event type\n * @param payload event payload\n */\n logEvent(eventType: TelemetryEvent, payload: TelemetryEventContent): void;\n\n /**\n * Render telemetry data attribute\n * @param telemetryId Unique ID for telemetry object\n * @param additionalTelemetryData Any additional properties to set\n */\n setTelemetryAttribute?(telemetryId: string, additionalTelemetryData?: object): IDictionary;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ICartInfo,\n // ICustomEvent,\n IEventLogger,\n // IPageViewInfo,\n IProductInfo,\n IProductTransaction,\n TelemetryEvent,\n TelemetryEventContent\n} from '../interfaces';\n\n/**\n * Commerce Insights logger that sends events to MS clickstream pipeline\n */\nexport class CommerceInsightsLogger implements IEventLogger {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _client: any;\n\n /**\n * Registers the Web Analytics plugin for use with the Commerce Insights logger\n */\n public registerWebAnalyticsPlugin = (webAnalyticsPlugin: object): void => {\n this._client = webAnalyticsPlugin;\n };\n\n /**\n * Sends the given event to the Commerce Insights data pipeline\n * @param eventType Type of event to log\n * @param payload Extra parameters dependent on the eventType\n */\n public logEvent(eventType: TelemetryEvent, payload: TelemetryEventContent): void {\n // Can't log if Web Analytics plugin not initialized\n if (this._client === undefined) {\n return;\n }\n\n let eventData: { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } | undefined;\n let eventName: string;\n\n // Check event type and convert to appropriate schema\n switch (eventType) {\n case TelemetryEvent.PageView:\n // TODO (matt, 6/15/20): Filtering all manual page views, undo once 1DS forwarding to framework implemented\n return;\n /* if (this._isPageViewInfo(payload)) {\n eventName = TelemetryEvent.PageView;\n eventData = this._populatePageViewInfo(payload);\n } else {\n console.error('PageView event needs PageViewInfo data'); return;\n }\n break; */\n case TelemetryEvent.ProductPageView:\n if (this._isCartInfo(payload)) {\n eventName = TelemetryEvent.ProductPageView;\n eventData = this._populateCartInfo(payload);\n } else {\n console.error('ProductPageView event needs an array of ProductUnit data');\n return;\n }\n break;\n case TelemetryEvent.AddToCart:\n if (this._isCartInfo(payload)) {\n eventName = TelemetryEvent.AddToCart;\n eventData = this._populateCartInfo(payload);\n } else {\n console.error('AddToCart event needs an array of ProductUnit data');\n return;\n }\n break;\n case TelemetryEvent.RemoveFromCart:\n if (this._isCartInfo(payload)) {\n eventName = TelemetryEvent.RemoveFromCart;\n eventData = this._populateCartInfo(payload);\n } else {\n console.error('RemoveFromCart event needs an array of ProductUnit data');\n return;\n }\n break;\n case TelemetryEvent.UpdateInCart:\n if (this._isCartInfo(payload)) {\n eventName = TelemetryEvent.UpdateInCart;\n eventData = this._populateCartInfo(payload);\n } else {\n console.error('UpdateInCart event needs an array of ProductUnit data');\n return;\n }\n break;\n case TelemetryEvent.CheckOut:\n if (this._isCartInfo(payload)) {\n eventName = TelemetryEvent.CheckOut;\n eventData = this._populateCartInfo(payload);\n } else {\n console.error('CheckOut event needs an array of ProductUnit data');\n return;\n }\n break;\n case TelemetryEvent.Purchase:\n if (this._isProductTransaction(payload)) {\n eventName = TelemetryEvent.Purchase;\n eventData = this._populateProductTransaction(payload);\n } else {\n console.error('Purchase event needs ProductTransaction data');\n return;\n }\n break;\n case TelemetryEvent.Custom:\n // TODO (matt, 6/15/20): Filtering all manual page views, undo once 1DS forwarding to framework implemented\n return;\n /* if (this._isCustomEvent(payload)) {\n eventName = TelemetryEvent.Custom;\n eventData = this._populateCustomEvent(payload);\n } else {\n console.error('Custom event needs CustomEvent data'); return;\n }\n break; */\n default:\n eventName = '';\n }\n\n // Log event\n this._client.trackEvent({\n name: eventName,\n baseType: 'EventData',\n baseData: { name: eventName },\n data: eventData\n });\n\n return;\n }\n\n /*\n * Determines if the telemetry event data is IPageViewInfo\n * @param payload Telemetry event data to check\n private _isPageViewInfo(payload: TelemetryEventContent): payload is IPageViewInfo {\n return (payload).title !== undefined;\n }\n */\n\n /**\n * Determines if the telemetry event data is array of ICartInfo\n * @param payload Telemetry event data to check\n */\n private _isCartInfo(payload: TelemetryEventContent): payload is ICartInfo {\n return (payload).cartId !== undefined;\n }\n\n /**\n * Determines if the telemetry event data is IProductTransaction\n * @param payload Telemetry event data to check\n */\n private _isProductTransaction(payload: TelemetryEventContent): payload is IProductTransaction {\n return (payload).id !== undefined;\n }\n\n /*\n * Determines if the telemetry event data is ICustomEvent\n * @param payload Telemetry event data to check\n private _isCustomEvent(payload: TelemetryEventContent): payload is ICustomEvent {\n return (payload).contentCategory !== undefined;\n }\n */\n\n /*\n * Converts IPageViewInfo data into the format 1DS expects\n * @param payload Telemetry event data to convert\n private _populatePageViewInfo(\n payload: IPageViewInfo\n ): { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } {\n return {\n title: payload.title,\n location: payload.location || '',\n page: payload.page || ''\n };\n }\n */\n\n /**\n * Converts ICartInfo data into the format 1DS expects\n * @param payload Telemetry event data to convert\n */\n private _populateCartInfo(payload: ICartInfo): { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } {\n const productArray: { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] }[] = [];\n\n payload.products.forEach(product => {\n productArray.push(this._populateProductInfo(product));\n });\n\n return {\n products: productArray,\n orderId: payload.orderId || '',\n cartId: payload.cartId || '',\n cartVersion: payload.cartVersion || ''\n };\n }\n\n /**\n * Converts IProductInfo data into the format 1DS expects\n * @param payload Telemetry event data to convert\n */\n private _populateProductInfo(\n payload: IProductInfo\n ): { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } {\n return {\n productChannelId: payload.productChannelId || '',\n productChannelName: payload.productChannelName || '',\n productCategoryId: payload.productCategoryId || '',\n productCategoryName: payload.productCategoryName || '',\n productId: payload.productId || '',\n productName: payload.productName || '',\n productSku: payload.productSku || '',\n productPrice: payload.productPrice || '',\n productQuantity: payload.productQuantity || '',\n productCurrency: payload.productCurrency || ''\n };\n }\n\n /**\n * Converts IProductTransaction data into the format 1DS expects\n * @param payload Telemetry event data to convert\n */\n private _populateProductTransaction(\n payload: IProductTransaction\n ): { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } {\n const productArray: { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] }[] = [];\n\n if (payload.products) {\n payload.products.forEach(product => {\n productArray.push(this._populateProductInfo(product));\n });\n }\n\n return {\n id: payload.id,\n affiliation: payload.affiliation || '',\n revenue: payload.revenue || -1,\n tax: payload.tax || -1,\n shippingCost: payload.shippingCost || -1,\n products: productArray\n };\n }\n\n /*\n * Converts ICustomEvent data into the format 1DS expects\n * @param payload Telemetry event data to convert\n private _populateCustomEvent(\n payload: ICustomEvent\n ): { [key: string]: string | number | boolean | object | string[] | number[] | boolean[] } {\n return {\n contentCategory: payload.contentCategory,\n contentAction: payload.contentAction || {}\n };\n }\n */\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IEventId, IEventTime, ISuccess, TSuccessNumber, TSuccessString } from '../interfaces';\n\nexport const EVENT_CLIENT_RENDER_START = 'ClientRenderEventStart';\nexport const EVENT_CLIENT_RENDER_STOP = 'ClientRenderEventStop';\nexport const CONTENT_SECURITY_POLICY_ERROR = 'Content Security Policy error';\n\n/**\n * Additional properties to send along with ending a request\n */\nexport interface IEventClientRenderProperties extends IEventId, ISuccess {}\n\nexport interface IEventClientRenderMetrics extends IEventTime, ISuccess {}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IEventId, ISuccess, TSuccessString } from '../interfaces';\n\nexport const EVENT_HTTP_SERVICE_START = 'HttpServiceEventStart';\nexport const EVENT_HTTP_SERVICE_STOP = 'HttpServiceEventStop';\n\n/**\n * Additional properties to send along with ending a request\n */\nexport interface IEventHttpServiceStopProperties extends IEventId, ISuccess {\n statusCode: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport const EVENT_WEB_VITALS_CLS = 'WebVitalsCLSEvent';\nexport const EVENT_WEB_VITALS_FCP = 'WebVitalsFCPEvent';\nexport const EVENT_WEB_VITALS_FID = 'WebVitalsFIDEvent';\nexport const EVENT_WEB_VITALS_INP = 'WebVitalsINPEvent';\nexport const EVENT_WEB_VITALS_LCP = 'WebVitalsLCPEvent';\nexport const EVENT_WEB_VITALS_TTFB = 'WebVitalsTTFBEvent';\n\nexport interface IEventClientWebVitalsCLSMetrics {\n value: number;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { sha256 } from 'js-sha256';\n\n/**\n * execute callback. Variable name intentionally short\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const p = (innerFunction: (...args: any) => T) => innerFunction();\n\nexport const generateEventNameHash = (eventName: string): string => {\n // Only generate hash client side\n if (typeof window !== 'undefined') {\n return sha256(eventName);\n }\n return eventName;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport uuid from 'uuid/v4';\nimport { commerceInsightsAttributeRenderer } from '../attribute-renderers';\nimport { CommerceInsightsLogger } from '../event-loggers';\nimport { generateEventNameHash, p } from '../helpers';\nimport {\n ICustomEvent,\n IDataAttributeRenderer,\n IEventLogger,\n IExpLogger,\n IPageViewInfo,\n IRegisterTraceLoggerOptions,\n ITelemetry,\n ITelemetryContext,\n ITelemetryRequestContext,\n ITraceLogger,\n LogLevel,\n NumericLogLevel,\n TelemetryEvent,\n TelemetryEventContent\n} from '../interfaces';\nimport { IDictionary } from '../interfaces/IDictionary';\nimport { ITrackDependency } from '../interfaces/ITrackDependency';\nimport { InternalTelemetryLogOptions } from './internal-telemetry-log-options';\nimport { TelemetryLogOptions } from './telemetry-log-options';\n\n/**\n * Base class for Telemetry & Internal telemetry\n * @abstract\n * @class TelemetryBase\n */\nexport abstract class TelemetryBase {\n /**\n * Enable Data Analytics feature switch\n */\n protected _enableDataAnalytics: boolean;\n\n /**\n * Map of timers\n */\n protected _timers: Map;\n\n /**\n * Array of ILogger objects representing the trace loggers used.\n */\n protected _traceLoggers: ITraceLogger[];\n\n /**\n * An object holding the information about telemetry event loggers.\n */\n protected _eventLoggers: IEventLogger[];\n\n /**\n * An object holding the information about the experimentation logger.\n */\n protected _expLogger: IExpLogger | undefined;\n\n /**\n * Array holding the registered Data Attribute Renderers\n */\n protected _attributeRenderers: IDataAttributeRenderer[];\n\n /**\n * Context object used with telemetry.\n */\n protected _telemetryContext: ITelemetryContext;\n\n /**\n * Dictionary of loggers by name (if one is provided)\n */\n protected _namedLoggers: IDictionary;\n\n /**\n * WebAnalytics client used to send BI events\n */\n protected _webAnalyticsPlugin?: object;\n\n public static generateGuid = (): string => {\n return uuid();\n };\n\n public constructor() {\n this._enableDataAnalytics = false;\n this._traceLoggers = [];\n this._eventLoggers = [];\n this._attributeRenderers = [];\n this._telemetryContext = {\n requestContext: {},\n moduleContext: {}\n };\n this._namedLoggers = {};\n this._timers = new Map();\n }\n\n /**\n * Start a named timer\n *\n * @param {string} id of timer\n * @memberof InternalTelemetry\n */\n public startTimer = (timerId: string): void => {\n this._timers.set(timerId, Date.now());\n };\n\n /**\n * Stops a named timer\n *\n * @param {string} timerId id of timer\n * @param {boolean} [removeTimer=true] should time be removed from dictionary? default rue\n * @returns {number} elapsed time in ms\n */\n public stopTimer = (timerId: string, removeTimer: boolean = true): number => {\n const now = Date.now();\n const result: number = this._timers.has(timerId) ? now - this._timers.get(timerId) : -1;\n if (removeTimer) {\n this._timers.delete(timerId);\n }\n return result;\n };\n\n /**\n * Saves the feature swtich marking whether data analytics is enabled for this request\n */\n public enableDataAnalytics = (enableDataAnalytics: boolean): void => {\n this._enableDataAnalytics = enableDataAnalytics;\n\n if (this._enableDataAnalytics) {\n this._eventLoggers = [new CommerceInsightsLogger()];\n this._attributeRenderers = [commerceInsightsAttributeRenderer];\n }\n };\n\n /**\n * Renders a data attribute string\n */\n public setTelemetryAttribute = (telemetryId: string, additionalTelemetryData?: object): IDictionary => {\n let telemetryAttribute: IDictionary = {};\n\n for (let i = 0; i < this._attributeRenderers.length; ++i) {\n telemetryAttribute = { ...telemetryAttribute, ...this._attributeRenderers[i](telemetryId, additionalTelemetryData) };\n }\n\n return telemetryAttribute;\n };\n\n /**\n * Logs a telemetry event.\n */\n public logEvent = (eventType: TelemetryEvent, payload: TelemetryEventContent): void => {\n for (let i = 0; i < this._eventLoggers.length; ++i) {\n p(() => this._eventLoggers[i].logEvent(eventType, payload));\n }\n\n // if exp logger is registered, mutate and send event\n if (this._expLogger) {\n let eventName: string | undefined = '';\n switch (eventType) {\n case TelemetryEvent.PageView:\n const pageViewEventName = (payload).title ? `${(payload).title}.PageView` : '';\n eventName = pageViewEventName;\n break;\n case TelemetryEvent.Custom:\n eventName = this._generateEventName(payload);\n if (eventName) {\n break;\n }\n default:\n eventName = eventType;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const expPayload: any = payload;\n expPayload.eventName = eventName;\n const eventNameHash = generateEventNameHash(eventName);\n this._expLogger.logEvent(eventNameHash, expPayload);\n }\n };\n\n /**\n * Tracks a metric\n */\n public trackMetric = (name: string, value: number): void => {\n this.notifyTraceLoggers(logger => logger.trackMetric(name, value, this._telemetryContext));\n };\n\n /**\n * Tracks an event\n */\n public trackEvent = (\n name: string,\n properties?: TProperties,\n measurements?: TMeasurements,\n context?: ITelemetryContext\n ): void => {\n this.notifyTraceLoggers(logger => logger.trackEvent(name, properties, measurements, context));\n };\n\n public trackPageView = (page: string, url?: string) => {\n this.notifyTraceLoggers(logger => logger.trackPageView(page, url));\n };\n\n public trackDependency = (options: ITrackDependency) => {\n this.notifyTraceLoggers(logger => logger.trackDependency(options));\n };\n\n /**\n * Adds the given trace logger to the list of trace loggers.\n * @param traceLogger - The ILogger object to be added to the list of trace loggers\n */\n public registerTraceLogger = (options: IRegisterTraceLoggerOptions): void => {\n if (options.traceLogger) {\n if (options.traceLogger.initialize && options.options) {\n options.traceLogger.initialize(options.options);\n }\n this._traceLoggers.push(options.traceLogger);\n options.name && (this._namedLoggers[options.name] = options.traceLogger);\n }\n };\n\n /**\n * Adds the given event logger to the list of event loggers\n * @param eventLogger - The IEventLogger object to be added to the list of event loggers\n */\n public registerEventLogger = (eventLogger: IEventLogger): void => {\n this._eventLoggers.push(eventLogger);\n };\n\n /**\n * Adds the given experimentation logger to the telemetry object\n * @param expLogger - The IExpLogger object to be added\n */\n public registerExpLogger = (expLogger: IExpLogger): void => {\n this._expLogger = expLogger;\n };\n\n /**\n * Adds the given attribute renderer to the list of attribute renderers\n * @param attributeRenderer - The IDataAttributeRenderer object to be added to the list of attribute renderers\n */\n public registerAttributeRenderer = (attributeRenderer: IDataAttributeRenderer): void => {\n this._attributeRenderers.push(attributeRenderer);\n };\n\n /**\n * Registers the Web Analytics plugin for use in the BI logging framework\n */\n public registerWebAnalyticsPlugin = (webAnalyticsPlugin: object): void => {\n this._webAnalyticsPlugin = webAnalyticsPlugin;\n\n // Pass Web Analytics plugin to the Commerce Insights logger\n if (this._enableDataAnalytics) {\n (this._eventLoggers[0]).registerWebAnalyticsPlugin(webAnalyticsPlugin);\n }\n };\n\n /**\n * Merges the properties specific to the current request that should be added to every log\n * @param requestContext Contains the context items specific to the current request\n */\n public setTelemetryRequestContext = (requestContext: Partial): void => {\n this._telemetryContext.requestContext = { ...(this._telemetryContext.requestContext || {}), ...requestContext };\n };\n\n /**\n * Gets named logger if it exists\n *\n * @param {string} name name of logger to get\n */\n public getNamedLoggerInstance = (name: string): T | undefined => {\n return this._namedLoggers[name];\n };\n\n /**\n * String formatter\n * @param templateString Template string\n * @param args ordered argument list\n */\n public stringFormat = (templateString: string, args: string[]): string => {\n for (let index = 0; index < args.length; ++index) {\n templateString = templateString.replace(`$${index}`, args[index]);\n }\n return templateString;\n };\n\n /**\n * Helper to notify trace loggers\n *\n * @private\n * @memberof Telemetry\n */\n protected notifyTraceLoggers = (fx: (logger: ITraceLogger) => void) => {\n for (let i = 0; i < this._traceLoggers.length; ++i) {\n // TODO: revisit this unhandled promise\n fx(this._traceLoggers[i]);\n }\n };\n\n protected _log = (\n logLevel: LogLevel,\n messageTemplate: string,\n logOptions?: InternalTelemetryLogOptions | TelemetryLogOptions\n ): void => {\n const requestedLogLevel = NumericLogLevel[logLevel];\n const minLogLevel = (process.env.SDK_MIN_LOG_LEVEL);\n\n // Do not log if below minimum log level\n if (requestedLogLevel < minLogLevel) {\n return;\n }\n\n // Create map of placeholders in string and arguments provided\n const regex = /{([a-zA-Z_0123456789]+)}/g;\n const placeholders = new Map();\n const values = logOptions && logOptions.values ? logOptions.values : [];\n let i = 0;\n let match = regex.exec(messageTemplate);\n\n while (match !== null) {\n // If this placeholder is a repeat of a previous one\n if (placeholders.get(match[1]) !== undefined) {\n match = regex.exec(messageTemplate);\n // Else if a new placeholder but no more arguments were given\n } else if (values[i] === undefined) {\n values[i] = `Undefined - No value given for this placeholder`;\n // Still increment in case a placeholder value in the middle was undefined\n placeholders.set(match[1], values[i++]);\n // Get next match\n match = regex.exec(messageTemplate);\n // Else save match and next argument provided\n } else {\n placeholders.set(match[1], values[i++]);\n\n // Get next match\n match = regex.exec(messageTemplate);\n }\n }\n this.notifyTraceLoggers((logger: ITraceLogger) => {\n logger.sendLog(\n logLevel,\n this._telemetryContext,\n messageTemplate,\n placeholders,\n logOptions && logOptions.customTags,\n logOptions && logOptions.exception\n );\n });\n };\n\n /**\n * Generates the event name for a custom click event\n * @param payload Payload of custom event\n */\n private _generateEventName(payload: TelemetryEventContent): string | undefined {\n if ((payload).contentCategory === 'click') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const attributes: any = (payload).contentAction;\n\n // Generate event name for custom clicks with page name, module name, and either element text or recordId\n if (attributes && attributes.pgname && attributes.mname && (attributes.etext || attributes.recid)) {\n return `${attributes.pgname}.${attributes.mname}.${attributes.etext || attributes.recid}${\n attributes.etype ? `.${attributes.etype}` : ''\n }`;\n }\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IInternalTelemetry, ITelemetryModuleContext, LogLevel } from '../interfaces';\nimport { InternalTelemetryLogOptions } from './internal-telemetry-log-options';\nimport { TelemetryBase } from './telemetry-base';\n\n/**\n * Telemetry client containing trace loggers\n */\nexport class InternalTelemetry extends TelemetryBase implements IInternalTelemetry {\n /**\n * Creates a new instance of InternalTelemetry.\n */\n public constructor() {\n super();\n }\n\n public setTelemetryModuleContext = (moduleContext: ITelemetryModuleContext) => {\n return () => {\n // Create copy of telemetry object with specified module context\n // TODO: kopik do we need to create new instance of telemetry here or can we just capture in closure?\n const telemetryWithContext = new InternalTelemetry();\n telemetryWithContext._enableDataAnalytics = this._enableDataAnalytics;\n telemetryWithContext._webAnalyticsPlugin = this._webAnalyticsPlugin;\n telemetryWithContext._traceLoggers = this._traceLoggers;\n telemetryWithContext._eventLoggers = this._eventLoggers;\n telemetryWithContext._expLogger = this._expLogger;\n telemetryWithContext._attributeRenderers = this._attributeRenderers;\n telemetryWithContext._telemetryContext.requestContext = this._telemetryContext.requestContext;\n telemetryWithContext._telemetryContext.moduleContext = moduleContext;\n\n return telemetryWithContext;\n };\n };\n\n /**\n * Logs a structured message at the given log level, with optional custom tags and/or an exception\n * @param logLevel LogLevel of the message\n * @param messageTemplate String to log, denoting placeholders with {placeholder}.\n * Example input string: \"Hello {signedInUser}! Good {morningOrEvening}!\"\n * @param logOptions Contains arguments to replace placeholders, custom tags for log, and optional error object.\n * For the example message template, arguments need to be provided for 'user' and 'morningOrEvening'.\n */\n public log = (logLevel: LogLevel, messageTemplate: string, logOptions?: InternalTelemetryLogOptions): void => {\n this._log(logLevel, messageTemplate, logOptions);\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { InternalTelemetry } from './internal-telemetry';\nconst _telemetry = new InternalTelemetry();\nexport { _telemetry as StaticTelemetry };\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Helper function that attempts to stringify data. If stringify fails, it will\n * fallback to basic string serialization.\n */\nexport function safeStringify(input: unknown): string {\n let output: string;\n\n try {\n output = typeof input === 'object' ? JSON.stringify(input) : String(input);\n } catch (e) {\n if (e && e.name === 'TypeError') {\n // Fallback to string serialization\n output = String(input);\n } else {\n throw e;\n }\n }\n\n return output;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ITelemetry, ITelemetryModuleContext, LogLevel, NumericLogLevel } from '../interfaces';\nimport { safeStringify } from '../loggers/logging-helper';\nimport { TelemetryBase } from './telemetry-base';\nimport { TelemetryLogOptions } from './telemetry-log-options';\n\n/**\n * Telemetry client containing trace loggers\n */\nexport class Telemetry extends TelemetryBase implements ITelemetry {\n /**\n * Creates a new instance of Telemetry.\n */\n public constructor() {\n super();\n }\n\n /**\n * Logs a trace message with the Trace log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public trace = (message: string, ...args: unknown[]): void => {\n this._logTrace(LogLevel.Trace, message, args);\n };\n\n /**\n * Logs a trace message with the Debug log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public debug = (message: string, ...args: unknown[]): void => {\n this._logTrace(LogLevel.Debug, message, args);\n };\n\n /**\n * Logs a trace message with the Information log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public information = (message: string, ...args: unknown[]): void => {\n this._logTrace(LogLevel.Information, message, args);\n };\n\n /**\n * Logs a trace message with the Warning log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public warning = (message: string, ...args: unknown[]): void => {\n this._logException(LogLevel.Warning, message, args);\n };\n\n /**\n * Logs a trace message with the Error log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public error = (message: string, ...args: unknown[]): void => {\n this._logException(LogLevel.Error, message, args);\n };\n\n /**\n * Logs a trace message with the Critical log level\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n public critical = (message: string, ...args: unknown[]): void => {\n this._logException(LogLevel.Critical, message, args);\n };\n\n /**\n * Logs an Error object as an exception\n * @param error The Error object to log\n */\n public exception = (error: Error): void => {\n this.notifyTraceLoggers(logger => logger.exception(error, this._telemetryContext));\n };\n\n /**\n * Sets the properties specific to the current module that should be added to every log\n * @param moduleContext Contains the context items specific to the current module\n */\n public setTelemetryModuleContext = (moduleContext: ITelemetryModuleContext) => {\n return () => {\n // Create copy of telemetry object with specified module context\n // TODO: kopik do we need to create new instance of telemetry here or can we just capture in closure?\n const telemetryWithContext = new Telemetry();\n telemetryWithContext._enableDataAnalytics = this._enableDataAnalytics;\n telemetryWithContext._webAnalyticsPlugin = this._webAnalyticsPlugin;\n telemetryWithContext._traceLoggers = this._traceLoggers;\n telemetryWithContext._eventLoggers = this._eventLoggers;\n telemetryWithContext._expLogger = this._expLogger;\n telemetryWithContext._attributeRenderers = this._attributeRenderers;\n telemetryWithContext._telemetryContext.requestContext = this._telemetryContext.requestContext;\n telemetryWithContext._telemetryContext.moduleContext = moduleContext;\n\n return telemetryWithContext;\n };\n };\n\n /**\n * Logs a structured message at the given log level, with optional custom tags and/or an exception\n * @param logLevel LogLevel of the message\n * @param messageTemplate String to log, denoting placeholders with {placeholder}.\n * Example input string: \"Hello {signedInUser}! Good {morningOrEvening}!\"\n * @param logOptions Contains arguments to replace placeholders, custom tags for log, and optional error object.\n * For the example message template, arguments need to be provided for 'user' and 'morningOrEvening'.\n */\n public log = (logLevel: LogLevel, messageTemplate: string, logOptions?: TelemetryLogOptions): void => {\n this._log(logLevel, messageTemplate, logOptions);\n };\n\n /**\n * Logs an exception message with the given LogLevel\n * @param logLevel LogLevel of the trace message\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n private _logException = (logLevel: LogLevel, message: string, args: unknown[]): void => {\n // Append any extra arguments to the message\n let fullMessage = message;\n args.forEach(arg => {\n fullMessage = fullMessage.concat('\\n', safeStringify(arg));\n });\n this._log(logLevel, message, { exception: { name: message, message: fullMessage } });\n };\n\n /**\n * Logs a trace message with the given LogLevel\n * @param logLevel LogLevel of the trace message\n * @param message The string to log\n * @param args Any extra arguments to log. Will be converted to strings and appended to message\n */\n private _logTrace = (logLevel: LogLevel, message: string, args: unknown[]): void => {\n const requestedLogLevel = NumericLogLevel[logLevel];\n const minLogLevel = (process.env.SDK_MIN_LOG_LEVEL);\n if (minLogLevel <= requestedLogLevel) {\n this.notifyTraceLoggers(logger => logger.log(logLevel, message, args, this._telemetryContext));\n }\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { DynamicsPrivacyLog } from './dynamics-privacy-log';\n\n/**\n * Wraps the given data in an 'AccessControl' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asAccessControl(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'AccessControl',\n isCustomerData: false,\n isRestrictedData: true,\n isPersonalData: false,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'CustomerContent' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asCustomerContent(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'CustomerContent',\n isCustomerData: true,\n isRestrictedData: true,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'EUII' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asEUII(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'EUII',\n isCustomerData: true,\n isRestrictedData: true,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'SupportData' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asSupportData(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'SupportData',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'AccountData' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asAccountData(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'AccountData',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'PublicPersonalData' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asPublicPersonalData(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'PublicPersonalData',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'EUPI' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asEUPI(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'EUPI',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: true,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'OII' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asOII(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'OII',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: false,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'SystemMetadata' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asSystemMetadata(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'SystemMetadata',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: false,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Wraps the given data in an 'PublicNonPersonalData' DynamicsPrivacyLog object.\n * @param data Data to wrap with privacy information\n */\nexport function asPublicNonPersonalData(data: T): DynamicsPrivacyLog {\n return {\n data: data,\n classificationLevel: 'PublicNonPersonalData',\n isCustomerData: false,\n isRestrictedData: false,\n isPersonalData: false,\n __isDynamicsPrivacy: true\n };\n}\n\n/**\n * Gets the data out of the input object if it is a DynamicsPrivacyLog object.\n * Filters data if it contains privacy information.\n * @param input Input object that may or may not be a DynamicsPrivacyLog\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getFilteredData(input: any): any {\n // Check if the input is a DynamicsPrivacyLog object\n if (input && input.__isDynamicsPrivacy) {\n // If input contains privacy data, censor output\n if (input.isCustomerData || input.isRestrictedData || input.isPersonalData) {\n return `DATA CENSORED (${input.classificationLevel})`;\n } else {\n return input.data;\n }\n } else {\n return input;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SeverityLevel } from 'applicationinsights/out/Declarations/Contracts';\nimport { ITelemetryContext } from '../interfaces';\nimport { IDictionary } from '../interfaces/IDictionary';\nimport { getFilteredData } from '../privacy/dynamics-privacy-helper';\nimport { safeStringify } from './logging-helper';\n\n/**\n * Key value for Custom Tags custom dimension in AppInsights events\n */\nexport const customTagsKey: string = 'custom-tags';\n\n/**\n * Key value for Message Template custom dimension in AppInsights events\n */\nexport const messageTemplateKey: string = 'message-template';\n\n/**\n * Key value for Module ID custom dimension in AppInsights events\n */\nexport const moduleIdKey: string = 'Module ID';\n\n/**\n * Key value for Module Type custom dimension in AppInsights events\n */\nexport const moduleTypeKey: string = 'Module Type';\n\n/**\n * Key value for Page Type custom dimension in AppInsights events\n */\nexport const pageTypeKey: string = 'Page Type';\n\n/**\n * Key value for Page Type custom dimension in AppInsights events\n */\nexport const cmsPageIdKey: string = 'CMS Page ID';\n\n/**\n * Key value for Channel id custom dimension in AppInsights events\n */\nexport const channelIdKey: string = 'Channel ID';\n\n/**\n * Builds custom properties list from telemetry context and message template arguments\n * @param context Telemetry context from which the properties will be pulled\n * @param placeholders List of placeholders in messageTemplate along with position in string\n * @param values Arguments to replace placeholders\n */\nexport function buildPropertiesList(\n context: ITelemetryContext,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n placeholders: Map,\n customTags?: string[]\n): IDictionary {\n // Start properties list with those from telemetry context\n const properties: IDictionary = getPropertiesFromContext(context);\n\n // Add message template arguments as custom properties\n placeholders.forEach((value, key) => {\n // Get filtered data out of placeholder if it is a privacy object\n const data = getFilteredData(value);\n\n // Add placeholder to list of custom parameters\n properties[`param_${key}`] = safeStringify(data);\n });\n\n // Add custom tags to properties\n if (customTags) {\n properties[customTagsKey] = [].join.apply(customTags, [', ']);\n }\n\n return properties;\n}\n\n/**\n * Converts the given telemetry context into AppInsights readable properties\n * @param context Telemetry context from which the properties will be pulled\n */\nexport function getPropertiesFromContext(context: ITelemetryContext): IDictionary {\n const properties: IDictionary = {};\n // Only add context to properties if they have been set (non-empty string)\n if (context.moduleContext.moduleId) {\n properties[moduleIdKey] = context.moduleContext.moduleId;\n }\n if (context.moduleContext.moduleType) {\n properties[moduleTypeKey] = context.moduleContext.moduleType;\n }\n if (context.requestContext.pageId) {\n properties[cmsPageIdKey] = context.requestContext.pageId;\n }\n if (context.requestContext.pageType) {\n properties[pageTypeKey] = context.requestContext.pageType;\n }\n if (context.requestContext.channelId) {\n properties[channelIdKey] = context.requestContext.channelId;\n }\n\n return properties;\n}\n\n/**\n * Given a severity level and if debug flag is set or not, this method will return true if we should bypass logs\n * @param severityLevel - SeverityLevel enum\n * @param isDebug - boolean\n */\nexport function shouldSkipLogging(severityLevel: SeverityLevel | undefined, isDebug: boolean): boolean {\n // Do not send events marked as None or Debug to AppInsights\n // Do not send events marked as trace to AppInsights, if debug mode is not on\n\n return severityLevel === undefined || (!isDebug && severityLevel === 0);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ApplicationInsights,\n IEventTelemetry,\n ITraceTelemetry,\n IExceptionTelemetry,\n IPageViewTelemetry,\n IDependencyTelemetry\n} from '@microsoft/applicationinsights-web';\nimport { ITelemetryContext, ITraceLogger, ITraceLoggerParams, LogLevel } from '../interfaces';\nimport { IDictionary } from '../interfaces/IDictionary';\nimport { ITrackDependency } from '../interfaces/ITrackDependency';\nimport { TelemetryBase } from '../telemetry';\nimport { buildPropertiesList, getPropertiesFromContext, messageTemplateKey, shouldSkipLogging } from './app-insights-helper';\nimport { safeStringify } from './logging-helper';\n\nexport enum LoggerType {\n MSFTApplicationInsightsLogger,\n OperationalApplicationInsightsLogger\n}\n\n/**\n * Client-side logger that sends messages to Application Insights\n */\nexport class ClientAppInsightsJSLogger implements ITraceLogger {\n /**\n * Mapping between telemetry framework LogLevel and AppInsights JS Severity Levels\n */\n private static _severityLevelMapping: Map = new Map([\n [LogLevel.Trace, 0],\n [LogLevel.Information, 1],\n [LogLevel.Warning, 2],\n [LogLevel.Error, 3],\n [LogLevel.Critical, 4]\n ]);\n\n private options: ITraceLoggerParams = {};\n private AppInsights: ApplicationInsights;\n private loggertype: LoggerType;\n\n /**\n * Creates a new instance of AppInsights Logger\n * @param loggerType The type of instance of Application Insights\n * @param instrumentationKey The instrumentation key for the Application Insights instance\n */\n constructor(loggerType: LoggerType, instrumentationKey: string) {\n const eventLog: IEventTelemetry = {\n name: 'Client version of Application Insights registered'\n };\n\n this.loggertype = loggerType;\n\n // @ts-ignore -- fetching globally available properties\n const loggerProps = window.___initialData___.requestContext;\n\n this.AppInsights = new ApplicationInsights({\n config: {\n instrumentationKey: instrumentationKey,\n enableCorsCorrelation: true,\n // @ts-ignore -- fetching globally available properties\n correlationHeaderDomains: window._loggerProps[0].correlationHeaderDomains\n }\n });\n\n this.AppInsights.loadAppInsights();\n\n if (this.loggertype === LoggerType.MSFTApplicationInsightsLogger) {\n this.addTelemetryInitializer(loggerProps);\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // @ts-ignore -- globally providing the application insights trackException instance for logging\n window['_aiTrackExceptionInstance'] = exceptionLog => _this.AppInsights.trackException(exceptionLog);\n }\n\n if (this.loggertype === LoggerType.OperationalApplicationInsightsLogger) {\n this.operationalInsightsEventFilter();\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _this = this;\n // @ts-ignore -- globally providing the operational insights trackException instance for logging\n window['_oiTrackExceptionInstance'] = exceptionLog => _this.AppInsights.trackException(exceptionLog);\n }\n\n this.AppInsights.trackPageView();\n this.AppInsights.trackEvent(eventLog);\n\n // empty error queue if present\n // @ts-ignore\n const errors = window._globalErrors;\n if (errors && errors.length) {\n for (let i = 0; i < errors.length; i++) {\n this.AppInsights.trackException(errors[i]);\n }\n }\n }\n\n public initialize(options: ITraceLoggerParams): void {\n this.options = options;\n }\n\n /**\n * @internal\n * Logs a trace message to AppInsights\n * @param logLevel LogLevel of the message\n * @param context Telemetry context to add to log\n * @param messageTemplate Structured log formatted string\n * @param placeholders List of placeholders in messageTemplate along with position in string\n * @param values Arguments to replace placeholders\n * @param customTags Array of strings to attach to log\n */\n public sendLog(\n logLevel: LogLevel,\n context: ITelemetryContext,\n messageTemplate: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n placeholders: Map,\n customTags?: string[],\n exception?: Error\n ): void {\n // Convert ITelemetry LogLevel to corresponding AppInsights SeverityLevel when logging\n const severityLevel = ClientAppInsightsJSLogger._severityLevelMapping.get(logLevel);\n\n if (shouldSkipLogging(severityLevel, this.options.isDebug)) {\n return;\n }\n\n // Build properties list with telemetry context and message template arguments\n const properties: IDictionary = buildPropertiesList(context, placeholders, customTags);\n\n if (exception === undefined) {\n // Send log to AppInsights as trace event\n const traceLog: ITraceTelemetry = {\n message: messageTemplate,\n severityLevel: severityLevel\n };\n this.AppInsights.trackTrace(traceLog, properties);\n } else {\n // Attach message template as custom property\n properties[messageTemplateKey] = messageTemplate;\n\n const exceptionLog: IExceptionTelemetry = {\n exception: exception,\n properties: properties,\n severityLevel: severityLevel\n };\n // Send log to AppInsights as exception event\n this.AppInsights.trackException(exceptionLog);\n }\n }\n\n /**\n * @internal\n * Logs a trace message to AppInsights\n * @param logLevel Severity level of the log\n * @param message String to log\n * @param args Any additional objects to log\n * @param context Additional properties to add to the log\n */\n public log(logLevel: LogLevel, message: string, args: unknown[], context: ITelemetryContext): void {\n // Convert ITelemetry LogLevel to corresponding AppInsights SeverityLevel when logging\n const severityLevel = ClientAppInsightsJSLogger._severityLevelMapping.get(logLevel);\n\n if (shouldSkipLogging(severityLevel, this.options.isDebug)) {\n return;\n }\n\n // Append any extra arguments to the message\n let fullMessage = message;\n args.forEach(arg => {\n fullMessage = fullMessage.concat('\\n', safeStringify(arg));\n });\n\n const traceLog: ITraceTelemetry = {\n message: `${logLevel}: ${fullMessage}`,\n properties: getPropertiesFromContext(context)\n };\n this.AppInsights.trackTrace(traceLog);\n }\n /**\n * @internal\n * Logs an error object to AppInsights as an exception\n * @param error Error object to log\n * @param context Additional properties to add to the log\n */\n public exception(error: Error, context: ITelemetryContext): void {\n const exceptionLog: IExceptionTelemetry = {\n exception: error,\n properties: getPropertiesFromContext(context)\n };\n this.AppInsights.trackException(exceptionLog);\n }\n /**\n * @internal\n * No-op - not tracking client side metrics\n * @param name name of the metric\n * @param value value of the metric\n */\n public trackMetric(name: string, value: number, context: ITelemetryContext): void {\n // noop\n }\n /**\n * Track a structured event with app insights\n *\n * @template TProperties interface for properties\n * @template TMeasurements interface for measurements to go with the event\n * @param {ITrackEventOptions} trackEventOptions event options\n */\n public trackEvent(\n name: string,\n properties?: TProperties,\n measurements?: TMeasurements,\n context?: ITelemetryContext\n ): void {\n const eventLog: IEventTelemetry = {\n name: name,\n properties: >(properties),\n measurements: >(measurements)\n };\n this.AppInsights.trackEvent(eventLog);\n }\n\n /**\n * Track a page view\n *\n * @param {string} name\n * @param {string} [url]\n */\n public trackPageView(name: string, url?: string): void {\n const pageViewLog: IPageViewTelemetry = {\n name: name,\n uri: url\n };\n this.AppInsights.trackPageView(pageViewLog);\n }\n\n /**\n * Track request\n * @param options request options\n */\n public trackDependency(options: ITrackDependency): void {\n const id = TelemetryBase.generateGuid();\n\n const dependencyLog: IDependencyTelemetry = {\n id: id,\n type: options.method,\n target: `https://${options.target}${options.name}` || '',\n name: options.name || '',\n duration: options.duration,\n success: options.success,\n responseCode: options.resultCode,\n properties: options.properties\n };\n this.AppInsights.trackDependencyData(dependencyLog);\n }\n\n private operationalInsightsEventFilter() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const telemetryInitializer = (envelope: any) => {\n const MessageString = 'MessageData';\n const EventString = 'EventData';\n const RemoteDependencyDataString = 'RemoteDependencyData';\n\n if (envelope) {\n const baseType = envelope.baseType;\n if (baseType === MessageString || baseType === EventString) {\n return false;\n }\n // All retail server calls will have requestId set. if no requestId set, drop it\n if (baseType === RemoteDependencyDataString && !envelope.baseData.properties.requestId) {\n return false;\n }\n\n return true;\n }\n };\n\n this.AppInsights.addTelemetryInitializer(telemetryInitializer);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private addTelemetryInitializer(loggerProps: any) {\n const IS_DEV = process.env.NODE_ENV === 'development';\n const sdkVersion = loggerProps._debug.commerceSDKVersion;\n const sskVersion = loggerProps._debug.commerceSSKVersion || 'XX';\n const retailProxyVersion = loggerProps._debug.retailProxyVersion || 'XX';\n let environmentId = 'Development';\n let commerceCoreEnvironmentId = 'Development';\n\n if (!IS_DEV) {\n environmentId = loggerProps.telemetrySettings.environmentId;\n commerceCoreEnvironmentId = loggerProps.telemetrySettings.commerceCoreEnvId || 'CommerceCore_EnvironmentId_Missing';\n }\n\n const pageViewDataString = 'PageviewData';\n const pageviewPerformanceDataString = 'PageviewPerformanceData';\n const remoteDependencyDataString = 'RemoteDependencyData';\n const exceptionDataString = 'ExceptionData';\n const censoredString = 'CENSORED';\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const telemetryInitializer = (envelope: any) => {\n const telemetryItem = envelope.baseData;\n telemetryItem.properties = telemetryItem.properties || {};\n\n if (envelope) {\n const baseType = envelope.baseType;\n // we add more client performance metrics to PageviewPerformanceData\n if (baseType === pageviewPerformanceDataString) {\n const performanceNavigationTimming = window && window.performance.getEntriesByType('navigation');\n const performancePaintTiming = window.performance.getEntriesByType('paint');\n // add performance metrics\n if (performanceNavigationTimming && performanceNavigationTimming.length > 0) {\n const performanceNavigationTimmingData = performanceNavigationTimming[0];\n const duration = performanceNavigationTimmingData.duration;\n // @ts-ignore -- Content Load Event Start\n const domContentLoadedEventStart = performanceNavigationTimmingData.domContentLoadedEventStart;\n // @ts-ignore -- Content Load Event End\n const domContentLoadedEventEnd = performanceNavigationTimmingData.domContentLoadedEventEnd;\n // @ts-ignore\n const domInteractive = performanceNavigationTimmingData.domInteractive;\n // @ts-ignore -- performance Navigation complete duration\n const domComplete = performanceNavigationTimmingData.domComplete;\n duration ? (telemetryItem.properties.duration = duration) : null;\n domContentLoadedEventStart && domContentLoadedEventEnd\n ? (telemetryItem.properties.domContentLoadedEvent = domContentLoadedEventEnd - domContentLoadedEventStart)\n : null;\n domInteractive ? (telemetryItem.properties.domInteractive = domInteractive) : null;\n domComplete ? (telemetryItem.properties.domComplete = domComplete) : null;\n }\n // add painting perf metrics\n if (performancePaintTiming && performancePaintTiming.length > 0) {\n performancePaintTiming.forEach(paintTiming => {\n telemetryItem.properties[paintTiming.name] = paintTiming.startTime;\n });\n }\n }\n\n // To check the telemetry item’s type\n if (baseType === pageViewDataString || baseType === pageviewPerformanceDataString) {\n // this statement removes url from all page view documents\n telemetryItem.uri = `URL ${censoredString}`;\n // @ts-ignore\n telemetryItem.properties['ExperimentVariants'] = window._loggerProps[0].expVariantInfo;\n }\n // All retail server calls will have requestId set. if no requestId set, censor the strings\n if (baseType === remoteDependencyDataString && !telemetryItem.properties.requestId) {\n return false;\n }\n\n if (envelope.tags) {\n if (\n baseType === exceptionDataString ||\n baseType === pageviewPerformanceDataString ||\n baseType === pageViewDataString ||\n baseType === remoteDependencyDataString\n ) {\n envelope.tags['ai.operation.name'] = censoredString;\n }\n }\n }\n\n const props = telemetryItem.properties;\n props['Environment id'] = environmentId;\n props['Commerce core environment id'] = commerceCoreEnvironmentId;\n props['SDK Version'] = sdkVersion;\n props['RetailProxy Version'] = retailProxyVersion;\n // @ts-ignore\n props['Node Process ID'] = window._loggerProps[0].processID;\n props['SSK Version'] = sskVersion;\n props['Server operation id'] = loggerProps.telemetrySettings.operationId;\n // @ts-ignore\n props['DA SDK Version'] = window && window.oneDSWeb && window.oneDSWeb.config && window.oneDSWeb.config._daSdkVer;\n };\n\n this.AppInsights.addTelemetryInitializer(telemetryInitializer);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ITelemetryContext, ITraceLogger, ITraceLoggerParams, LogLevel } from '../interfaces';\nimport { ITrackDependency } from '../interfaces/ITrackDependency';\n/**\n * Default console logger\n * This is a default logger that just logs messages directly to the console\n */\nclass GenericConsoleLogger implements ITraceLogger {\n private options: ITraceLoggerParams = {};\n\n public initialize(options: ITraceLoggerParams): void {\n this.options = options;\n }\n\n /**\n * @internal\n * Logs a message to the console, prefixed with custom tags, and with arguments following\n * @param logLevel LogLevel of the message\n * @param context Telemetry context to add to log\n * @param messageTemplate Structured log formatted string\n * @param placeholders List of placeholders in messageTemplate along with position in string\n * @param values Arguments to replace placeholders\n * @param customTags Array of strings to attach to log\n */\n public sendLog(\n logLevel: LogLevel,\n context: ITelemetryContext,\n messageTemplate: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n placeholders: Map,\n customTags?: string[],\n exception?: Error\n ): void {\n // Determine console output method based on log level\n let printFunction: Function;\n switch (logLevel) {\n case LogLevel.Critical:\n case LogLevel.Error:\n printFunction = console.error;\n break;\n case LogLevel.Warning:\n printFunction = console.warn;\n break;\n case LogLevel.Information:\n case LogLevel.Debug:\n case LogLevel.Trace:\n // Don't print debug and info messages to console unless in debug mode\n if (!this.options.isDebug) {\n return;\n }\n default:\n printFunction = console.log;\n }\n\n // Output tags and message template\n let tagsString = '';\n if (customTags !== undefined) {\n customTags.forEach(tag => {\n tagsString += `[${tag}]`;\n });\n }\n tagsString && printFunction(tagsString);\n let message = messageTemplate;\n\n // Output arguments\n for (const [key, value] of placeholders.entries()) {\n let messageValue;\n // If Dynamics privacy object only print data value, else print object\n if (value.__isDynamicsPrivacy) {\n messageValue = value.data;\n } else {\n messageValue = value;\n }\n if (messageValue.toString() === '[object Object]') {\n messageValue = JSON.stringify(messageValue, null, 2);\n }\n message = message.replace(new RegExp(`{${key}}`, 'g'), messageValue);\n }\n printFunction(`[${logLevel}] ${message}`);\n\n // Print exception if present\n if (exception !== undefined) {\n printFunction(exception.stack);\n }\n }\n\n /**\n * @internal\n * Logs a message to the console based on LogLevel\n */\n public log(logLevel: LogLevel, message: string, args: unknown[], context: ITelemetryContext): void {\n switch (logLevel) {\n case LogLevel.Information:\n this.options.isInfo && this._printMessages(console.log, message, args);\n break;\n case LogLevel.Debug:\n this.options.isDebug && this._printMessages(console.log, message, args);\n break;\n case LogLevel.Trace:\n this._printMessages(console.log, message, args);\n break;\n case LogLevel.Warning:\n this._printMessages(console.warn, message, args);\n break;\n case LogLevel.Critical:\n case LogLevel.Error:\n this._printMessages(console.error, message, args);\n break;\n default:\n }\n }\n\n /**\n * @internal\n * Logs an exception object to the console\n */\n public exception(error: Error, context: ITelemetryContext): void {\n if (error) {\n console.error(error.stack);\n }\n }\n\n /**\n * @internal\n * Tracks a metric\n * @param name Metric name\n * @param value Metric value\n */\n public trackMetric(name: string, value: number, context: ITelemetryContext): void {\n console.log(`${name}: ${value}`);\n }\n\n public trackEvent(\n name: string,\n properties?: TProperties,\n measurements?: TMeasurements,\n context?: ITelemetryContext\n ): void {\n const event = {\n name: name,\n time: new Date(),\n properties,\n measurements\n };\n this.log(LogLevel.Information, name, [event], context);\n }\n\n /**\n * Track a page view\n *\n * @param {string} name\n * @param {string} [url]\n */\n public trackPageView(name: string, url?: string): void {\n this.trackEvent('trackPageView', { url });\n }\n\n /**\n * Track request\n * @param options the request options\n */\n public trackDependency(options: ITrackDependency): void {\n this.trackEvent('trackRequest', options);\n }\n\n /**\n * Prints the given message and arguments to the console via the given function\n * @param printFunction Function to use to print\n * @param message String to print\n * @param args Additional args to print\n */\n private _printMessages(printFunction: Function, message: string, args: unknown[]): void {\n printFunction(message);\n args.forEach(arg => {\n printFunction(arg);\n });\n }\n}\n\nconst singletonLoggerInstance = new GenericConsoleLogger();\nexport { singletonLoggerInstance as GenericConsoleLogger };\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport const EXCEPTION_CURRENCY_FORMATTER = 'Unable to determine currency format';\nexport const NAME_CURRENCY_FORMATTER_EXCEPTION = 'CurrencyFormatterException';\nexport const EXCEPTION_LOAD_DATA_EXCEPTION = 'Load data exception';\nexport const EXCEPTION_PARSE_ISSUE = 'Content not parsed correctly';\nexport const EXCEPTION_GENERIC_EXPRESS = 'Express Caught an exception';\nexport const EXCEPTION_INVALID_URL = 'Invalid URL';\nexport const EXCEPTION_HTTP_TIMEOUT = 'Request timed out';\nexport const EXCEPTION_PAGECONFIG = 'Error while attempting to get page config';\nexport const EXCEPTION_PAGERENDERING = 'Error in page rendering.';\nexport const EXCEPTION_NO1RFRESPONSE = 'Unable to retrieve Server page response';\nexport const EXCEPTION_UNREGISTEREDMODULEID = 'Module id: $0, type: $1 is not registered';\nexport const EXCEPTION_ERROR_CLIENT_BOUNDARY = 'Error in client error boundary';\nexport const EXCEPTION_MISSINGMODULECONFIG = 'Module config is missing for module with id $0 type $1';\nexport const EXCEPTION_NOMODULEBINDER = 'Cannot get module binder for $0';\nexport const EXCEPTION_MODULERENDERFAIL = 'Failed to render module with id $0';\nexport const EXCEPTION_CLIENT_CACHE_HYDRATE = 'Error while hydrating the client-side cache $0';\nexport const EXCEPTION_LOADDATA_ACTION = 'Threw error while processing action {actionName}';\nexport const EXCEPTION_LOADDATA_ACTION_0 = 'Threw error while processing action {actionName} for module {moduleName}';\nexport const EXCEPTION_LOADDATA_ACTION_1 = 'Issue with data action';\nexport const EXCEPTION_LOADDATA_ACTION_2 = 'Issue with data action registered at {actionPath} for module {moduleName}';\nexport const EXCEPTION_LOADDATA_ACTION_3 = 'Encountered an error while processing ajax data action $0';\nexport const EXCEPTION_API_ROUTE1 = 'missing id parameter';\nexport const EXCEPTION_API_ROUTE2 = 'invalid action id parameter passed';\nexport const EXCEPTION_API_ROUTE3 = 'error occurred while executing the given data action';\nexport const EXCEPTION_DATAACTION_EXECUTION = 'Error encountered with execution of action: {actionError}';\nexport const EXCEPTION_NO_MOCKS_FOUND = 'No mock files found with mock paths';\nexport const EXCEPTION_NOTYPEQUERY = 'Please specify type query string. Eg: http://localhost:3000/modules?type=hero:hero1,hero:hero2';\nexport const EXCEPTION_JSONPARSEFAILED = 'JSON Parsing failed';\nexport const EXCEPTION_BADCONFIGPASSED = 'Malformed config $0 passed';\nexport const EXCEPTION_BADPAGECONTEXT = `PageContext can't be created with null or empty page data`;\nexport const EXCEPTION_INITIALDATAFAIL = 'Backend state not found on `window.___initialData___`. Unable to initialize client code.';\nexport const EXCEPTION_EXPECTED501 = 'expected to throw 501: $0';\nexport const EXCEPTION_PARSECONFIGVALUE = 'Failed to parse the given config value';\nexport const EXCEPTION_PRODUCT_LIST_ACTION = 'Error while running productList hydration action';\nexport const EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION = 'Error while hydrating productList on client';\nexport const EXCEPTION_LINK_ACTION = 'Error while running link hydration action';\nexport const INVALID_PRODUCT_LIST_TYPE = 'An invalid productList type was found $0';\nexport const NAME_CULTURE_INFO_FORMATTER_EXCEPTION = 'CultureInfoFormatterException';\nexport const EXCEPTION_RS_INTERCEPT = `Could not intercept RS request`;\n\nexport const EXCEPTION_INVALID_ARGUMENT = (functionName: string, invalidVariable: string): string => {\n return `Invalid input. Argument ${invalidVariable} to ${functionName} is invalid or undefined.`;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport const MESSAGE_SERVER_ENDPOINT = 'Server Endpoint: {serverEndpoint}';\nexport const MESSAGE_GETTING_PAGE_RESPONSE = 'Getting Page Response for: {pageUrl}';\nexport const MESSAGE_CREATE_INPUT_LOADDATA = 'Created input for data actions $0 in $1-$2';\nexport const MESSAGE_NO_MOCK_FOUND = 'No mock path found from query';\nexport const MESSAGE_NO_SERVER_ENDPOINT_SET =\n 'No server endpoint provided in .env file to lookup url. Please use a page mock or set MSDyn365_HOST in the .env file.';\nexport const MESSAGE_OVERRIDE_MODULE_CONFIG = 'Overriding module data property $0 with $1 for module $2';\nexport const MESSAGE_NEWCHILDPROP = 'Adding new child property $0 in $1 for module $2';\nexport const MESSAGE_INVALIDJSONPATH = 'Invalid JSON path, could not create new property in $0 for module $1';\nexport const MESSAGE_MULTIPLE_REND_CONTEXTS = 'Multiple RenderingContexts found across module mocks, only the first will be used';\nexport const MESSAGE_MOCKSNOTFOUND = 'Unable to find module mocks. Please ensure module mocks exist for the following mocks $0.';\nexport const MESSAGE_RS_CALL_ARGUMENTS = `Server-side retail call [m:{method}; e:{endPoint};v:{vector};r:{requestId}]`;\nexport const MESSAGE_DEBUG_MODULE_SSR_ERROR =\n 'To debug the error further, please add debug=true query param to the page url to get more verbose debug information on the page.';\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport const MESSAGE_CLIENT_RENDER_ERROR = 'Backend state not found on `window.___initialData___`. Unable to initialize client code.';\n","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n"],"names":["GetAzureblobstorageSecureurlInput","constructor","context","orderId","documentName","uniqueId","getCacheKey","getCacheObjectType","dataCacheType","this","Msdyn365","action","async","input","ctx","getDocumentBlobSecureUrlAsync","id","GetDecryptionKeysInput","_Msdyn365$msdyn365Com","_Msdyn365$msdyn365Com2","_Msdyn365$msdyn365Com3","encryptionEnable","secretManager","getSecretValue","requestContext","apiSettings","baseUrl","console","log","encryptionAesKey","encryptionAesIV","value","cookie","Cookies","currentTime","Date","storedCurrentTime","get","storedTime","getTime","isTimeToUpdate","currentTimeString","toISOString","set","updateKeys","EncryptionAesKey","EncryptionAesIV","updatedCurrentTime","lastUpdateTime","EncryptionEnable","remove","args","ListPageState","activeFilters","activeProducts","sortingCritera","currentPageNumber","refiners","pageSize","pageType","featureProduct","productPrices","__decorate","observable","ListPageStateInput","listPageStateAction","createListPageInput","inputData","createObservableDataAction","e","n","t","i","r","a","o","addEventListener","persisted","timeStamp","c","window","performance","getEntriesByType","u","activationStart","f","document","prerendering","wasDiscarded","type","replace","name","rating","delta","entries","concat","now","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","d","l","requestAnimationFrame","p","visibilityState","v","m","h","g","T","y","removeEventListener","E","setTimeout","C","L","w","forEach","disconnect","startTime","firstHiddenTime","max","push","reportAllChanges","b","A","passive","capture","I","P","k","F","entryType","target","cancelable","processingStart","M","D","B","R","H","N","interactionId","min","O","interactionCount","q","durationThreshold","j","_","z","G","J","K","length","duration","latency","sort","splice","U","V","X","Y","readyState","Z","responseStart","TTLCache","options","removalThresholdInMs","intervalForRemovalInMs","_cache","Map","key","onRemoveCallback","clear","_cleanCache","keys","delete","RequestVectorizer","next","bind","requestId","nextValue","undefined","SEP","RequestVectorizerInstance","regexGetRoundBraces","toLowerCaseDict","objectDictionary","reduce","prevValue","current","_objectSpread","toLocaleLowerCase","ttlRequestCache","RSResponseInterceptor","response","requestCache","activityId","headers","config","lowercaseHeaders","requestid","activityid","properties","elapsedTime","StaticTelemetry","stopTimer","status","request","parsedUrl","url","parse","baseURL","trackDependency","method","toUpperCase","resultCode","success","hostname","empty","_isEmpty2","data","ahs","authTokenSize","dependencyName","RSRequestInterceptor","requestHeaders","caseInsensitiveHeaderMap","oun","apiEndPoint","pathname","replaceString","requestIdVector","authorizationHeader","toString","authorizationHeaderLength","toLowerCase","indexOf","authArray","split","caseInsensitiveRequestIdHeaderName","currentRequestId","startTimer","rv","replaceIdentifiers","isUrlLocalizationEnabled","parameterizeFeatureFlags","msdyn365Commerce","platformSettings","enableUrlLocalization","getPageTypeContextByIdAction","pageTypeContext","ProductLinkInput","productId","product","getByIdAsync","callerContext","channelId","Name","Error","RecordId","err","telemetry","error","catalogid","checkVersionForFeature","getCatalogIdForSdk","getCategoriesAsync","categories","rootCategory","find","category","categoryId","localName","getFriendlyName","locale","NameTranslations","rootCategoryWithNeutralizedName","NeutralizedName","slug","getCategorySlug","parameterize","currentCategory","ParentCategory","parentId","parentCategory","parentCategoryWithLocalizedName","getParameterizeFeatureFlagsWithRequestContext","Slug","catch","searchForComplexType","obj","moduleId","propertyToMapInConfig","promisesArray","Array","isArray","children","linkObject","_context$requestConte","destinationUrl","requestUrl","features","disable_hydrator_link_locale","_context$requestConte2","queryParams","query","featureContext","add_external_link_domain","skip_external_link_catalogid","appendQueryParams","routeContext","catalogId","getUrlSync","EXCEPTION_LINK_ACTION","exception","CategoryLinkInput","hydrateLink","hydrateProductList","processComplexDataTypes","lazyloadAllDataActions","processType","pageSlots","processComplexDataTypesAsync","all","lazyLoadAllDataActions","lazyLoadAllModuleQueryString","clientRenderAllModuleQueryString","lazyLoadModuleFeature","params","isEditor","currModule","currModuleConfig","clientRenderConfigSwitch","hasOwnProperty","runAllActionsInQueue","PageContext","pageData","resourceManager","_moduleList","_themeModulesList","_clientPlatformSetting","_environmentVariable","_versionDependentFeatureInfo","setEnvironmentVariableForCLient","environment","getAllEnvironmentVariable","isEmptyOrNullObject","EXCEPTION_BADPAGECONTEXT","user","c1AccessToken","pageRoot","getVersionDependentFeatureInfo","_putRequestedModulesInCacheOnServer","_initThemeModulesList","moduleList","resultArray","item","index","chunkIndex","Number","_constructModuleMetaData","_requestContext$featu","loadData_optimization","map","moduleMetaData","modules","setAppCacheEntries","appCacheEntries","put","typeName","CACHE_SETTING","setPlatformSettingsForClient","clientSideDataActionTimeoutInMs","shouldUseInstanceCache","disableActionRegOptimization","imageFallbackOptimize","enableModuleEntryPoints","isModuleEntryPointsEnabled","enableImageOptimizeEvents","enableModuleCssOptimization","clientTimeoutMapInMs","secondaryInstrumentationKey","getPlatformSettingsForClient","deferred","getValue","MODULE_DEFERRED_KEY","getResourceTextForPlaceholderPreview","resourceItem","MODULE_RESOURCES_KEY","clickToConfigure","markModuleAsDeferred","internalCache","EXCEPTION_INITIALDATAFAIL","cacheType","cacheBasedOnType","cachekey","_pageData$requestCont","cacheItem","_rehydrateAsyncResults","debug","MODULE_CACHE_KEY","moduleItem","dataActions","_populateDataActionResultFromCache","cacheObjectType","cacheKey","cachedValueBasedOnInput","isAsyncResult","transaction","promiseResult","result","_resolveCacheRef","cacheRefInfo","filter","Boolean","_this$requestContext$","themeName","theme","slots","moduleInstance","MODULE_CONFIG_KEY","MODULE_CONFIG_ERRORS_KEY","configErrors","MODULE_DATA_KEY","MODULE_ACTION_KEY","MSDYN365_WYSIWYG_DISABLED_PROPS","MSDYN365_WYSIWYG_CANADDMODULE","getModuleResources","enableAuthoringRemoveAndAddModule","getAllModuleBinder","moduleBinder","getParentModuleName","_type","metadata","AsyncResult","reject","actions","resources","actionMetaDataList","toJS","entity","inputs","isObservableArray","isAuthoringEditEnabled","getWrappedProxyObject","disabledProperties","slotsForAddModule","SessionStorageContext","_cookieContext","getDataFromStorage","setDataInStorage","getCheckoutCartData","getCheckoutCartKey","setCheckoutCartData","removeDataFromStorage","removeCheckoutCartData","sessionStorage","startsWith","checkoutCartKeyPrefix","isBrowser","objString","getItem","JSON","setItem","stringify","removeItem","checkoutCartCookie","getCheckoutCartCookie","readCookie","cleanValue","substr","cleanupCookieValue","doNotParse","isParsingCookie","__assign","arguments","prototype","call","apply","cookies","_this","changeListeners","HAS_DOCUMENT_COOKIE","parseCookies","_updateBrowserValues","parseOptions","_emitChange","getAll","name_1","_a","finalOptions","expires","maxAge","addChangeListener","callback","removeChangeListener","idx","UserConsentCookieName","CookieContext","cookieString","_setCookieList","_serverCookieList","_clientCookieList","cookieName","isEssential","isConsentGiven","cookieValue","_cookies","sameSiteRequiredFlag","_options","sameSiteRequired","cookieOptionsWithDefaults","path","secure","sameSite","filteredOptions","clientCookieString","createCookieString","serverCookieString","getCartCookie","CartCookie","getTargetIdCookie","setCartCookie","cart","isAuthenticated","setAlways","prefix","cartCookieOptions","Id","existingCart","cartExpirationInDays","setCheckoutCartCookie","checkoutCartCookieOptions","existingCookie","removeCheckoutCartCookie","getAccountSelectionCookie","accountSelectionCookie","setAccountSelectionCookie","isOBORequest","customerAccountNumber","accountSelectionCookieOptions","removeAccountSelectionCookie","isConsentRequired","setConsentCookie","setCookieFunction","dispatchEvent","Event","USER_CONSENT_GIVEN_EVENT","deleteConsentCookie","optionsString","_appendCookieOptions","cookieOptions","domain","httpOnly","join","req","REQUEST_CONTEXT_PROPERTIES_FOR_SEG","axios","use","RSErrorResponseHandler","statusCode","CLIENT_HYDRATE_CACHE_KEY","CLIENT_HYDRATE_KEY","CLIENT_HYDRATE_TYPE","resetClientHydrateContext","del","activateExperiments","experimentationConnector","experimentation","experiments","userId","activeExperiments","experimentInfo","experimentsWithoutModuleId","experimentsWithModuleId","_partition2","provider","activateExperiment","Type","device","experimentMap","experimentObserver","IntersectionObserver","observer","entry","isIntersecting","intersectionRatio","activatedExpId","getAttribute","_msdyn365Commerce$exp","unobserve","threshold","currentExperiment","querySelector","experimentId","hydrateClient","pageContext","coreContext","body","props","defaultPageConfig","disable_moduleConfig_optimize","ReactDOM","React","CoreContext","Provider","SafeRenderModule","store","root","getElementById","LAYOUT_MOUNT_POINT","isDebug","initAuthoringHelper","actionContext","moduleTelemetry","themeSettings","___initialData___","authoringHelper","AuthoringToolsHelper","_msdyn365","dpEvent","detail","updateDisabledProperties","clientRender","_msdyn365Commerce$exp2","_requestContext$chann","_requestContext$app","storeData","MESSAGE_CLIENT_RENDER_ERROR","removePlaceholderModules","modulesDictionary","slot","module","disableCookieCompliance","app","platform","cartSessionExpiration","urlSearchParams","URLSearchParams","location","search","fromEntries","param","telemetrySettings","operationalInsightsInstrumentationKey","freeze","URL","getRequestContext","requestFormData","routes","checkout","requestContextUrl","isCheckoutRoute","_requestContext$query","pv","isPaymentVerification","appCache","getAppCache","__msdyn365__","oneDSWeb","expListener","listener","appInsightsInstrumentationKey","instrumentationKey","msftClientAppInsightsJSLogger","ClientAppInsightsJSLogger","LoggerType","MSFTApplicationInsightsLogger","operationalClientAppInsightsJSLogger","OperationalApplicationInsightsLogger","internalTelemetry","enableDataAnalytics","registerWebAnalyticsPlugin","registerAttributeRenderer","expAttributeRenderer","registerTraceLogger","traceLogger","setTelemetryRequestContext","siteId","channel","urlTokens","pageId","correlationId","Telemetry","generateGuid","logWebVitals","targetId","tuid","resolveMissingSegmentsOnClient","missingSegments","canonicalDomain","neededMissingSegments","providerId","segmentProvider","segmentIds","segmentRequestId","missingSegmentResolvingUrl","segRequestContext","property","requestContextObject","disable_segment_requestContext","segmentProviderList","LogLevel","registerExpLogger","GenericConsoleLogger","contentSecurityPolicy","disableContentSecurityPolicy","enableReportOnlyMode","randomNumberGenerator","cspReport","blockedURI","documentURI","originalPolicy","violatedDirective","CONTENT_SECURITY_POLICY_ERROR","customTags","putRequestedModulesInCacheOnClient","EXCEPTION_CLIENT_CACHE_HYDRATE","finally","_requestContext$featu2","_requestContext$param","_requestContext$featu3","timeSliceLongJSTask","ActionContext","spawnChildOnExecute","cache","cultureFormatter","CultureInfoFormatter","getCurrencyCodeFromContext","allModules","optimizedGetAllModules","allowDispatchEvent","enable_verbose_logs","shouldOptimizeHydrate","optimizeClientHydrate","event","CLIENT_RENDER_START_EVENT","trackEvent","EVENT_CLIENT_RENDER_START","initialPromise","LAZYLOAD_ALL_SWITCH","lazyload_all","EXCEPTION_PRODUCT_LIST_CLIENTSIDE_HYDRATION","setupClientHydrateFlag","loadData","EVENT_CLIENT_RENDER_STOP","time","EXCEPTION_LOAD_DATA_EXCEPTION","_document$getElementB","setClientHydrate","pageName","telemetryPageName","setAttribute","logEvent","TelemetryEvent","PageView","title","deprecatedEvent","DEPRECATED_CLIENT_RENDER_COMPLETE_EVENT","CLIENT_RENDER_COMPLETE_EVENT","setClientHydrateContext","_requestContext$param2","_requestContext$featu4","_requestContext$featu5","_document$getElementB2","modulesRenderedOnServer","isLazyRenderModuleEnabled","_pageContext$requestC","CLIENT_ENTRY_POINTS_TYPE","eventName","hadRecentInput","takeRecords","onCLS","metric","EVENT_WEB_VITALS_CLS","onFCP","EVENT_WEB_VITALS_FCP","onFID","EVENT_WEB_VITALS_FID","onLCP","EVENT_WEB_VITALS_LCP","onTTFB","EVENT_WEB_VITALS_TTFB","some","PerformanceEventTiming","onINP","EVENT_WEB_VITALS_INP","initializeApp","bindings","MSDyn365Commerce","viewBinder","views","componentBinder","components","getPartnerOverrideAction","partnerDataActions","dataAction","getConnector","connectors","values","perfAnalysisBinder","_this$bindings","perfAnalysisLibBinding","updatePrivateVariable","_env","process","getModuleBinder","getBinder","lookupKey","moduleName","pageInsightsEnabled","view","_requestCache$get","componentInsightsKey","getPageInsightsCacheKey","PAGE_INSIGHTS_COMPONENTS_KEY","componentInsights","lookupFunc","themeBinder","moduleNamespace","packageName","getComponent","isPageInsightsEnabled","actionContextData","Debug","component","parentThemeName","getModuleName","parentDefinitionPath","parentThemeBinder","defaultComponentLookupFunc","parentModuleBinder","createComponent","componentObj","EXCEPTION_NOMODULEBINDER","asSystemMetadata","componentName","componentView","Component","propsDictionary","addChunk","cn","RequestCache","addCreateComponentHook","initializeClientApp","skipConsoleWarn","clientPlatformSettings","originalBinder","moduleKey","binder","fetchComponent","default","moduleDirectory","md","da","definitionPath","pdp","isNodeModule","iNM","ns","chunkName","viewComponent","viewKey","fetchViewComponent","ecommerceComponent","componentKey","fetchEComComponent","initBindings","appDatabv","___appData___","bv","_buildVersion","_experimentationConnector","_platformSettings","AddControlMode","AsyncClientRenderComponent","super","loadScriptAsync","script","createElement","appendChild","onload","onerror","moduleChunk","src","defer","waitAndInitializeModule","__bindings__","mappedProps","retryCount","currentModuleArray","currentModule","lazyLoadHandler","componentDidMount","_this$props$requestCa","scriptInitCompleted","clientModuleChunks","chunksToBeAdded","chunk","scriptElements","getElementsByTagName","chunkExistsOnPage","scriptEl","render","_moduleBinder$compone","registrationBindings","registeredModules","moduleTypeName","rawModuleRegistrationObj","newModuleRegistrationObj","registeredViews","viewDictionary","viewRegistrationKey","rawViewRegistrationObj","newViewComponent","ref","componentRef","renderModuleAttributes","renderView","AddModuleControl","toggleMenuDisplay","button","getAddButtonId","menu","getAddButtonMenuId","style","display","hideMenuDisplay","slotId","onKeyPressMenu","onKeyPressAddModule","addModule","onKeyPressAddFragment","addFragment","helper","getRenderingHelper","getLocalizedStringsfromTools","stringName","getLocalizedString","state","enabled","localizedStrings","insertModule","insertFragment","moveNotAllowed","tooltip","className","role","onClick","onKeyDown","tabIndex","viewBox","mode","Sibling","slotName","parentData","AddModuleWrapper","_this$props","safeRenderProps","addModuleProps","_objectWithoutProperties","_excluded","SafeRenderModuleWithContext","getViewBinder","viewLookupKey","viewCacheKey","PAGE_INSIGHTS_VIEWS_KEY","viewInsights","viewLookupFunc","getView","viewLookup","defaultViewLookupFunc","performanceUtils","getPerformanceUtils","renderId","performanceUtilsPackage","Random","Guid","runPreRenderViewPerformanceHook","node","_view$component","renderViewForModule","runPostRenderViewPerformanceHook","ErrorModule","_get2","useMemo","message","getStandardErrorModuleMarkup","shouldDisplayErrors","isRenderAttrributeCalled","disableSSRErrorChecks","renderCallsCounter","setState","isLazyLoaded","_props$context$reques","telemetryId","friendlyName","telemetryAttributes","setTelemetryAttribute","moduleAttributes","_isEditorial","_setDataInfoAttribute","moduleIdToExperimentIdMap","MODULE_LAYOUT_FIELD","info","isConfigured","isRegistered","mounted","disableServerSideErrorChecking","mobxShouldComponentUpdate","shouldComponentUpdate","customShouldComponentUpdate","_setErrorStates","_setDataAttributes","_initializePerformanceComponent","nextProps","nextState","componentDidUpdate","componentDidCatch","runPreRenderPerformanceHook","renderCallIndex","_renderModule","runPostRenderPerformanceHook","initializePerformance","isMounted","mapStateToProps","lazyRenderModuleEnabled","stringFormat","EXCEPTION_UNREGISTEREDMODULEID","errorType","x","element","renderErrorOrPlaceHolderModules","EXCEPTION_ERROR_CLIENT_BOUNDARY","componentStack","moduleError","dataInfo","LazyLoad","offsetTop","_this$props$store","lazyload_offset","$type","_generateDataInfo","_doServerSideRender","renderHtmlString","renderHtml","require","addFailingModuleServerRenderToCache","stack","SDK_FRAGMENT_NAME","dangerouslySetInnerHTML","__html","buildModuleServerRenderCacheKey","moduleType","errorName","errorMessage","errorStack","getModuleServerRenderCacheKeyName","SERVER_RENDER_ERROR_CACHE_KEY","refNode","moduleConfig","getModuleConfig","EXCEPTION_MISSINGMODULECONFIG","Item","enableAddModuleControls","getSlotDictionary","EXCEPTION_MODULERENDERFAIL","slotDictionary","slotsWithAddModuleControls","addSiblingIndexDictionary","getNonPlaceholderModules","mods","getRenderSlotComponent","parentProps","moduleConfigs","addSiblingIndices","canAddAtIndex","_parentProps$store","EmptySlot","WithContext","parseInt","PDP_PAGE_NAME","FREQUENTLY_BOUGHT_TOGETHER_LIST","PICKS_FOR_YOU_LIST","CATEGORY_PAGE_NAME","PAGE_INSIGHTS_ACTIONS_KEY","LAZYLOAD_SWITCH_PREFIX","CLIENT_DATA_UPDATE_EVENT","AUTHORING_ADD_RENDER_COMPLETE_EVENT","ActionRuntime","complexDataTypesPromises","dataActionMetadataList","lazyLoadModuleIds","tempMetadataList","storeLazyloadModuleId","loadDataProcessing","storeTemporaryAsyncResults","tempResultCacheItem","runOn","tempMetadata","firstInput","dataActionFunction","isObservable","tempInput","expectedActionCount","promises","processDataActionMetadataList","getRefreshActions","moduleContract","moduleBinderInitial","combineExtendedDataActionToModule","originalModuleBinder","themeDataActionsForModule","moduleDataActions","dataActionCustimizedMerge","newDataAction","customizer","originAction","newAction","lookupId","newLookUpId","inputFunc","fetchDataActionWithActionid","processModuleDataAction","EXCEPTION_LOADDATA_ACTION_0","EXCEPTION_LOADDATA_ACTION_1","EXCEPTION_LOADDATA_ACTION_2","MESSAGE_CREATE_INPUT_LOADDATA","addLocaleInformation","dataActionInsightsKey","dataActionsInsights","Server","Client","convertRunOnToString","server","serverOnly","renderingContext","switchName","promise","chainAction","dataActionMetadata","EXCEPTION_DATAACTION_EXECUTION","disable_inst_action_await","isServerInstanceAction","runtime","client","ProductListType","ProductListInput","listMetadata","_cacheKey","_cacheObjectType","_cacheType","catalogIdNumber","listType","skipToken","skip","baseCacheKey","productBySearch","searchText","productByCategory","categoryIds","relatedProducts","productIds","promotional","discountIds","editorial","algo","recommendation","includeCart","personalization","getProductImageUrls","products","productsWithImageUrls","PrimaryImageUrl","generateImageUrl","imageUrl","baseImageUrl","encodeURIComponent","ProductListInventoryFilteringOptions","getInventorySorting","channelInventoryConfiguration","sorting","ProductAvailabilitySortableAttributeRecordId","Columns","ColumnName","IsDescending","getInventoryInStockSortableRefinerValue","RefinerRecordId","DataTypeValue","LeftValueBoundString","RightValueBoundString","UnitText","RowNumber","Count","ExtensionProperties","RefinerSourceValue","getProductsByCategoryListAction","recordId","productSearchCriteria","Context","ChannelId","CatalogId","CategoryIds","SkipVariantExpansion","IncludeAttributes","queryResultSettings","Paging","Top","versionGte","_context$requestConte3","_context$requestConte4","productListInventoryDisplay","HideOOS","SortOOS","StoreOperationsDataActions","getInventoryConfigurationAsync","inventoryInStockRefinerValue","Refinement","Sorting","searchByCriteriaAsync","getProductsByRecentlyViewedListAction","searchCriteriaInput","cookieContext","Ids","_ctx$requestContext$a","_ctx$requestContext$a2","_ctx$requestContext$a3","_ctx$requestContext$a4","ProductInput","buildCacheKey","base","createGetByIdsInput","DataServiceQuery","productsQuery","resultSettings","createDataServiceRequestForOperation","bypassCache","returnEntity","trace","productIdMapping","executeAction","getByIdsAsyncAction","mappedProducts","memo","isBatched","getProductIdForReco","recommendationCriteria","cartCookieParts","readCart","readAsync","getCart","CartLines","cartProductIds","ProductId","includePageContext","getProductsByNewSearchByCriteria","customer","getCustomerActionDataAction","GetCustomerInput","searchCriteria","CustomerAccountNumber","AccountNumber","RecommendationListId","recommendationListId","rsVersion","disable_sequential_call_for_recoProducts","getCategoryIdForReco","productSearchResults","productSearchResultsTmp","IsMasterProduct","MasterProductId","getProductsByRecommendationListAction","proxyContext","reccomendationListId","missingType","actionInputError","ProductIds","isHideAndSortByInventoryAvailabilitySupported","_context$requestConte5","getElementsAsync","recommendedElements","productInputs","productTypeId","ElementId","ElementTypeValue","itemIds","_context$requestConte6","_context$requestConte7","unorderedProductSearchResults","itemId","orderProductSearchResults","getProductsByRelationshipIdListAction","relationshipId","getRelatedProductsAsync","getProductsByPromotionListAction","productsDataActions","getProductPromotionsAsync","HeaderContext","LineContexts","productPromotions","productSearchResult","getProductsBySearchListAction","searchByTextAsync","listMetaData","productListMetaData","recentlyViewedProducts","INVALID_PRODUCT_LIST_TYPE","productList","updateListDataInRequestCache","EXCEPTION_PRODUCT_LIST_ACTION","cacheValue","_set2","getProxyHandler","disableChildModules","parentModule","slotKeys","childModules","findModule","res","handler","Proxy","newValue","propertyPath","parentPath","getDisabledProperties","EditError","fullPath","requiredProperties","getRequiredProperties","PROPERTY_INIT","CustomEvent","renderingHelper","moduleRequiredProperties","HttpException","code","setPrototypeOf","HttpRedirectException","isTruthy","String","pageInsights","clientRenderOptimizationEnabled","optimize_client_hydrate","clientRenderQsp","optimize_hydrate","Currency","getCurrency","_requestContext$query2","disable_lazy_render_support","_requestContext$query3","allModulesListArray","flat","commerceInsightsAttributeRenderer","additionalTelemetryData","prop","NumericLogLevel","information","warning","critical","none","CommerceInsightsLogger","webAnalyticsPlugin","_client","eventType","payload","eventData","ProductPageView","_isCartInfo","_populateCartInfo","AddToCart","RemoveFromCart","UpdateInCart","CheckOut","Purchase","_isProductTransaction","_populateProductTransaction","Custom","baseType","baseData","cartId","productArray","_populateProductInfo","cartVersion","productChannelId","productChannelName","productCategoryId","productCategoryName","productName","productSku","productPrice","productQuantity","productCurrency","affiliation","revenue","tax","shippingCost","EVENT_HTTP_SERVICE_START","EVENT_HTTP_SERVICE_STOP","generateEventNameHash","sha256","TelemetryBase","timerId","_timers","removeTimer","has","_enableDataAnalytics","_eventLoggers","_attributeRenderers","telemetryAttribute","innerFunction","_expLogger","_generateEventName","expPayload","eventNameHash","trackMetric","notifyTraceLoggers","logger","_telemetryContext","measurements","trackPageView","page","initialize","_traceLoggers","_namedLoggers","registerEventLogger","eventLogger","expLogger","attributeRenderer","_webAnalyticsPlugin","getNamedLoggerInstance","templateString","fx","_log","logLevel","messageTemplate","logOptions","regex","placeholders","match","exec","sendLog","moduleContext","contentCategory","attributes","contentAction","pgname","mname","etext","recid","etype","uuid","InternalTelemetry","setTelemetryModuleContext","telemetryWithContext","_telemetry","safeStringify","output","_len","_key","_logTrace","Trace","_len2","_key2","_len3","_key3","Information","_len4","_key4","_logException","Warning","_len5","_key5","_len6","_key6","Critical","fullMessage","arg","classificationLevel","isCustomerData","isRestrictedData","isPersonalData","__isDynamicsPrivacy","getPropertiesFromContext","shouldSkipLogging","severityLevel","loggerType","loggertype","loggerProps","AppInsights","ApplicationInsights","enableCorsCorrelation","correlationHeaderDomains","_loggerProps","loadAppInsights","addTelemetryInitializer","exceptionLog","trackException","operationalInsightsEventFilter","errors","_globalErrors","_severityLevelMapping","buildPropertiesList","traceLog","trackTrace","eventLog","pageViewLog","uri","dependencyLog","responseCode","trackDependencyData","envelope","sdkVersion","_debug","commerceSDKVersion","sskVersion","commerceSSKVersion","retailProxyVersion","environmentId","commerceCoreEnvironmentId","commerceCoreEnvId","pageViewDataString","pageviewPerformanceDataString","remoteDependencyDataString","censoredString","telemetryItem","performanceNavigationTimming","performancePaintTiming","performanceNavigationTimmingData","domContentLoadedEventStart","domContentLoadedEventEnd","domInteractive","domComplete","domContentLoadedEvent","paintTiming","expVariantInfo","tags","processID","operationId","_daSdkVer","singletonLoggerInstance","printFunction","warn","tagsString","tag","messageValue","RegExp","isInfo","_printMessages","NAME_CULTURE_INFO_FORMATTER_EXCEPTION","EXCEPTION_INVALID_ARGUMENT","functionName","invalidVariable","exports","str","TypeError","opt","pairs","dec","decode","pair","substring","trim","val","slice","tryDecode","enc","encode","fieldContentRegExp","test","isNaN","isFinite","toUTCString","decodeURIComponent","byteToHex","buf","offset","bth","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rnds","rng","bytesToUuid","ii"],"sourceRoot":""}