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?6ba1","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/Utilities/select-financing-offer.tsx?5f53","webpack://mattressfirm/./src/actions/BonusItemDataServiceEntities.g.ts?cf80","webpack://mattressfirm/./src/actions/BonusItemDataActionExtension.g.ts?22ff","webpack://mattressfirm/./src/actions/bonus-coupon-details.action.ts?7fb2","webpack://mattressfirm/./src/actions/bonus-item-product.action.ts?0b53","webpack://mattressfirm/./src/actions/checkout-billing-validity.action.ts?484f","webpack://mattressfirm/./src/actions/complete-your-bed-pillow.action.ts?db7f","webpack://mattressfirm/./src/actions/complete-your-bed-protector.action.ts?82b2","webpack://mattressfirm/./src/actions/fetch-choose-your-foundation-database.action.ts?867b","webpack://mattressfirm/./src/actions/fetch-complete-your-bed.action.ts?ea35","webpack://mattressfirm/./src/actions/get-delivery-fee-update.action.ts?8fde","webpack://mattressfirm/./src/actions/get-mattress-foundations-to-add.action.ts?7e5d","webpack://mattressfirm/./src/actions/get-mfrm-products-category-paths.action.ts?dc81","webpack://mattressfirm/./src/actions/get-recycle-fee-checkout.action.ts?9366","webpack://mattressfirm/./src/actions/get-sm-inventory-status.action.ts?cb72","webpack://mattressfirm/./src/actions/get-soci-data.action.ts?ce73","webpack://mattressfirm/./src/actions/TryInStoreDataServiceEntities.g.ts?ea57","webpack://mattressfirm/./src/actions/TryInStoreDataActionExtension.g.ts?c8db","webpack://mattressfirm/./src/actions/get-try-in-store-info.action.ts?dff9","webpack://mattressfirm/./src/actions/get-unbxd-product-recommendations.action.ts?bae6","webpack://mattressfirm/./src/actions/payment-redirect-to-order-confirmation.action.ts?c6dc","webpack://mattressfirm/./src/actions/paypalsuccesstrigger.action.ts?ccb0","webpack://mattressfirm/./src/actions/select-your-foundation.action.ts?e743","webpack://mattressfirm/./src/actions/social-icons-state.action.ts?1e1b","webpack://mattressfirm/./src/actions/srp-breadcrumb-page.action.ts?4397","webpack://mattressfirm/./src/actions/trigger-special-synchrony-financing.action.ts?1948","webpack://mattressfirm/./src/actions/update-monthly-payment.action.ts?0e43","webpack://mattressfirm/./src/actions/user-defined-promocode.action.ts?c234","webpack://mattressfirm/./src/actions/wmap-address-state.action.ts?f45e","webpack://mattressfirm/./src/actions/zip-code-state.action.ts?958a","webpack://mattressfirm/./src/actions/zip-code-validation.action.ts?0973","webpack://mattressfirm/./src/data-actions/bonuscoupons-action.action.ts?e535","webpack://mattressfirm/./src/data-actions/brightspot-content-action.action.ts?2792","webpack://mattressfirm/./src/data-actions/financing-offer-state.action.ts?9faa","webpack://mattressfirm/./src/data-actions/get-address-from-zipcode.action.ts?d9c9","webpack://mattressfirm/./src/data-actions/get-card-payment-accept-point.override.action.ts?a2c5","webpack://mattressfirm/./src/data-actions/get-comfort-type.action.ts?e535","webpack://mattressfirm/./src/data-actions/get-dimensions-for-selected-variant.override.action.ts?2573","webpack://mattressfirm/./src/data-actions/get-franchise-data.action.ts?7044","webpack://mattressfirm/./src/data-actions/get-product-benefit-enhanced-content.action.ts?85e9","webpack://mattressfirm/./src/data-actions/get-product-benefits-data.action.ts?1d43","webpack://mattressfirm/./src/data-actions/get-promocode-value.action.ts?e12d","webpack://mattressfirm/./src/data-actions/get-resons-to-buy-data.action.ts?34a7","webpack://mattressfirm/./src/data-actions/get-sales-order-details-action.action.ts?5a8b","webpack://mattressfirm/./src/data-actions/get-seo-data.action.ts?b8ff","webpack://mattressfirm/./src/data-actions/get-sleep-disruptor-icons.action.ts?0ec7","webpack://mattressfirm/./src/data-actions/get-store-location-information.override.action.ts?f6e2","webpack://mattressfirm/./src/data-actions/mfi-atp-inventory.action.ts?2cbf","webpack://mattressfirm/./src/data-actions/mfrm-mfi-bonusitem.action.ts?15d0","webpack://mattressfirm/./src/data-actions/mfrm-notification.action.ts?70c5","webpack://mattressfirm/./src/data-actions/payment-cc-card-types.action.ts?37d5","webpack://mattressfirm/./src/data-actions/payment-error-state.action.ts?5f0f","webpack://mattressfirm/./src/data-actions/products-by-category.override.action.ts?6afc","webpack://mattressfirm/./src/data-actions/products-by-recommendation.override.action.ts?9a45","webpack://mattressfirm/./src/data-actions/products-by-relationship-id.override.action.ts?f0f3","webpack://mattressfirm/./src/data-actions/products-get-by-id.action.ts?0a83","webpack://mattressfirm/./src/data-actions/progressive-leasing-modal-state.action.ts?5447","webpack://mattressfirm/./src/data-actions/promocode-applied-in-progress.action.ts?91e5","webpack://mattressfirm/./src/data-actions/redirect-to-wmap-submit-payment.action.ts?70c9","webpack://mattressfirm/./src/data-actions/search-org-unit-locations.action.ts?6dc5","webpack://mattressfirm/./src/data-actions/toggle-submit-order-button.action.ts?9a11","webpack://mattressfirm/./src/data-actions/update-email-call.action.ts?bac8","webpack://mattressfirm/./src/data-actions/wmap-get-order-details.action.ts?108d","webpack://mattressfirm/./src/data-actions/wmap-submit-payment.action.ts?1746","webpack://mattressfirm/./src/modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action.ts?8fd0","webpack://mattressfirm/./src/modules/mfrm-category-page-summary/mfrm-category-page-summary.action.ts?d22e","webpack://mattressfirm/./src/modules/mfrm-product-page-summary/get-product-recordId.action.ts?a795","webpack://mattressfirm/./src/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action.ts?e1f9","webpack://mattressfirm/./lib/__local__/module-registration.js?8a42","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import MsDyn365 from '@msdyn365-commerce/core';\r\nimport {IProductDetails,IProductBonusItems, IProductBonusWithBrandName } from '../modules/mfrm-cart/mfrm-cart';\r\nimport {IMFIBonusItemsResponse, IMFIGetBonusCouponsDetailsResponse} from '../actions/BonusItemDataServiceEntities.g';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nexport interface IMFRMDateGroupedProducts {\r\n dateStr: string;\r\n days?: string;\r\n productVariantRecordIds: number[];\r\n productItemIds: string[];\r\n productsType: string;\r\n}\r\n\r\nconst getSetLocalStorage = (key: string, getSet: string, valueToSet?: any, returnType?: any) => {\r\n if (MsDyn365.isBrowser) {\r\n switch (getSet) {\r\n case 'set':\r\n return localStorage.setItem(key, JSON.stringify(valueToSet || returnType));\r\n case 'get':\r\n return JSON.parse(localStorage.getItem(key) || '[]');\r\n default:\r\n return returnType;\r\n }\r\n } else {\r\n return returnType;\r\n }\r\n};\r\n\r\nexport const getSetProductData = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_details', getSet, products, []);\r\n};\r\n\r\nexport const getSetProductSpec = (getSet: string, products?: IProductDetails[]) => {\r\n return getSetLocalStorage('product_specification', getSet, products, []);\r\n};\r\n\r\nexport const getSetPromoCodeApplyList = (getSet: string) => {\r\n return getSetLocalStorage('promo_code_apply_list', getSet, [], []);\r\n};\r\n\r\nexport const getSetPromoCode = (getSet: string) => {\r\n return getSetLocalStorage('promoCode', getSet, [], []);\r\n};\r\n\r\nexport const getSetGrandTotal = (getSet: string, total?: string) => {\r\n return getSetLocalStorage('grand_total', getSet, total, 0);\r\n};\r\n\r\nexport const getSetBonusItemProd = (getSet: string, globalBonusItems?: IMFIBonusItemsResponse[])=>{\r\n return getSetLocalStorage('BonusItemProduct', getSet, globalBonusItems, []);\r\n};\r\n\r\nexport const getSetSelectedBonasItem = (getSet: string, bonusItemArray?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('selectedBonasItems', getSet, bonusItemArray, []);\r\n};\r\n\r\nexport const getSetBonusCouponDetail = (getSet: string, getCoupons?: IMFIGetBonusCouponsDetailsResponse[])=>{\r\n return getSetLocalStorage('bonusCouponsDetail', getSet, getCoupons, []);\r\n};\r\n\r\nexport const getSetPrevBonasModalState = (getSet: string, previousBonasModal?: IProductBonusItems[]) => {\r\n return getSetLocalStorage('previousBonasModalState', getSet, previousBonasModal, []);\r\n};\r\n\r\nexport const getSetBonusItemBrandName = (getSet: string, bonusItemsBrandName?: IProductBonusWithBrandName[]) => {\r\n return getSetLocalStorage('bonusItmesWithBrand', getSet, bonusItemsBrandName, []);\r\n};\r\n\r\nexport const getSetDateGroupedProducts = (getSet: string, products?: IMFRMDateGroupedProducts[]) => {\r\n return getSetLocalStorage('date_grouped_products', getSet, products, []);\r\n};\r\nexport const getSetWmapCartLines = (getSet: string, products?: { product: SimpleProduct, count: number }[]) => {\r\n return getSetLocalStorage('wmapCartLines', getSet, products, []);\r\n};","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links and product links, which end in .c or .p. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') && !linkBase.endsWith('.p') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","import { RichText } from '@msdyn365-commerce/core';\r\n\r\nimport dayjs from 'dayjs';\r\nimport tz from 'dayjs/plugin/timezone';\r\nimport utc from 'dayjs/plugin/utc';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\ndayjs.extend(tz);\r\ndayjs.extend(utc);\r\ndayjs.extend(isBetween);\r\nconst format = 'M/D/YYYY';\r\n\r\nexport interface IFinancingOffer {\r\n offerName?: string;\r\n noInterestFor: number;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage:string,\r\n limitedFinancingOfferMessage:string,\r\n monthlyOfferDetails?: RichText;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n offerValidStartDate?: string;\r\n offerValidEndDate?: string;\r\n specialCampaignOffer?: IFinancingOfferCampaign;\r\n checkoutDisplay?: {heading: string; details: string}\r\n}\r\n\r\nexport interface IFinancingOfferFormatted {\r\n numOfMonths: number;\r\n costPerMonth: number;\r\n startDate?: string;\r\n endDate?: string;\r\n isLTO: boolean;\r\n monthlyOfferDetails?: RichText;\r\n minPurchase: number;\r\n everydayFinancingOfferMessage:string;\r\n limitedFinancingOfferMessage:string;\r\n financingOfferDescription: RichText;\r\n disclaimer: RichText;\r\n specialCampaign?: IFinancingOfferCampaign;\r\n offerName?: string;\r\n checkoutDisplay?: {heading: string; details: string}\r\n}\r\n\r\nexport interface IFinancingOfferCampaign {\r\n initialMonthlyAmount: number;\r\n numOfDiscountedMonths: number;\r\n campaignValidStartDate: string;\r\n campaignValidEndDate: string;\r\n enableCampaign: boolean;\r\n showEverydayFlag: boolean;\r\n}\r\n\r\nexport interface ISelectFinancingOfferData {\r\n limitedTimeFinancingOffers: IFinancingOffer[];\r\n everydayFinancingOffers: IFinancingOffer[];\r\n totalPrice: number | undefined;\r\n specialFinancingOffer?: IFinancingOffer[];\r\n synchronySpecialFinancingCondition?: boolean;\r\n specialFinancingEnable?: boolean;\r\n}\r\n\r\nexport interface ICampaignRemainingCost {\r\n cost: number;\r\n months: number;\r\n}\r\n\r\nexport const getValidSpecialCampaign = (financingOffer: IFinancingOfferFormatted): IFinancingOfferCampaign | undefined => {\r\n if (\r\n financingOffer.specialCampaign &&\r\n financingOffer.specialCampaign.enableCampaign &&\r\n financingOffer.specialCampaign.initialMonthlyAmount &&\r\n financingOffer.specialCampaign.numOfDiscountedMonths &&\r\n isCampaignScheduled(financingOffer)\r\n ) {\r\n return financingOffer.specialCampaign;\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getCampaignRemainingCost = (\r\n campaign: IFinancingOfferCampaign,\r\n financingOffer: IFinancingOfferFormatted,\r\n totalPrice: number | undefined\r\n): ICampaignRemainingCost | undefined => {\r\n if (!totalPrice) {\r\n return undefined;\r\n }\r\n\r\n const initialCost = campaign.initialMonthlyAmount * campaign.numOfDiscountedMonths;\r\n const remainingCost = totalPrice - initialCost;\r\n const remainingMonths = financingOffer.numOfMonths - campaign.numOfDiscountedMonths;\r\n const monthlyCost = remainingCost / remainingMonths;\r\n\r\n return {\r\n cost: monthlyCost,\r\n months: remainingMonths\r\n };\r\n};\r\nexport const isValidLimitedTimeOffer = (offer: IFinancingOffer): boolean => {\r\n const startDate = dayjs(offer.offerValidStartDate, format);\r\n const endDate = dayjs(offer.offerValidEndDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const isCampaignScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const tempOffer = Object.create(offer);\r\n if (tempOffer.specialCampaign?.campaignValidStartDate && tempOffer.specialCampaign?.campaignValidEndDate) {\r\n tempOffer.startDate = tempOffer.specialCampaign?.campaignValidStartDate;\r\n tempOffer.endDate = tempOffer.specialCampaign?.campaignValidEndDate;\r\n\r\n return isScheduled(tempOffer);\r\n }\r\n\r\n return false;\r\n};\r\n\r\nexport const isScheduled = (offer: IFinancingOfferFormatted): boolean => {\r\n const startDate = dayjs(offer.startDate, format);\r\n const endDate = dayjs(offer.endDate, format).add(1, 'd');\r\n\r\n const startDateCentralTime = startDate.isValid() && dayjs(startDate.format(format), format).tz('America/Chicago').local();\r\n const endDateCentralTime = endDate.isValid() && dayjs(endDate.format(format), format).tz('America/Chicago').local();\r\n\r\n const now = dayjs();\r\n\r\n return startDateCentralTime && endDateCentralTime && now.isBetween(startDateCentralTime, endDateCentralTime);\r\n};\r\n\r\nexport const selectFinancingOffer = ({ limitedTimeFinancingOffers = [], everydayFinancingOffers = [], totalPrice = 0, specialFinancingOffer = [], synchronySpecialFinancingCondition = false, specialFinancingEnable = false }: ISelectFinancingOfferData, returnCustomOfferArray?: boolean): IFinancingOfferFormatted | undefined => {\r\n let highestMinimumPurchase: number = 0;\r\n let bestOffer: IFinancingOfferFormatted = {\r\n numOfMonths: 0,\r\n costPerMonth: 0,\r\n isLTO: false,\r\n minPurchase: 0,\r\n everydayFinancingOfferMessage:'',\r\n limitedFinancingOfferMessage:'',\r\n monthlyOfferDetails: '',\r\n financingOfferDescription: '',\r\n disclaimer: ''\r\n };\r\n let offerFound = false;\r\n\r\n let campaignFound: IFinancingOfferFormatted | undefined;\r\n\r\n const everydayOffers: IFinancingOfferFormatted[] | undefined = [];\r\n const specialOffer: IFinancingOfferFormatted[] | undefined = [];\r\n\r\n const validLimitedTimeFinancingOffers = limitedTimeFinancingOffers.filter((offer)=>{\r\n return isValidLimitedTimeOffer(offer) && offer;\r\n });\r\n\r\n if (synchronySpecialFinancingCondition && specialFinancingEnable) {\r\n if (!offerFound || (!isScheduled(bestOffer) && specialFinancingOffer.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n specialFinancingOffer.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n specialOffer?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = specialOffer;\r\n }\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n validLimitedTimeFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n\r\n if (totalPrice >= minPurchase && minPurchase > highestMinimumPurchase) {\r\n const currentOffer: IFinancingOfferFormatted = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n startDate: offer.offerValidStartDate,\r\n endDate: offer.offerValidEndDate,\r\n isLTO: true,\r\n minPurchase: offer.minPurchase,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n specialCampaign: offer.specialCampaignOffer,\r\n checkoutDisplay: offer.checkoutDisplay,\r\n offerName: offer.offerName\r\n };\r\n bestOffer = currentOffer;\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n\r\n // check if campaign schedule is scheduled, otherwise fall back to parent offer\r\n const validCampaign = getValidSpecialCampaign(currentOffer);\r\n if (validCampaign) {\r\n currentOffer.startDate = validCampaign.campaignValidStartDate;\r\n currentOffer.endDate = validCampaign.campaignValidEndDate;\r\n campaignFound = currentOffer;\r\n }\r\n else {\r\n campaignFound = undefined;\r\n }\r\n }\r\n });\r\n\r\n if (!offerFound || (!isScheduled(bestOffer) && everydayFinancingOffers.length)) {\r\n // try default offer\r\n offerFound = false;\r\n highestMinimumPurchase = 0;\r\n\r\n everydayFinancingOffers.forEach((offer: IFinancingOffer) => {\r\n const minPurchase = offer.minPurchase ? offer.minPurchase : 0;\r\n let currentOfferAccepted = false;\r\n if (totalPrice >= minPurchase && minPurchase >= highestMinimumPurchase) {\r\n bestOffer = {\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage: offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n offerName: offer.offerName,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer\r\n };\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n }\r\n\r\n if (returnCustomOfferArray && (totalPrice >= minPurchase)) {\r\n everydayOffers?.push({\r\n numOfMonths: offer.noInterestFor,\r\n costPerMonth: Math.ceil(totalPrice / offer.noInterestFor),\r\n isLTO: false,\r\n minPurchase: offer.minPurchase || 0,\r\n everydayFinancingOfferMessage:offer.everydayFinancingOfferMessage,\r\n limitedFinancingOfferMessage:offer.limitedFinancingOfferMessage,\r\n monthlyOfferDetails: offer.monthlyOfferDetails,\r\n financingOfferDescription: offer.financingOfferDescription,\r\n disclaimer: offer.disclaimer,\r\n offerName: offer.offerName\r\n });\r\n highestMinimumPurchase = offer.minPurchase;\r\n offerFound = true;\r\n currentOfferAccepted = true;\r\n // @ts-ignore\r\n bestOffer = everydayOffers;\r\n }\r\n\r\n // Do not use default if end date is defined and has expired\r\n if (currentOfferAccepted && offer.offerValidEndDate) {\r\n const endDate = dayjs(offer.offerValidEndDate, format);\r\n const now = dayjs();\r\n if (endDate.isValid() && now.isAfter(endDate)) {\r\n offerFound = false;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\n if (!offerFound) {\r\n return undefined;\r\n }\r\n if (campaignFound) {\r\n return campaignFound;\r\n }\r\n return bestOffer;\r\n};\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity interface.\r\n */\r\nexport interface IMFIGetBonusItemsParameters {\r\n CartId?: string;\r\n Coupons?: string[];\r\n // Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity interface.\r\n */\r\nexport interface IMFIBonusItemsDetailsEntity {\r\n Coupon?: string;\r\n IsBonusCoupon?: string;\r\n CouponMessage?: string;\r\n Items?: IMFIQualifyingItemDetails[];\r\n Id: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity interface.\r\n */\r\nexport interface IMFIQualifyingItemDetails {\r\n QualifyingItemId?: string;\r\n QualifyingProductId?: string;\r\n BonusProductQty: number;\r\n BonusItems?: IMFIBonusItemDetails[];\r\n }\r\n\r\n /**\r\n * MFIBonusItemDetails entity interface.\r\n */\r\n export interface IMFIBonusItemDetails {\r\n QualifyingProductId?: string;\r\n QualifyingItemId?: string;\r\n BonusItemId?: string;\r\n BonusProductId?: string;\r\n Name?: string;\r\n AdditionToCart?: string;\r\n AdjustedPrice: number;\r\n BasePrice: number;\r\n CustomerContextualPrice: number;\r\n DiscountAmount: number;\r\n DiscountTypeValue: number;\r\n DiscountType?: string;\r\n PrimaryImageUrl: string;\r\n ProductTypeValue: number;\r\n DealPriceOrDiscountPercentage: number;\r\n BonusCalculatedDiscountPrice: number;\r\n Coupon?: string;\r\n }\r\n\r\n /**\r\n * MFIGetBonusCouponsDetailsResponse entity interface.\r\n */\r\n export interface IMFIGetBonusCouponsDetailsResponse {\r\n BonusCoupons?: IMFIBonusCouponsDetail[];\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity interface.\r\n */\r\nexport interface IMFIBonusItemsResponse {\r\n BonusItemsDetails?: IMFIBonusItemsDetailsEntity[];\r\n Message?: string;\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity interface.\r\n */\r\nexport interface IMFIBonusCouponsDetail {\r\n BonusCoupon?: string;\r\n BonusCouponMessage?: string;\r\n ChildCoupons?: string[];\r\n}\r\n\r\n/**\r\n * MFIGetBonusItemsParameters entity class.\r\n */\r\nexport class MFIGetBonusItemsParametersExtensionClass implements IMFIGetBonusItemsParameters {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CartId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupons: string[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CartId = odataObject.CartId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons = undefined;\r\n if (odataObject.Coupons) {\r\n this.Coupons = [];\r\n for (let i = 0; i < odataObject.Coupons.length; i++) {\r\n if (odataObject.Coupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = odataObject.Coupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupons[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsDetailsEntity entity class.\r\n */\r\nexport class MFIBonusItemsDetailsEntityExtensionClass implements IMFIBonusItemsDetailsEntity {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Coupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public IsBonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Items: IMFIQualifyingItemDetails[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Id: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Coupon = odataObject.Coupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.IsBonusCoupon = odataObject.IsBonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CouponMessage = odataObject.CouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items = undefined;\r\n if (odataObject.Items) {\r\n this.Items = [];\r\n for (let i = 0; i < odataObject.Items.length; i++) {\r\n if (odataObject.Items[i]) {\r\n if (odataObject.Items[i]['@odata.type']) {\r\n let className: string = odataObject.Items[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.Items[i] = new EntityClasses[className](odataObject.Items[i]);\r\n }\r\n } else {\r\n this.Items[i] = new MFIQualifyingItemDetailsExtensionClass(odataObject.Items[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Items[i] = undefined;\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Id = odataObject.Id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIQualifyingItemDetails entity class.\r\n */\r\nexport class MFIQualifyingItemDetailsExtensionClass implements IMFIQualifyingItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public QualifyingProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductQty: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItems: IMFIBonusItemDetails[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingItemId = odataObject.QualifyingItemId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.QualifyingProductId = odataObject.QualifyingProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductQty = odataObject.BonusProductQty ? parseFloat(odataObject.BonusProductQty) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems = undefined;\r\n if (odataObject.BonusItems) {\r\n this.BonusItems = [];\r\n for (let i = 0; i < odataObject.BonusItems.length; i++) {\r\n if (odataObject.BonusItems[i]) {\r\n if (odataObject.BonusItems[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItems[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItems[i] = new EntityClasses[className](odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n this.BonusItems[i] = new MFIBonusItemDetailsExtensionClass(odataObject.BonusItems[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItems[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemDetails entity class.\r\n */\r\nexport class MFIBonusItemDetailsExtensionClass implements IMFIBonusItemDetails {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusProductId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Name: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdditionToCart: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public AdjustedPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BasePrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public CustomerContextualPrice: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountAmount: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountTypeValue: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DiscountType: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public DealPriceOrDiscountPercentage: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCalculatedDiscountPrice: number;\r\n\r\n public PrimaryImageUrl: string;\r\n\r\n public ProductTypeValue: number;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemId = odataObject.BonusItemId;\r\n\r\n this.PrimaryImageUrl = odataObject.PrimaryImageUrl;\r\n\r\n this.ProductTypeValue = odataObject.ProductTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusProductId = odataObject.BonusProductId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Name = odataObject.Name;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdditionToCart = odataObject.AdditionToCart;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.AdjustedPrice = odataObject.AdjustedPrice ? parseFloat(odataObject.AdjustedPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BasePrice = odataObject.BasePrice ? parseFloat(odataObject.BasePrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.CustomerContextualPrice = odataObject.CustomerContextualPrice ? parseFloat(odataObject.CustomerContextualPrice) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountAmount = odataObject.DiscountAmount ? parseFloat(odataObject.DiscountAmount) : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountTypeValue = odataObject.DiscountTypeValue;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DiscountType = odataObject.DiscountType;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.DealPriceOrDiscountPercentage = odataObject.DealPriceOrDiscountPercentage\r\n ? parseFloat(odataObject.DealPriceOrDiscountPercentage)\r\n : 0;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCalculatedDiscountPrice = odataObject.BonusCalculatedDiscountPrice\r\n ? parseFloat(odataObject.BonusCalculatedDiscountPrice)\r\n : 0;\r\n }\r\n}\r\n\r\n/**\r\n * MFIGetBonusCouponsDetailsResponse entity class.\r\n */\r\nexport class MFIGetBonusCouponsDetailsResponseExtensionClass implements IMFIGetBonusCouponsDetailsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupons: IMFIBonusCouponsDetail[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons = undefined;\r\n if (odataObject.BonusCoupons) {\r\n this.BonusCoupons = [];\r\n for (let i = 0; i < odataObject.BonusCoupons.length; i++) {\r\n if (odataObject.BonusCoupons[i]) {\r\n if (odataObject.BonusCoupons[i]['@odata.type']) {\r\n let className: string = odataObject.BonusCoupons[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusCoupons[i] = new EntityClasses[className](odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n this.BonusCoupons[i] = new MFIBonusCouponsDetailExtensionClass(odataObject.BonusCoupons[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupons[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusItemsResponse entity class.\r\n */\r\nexport class MFIBonusItemsResponseExtensionClass implements IMFIBonusItemsResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusItemsDetails: IMFIBonusItemsDetailsEntity[];\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails = undefined;\r\n if (odataObject.BonusItemsDetails) {\r\n this.BonusItemsDetails = [];\r\n for (let i = 0; i < odataObject.BonusItemsDetails.length; i++) {\r\n if (odataObject.BonusItemsDetails[i]) {\r\n if (odataObject.BonusItemsDetails[i]['@odata.type']) {\r\n let className: string = odataObject.BonusItemsDetails[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.BonusItemsDetails[i] = new EntityClasses[className](odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n this.BonusItemsDetails[i] = new MFIBonusItemsDetailsEntityExtensionClass(odataObject.BonusItemsDetails[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusItemsDetails[i] = undefined;\r\n }\r\n }\r\n }\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n }\r\n}\r\n\r\n/**\r\n * MFIBonusCouponsDetail entity class.\r\n */\r\nexport class MFIBonusCouponsDetailExtensionClass implements IMFIBonusCouponsDetail {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCoupon: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public BonusCouponMessage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ChildCoupons: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCoupon = odataObject.BonusCoupon;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.BonusCouponMessage = odataObject.BonusCouponMessage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons = undefined;\r\n if (odataObject.ChildCoupons) {\r\n this.ChildCoupons = [];\r\n for (let i = 0; i < odataObject.ChildCoupons.length; i++) {\r\n if (odataObject.ChildCoupons[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = odataObject.ChildCoupons[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ChildCoupons[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction bonusItemsQuery(id?: number): DataServiceQuery {\r\n const key = id ? { Id: id } : null;\r\n return new DataServiceQuery(\r\n 'BonusItems',\r\n 'MFIGetBonusItemsParameters',\r\n DataServiceEntities.MFIGetBonusItemsParametersExtensionClass,\r\n key\r\n );\r\n}\r\n\r\nexport function createMFIGetBonusCouponsDetailsInput(bonusCoupons: string): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusCouponsDetails',\r\n true,\r\n DataServiceEntities.MFIGetBonusCouponsDetailsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIGetBonusCouponsDetailsResponse' },\r\n { bonusCoupons: bonusCoupons }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusCouponsDetailsAsync(\r\n context: IContext,\r\n bonusCoupons: string\r\n): AsyncResult {\r\n const request = createMFIGetBonusCouponsDetailsInput(bonusCoupons);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n\r\nexport function createMFIGetBonusItemsDetailInput(bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters): IDataServiceRequest {\r\n const query = bonusItemsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetBonusItemsDetail',\r\n true,\r\n DataServiceEntities.MFIBonusItemsResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIBonusItemsResponse' },\r\n { bonusItemParams: bonusItemParams }\r\n );\r\n}\r\n\r\nexport function mFIGetBonusItemsDetailAsync(\r\n context: IContext,\r\n bonusItemParams: DataServiceEntities.IMFIGetBonusItemsParameters\r\n): AsyncResult {\r\n const request = createMFIGetBonusItemsDetailInput(bonusItemParams);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusCouponDetails Input Action\r\n */\r\nexport class BonusCouponDetailsInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `bonusCouponDetail`;\r\n public getCacheObjectType = () => 'bonusCouponDetail';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusCouponDetailsData {\r\n bonusCouponDetail: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusCouponDetailsInput();\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: BonusCouponDetailsInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusCouponDetail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusCouponDetails',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * BonusItemProduct Input Action\r\n */\r\nexport class BonusItemProductInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IBonusItemProductData {\r\n bonusItemProduct: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new BonusItemProductInput();\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: BonusItemProductInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { bonusItemProduct: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'BonusItemProduct',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// sample-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IBillingState {\r\n isBillingFormValid: boolean;\r\n}\r\n\r\n/**\r\n * BillingState - action input\r\n */\r\nexport class BillingStateInput implements IActionInput {\r\n public getCacheKey = () => `BillingState`;\r\n public getCacheObjectType = () => 'BillingState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * BillingState - action\r\n */\r\nexport async function BillingStateAction(input: BillingStateInput, ctx: IActionContext): Promise {\r\n return { isBillingFormValid: false};\r\n}\r\n\r\n/**\r\n * BillingState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BillingStateInput();\r\n};\r\n\r\n/**\r\n * BillingState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >BillingStateAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedPillow Input Action\r\n */\r\nexport class CompleteYourBedPillowInput implements Msdyn365.IActionInput {\r\n public pillow: SimpleProduct | undefined | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(pillow: SimpleProduct | undefined | null) {\r\n this.pillow = pillow;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CompleteyourBedPillow`;\r\n public getCacheObjectType = () => 'CompleteyourBedPillow';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedPillowData {\r\n pillow: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteYourBedPillowInput(args?.config?.pillow);\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: CompleteYourBedPillowInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { pillow: input.pillow };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'CompleteyourBedPillow',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * CompleteyourBedProtector Input Action\r\n */\r\nexport class CompleteyourBedProtectorInput implements Msdyn365.IActionInput {\r\n public protector: SimpleProduct | undefined | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(protector: SimpleProduct | undefined | null) {\r\n this.protector = protector;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CompleteyourBedProtector`;\r\n public getCacheObjectType = () => 'CompleteyourBedProtector';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ICompleteYourBedProtectorData {\r\n protector: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new CompleteyourBedProtectorInput(args?.config?.protector);\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: CompleteyourBedProtectorInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { protector: input.protector };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'CompleteyourBedProtector',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchChooseYourFoundationDatabase Input Action\r\n */\r\nexport class FetchChooseYourFoundationDatabaseInput implements Msdyn365.IActionInput {\r\n public jsonSrc: string;\r\n // TODO: Construct the input needed to run the action\r\n constructor(jsonSrc: string) {\r\n this.jsonSrc = jsonSrc;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ChooseYourFoundationDatabase`;\r\n public getCacheObjectType = () => 'ChooseYourFoundationDatabase';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IFetchChooseYourFoundationDatabaseData {\r\n text: string;\r\n jsonSrc: string;\r\n}\r\n\r\nexport interface IDatabaseRow {\r\n mattressVariantReqId: string;\r\n baseVariantReqIdList: string[];\r\n recommendedBaseVariantReqId: string;\r\n}\r\n\r\nexport interface foo {\r\n database: AsyncResult;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchChooseYourFoundationDatabaseInput(args?.config?.jsonSrc!);\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: FetchChooseYourFoundationDatabaseInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(input.jsonSrc, 'get');\r\n const database = res.data;\r\n return database;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'FetchChooseYourFoundationDatabase',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { AsyncResult } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * FetchcompleteYourBedData Input Action\r\n */\r\nexport class FetchCompleteYourBedDataInput implements Msdyn365.IActionInput {\r\n public jsonData: string;\r\n // TODO: Construct the input needed to run the action\r\n constructor(jsonData: string) {\r\n this.jsonData = jsonData;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `completeYourBedData`;\r\n public getCacheObjectType = () => 'completeYourBedDataObject';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IFetchcompleteYourBedData {\r\n text: string;\r\n jsonData: string;\r\n}\r\n\r\nexport interface IDataRow {\r\n pillowVariantRecID: string;\r\n mattressProtectorVariantRecID: string[];\r\n}\r\n\r\nexport interface foo {\r\n data: AsyncResult;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FetchCompleteYourBedDataInput(args?.config?.jsonData!);\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: FetchCompleteYourBedDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const res = await Msdyn365.sendRequest(input.jsonData, 'get');\r\n const data = res.data;\r\n return data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'FetchcompleteYourBedData',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface IGetDeliveryFeeUpdateInput {\r\n deliveryAmount: number;\r\n}\r\n/**\r\n * GetDeliveryFeeUpdate Input Action\r\n */\r\nexport class GetDeliveryFeeUpdateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CheckoutUpdateDeliveryFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateDeliveryFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetDeliveryFeeUpdateData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetDeliveryFeeUpdateInput();\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: GetDeliveryFeeUpdateInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return {deliveryAmount: 0};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetDeliveryFeeUpdate',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetMattressFoundationsToAdd Input Action\r\n */\r\nexport class GetMattressFoundationsToAddInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TODO`;\r\n public getCacheObjectType = () => 'TODO';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetMattressFoundationsToAddData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetMattressFoundationsToAddInput();\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: GetMattressFoundationsToAddInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n console.log('input/context',{input, ctx});\r\n return { text: 'Static data from action' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetMattressFoundationsToAdd',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICommerceApiSettings,\r\n ICreateActionContext,\r\n IGeneric,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\n// import { ICategoryPath, ICategoryUrl } from '@msdyn365-commerce/core-internal/dist/types/interfaces/ICategoryPathInterfaces';\r\nimport { getCategoryPathsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { CategoryPathLookup, CategoryPathResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\n\r\n/**\r\n * Category path input\r\n */\r\nexport class GetCategoryPathsInput implements IActionInput {\r\n public readonly ChannelId: number;\r\n public CatalogId?: number;\r\n public productIds?: number[];\r\n // public readonly categoryPathLooksups: CategoryPathLookup[];\r\n public readonly apiSettings: ICommerceApiSettings;\r\n // @ts-ignore\r\n private constructedCacheKey: string | undefined;\r\n\r\n constructor(context: IRequestContext, catalogId?: number, productIds?: number[]) {\r\n this.ChannelId = context.apiSettings.channelId;\r\n this.CatalogId = catalogId; // context.apiSettings.catalogId || 0;\r\n this.productIds = productIds;\r\n // this.categoryPathLooksups = categoryPathLooksups;\r\n this.apiSettings = context.apiSettings;\r\n this.constructedCacheKey = '';\r\n // categoryPathLooksups.forEach(categoryPath=> {\r\n // this.constructedCacheKey+=`${categoryPath.ProductId && categoryPath.ProductId.toString()}|`;\r\n // });\r\n this.constructedCacheKey = this.productIds?.map(ids => ids).join('-').toString();\r\n this.constructedCacheKey += `${this.ChannelId?.toString()}|`;\r\n this.constructedCacheKey += `${this.CatalogId?.toString()}|`;\r\n }\r\n\r\n public getCacheKey = () => `MFRMProductCategoryPath-${this.constructedCacheKey}`;\r\n public getCacheObjectType = () => 'MFRMProductCategoryPath';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the getCategoryPath retail api call\r\n */\r\nexport const createGetCategoryPathsInput = (\r\n inputData: GetCategoryPathsInput,\r\n context: ICreateActionContext>\r\n): IActionInput => {\r\n const productId = inputData.productIds;\r\n if (productId) {\r\n return new GetCategoryPathsInput(context.requestContext, inputData.CatalogId, inputData.productIds);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the category path for a product\r\n */\r\nexport async function getProductsCategoryPathsAction(input: GetCategoryPathsInput, ctx: IActionContext): Promise {\r\n const catPaths: CategoryPathLookup[] = [];\r\n if (!hasArray(input.productIds)) {\r\n return [];\r\n }\r\n for (let productsIter = 0; productsIter < input.productIds!.length; productsIter++) {\r\n catPaths.push({ ProductId: input.productIds![productsIter] });\r\n }\r\n try {\r\n return await getCategoryPathsAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: input.productIds!.length }, Sorting: {} } }, input.ChannelId, input.CatalogId!, catPaths);\r\n } catch (err) {\r\n console.log(err);\r\n return [];\r\n }\r\n}\r\n\r\nexport const getCategoryPathsActionDataAction = createObservableDataAction({\r\n id: 'GetMFRMProductsCategoryPaths',\r\n action: >getProductsCategoryPathsAction,\r\n input: createGetCategoryPathsInput\r\n});\r\n\r\nexport default getCategoryPathsActionDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ICheckoutRecycleFeeTaxUpdate {\r\n recycleFee: number | null;\r\n tax: number | null;\r\n}\r\n/**\r\n * GetRecycleFeeCheckout Input Action\r\n */\r\nexport class GetRecycleFeeCheckoutInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CheckoutUpdateRecycleFee`;\r\n public getCacheObjectType = () => 'CheckoutUpdateRecycleFee';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetRecycleFeeCheckoutInput();\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: GetRecycleFeeCheckoutInput, 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 return {recycleFee: null , tax: null};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetRecycleFeeCheckout',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryStatusAsync } from './CoreProductDataActionExtension.g';\r\nimport { IMFIATPInventoryStatusResponse, IMFICLDeliveryScheduleParameters } from './CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * GetDeliveryMessage Input Action\r\n */\r\n\r\nexport class GetATPInventoryStatusInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public input: IMFICLDeliveryScheduleParameters;\r\n public isCached?: boolean;\r\n constructor(input: IMFICLDeliveryScheduleParameters, isCached: boolean = true) {\r\n this.input = input;\r\n this.isCached = isCached;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => {\r\n const key = Array.prototype.map.call(this.input.ItemLines, (item) => { return item.VariantRecordId; }).sort().join(\",\");\r\n return `Get-Inventory-Status${this.input.ZipCode}-${this.input.ItemLines![0].ItemId}-${key}-${\r\n this.input?.Weeks\r\n }-${this.input?.RequestedDate}`;\r\n };\r\n // public getCacheKey = () => 'do';\r\n public getCacheObjectType = () => 'GetATPInventoryStatusResult';\r\n public dataCacheType = (): Msdyn365.CacheType => (this.isCached ? 'request' : 'none');\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetDeliveryMessageInput();\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 getATPInventoryStatusAction(\r\n request: GetATPInventoryStatusInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIATPInventoryStatusAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getATPInventoryStatusAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetATPInventoryStatus'\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { IGeneric, IAny } from '@msdyn365-commerce/core';\r\n/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport axios from 'axios';\r\nimport { getZipCode } from '../Utilities/get-zipcode';\r\n\r\n/**\r\n * GetSociData Input Action\r\n */\r\nexport class GetSociDataInput implements Msdyn365.IActionInput {\r\n public searchradius?: number | undefined;\r\n public searchLimit?: number | undefined;\r\n public zipCode?: string | undefined;\r\n constructor(searchradius?: number | undefined, searchLimit?: number | undefined, zipCode?: string | undefined) {\r\n this.searchradius = searchradius;\r\n this.searchLimit = searchLimit;\r\n this.zipCode = zipCode;\r\n }\r\n\r\n public getCacheKey = () => `SociLocations-${this.zipCode}`;\r\n public getCacheObjectType = () => 'SociLocations';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetSociDataInput(args?.config?.lookupRadius, args?.config?.maxNoOfFranchise ?? 4);\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 getSociData(input: GetSociDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n try {\r\n const zipCode = input?.zipCode ? input.zipCode : getZipCode(ctx);\r\n if (!zipCode) {\r\n return null;\r\n }\r\n\r\n const response = await axios.post(`https://api.slippymap.com/rest/locatorsearch`, {\r\n \"request\": {\r\n \"appkey\": \"F147ADC0-8099-11EC-AC1B-273DC403F339\",\r\n \"formdata\": {\r\n \"dataview\": \"store_default\",\r\n \"limit\": input.searchLimit ?? 4,\r\n \"geolocs\": {\r\n \"geoloc\": [\r\n {\r\n \"postalcode\": zipCode\r\n }\r\n\r\n ]\r\n },\r\n \"searchradius\": input.searchradius?.toString() ?? \"50\"\r\n }\r\n }\r\n }\r\n , {\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n if (response.data) {\r\n return response.data;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('error for soci api', e);\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getSociData,\r\n id: 'GetSociData',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFITryInStore entity interface.\r\n */\r\nexport interface IMFITryInStore {\r\n ZipCode?: string;\r\n StoreId: string;\r\n Products?: string;\r\n Limit: number;\r\n Radius: number;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity interface.\r\n */\r\nexport interface IMFITryInStoreInfoResponse {\r\n Status?: string;\r\n Message?: string;\r\n StoreId?: string;\r\n Inventory?: string[];\r\n}\r\n\r\n/**\r\n * MFITryInStore entity class.\r\n */\r\nexport class MFITryInStoreExtensionClass implements IMFITryInStore {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ZipCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Products: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Limit: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Radius: number;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ZipCode = odataObject.ZipCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Products = odataObject.Products;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Limit = odataObject.Limit;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Radius = odataObject.Radius;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFITryInStoreInfoResponse entity class.\r\n */\r\nexport class MFITryInStoreInfoResponseExtensionClass implements IMFITryInStoreInfoResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public StoreId: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Inventory: string[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Status = odataObject.Status;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.StoreId = odataObject.StoreId;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory = undefined;\r\n if (odataObject.Inventory) {\r\n this.Inventory = [];\r\n for (let i = 0; i < odataObject.Inventory.length; i++) {\r\n if (odataObject.Inventory[i]) {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = odataObject.Inventory[i];\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Inventory[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './TryInStoreDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction tryInStoresQuery(storeId?: string): DataServiceQuery {\r\n const key = storeId ? { StoreId: storeId } : null;\r\n return new DataServiceQuery('TryInStores', 'MFITryInStore', DataServiceEntities.MFITryInStoreExtensionClass, key);\r\n}\r\n\r\nexport function createMFIGetTryInStoreInfoInput(tryInStoreProductIDs: DataServiceEntities.IMFITryInStore): IDataServiceRequest {\r\n const query = tryInStoresQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIGetTryInStoreInfo',\r\n true,\r\n DataServiceEntities.MFITryInStoreInfoResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFITryInStoreInfoResponse' },\r\n { tryInStoreProductIDs: tryInStoreProductIDs }\r\n );\r\n}\r\n\r\nexport function mFIGetTryInStoreInfoAsync(\r\n context: IContext,\r\n tryInStoreProductIDs: DataServiceEntities.IMFITryInStore\r\n): AsyncResult {\r\n const request = createMFIGetTryInStoreInfoInput(tryInStoreProductIDs);\r\n return callActionOrExecute(request, context.callerContext);\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIGetTryInStoreInfoAsync } from './TryInStoreDataActionExtension.g';\r\nimport { IMFITryInStore, IMFITryInStoreInfoResponse } from './TryInStoreDataServiceEntities.g';\r\n\r\n/**\r\n * GetTryInStoreInfo Input Action\r\n */\r\n\r\nexport class GetTryInStoreInfoInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public input: IMFITryInStore;\r\n constructor(input: IMFITryInStore) {\r\n this.input = input;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () =>\r\n `Try-In-Store${this.input.StoreId}-${this.input.ZipCode}-${this.input.Radius}-${this.input.Limit}-${this.input.Products}`;\r\n public getCacheObjectType = () => 'GetTryInStoreInfo';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\n// const createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n// return new GetTryInStoreInfoInput();\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 getTryInStoreAction(\r\n request: GetTryInStoreInfoInput,\r\n ctx: Msdyn365.IActionContext\r\n): Promise {\r\n if (request.input) {\r\n try {\r\n const result = await mFIGetTryInStoreInfoAsync({ callerContext: ctx }, request.input);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('Error', error);\r\n }\r\n }\r\n return {};\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getTryInStoreAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetTryInStoreInfo'\r\n // input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\n\r\nexport interface ICategoryLevelNamesData {\r\n categoryLevelName?: string;\r\n}\r\nexport class GetUnbxdRecommendationsDataInput implements Msdyn365.IActionInput {\r\n public pageType?: string | undefined;\r\n public widgetNumber?: string | undefined;\r\n public productID?: string | undefined;\r\n public catLevels?: ICategoryLevelNamesData[] | undefined;\r\n public cartItemIDs?: (string | undefined)[] | undefined;\r\n\r\n constructor(pageType?: string | undefined, widgetNumber?: string | undefined, productID?: string | undefined, catLevels?: ICategoryLevelNamesData[] | undefined, cartItemIDs?: (string | undefined)[] | undefined) {\r\n this.pageType = pageType;\r\n this.widgetNumber = widgetNumber;\r\n this.productID = productID;\r\n this.catLevels = catLevels;\r\n this.cartItemIDs = cartItemIDs;\r\n }\r\n\r\n public getCacheKey = () => `Unbxd-recommendation-data-${this.pageType}-${this.widgetNumber}`;\r\n public getCacheObjectType = () => 'Unbxd-recommendation-data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\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 getUnbxdRecommendationData(input: GetUnbxdRecommendationsDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const cookies = new Cookies();\r\n const unbxdUid = cookies.get('unbxd.userId');\r\n const pageType = input?.pageType ? input.pageType.toUpperCase() : \"\";\r\n const productID = input?.productID ? input.productID : \"\";\r\n const catLevels = input?.catLevels ? input.catLevels : [];\r\n const cartItemIDs = input?.cartItemIDs ? input.cartItemIDs : [];\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n\r\n if (!pageType) {\r\n return null;\r\n }\r\n try {\r\n let unbxdUrl = \"\";\r\n switch (pageType) {\r\n case \"HOME\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&uid=${unbxdUid}`;\r\n break;\r\n case \"CATEGORY\":\r\n const catnames = catLevels.map((catName, index) => {\r\n return `&catlevel${index + 1}Name=${catName ? catName.categoryLevelName : ''}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${catnames}&uid=${unbxdUid}`;\r\n break;\r\n case \"PRODUCT\":\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}&id=${productID}&uid=${unbxdUid}`;\r\n break;\r\n case \"CART\":\r\n const productitemIds = cartItemIDs.map((itemId) => {\r\n return `&id=${itemId}`;\r\n }).join('');\r\n\r\n unbxdUrl = `https://recommendations.unbxd.io/v2.0/${unbxdApiKey}/${unbxdSiteKey}/items?pageType=${pageType}${productitemIds}&uid=${unbxdUid}`;\r\n break;\r\n default:\r\n unbxdUrl = '';\r\n }\r\n const response = await Msdyn365.sendRequest(unbxdUrl, 'get');\r\n if (response.data && response.headers) {\r\n const recsData={\r\n \"unbxdRequestId\":response.headers[\"x-request-id\"]? response.headers[\"x-request-id\"]:'',\r\n \"unbxdRecs\":response.data[input.widgetNumber!.toLowerCase()]\r\n };\r\n return recsData;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getUnbxdRecommendationData,\r\n id: 'getUnbxdRecommendationData'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentRedirectToOrderConfirmation Input Action\r\n */\r\nexport class PaymentRedirectToOrderConfirmationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaymentRedirectToOrderConfirmation`;\r\n public getCacheObjectType = () => 'PaymentRedirectToOrderConfirmation';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentRedirectToOrderConfirmationData {\r\n redirectToOrderConfirmation: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentRedirectToOrderConfirmationInput();\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 paymentRedirectAction(input: PaymentRedirectToOrderConfirmationInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { redirectToOrderConfirmation: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >paymentRedirectAction,\r\n // TODO: Give your data action a unique id\r\n id: 'PaymentRedirectToOrderConfirmation',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * Paypalsuccesstrigger Input Action\r\n */\r\nexport class PaypalsuccesstriggerInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PayPalSuccessFlag`;\r\n public getCacheObjectType = () => 'PayPalSuccessFlag';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaypalsuccesstriggerData {\r\n isPaymentSuccess: boolean;\r\n paymentSuccessEmail: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaypalsuccesstriggerInput();\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: PaypalsuccesstriggerInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isPaymentSuccess: false, paymentSuccessEmail: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'Paypalsuccesstrigger',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * SelectYourFoundation Input Action\r\n */\r\nexport class SelectYourFoundationInput implements Msdyn365.IActionInput {\r\n public foundation: SimpleProduct | undefined | null;\r\n // TODO: Construct the input needed to run the action\r\n constructor(foundation: SimpleProduct | undefined | null) {\r\n this.foundation = foundation;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SelectYourFoundation`;\r\n public getCacheObjectType = () => 'SelectYourFoundation';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISelectYourFoundationData {\r\n foundation: SimpleProduct | undefined | null;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SelectYourFoundationInput(args?.config?.foundation);\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: SelectYourFoundationInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { foundation: input.foundation };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SelectYourFoundation',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface ISocialIconState {\r\n copyLinkClick: boolean;\r\n}\r\n\r\n/**\r\n * SocialIconsState Input Action\r\n */\r\nexport class SocialIconsStateInput implements IActionInput {\r\n public getCacheKey = () => `SocialIconsState`;\r\n public getCacheObjectType = () => 'SocialIconsState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport async function socialIconStateAction(input: SocialIconsStateInput, ctx: IActionContext): Promise {\r\n return { copyLinkClick: false };\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new SocialIconsStateInput();\r\n};\r\n\r\nexport default createObservableDataAction({\r\n action: >socialIconStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'SocialIconsState',\r\n input: createInput\r\n});\r\n","import * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport interface ISRPBreadcrumbState {\r\n breadcrumbCheck: boolean;\r\n}\r\n\r\n/**\r\n * SrpBreadcrumbPage Input Action\r\n */\r\nexport class SrpBreadcrumbPageInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `BreadcrumbSrp`;\r\n public getCacheObjectType = () => 'BreadcrumbSrp';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISrpBreadcrumbPageData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SrpBreadcrumbPageInput();\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: SrpBreadcrumbPageInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { breadcrumbCheck: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SrpBreadcrumbPage',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * TriggerSpecialSynchronyFinancing Input Action\r\n */\r\nexport class TriggerSpecialSynchronyFinancingInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `TriggerSpecialSynchronyFinancing`;\r\n public getCacheObjectType = () => 'TriggerSpecialSynchronyFinancing';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ITriggerSpecialSynchronyFinancingData {\r\n triggerSpecialFinancing: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new TriggerSpecialSynchronyFinancingInput();\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: TriggerSpecialSynchronyFinancingInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { triggerSpecialFinancing: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'TriggerSpecialSynchronyFinancing',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * UpdateMonthlyPayment Input Action\r\n */\r\nexport class UpdateMonthlyPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `updateMonthlyPayment`;\r\n public getCacheObjectType = () => 'updateMonthlyPayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IUpdateMonthlyPaymentData {\r\n updateTotal: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new UpdateMonthlyPaymentInput();\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 updateMonthlyPayment(input: UpdateMonthlyPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { updateTotal: '0' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >updateMonthlyPayment,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * UserDefinedPromocode Input Action\r\n */\r\nexport class UserDefinedPromocodeInput implements Msdyn365.IActionInput {\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `userDefinedPromoCodes`;\r\n public getCacheObjectType = () => 'userDefinedPromoCodes';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IUserDefinedPromocodeData {\r\n userDefinedPromos: string[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new UserDefinedPromocodeInput();\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: UserDefinedPromocodeInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { userDefinedPromos: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'UserDefinedPromocode',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","// WmapAddress-state.ts\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IWmapAddressState {\r\n preFilledAddress: any;\r\n isAddressUpdate: boolean;\r\n}\r\n\r\n/**\r\n * WmapAddressState - action input\r\n */\r\nexport class WmapAddressStateInput implements IActionInput {\r\n constructor() {}\r\n public getCacheKey = () => `WmapAddressState`;\r\n public getCacheObjectType = () => 'WmapAddressState';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\n/**\r\n * WmapAddressState - action\r\n */\r\nasync function action(input: WmapAddressStateInput, ctx: IActionContext): Promise {\r\n return { preFilledAddress: {}, isAddressUpdate: false };\r\n}\r\n\r\n/**\r\n * WmapAddressState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new WmapAddressStateInput();\r\n};\r\n\r\n/**\r\n * WmapAddressState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","// sample-state.ts\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\nexport interface IZipCodeState {\r\n isStateValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeStateInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeState`;\r\n public getCacheObjectType = () => 'ZipCodeState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipCodeStateAction(input: ZipCodeStateInput, ctx: IActionContext): Promise {\r\n return {isStateValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeStateInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipCodeStateAction,\r\n input: createInput\r\n});\r\n","// sample-state.ts\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\nexport interface IZipcodeValidation {\r\n isZipcodeValid: boolean;\r\n}\r\n\r\n/**\r\n * ZipCodeState - action input\r\n */\r\nexport class ZipCodeValidationInput implements IActionInput {\r\n public getCacheKey = () => `ZipCodeValidation`;\r\n public getCacheObjectType = () => 'ZipCodeValidation';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * ZipCodeState - action\r\n */\r\nexport async function ZipcodeValidationAction(input: ZipCodeValidationInput, ctx: IActionContext): Promise {\r\n return { isZipcodeValid: false };\r\n}\r\n\r\n/**\r\n * ZipCodeState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new ZipCodeValidationInput();\r\n};\r\n\r\n/**\r\n * ZipCodeState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >ZipcodeValidationAction,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport {\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 { mFIGetBonusCouponsDetailsAsync } from '../actions/BonusItemDataActionExtension.g';\r\nimport { IMFIGetBonusCouponsDetailsResponse } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n// tslint:disable-next-line: completed-docs\r\nexport class BonusCouponsInfoInput implements IActionInput {\r\n public bonusCoupon: string;\r\n constructor(bonusCoupon: string) {\r\n this.bonusCoupon = bonusCoupon;\r\n }\r\n public getCacheKey = () => `MFRMBonusCouponsInfoInput-${this.bonusCoupon}`;\r\n public getCacheObjectType = () => 'MFRMBonusCouponsInfoInput';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport interface IMFRMBonusCouponsDetailData {\r\n couponsDetails: IMFIGetBonusCouponsDetailsResponse;\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new BonusCouponsInfoInput('');\r\n};\r\n\r\nexport async function getAllBonusCouponsDetails(\r\n input: BonusCouponsInfoInput,\r\n ctx: IActionContext\r\n): Promise {\r\n try {\r\n const result = await mFIGetBonusCouponsDetailsAsync({ callerContext: ctx }, input.bonusCoupon);\r\n if (result) {\r\n return {couponsDetails: result};\r\n }\r\n } catch (error) {\r\n ctx.telemetry.warning(JSON.stringify(error));\r\n ctx.telemetry.debug('Unable to get Bonus Coupons Details when get all coupons');\r\n }\r\n return {couponsDetails: {}};\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getAllBonusCouponsDetails,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport class BrightSpotContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private brightspotUrl: string = '';\r\n constructor(brightspotUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'bspagecache', cacheKey: 'bspagecache' });\r\n this.brightspotUrl = brightspotUrl;\r\n }\r\n\r\n public getBrightspotUrl = () => this.brightspotUrl;\r\n public getCacheKey = () => `bspagecache`;\r\n public getCacheObjectType = () => 'bspagecache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.brightspotPageUrl) {\r\n return new BrightSpotContentInput(inputData.config.brightspotPageUrl);\r\n }\r\n return new BrightSpotContentInput('');\r\n};\r\n\r\nasync function action(input: BrightSpotContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const res = await Msdyn365.sendRequest(\r\n input.getBrightspotUrl(),\r\n 'get',\r\n null,\r\n { headers: {'Accept-Encoding': 'gzip'} }\r\n );\r\n\r\n return res.data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { IFinancingOfferFormatted } from '../Utilities/select-financing-offer';\r\n\r\n/**\r\n * FinancingOfferState Input Action\r\n */\r\n\r\nexport class FinancingOfferStateInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `FinancingOfferState`;\r\n public getCacheObjectType = () => 'FinancingOfferState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IFinancingOfferStateData {\r\n isOpen: boolean;\r\n totalPrice?: number;\r\n financingOffer?: IFinancingOfferFormatted;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new FinancingOfferStateInput();\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: FinancingOfferStateInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'FinancingOfferState',\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, ZipCodeInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAddressFromZipCodeAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\n\r\n/**\r\n * GetEyebrowMessage Input Action\r\n */\r\n\r\nexport class GetAddressByZipcodeInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public country: string;\r\n public zipcode: string;\r\n\r\n constructor(country: string, zipcode: string) {\r\n this.country = country;\r\n this.zipcode = zipcode;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `Get-Address-By-Zipcode-${this.zipcode}`;\r\n public getCacheObjectType = () => 'GetAddressByZipCode';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\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 getAddressByZipcodeAction(input: GetAddressByZipcodeInput, ctx: IActionContext): Promise {\r\n return getAddressFromZipCodeAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 1 } } }, input.country, input.zipcode);\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getAddressByZipcodeAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetAddressByZipcode'\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n ICommerceApiSettings, ICreateActionContext, isEmptyOrNullObject\r\n} from '@msdyn365-commerce/core';\r\nimport { getCheckoutState, ICheckoutState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n getCardPaymentAcceptPointAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n CardPaymentAcceptPoint, CommerceProperty\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport get from 'lodash/get';\r\nimport Cookies from 'universal-cookie';\r\nimport { selectFinancingOffer } from '../Utilities/select-financing-offer';\r\nimport { getSetGrandTotal } from '../Utilities/cart-utils';\r\nimport { hasArray } from '../Utilities/emtpyChecker';\r\nexport interface IGetCardPaymentAcceptPointInput {\r\n showBillingAddress?: boolean;\r\n paymenTenderType?: string;\r\n apiSettings: ICommerceApiSettings;\r\n selectedOfferName?: string;\r\n isReload?: boolean;\r\n amountDue?: number;\r\n synchronySpecialFinancingCondition?: boolean;\r\n}\r\n\r\n/**\r\n * GetCardPaymentAcceptPointInput - Input for create GetCardPaymentAcceptPoint\r\n */\r\nexport class GetCardPaymentAcceptPointInput implements IActionInput {\r\n public showBillingAddress?: boolean;\r\n public paymenTenderType?: string;\r\n public selectedOfferName?: string;\r\n public amountDue?: number;\r\n public synchronySpecialFinancingCondition?: boolean;\r\n private apiSettings: ICommerceApiSettings;\r\n public isReload?: boolean;\r\n\r\n constructor(input: IGetCardPaymentAcceptPointInput) {\r\n this.showBillingAddress = input.showBillingAddress;\r\n this.paymenTenderType = input.paymenTenderType;\r\n this.apiSettings = input.apiSettings;\r\n this.selectedOfferName = input.selectedOfferName;\r\n this.isReload = input.isReload;\r\n this.amountDue = input.amountDue;\r\n this.synchronySpecialFinancingCondition = input.synchronySpecialFinancingCondition;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`CardPaymentAcceptPoint${this.paymenTenderType ? `-${this.paymenTenderType}` : ''}`, this.apiSettings);\r\n public getCacheObjectType = () => `CardPaymentAcceptPoint`;\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createCheckoutPaymentInstrumentInput = (inputData: ICreateActionContext) => {\r\n // @ts-ignore\r\n const { showBillingAddress, paymenTenderType, amountDue, synchronySpecialFinancingCondition } = inputData.config;\r\n const getCardPaymentAcceptPointInput = {\r\n showBillingAddres: showBillingAddress,\r\n paymenTenderType: paymenTenderType,\r\n apiSettings: inputData.requestContext.apiSettings,\r\n amountDue,\r\n synchronySpecialFinancingCondition\r\n };\r\n\r\n return new GetCardPaymentAcceptPointInput(getCardPaymentAcceptPointInput);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns a cart object based on the passed GetCartInput\r\n */\r\nexport async function getCardPaymentAcceptPointAction(\r\n input: GetCardPaymentAcceptPointInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // If no cart ID is provided in input, we need to create a cart object\r\n if (!input) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing'));\r\n throw new Error('[getCardPaymentAcceptPointAction] No valid Input was provided, failing');\r\n }\r\n\r\n const { showBillingAddress, paymenTenderType, amountDue = 0, synchronySpecialFinancingCondition } = input;\r\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\r\n ctx.telemetry.exception(error);\r\n throw error;\r\n });\r\n\r\n if (\r\n isEmptyOrNullObject(checkoutState) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart) ||\r\n isEmptyOrNullObject(checkoutState.checkoutCart.cart)\r\n ) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Unable to get cart'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Unable to get cart');\r\n }\r\n\r\n if (!checkoutState.checkoutCart.cart.CartLines || !checkoutState.checkoutCart.cart.CartLines.length) {\r\n ctx.telemetry.exception(new Error('[getCardPaymentAcceptPointAction] Cart is empty'));\r\n throw new Error('[getCardPaymentAcceptPointAction] Cart is empty');\r\n }\r\n\r\n const requestUrl =\r\n typeof ctx.requestContext.url.requestUrl === 'string'\r\n ? new URL(ctx.requestContext.url.requestUrl)\r\n : ctx.requestContext.url.requestUrl;\r\n const origin = get(window, 'location.origin') || requestUrl.origin;\r\n const zeroAmount = 0;\r\n\r\n const cardPaymentAcceptSettings = {\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardPaymentAcceptSettings',\r\n HostPageOrigin: origin,\r\n AdaptorPath: `${origin}/Connectors/` || origin,\r\n CardPaymentEnabled: false,\r\n CardTokenizationEnabled: true,\r\n ...(!showBillingAddress && { HideBillingAddress: true }),\r\n ...(paymenTenderType && { TenderTypeId: paymenTenderType }),\r\n PaymentAmount: amountDue || zeroAmount\r\n };\r\n\r\n const { everydayFinancingOffers, addPaymentMethodName, extensionKeyPlanId, limitedTimeFinancingOffers, specialFinancingOffer, specialFinancingEnable } = ctx.requestContext.app.config;\r\n const getOffer = selectFinancingOffer({\r\n limitedTimeFinancingOffers,\r\n everydayFinancingOffers,\r\n totalPrice: getSetGrandTotal('get'),\r\n specialFinancingOffer,\r\n synchronySpecialFinancingCondition,\r\n specialFinancingEnable\r\n });\r\n const allOffers = [...(hasArray(limitedTimeFinancingOffers) || []), ...(hasArray(everydayFinancingOffers) || []), ...(hasArray(specialFinancingOffer) || [])];\r\n const offerName = synchronySpecialFinancingCondition && specialFinancingEnable? getOffer?.offerName : getOffer?.isLTO ? getOffer?.offerName : (input.selectedOfferName || getOffer?.offerName);\r\n const isReload = input.isReload;\r\n const defaultVal =\r\n allOffers?.find((item: { offerName: string }) => item.offerName?.toLowerCase() === offerName?.toLowerCase());\r\n const isSynchrony = paymenTenderType?.toLowerCase() === addPaymentMethodName?.toLowerCase();\r\n if(isSynchrony){\r\n (new Cookies()).set('Ecom_FinanceOption', defaultVal?.offerName);\r\n (new Cookies()).set('Ecom_FinancePlanId', defaultVal?.planID);\r\n }\r\n const ep: CommerceProperty[] = isSynchrony ? [{Key: extensionKeyPlanId, Value: { StringValue: defaultVal?.planID}}] : [];\r\n if (isReload) {\r\n return getCardPaymentAcceptPointAsync(\r\n { callerContext: ctx, bypassCache: 'get' },\r\n checkoutState.checkoutCart.cart.Id,\r\n cardPaymentAcceptSettings,\r\n ep\r\n ).then(cardPaymentAcceptPoint => {\r\n if (!cardPaymentAcceptPoint.AcceptPageUrl && !cardPaymentAcceptPoint.AcceptPageContent) {\r\n throw new Error(\r\n '[getCardPaymentAcceptPointAction] Payment Accept Page has neither return AcceptPageUrl nor AcceptPageContent in updatePaymentAcceptPageData'\r\n );\r\n }\r\n return cardPaymentAcceptPoint;\r\n })\r\n .catch(error => {\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('Unable to get Card Payment Accept Point');\r\n throw error;\r\n });\r\n }\r\n return {};\r\n}\r\n\r\nexport const getCardPaymentAcceptPointActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce/checkout-payment-instrument/get-card-payment-accept-point',\r\n action: >getCardPaymentAcceptPointAction,\r\n input: createCheckoutPaymentInstrumentInput\r\n});\r\n\r\nexport default getCardPaymentAcceptPointActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetComfortTypesData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private comfortTypesDataUrl: string = '';\r\n constructor(comfortTypesDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'comfortTypesDataCache', cacheKey: 'comfortTypesDataCache' });\r\n this.comfortTypesDataUrl = comfortTypesDataUrl;\r\n }\r\n public getComfortTypesDataUrl = () => this.comfortTypesDataUrl;\r\n public getCacheKey = () => `comfortTypesDataCache`;\r\n public getCacheObjectType = () => 'comfortTypesDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.comfortTypesDataUrl) {\r\n return new GetComfortTypesData(inputData.config.comfortTypesDataUrl);\r\n }\r\n return new GetComfortTypesData('');\r\n};\r\nasync function action(input: GetComfortTypesData, ctx: Msdyn365.IActionContext): Promise {\r\n const comfortTypesDataJsonUrl = ctx.requestContext.app.config.comfortTypesDataJsonUrl;\r\n const jsonUrl = comfortTypesDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const comfortTypesData = res.data && res.data;\r\n return comfortTypesData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\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 { IProductDimensionsWithAvailabilitiesFull, ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n IAny, ICreateActionContext, IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n ProductDimension, ProductDimensionAvailabilitySearchCriteria,\r\n ProductDimensionValue, ProductDimensionValueInventoryAvailability, ProductsDataActions\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { createInventoryAvailabilitySearchCriteria, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getDimensionValuesFromQuery, getQueryParamsFromQueryByName } from './utilities/utils';\r\nimport { variantQueryStringName } from '../Utilities/constants';\r\n\r\n/**\r\n * Defines the dimension value type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionValueForSelectedVariant extends ProductDimensionValueInventoryAvailability, ProductDimensionValue {}\r\n\r\n/**\r\n * Defines the returned type for get dimensions for selected variant data action.\r\n * Includes old API format for backward compatibility and new API info for availabilities for new logic.\r\n */\r\nexport interface IDimensionForSelectedVariant extends ProductDimensionFull, IProductDimensionsWithAvailabilitiesFull {}\r\n\r\n/**\r\n * Input class for the getDimensionsForSelectedVariant data action.\r\n */\r\nexport class GetDimensionsForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n public constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n /**\r\n * Cache key.\r\n * @returns String.\r\n */\r\n public getCacheKey: () => string = () => `DimensionsForSelectedVariantInput-${this.productId}-${this.channelId}`;\r\n\r\n /**\r\n * Cache object type.\r\n * @returns String.\r\n */\r\n public getCacheObjectType: () => string = () => 'DimensionsForSelectedVariantInput';\r\n\r\n /**\r\n * Cache type.\r\n * @returns String.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * Create input method for the getDimensionsForSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns - The input for the data action.\r\n */\r\nconst createDimensionsForSelectedVariantInput = (inputData: ICreateActionContext>): GetDimensionsForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetDimensionsForSelectedVariantInput(\r\n +productId,\r\n +inputData.requestContext.apiSettings.channelId,\r\n getDimensionValuesFromQuery(inputData.requestContext.url.requestUrl));\r\n }\r\n throw new Error('Unable to create DimensionsForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * Converts new API type with availabilities to old API type to preserve backward compatibility.\r\n * @param dimensions - Dimensions to convert.\r\n * @returns Dimensions in old API format.\r\n */\r\nconst prepareDimensionsDataResult = (dimensions: IProductDimensionsWithAvailabilitiesFull[]): IDimensionForSelectedVariant[] => {\r\n return dimensions.map(newDimension => {\r\n const oldDimension: IDimensionForSelectedVariant = { ...newDimension };\r\n oldDimension.DimensionValues = ArrayExtensions.validValues(newDimension.dimensionValuesWithInventory?.map(value => value.DimensionValue));\r\n return oldDimension;\r\n });\r\n};\r\n\r\n/**\r\n * Action Method for the getDimensionsForSelectedVariant Data Action.\r\n * @param input - Input for the data action.\r\n * @param context - Action context.\r\n * @returns Product dimensions with availability.\r\n */\r\nexport async function getDimensionsForSelectedVariantAction(\r\n input: GetDimensionsForSelectedVariantInput,\r\n context: IActionContext\r\n): Promise {\r\n const variantId = context.requestContext.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(MsDyn365.isBrowser ? new URL(window.location.href.toString()) : context.requestContext.url.requestUrl, variantQueryStringName) : undefined;\r\n let activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, variantId && !Number.isNaN(Number(variantId)) ? Number(variantId) : input.productId, input.channelId);\r\n if (!activeProduct && variantId) {\r\n activeProduct = await ProductsDataActions.getByIdAsync({ callerContext: context }, Number(input.productId), input.channelId);\r\n }\r\n if (!ArrayExtensions.hasElements(activeProduct.Dimensions)) {\r\n return [];\r\n }\r\n\r\n const promises = activeProduct.Dimensions.map(dimension => {\r\n const shippingInventoryConfiguration = createInventoryAvailabilitySearchCriteria(context, [], true, undefined, undefined);\r\n\r\n const searchCriteria: ProductDimensionAvailabilitySearchCriteria =\r\n {\r\n RequestedDimensionTypeValue: dimension.DimensionTypeValue,\r\n MatchingDimensionValues: input.matchingDimensionValues.filter(item => item.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n DefaultWarehouseOnly: shippingInventoryConfiguration.DefaultWarehouseOnly,\r\n FilterByChannelFulfillmentGroup: shippingInventoryConfiguration.FilterByChannelFulfillmentGroup,\r\n DeliveryModeTypeFilterValue: shippingInventoryConfiguration.DeliveryModeTypeFilterValue\r\n };\r\n\r\n const dimensionValuesPromise = ProductsDataActions.getDimensionValuesWithEstimatedAvailabilitiesAsync(\r\n { callerContext: context, queryResultSettings: {} },\r\n activeProduct.MasterProductId ? activeProduct.MasterProductId : activeProduct.RecordId,\r\n searchCriteria\r\n );\r\n const fullDimensionPromise = dimensionValuesPromise.then(dimensionValues => {\r\n const fullDimension: IProductDimensionsWithAvailabilitiesFull = {\r\n ...dimension,\r\n dimensionValuesWithInventory: dimensionValues\r\n };\r\n return fullDimension;\r\n });\r\n\r\n return fullDimensionPromise;\r\n });\r\n\r\n const dimensionValuesResults = await Promise.all(promises);\r\n\r\n return prepareDimensionsDataResult(dimensionValuesResults);\r\n}\r\n\r\n/**\r\n * The GetDimensionsForSelectedVariantDataAction\r\n * Get the currently selected Variant via the getSelectedVariant data action, and the gets the\r\n * available product dimensions for the variant via the getDimensionValues RetailServer API.\r\n */\r\nexport const getDimensionsForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-dimensions/for-selected-variant',\r\n action: getDimensionsForSelectedVariantAction as IAction,\r\n input: createDimensionsForSelectedVariantInput\r\n});\r\n\r\nexport default getDimensionsForSelectedVariantActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetFranchiseData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number) {\r\n super({\r\n shouldCacheOutput: true,\r\n cacheObjectType: 'FranchiseDataCache',\r\n cacheKey: 'FranchiseDataCache'\r\n });\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n }\r\n public getCacheKey = () => `FranchiseDataCache`;\r\n public getCacheObjectType = () => 'FranchiseDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\nexport interface IFranchise {\r\n \"id\": string;\r\n \"name\": string;\r\n \"address_line_1\": string;\r\n \"address_line_2\": string;\r\n \"city\": string;\r\n \"state_province\": string;\r\n \"postal_code\": string;\r\n \"country\": string;\r\n \"lat\": string;\r\n \"long\": string;\r\n \"distance\": number;\r\n \"website_url\": string;\r\n \"miles\"?: number;\r\n}\r\n\r\nconst _calculateDistance = (latitude1: any, longitude1: any, latitude2: any, longitude2: any) => {\r\n\r\n // The math module contains a function\r\n // named toRadians which converts from\r\n // degrees to radians.\r\n const long1 = longitude1 * Math.PI / 180;\r\n const long2 = longitude2 * Math.PI / 180;\r\n const lat1 = latitude1 * Math.PI / 180;\r\n const lat2 = latitude2 * Math.PI / 180;\r\n\r\n // Haversine formula\r\n const dlon = long2 - long1;\r\n const dlat = lat2 - lat1;\r\n const a = Math.pow(Math.sin(dlat / 2), 2)\r\n + Math.cos(lat1) * Math.cos(lat2)\r\n * Math.pow(Math.sin(dlon / 2), 2);\r\n const c = 2 * Math.asin(Math.sqrt(a));\r\n\r\n // Radius of earth\r\n // for kilometers=6371\r\n // for miles = 3956\r\n const r = 3956;\r\n\r\n // calculate the result\r\n return (c * r);\r\n};\r\n\r\nexport const getFranchiseInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n return new GetFranchiseData();\r\n};\r\n\r\n\r\nexport async function getFranchise(input: GetFranchiseData, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrl = ctx.requestContext.app.config.sociFranchiseDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MAcq1X!!';\r\n const franchiseDataJson = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const franchiseStores: IFranchise[] = [];\r\n franchiseDataJson.data.map((franchise: IFranchise) => {\r\n const miles = _calculateDistance(input.Latitude, input.Longitude, franchise.lat, franchise.long);\r\n if (miles <= (input.Radius || 50)) {\r\n franchise.miles = miles;\r\n franchiseStores.push(franchise);\r\n }\r\n });\r\n\r\n return franchiseStores;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getFranchise,\r\n input: getFranchiseInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetProductBenefitsEnhancedContentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public masterProductID: string = '';\r\n constructor( masterProductID:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsEnhancedContentCache', cacheKey: 'productBenefitsEnhancedContentCache' });\r\n this.masterProductID = masterProductID;\r\n }\r\n public getCacheKey = () => `productBenefitsEnhancedContentCache`;\r\n public getCacheObjectType = () => 'productBenefitsEnhancedContentCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n// tslint:disable: no-any\r\nasync function getEnhancedContentAction(input: GetProductBenefitsEnhancedContentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.productBenefitsEnhancedContentUrl;\r\n const masterProductid = input.masterProductID;\r\n const jsonUrl = jsonUrlFromGlobals || '';\r\n try {\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n if (res && masterProductid) {\r\n const productBenefitData = res.data && res.data[masterProductid];\r\n return productBenefitData;\r\n }\r\n }\r\n catch (error) {\r\n console.log('error', error);\r\n }\r\n return null;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getEnhancedContentAction\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetProductBenefitsData extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private productBenefitsDataUrl: string = '';\r\n constructor(productBenefitsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'productBenefitsDataCache', cacheKey: 'productBenefitsDataCache' });\r\n this.productBenefitsDataUrl = productBenefitsDataUrl;\r\n }\r\n public getProductBenefitsDataUrl = () => this.productBenefitsDataUrl;\r\n public getCacheKey = () => `productBenefitsDataCache`;\r\n public getCacheObjectType = () => 'productBenefitsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.productBenefitsDataUrl) {\r\n return new GetProductBenefitsData(inputData.config.productBenefitsDataUrl);\r\n }\r\n return new GetProductBenefitsData('');\r\n};\r\nasync function action(input: GetProductBenefitsData, ctx: Msdyn365.IActionContext): Promise {\r\n const productBenefitsDataJsonUrl = ctx.requestContext.app.config.productBenefitsDataUrl;\r\n const jsonUrl = productBenefitsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const productBenefitsData = res.data && res.data;\r\n return productBenefitsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPromocodeValue Input Action\r\n */\r\n\r\nexport class GetPromocodeValueInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `getPromoCode`;\r\n public getCacheObjectType = () => 'getPromoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPromocodeValueData {\r\n promocodeValue: [IPromoCode];\r\n}\r\nexport interface IPromoCode {\r\n promoCodeApplied: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPromocodeValueInput();\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: GetPromocodeValueInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const promocodeValue: IPromoCode[] = [];\r\n return promocodeValue;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPromocodeValue',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport class GetReasonsToBuyDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n public categoryName:string ='';\r\n constructor( categoryName:string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'rtbDataCache', cacheKey: 'rtbDataCache' });\r\n this.categoryName = categoryName;\r\n }\r\n public getCacheKey = () => `rtbDataCache`;\r\n public getCacheObjectType = () => 'rtbDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n// tslint:disable: no-any\r\nasync function action(input: GetReasonsToBuyDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.reasonsToBuyJsonUrl;\r\n const categoryName =input.categoryName;\r\n const jsonUrl =jsonUrlFromGlobals || undefined;\r\n if(jsonUrl){\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const reasonsToBuyData = res.data && res.data[categoryName];\r\n return reasonsToBuyData;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action\r\n});\r\n","import { buildCacheKey, getSimpleProducts, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, ICommerceApiSettings, ICreateActionContext } from '@msdyn365-commerce/core';\r\nimport { ProductDeliveryOptions, SalesOrder, SimpleProduct, TransactionType } from '@msdyn365-commerce/retail-proxy';\r\nimport { getDeliveryOptionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getSalesOrderDetailsBySalesIdAsync, getSalesOrderDetailsByTransactionIdAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/SalesOrdersDataActions.g';\r\n\r\ninterface ISalesOrderWithHydrations {\r\n salesOrder: SalesOrder;\r\n products: SimpleProduct[];\r\n productDeliveryOptions?: ProductDeliveryOptions[];\r\n}\r\n\r\n/**\r\n * orderTypes Types of orders\r\n */\r\nexport const enum orderTypes {\r\n salesOrder = 'salesOrder',\r\n transaction = 'transaction'\r\n}\r\n\r\n/**\r\n * Calls the Retail API and returns the sales order\r\n */\r\nconst getSalesOrder = (orderType: string = '', orderId: string = '') => async (ctx: IActionContext): Promise => {\r\n return orderType === orderTypes.salesOrder\r\n ? getSalesOrderDetailsBySalesIdAsync({ callerContext: ctx }, orderId)\r\n : // Local (1) searches the retail server database, and remote (2) searches\r\n // on the headquarters side. All (3) and none (0) are not supported.\r\n getSalesOrderDetailsByTransactionIdAsync({ callerContext: ctx }, orderId, 1);\r\n};\r\n\r\n/**\r\n * Calls the Retail API and returns the products\r\n */\r\nconst getProducts = (productIds: number[] = [], channelId?: number) => async (ctx: IActionContext): Promise => {\r\n const productInputs = productIds.map(productId => new ProductInput(productId, ctx.requestContext.apiSettings, channelId));\r\n return getSimpleProducts(productInputs, ctx);\r\n};\r\n\r\n/**\r\n * Action input\r\n */\r\nexport class GetSalesOrderWithHydrationsInput implements IActionInput {\r\n public orderType: string;\r\n public orderId: string;\r\n private apiSettings: ICommerceApiSettings;\r\n\r\n constructor(orderType: string , orderId: string, apiSettings: ICommerceApiSettings) {\r\n this.orderType = orderType;\r\n this.orderId = orderId;\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`SalesOrderWithHydrations`, this.apiSettings);\r\n public getCacheObjectType = () => `SalesOrderWithHydrations-${this.orderType}-${this.orderId}`;\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * Creates the input required to make the retail api call\r\n */\r\nconst createSalesOrderWithHydrationsInput = (inputData: ICreateActionContext) => {\r\n const { salesId = '', transactionId = '' } = (inputData.requestContext.query && inputData.requestContext.query) || {};\r\n if (salesId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.salesOrder, salesId, inputData.requestContext.apiSettings);\r\n } else if (transactionId) {\r\n return new GetSalesOrderWithHydrationsInput(orderTypes.transaction, transactionId, inputData.requestContext.apiSettings);\r\n }\r\n throw new Error(`createSalesOrderWithHydrationsInput - No salesId or transactionId provided.`);\r\n};\r\n\r\n/**\r\n * Get sales order with hydrations action\r\n */\r\nexport async function getSalesOrderWithHydrationsAction(\r\n input: GetSalesOrderWithHydrationsInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!ctx) {\r\n throw new Error(`getSalesOrderWithHydrationsAction - Action context cannot be null/undefined`);\r\n }\r\n\r\n const { orderType, orderId } = input;\r\n\r\n if (!orderType || !orderId) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No orderType or orderId provided.`);\r\n return {};\r\n }\r\n\r\n const salesOrder = await getSalesOrder(orderType, orderId)(ctx);\r\n\r\n if (!salesOrder) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesOrder found.`);\r\n return {};\r\n }\r\n\r\n // If it is salesInvoice, return salesOrder and empty products\r\n // tslint:disable-next-line:prefer-type-cast\r\n if (salesOrder.TransactionTypeValue === 15 as TransactionType.SalesInvoice) {\r\n return {\r\n salesOrder,\r\n products: []\r\n };\r\n }\r\n\r\n if (!salesOrder.SalesLines || !salesOrder.SalesLines.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No salesLine found.`);\r\n return {};\r\n }\r\n\r\n const productIds: number[] = salesOrder.SalesLines.map(salesLine => salesLine.ProductId || 0).filter(productId => productId);\r\n\r\n if (!productIds || !productIds.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No productId in saleLines found.`);\r\n return {};\r\n }\r\n\r\n const products = await getProducts(productIds, salesOrder.ChannelId)(ctx);\r\n\r\n if (!products || !products.length) {\r\n ctx.trace(`[getSalesOrderWithHydrationsAction] No product found.`);\r\n return {};\r\n }\r\n\r\n const deliveryOptions = await getDeliveryOptionsAsync({ callerContext: ctx, queryResultSettings: {} }, products.map(x => x.RecordId), {}, 4)\r\n .then(result => {\r\n return result;\r\n }).catch((error: Error) => {\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[getDeliveryOptionsForCartLineItems]Error executing action`);\r\n throw new Error('[getDeliveryOptionsForCartLineItems]Error executing action');\r\n });\r\n\r\n return {\r\n salesOrder,\r\n products,\r\n deliveryOptions\r\n };\r\n}\r\n\r\nexport const getSalesOrderWithHydrationsActionDataAction = createObservableDataAction({\r\n id: 'mfrm-get-sales-order-with-hydrations',\r\n action: >getSalesOrderWithHydrationsAction,\r\n input: createSalesOrderWithHydrationsInput\r\n});\r\n\r\nexport default getSalesOrderWithHydrationsActionDataAction;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { filteredURL } from '../Utilities/plp-url-utils';\r\n\r\nexport class GetSeoDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n private seoDataUrl: string = '';\r\n constructor(seoDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'SeoDataCache', cacheKey: 'SeoDataCache' });\r\n this.seoDataUrl = seoDataUrl;\r\n }\r\n\r\n public getSeoDataUrl = () => this.seoDataUrl;\r\n public getCacheKey = () => `SeoDataCache`;\r\n public getCacheObjectType = () => 'SeoDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.seoDataUrl) {\r\n return new GetSeoDataInput(inputData.config.seoDataUrl);\r\n }\r\n return new GetSeoDataInput('');\r\n};\r\n\r\n// tslint:disable: no-any\r\nasync function action(input: GetSeoDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.seoDataUrl;\r\n // TODO: Just remove the fallback\r\n const jsonUrl = jsonUrlFromGlobals || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const filteredUrlPath = filteredURL(ctx.requestContext);\r\n const seoData = filteredUrlPath && res.data && res.data[filteredUrlPath];\r\n return seoData && seoData[0];\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nexport class GetSleepDisruptorIcons extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n private sleepDisuptorIconsDataUrl: string = '';\r\n constructor(sleepDisuptorIconsDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'sleepDisuptorIconsDataCache', cacheKey: 'sleepDisuptorIconsDataCache' });\r\n this.sleepDisuptorIconsDataUrl = sleepDisuptorIconsDataUrl;\r\n }\r\n public getSleepDisuptorIconsDataUrl = () => this.sleepDisuptorIconsDataUrl;\r\n public getCacheKey = () => `sleepDisuptorIconsDataCache`;\r\n public getCacheObjectType = () => 'sleepDisuptorIconsDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.sleepDisuptorIconsDataUrl) {\r\n return new GetSleepDisruptorIcons(inputData.config.sleepDisuptorIconsDataUrl);\r\n }\r\n return new GetSleepDisruptorIcons('');\r\n};\r\nasync function action(input: GetSleepDisruptorIcons, ctx: Msdyn365.IActionContext): Promise {\r\n const sleepDisuptorIconsDataJsonUrl = ctx.requestContext.app.config.sleepDisruptorIconDataUrl;\r\n const jsonUrl = sleepDisuptorIconsDataJsonUrl || '';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const sleepDisuptorIconsData = res.data && res.data;\r\n return sleepDisuptorIconsData;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n input: createInput\r\n});","import { IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\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 { ChannelDeliveryOption, OrgUnitAvailability, OrgUnitLocation, SearchArea, StoreHours } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n /*getChannelDeliveryOptionsAsync,*/ getOrgUnitLocationsByAreaAsync,\r\n getStoreHoursAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\n// import {FeatureStateInput, getFeatureStateAction} from './get-feature-state';\r\n\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class GetOrgUnitLocationsByAreaInput implements IActionInput {\r\n public Latitude?: number;\r\n public Longitude?: number;\r\n public Radius?: number;\r\n public DistanceUnitValue?: number;\r\n public IgnoreLocation?: boolean;\r\n\r\n constructor(_Latitude?: number, _Longitude?: number, _Radius?: number, _DistanceUnitValue?: number, _IgnoreLocation?: boolean) {\r\n this.Latitude = _Latitude;\r\n this.Longitude = _Longitude;\r\n this.Radius = _Radius;\r\n this.DistanceUnitValue = _DistanceUnitValue;\r\n this.IgnoreLocation = _IgnoreLocation;\r\n }\r\n\r\n public getCacheKey = () => `GetOrgUnitLocationsByAreaInput`;\r\n public getCacheObjectType = () => 'GetOrgUnitLocationsByAreaInput';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nexport const createGetOrgUnitLocationsByAreaInput = (inputData: ICreateActionContext>): GetOrgUnitLocationsByAreaInput => {\r\n return new GetOrgUnitLocationsByAreaInput();\r\n};\r\n\r\n/**\r\n * Calls the Retail Feature State API and returns a list of feature with isEnabled flag.\r\n */\r\n// export async function getFeatureState(context: IActionContext): Promise {\r\n// return getFeatureStateAction(new FeatureStateInput(), context);\r\n// }\r\n\r\n/**\r\n * Action method for the getSelectedVariant data action\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\nexport async function getOrgUnitLocationsByArea(\r\n input: GetOrgUnitLocationsByAreaInput,\r\n ctx: IActionContext\r\n): Promise {\r\n if ((input.Radius === undefined || !input.Latitude || !input.Longitude) && !input.IgnoreLocation) {\r\n // No valid location we want to return empty array so module can show no locations message\r\n return [];\r\n }\r\n\r\n const searchArea: SearchArea = {\r\n Latitude: input.Latitude,\r\n Longitude: input.Longitude,\r\n Radius: input.Radius,\r\n DistanceUnitValue: input.DistanceUnitValue || 0 // 0 is miles\r\n };\r\n\r\n // const featureState = await getFeatureState(ctx);\r\n // const retailMulitplePickupMFeatureState = featureState?.find(item => item.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature')?.IsEnabled;\r\n\r\n return getOrgUnitLocationsByAreaAsync({ callerContext: ctx, queryResultSettings: { Paging: { Top: 4 } } }, searchArea)\r\n .then(async (stores: OrgUnitLocation[]) => {\r\n const locationDeliveryOptions: ChannelDeliveryOption[] | undefined = [];\r\n // if mulitple pickup mode is enable then call getchanneldeliveryoption\r\n // if(retailMulitplePickupMFeatureState) {\r\n // const orgUnitChannel = stores.map(store => store.ChannelId);\r\n // locationDeliveryOptions = await _getLocationPickUpDeliveryModes(orgUnitChannel, ctx);\r\n // }\r\n const locationPromiseList = stores.map(store => {\r\n const locationDeliveryOption = locationDeliveryOptions?.find(\r\n _channeldeliveryoption => _channeldeliveryoption.ChannelId === store.ChannelId\r\n );\r\n return _getLocationWithHours(store, locationDeliveryOption, ctx);\r\n });\r\n return Promise.all(locationPromiseList);\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetOrgUnitLocationsByArea] error getting Locations');\r\n ctx.trace(error.message);\r\n ctx.telemetry.error(error.message);\r\n ctx.telemetry.debug(`[GetOrgUnitLocationsByArea] error getting Locations`);\r\n return [];\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param orgUnitLocation The org unit location\r\n * @param storeMap a map that contains store information group by the inventory location id\r\n * @param ctx The action context\r\n */\r\nasync function _getLocationWithHours(\r\n orgUnitLocation: OrgUnitLocation,\r\n channelDeleiveryOptions: ChannelDeliveryOption | undefined,\r\n ctx: IActionContext\r\n): Promise {\r\n if (!orgUnitLocation || !orgUnitLocation.OrgUnitNumber) {\r\n return { OrgUnitAvailability: undefined };\r\n }\r\n\r\n return getStoreHoursAsync({ callerContext: ctx }, orgUnitLocation.OrgUnitNumber)\r\n .then((hours: StoreHours) => {\r\n const availability: OrgUnitAvailability = {\r\n OrgUnitLocation: orgUnitLocation\r\n };\r\n\r\n if (hours && !(hours instanceof Error)) {\r\n return { OrgUnitAvailability: availability, StoreHours: hours, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n }\r\n\r\n return { OrgUnitAvailability: availability, OrgUnitPickUpDeliveryModes: channelDeleiveryOptions };\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace('[GetFullAvailableInventoryNearby] error getting availability with hours');\r\n ctx.trace(error.message);\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] error getting availability with hours`);\r\n return { OrgUnitAvailability: {} };\r\n });\r\n}\r\n\r\n/**\r\n * Action method that obtains the store information\r\n * @param channelCollection The org unit channel Id list\r\n * @param ctx The action context\r\n */\r\n// VSI Customization Start\r\n// Need to comment this function because we removed featuresState data-action import.\r\n// async function _getLocationPickUpDeliveryModes(\r\n// channelCollection: (number| undefined)[],\r\n// ctx: IActionContext): Promise {\r\n// if (channelCollection?.length === 0 || channelCollection === undefined) {\r\n// return undefined;\r\n// }\r\n\r\n// const channelIdList: number[] = [];\r\n// channelCollection?.map(id => {\r\n// if(id !== undefined) {\r\n// return channelIdList.push(id);\r\n// }\r\n// return null;\r\n// });\r\n\r\n// // to get all channel pickup delivery mode filterOption should be 4\r\n// return getChannelDeliveryOptionsAsync({ callerContext: ctx }, channelIdList, 4)\r\n// .then((channelDeliveryOptions: ChannelDeliveryOption[]) => {\r\n\r\n// if (channelDeliveryOptions && !(channelDeliveryOptions instanceof Error)) {\r\n// return channelDeliveryOptions;\r\n// }\r\n\r\n// return undefined;\r\n// })\r\n// .catch((error: Error) => {\r\n// ctx.trace('[GetFullAvailableInventoryNearby][getChannelDeliveryOptionsAsync] error getting availability with channel delivery options');\r\n// ctx.trace(error.message);\r\n// ctx.telemetry.exception(error);\r\n// ctx.telemetry.debug(`[GetFullAvailableInventoryNearby] [getChannelDeliveryOptionsAsync] error getting availability with channel delivery options`);\r\n// return [];\r\n// });\r\n// }\r\n\r\n/**\r\n * The complete getOrgUnitLocationsByArea data action\r\n */\r\nexport const getOrgUnitLocationsByAreaDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-store-location-information',\r\n action: >getOrgUnitLocationsByArea,\r\n input: createGetOrgUnitLocationsByAreaInput\r\n});\r\n\r\nexport default getOrgUnitLocationsByAreaDataAction;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { mFIATPInventoryDynamicAsync } from '../actions/CoreProductDataActionExtension.g';\r\nimport {\r\n IMFIATPInventoryDynamicResponse, IMFICartLine, IMFICLDeliveryScheduleParameters\r\n} from '../actions/CoreProductDataServiceEntities.g';\r\n\r\n/**\r\n * MfiAtpInventory Input Action\r\n */\r\nexport class MfiAtpInventoryInput implements Msdyn365.IActionInput {\r\n // MfiAtpInventory: Construct the input needed to run the action\r\n public inventoryType: string;\r\n public weeks: number;\r\n public storeId: string;\r\n public page: string;\r\n public requestedDate: string;\r\n public zipCode: string;\r\n public itemLines: IMFICartLine[];\r\n\r\n constructor(inventoryType: string, weeks: number, storeId: string, page: string, requestedDate: string, zipCode: string, itemLines: IMFICartLine[]) {\r\n this.inventoryType = inventoryType;\r\n this.weeks = weeks;\r\n this.storeId = storeId;\r\n this.page = page;\r\n this.requestedDate = requestedDate;\r\n this.zipCode = zipCode;\r\n this.itemLines = itemLines;\r\n }\r\n\r\n // MfiAtpInventory: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `MfiAtpInventory`;\r\n public getCacheObjectType = () => 'MfiAtpInventory';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// MfiAtpInventory: Create a data model here or import one to capture the response of the action\r\nexport interface IMfiAtpInventoryData {\r\n text: string;\r\n}\r\n\r\n\r\n/**\r\n * MfiAtpInventory: Use this function to call your action and process the results as needed\r\n */\r\nexport async function mfiAtpInventoryAction(input: MfiAtpInventoryInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n const requestBody: IMFICLDeliveryScheduleParameters = {\r\n InventoryType: input.inventoryType,\r\n Weeks: input.weeks,\r\n StoreId: input.storeId,\r\n Page: input.page,\r\n RequestedDate: input.requestedDate,\r\n ZipCode: input.zipCode,\r\n ItemLines: input.itemLines\r\n };\r\n\r\n const response = await mFIATPInventoryDynamicAsync({ callerContext: ctx }, requestBody);\r\n return response;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >mfiAtpInventoryAction,\r\n // MfiAtpInventory: Give your data action a unique id\r\n id: 'MfiAtpInventory'\r\n // input: createInput\r\n // MfiAtpInventory: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IMFIBonusItemsDetailsEntity } from '../actions/BonusItemDataServiceEntities.g';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MFIbonusitemsInput implements Msdyn365.IActionInput {\r\n public getCacheKey = () => `mfibonusitems`;\r\n public getCacheObjectType = () => 'mfibonusitems';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IMFIBonusItems {\r\n bonusItems: IMFIBonusItemsDetailsEntity[] | undefined;\r\n}\r\n\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MFIbonusitemsInput();\r\n};\r\n\r\nasync function action(input: MFIbonusitemsInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const bonusItems: IMFIBonusItemsDetailsEntity[] | undefined = [];\r\n return bonusItems;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'MFIbonusitems',\r\n input: createInput\r\n});\r\n\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * MfrmNotification Input Action\r\n */\r\n\r\nexport class MfrmNotificationInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `promoCode`;\r\n public getCacheObjectType = () => 'promoCode';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IMfrmNotificationState {\r\n notifications: [INotification];\r\n}\r\n\r\nexport interface INotification {\r\n id?: number | string | undefined;\r\n type?: string;\r\n value?: string | undefined;\r\n status?: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new MfrmNotificationInput();\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: MfrmNotificationInput, ctx: Msdyn365.IActionContext): Promise {\r\n // tslint:disable-next-line: no-unnecessary-local-variable\r\n const notifications: INotification[] = [];\r\n return notifications;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'MfrmNotification',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentCcCardTypes Input Action\r\n */\r\nexport class PaymentCcCardTypesInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `payment-cc-card-types`;\r\n public getCacheObjectType = () => 'payment-cc-card-types';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentCcCardTypesData {\r\n cardType: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentCcCardTypesInput();\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: PaymentCcCardTypesInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { cardType: '' };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'PaymentCcCardTypes',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * PaymentErrorState Input Action\r\n */\r\nexport class PaymentErrorStateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() { }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `PaymentErrorState`;\r\n public getCacheObjectType = () => 'PaymentErrorState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IPaymentErrorState {\r\n errorTitle: string;\r\n errorMessage: string;\r\n progressiveLinkText: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new PaymentErrorStateInput();\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: PaymentErrorStateInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { errorTitle: \"\", errorMessage: \"\", progressiveLinkText: \"\" };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'PaymentErrorState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport { getProductImageUrls } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\n\r\nexport const getProductsByCategoryList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let categoryId: number;\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n // If the category ID has been provided from the list metadata use it, otherwise grab the category ID from context\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryId = input.listMetadata.categoryIds[0];\r\n } else if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME && urlTokens.recordId) {\r\n categoryId = +urlTokens.recordId;\r\n } else if (urlTokens && urlTokens.categories && urlTokens.categories.length > 0) {\r\n categoryId = +urlTokens.categories[0];\r\n } else {\r\n // Unable to determine category from list meta data or context\r\n throw new Error('CategoryId Missing for ProductsByCategory List');\r\n }\r\n context.telemetry.debug(`Category Id input to ProductsByCategory action : ${categoryId}`);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Context: {\r\n ChannelId: +input.channelId,\r\n CatalogId: +input.catalogId\r\n },\r\n CategoryIds: [categoryId],\r\n IncludeAttributes: true\r\n };\r\n\r\n return searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n )\r\n .then((products: ProductSearchResult[]) => {\r\n context.telemetry.debug('Products returned by ProductByCategory action', products);\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n })\r\n .catch(error => {\r\n context.telemetry.error(`Error running ProductByCategory action: ${error}`);\r\n throw new Error(error);\r\n });\r\n};\r\n\r\nexport const getProductsByCategoryListAction = createObservableDataAction({\r\n action: >getProductsByCategoryList,\r\n id: '@msdyn365-commerce/products-by-category'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport { IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport { readAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport { getProductRatingsAsync, searchByCriteriaAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { getElementsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/RecommendationsDataActions.g';\r\nimport {\r\n Cart,\r\n ProductSearchCriteria,\r\n ProductSearchResult,\r\n RecommendationCriteria,\r\n RecommendedElement\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { CATEGORY_PAGE_NAME, PDP_PAGE_NAME, PICKS_FOR_YOU_LIST } from '@msdyn365-commerce/runtime-internal/dist/lib/consts';\r\n// @ts-ignore\r\nimport * as getSimpleProducts from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\n// tslint:disable-next-line:no-duplicate-imports\r\nimport { ProductInput } from '@msdyn365-commerce/runtime-internal/dist/lib/hydrators/get-simple-products';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types/hydrators/hydrator-action-inputs';\r\nimport * as semver from 'semver';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRecommendationId action`);\r\n};\r\n\r\nconst enum CartTokenPrefix {\r\n Auth = 't',\r\n Anon = 'p'\r\n}\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\n/**\r\n * Constructs the category context for a recommendation call. If page context is selected the category dervided from page context\r\n * (current page) will be used. If instead a spefic category is chosen as context that category will be used instead.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getCategoryIdForReco = (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let categoryIds: number[] = [];\r\n\r\n if (input.listMetadata.includePageContext || !input.listMetadata.categoryIds || input.listMetadata.categoryIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.pageType && urlTokens.pageType.toLowerCase() === CATEGORY_PAGE_NAME) {\r\n if (urlTokens.recordId) {\r\n categoryIds = [+urlTokens.recordId];\r\n }\r\n }\r\n } else {\r\n // Use category from a specific context if provided\r\n if (input.listMetadata.categoryIds && input.listMetadata.categoryIds.length > 0) {\r\n categoryIds = input.listMetadata.categoryIds;\r\n }\r\n }\r\n\r\n recommendationCriteria.CategoryIds = categoryIds;\r\n};\r\n\r\n/**\r\n * Fetches the current active cart to be used when cart context\r\n * is selected for a reco list\r\n *\r\n * @param ctx The current action context\r\n */\r\nconst getCart = async (ctx: IActionContext): Promise => {\r\n let cart;\r\n if (ctx.requestContext && ctx.requestContext.cookies) {\r\n const cookies = ctx.requestContext && ctx.requestContext.cookies;\r\n const cartCookie = cookies.getCartCookie();\r\n const cartCookieParts = cartCookie.split(':');\r\n if (cartCookieParts && cartCookieParts.length === 2) {\r\n if (\r\n (ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Auth) ||\r\n (!ctx.requestContext.user.isAuthenticated && cartCookieParts[0] === CartTokenPrefix.Anon)\r\n ) {\r\n const readCart = await readAsync({ callerContext: ctx }, cartCookieParts[1]);\r\n if (readCart && readCart.Id) {\r\n cart = readCart;\r\n }\r\n }\r\n }\r\n }\r\n return cart;\r\n};\r\n\r\n/**\r\n * Constructs the product context for a recommendation call. If cart context is selected, products currently in the active cart will\r\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.\r\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.\r\n *\r\n * @param recommendationCriteria The criteria that will be used for the recommendation API call\r\n * @param input The ProductListInput provided to the action\r\n * @param context The current action context\r\n */\r\nconst getProductIdForReco = async (recommendationCriteria: RecommendationCriteria, input: ProductListInput, context: IActionContext) => {\r\n let productIds: number[] = [];\r\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\r\n if (input.listMetadata.includeCart) {\r\n const cart = await getCart(context);\r\n if (cart && cart.CartLines) {\r\n const validCartLines = cart.CartLines.filter(element => element.ProductId !== undefined);\r\n const cartProductIds = validCartLines.map(product => product.ProductId);\r\n context.telemetry.debug(`Products in cart: ${cartProductIds}`);\r\n // If the cart isn't empty, assign the products in the cart to the productIds for seeding\r\n if (cartProductIds && cartProductIds.length > 0) {\r\n // @ts-ignore compiler alerts that cartProductIds is of type (number | undefined)[]\r\n // however, we filter on undefined product ids first before mapping on product ids so each element must be defined\r\n productIds = cartProductIds;\r\n }\r\n }\r\n } else if (input.listMetadata.includePageContext || !input.listMetadata.productIds || input.listMetadata.productIds.length === 0) {\r\n const urlTokens = context.requestContext.urlTokens;\r\n\r\n if (urlTokens && urlTokens.recordId && urlTokens.pageType && urlTokens.pageType.toLowerCase() === PDP_PAGE_NAME) {\r\n productIds = [+urlTokens.recordId];\r\n }\r\n } else {\r\n // Use the product from specfic context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n productIds = [input.listMetadata.productIds[0]];\r\n }\r\n }\r\n\r\n recommendationCriteria.ProductIds = productIds;\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRecommendationList = async (input: ProductListInput, context: IActionContext): Promise => {\r\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\r\n const customerAccountNumber =\r\n context.requestContext && context.requestContext.user && context.requestContext.user.customerAccountNumber;\r\n if (input.listMetadata.recommendationListId === PICKS_FOR_YOU_LIST && !customerAccountNumber) {\r\n return [];\r\n }\r\n\r\n const recommendationCriteria: RecommendationCriteria = {};\r\n const proxyContext: IContext = { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } };\r\n recommendationCriteria.CatalogId = input.catalogId;\r\n\r\n let reccomendationListId = '';\r\n if (input.listMetadata.recommendationListId) {\r\n reccomendationListId = input.listMetadata.recommendationListId;\r\n } else {\r\n actionInputError(`recommendationListId (from listmetadata)`);\r\n }\r\n\r\n getCategoryIdForReco(recommendationCriteria, input, context);\r\n await getProductIdForReco(recommendationCriteria, input, context);\r\n\r\n if ((input.listMetadata.personalization || reccomendationListId === PICKS_FOR_YOU_LIST) && customerAccountNumber) {\r\n recommendationCriteria.CustomerAccountNumber = customerAccountNumber;\r\n proxyContext.bypassCache = 'get';\r\n }\r\n\r\n context.telemetry.debug(`Recommendation Criteria: ${JSON.stringify(recommendationCriteria)}`);\r\n\r\n // @ts-ignore\r\n return (\r\n getElementsAsync(proxyContext, reccomendationListId, recommendationCriteria)\r\n .then(async (recommendedElements: RecommendedElement[]) => {\r\n if (recommendedElements) {\r\n const productInputs: ProductInput[] = [];\r\n const productTypeId: string[] = [];\r\n // Grab all the elements that are products and store the product ids\r\n for (let i = 0; i < recommendedElements.length; i++) {\r\n const element = recommendedElements[i];\r\n // Element type value of 1 indicates product type\r\n if (element.ElementId && element.ElementTypeValue === 1) {\r\n productInputs[i] = new ProductInput(+element.ElementId, context.requestContext.apiSettings);\r\n productTypeId[i] = element.ElementId;\r\n }\r\n }\r\n context.telemetry.debug(`Running recommendation action for list ${input.listMetadata.recommendationListId}`);\r\n context.telemetry.debug(`Number of products returned: ${productTypeId.length}`);\r\n context.telemetry.debug('Product ids returned', productTypeId);\r\n\r\n if (productInputs.length) {\r\n // Check to see if retail proxy version is greater than min version required for new API\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = productInputs.map(value => value.productId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n\r\n // Get Product Ratings Block (If needed)\r\n const productRatingsPromise = getProductRatingsAsync(\r\n { callerContext: context },\r\n productInputs.map(productInput => productInput.productId)\r\n );\r\n\r\n return getSimpleProducts(productInputs, context).then((products: ProductSearchResult[]) => {\r\n getProductImageUrls(products, context.requestContext.apiSettings);\r\n products = orderProductSearchResults(\r\n productInputs.map(value => value.productId),\r\n products\r\n );\r\n return productRatingsPromise.then(productRatings => {\r\n productRatings.forEach(productRating => {\r\n const unratedProduct: ProductSearchResult = (\r\n products.find(mappedProduct => mappedProduct.RecordId === productRating.ProductId)\r\n );\r\n if (unratedProduct) {\r\n unratedProduct.TotalRatings = productRating.TotalRatings;\r\n unratedProduct.AverageRating = productRating.AverageRating;\r\n }\r\n });\r\n\r\n return products;\r\n });\r\n });\r\n }\r\n }\r\n return [];\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((error: any) => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n })\r\n );\r\n};\r\n\r\nexport const getProductsByRecommendationListAction = createObservableDataAction({\r\n action: >getProductsByRecommendationList,\r\n id: '@msdyn365-commerce/products-by-recommendation'\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n// @ts-ignore\r\nimport * as semver from 'semver';\r\n\r\nimport { createObservableDataAction } from '@msdyn365-commerce/action-internal';\r\nimport { IAction, IActionContext } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n getByIdAsync,\r\n getRelatedProductsAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductSearchCriteria, ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n// @ts-ignore\r\nimport { getProductImageUrls, orderProductSearchResults } from '@msdyn365-commerce/runtime-internal/dist/lib/utils/product-list-utils';\r\nimport { ProductListInput } from '@msdyn365-commerce/runtime-internal/dist/types';\r\n\r\nconst MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS = '9.16.8';\r\n\r\nconst actionInputError = (missingType: string) => {\r\n throw new Error(`Input ${missingType} is missing and required to run GetProductsByRelationship action`);\r\n};\r\n\r\n// tslint:disable-next-line: max-func-body-length\r\nexport const getProductsByRelationshipIdList = async (input: ProductListInput, context: IActionContext): Promise => {\r\n let productId;\r\n let relationshipId;\r\n // Grab the product ID from the list meta data or context\r\n if (input.listMetadata.productIds && input.listMetadata.productIds.length > 0) {\r\n const productResponse: SimpleProduct | SimpleProduct[] = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n input.listMetadata.productIds[0],\r\n input.channelId\r\n );\r\n const baseProduct: SimpleProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = input.listMetadata.productIds[0];\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else if (context.requestContext.urlTokens && context.requestContext.urlTokens.itemId) {\r\n const productResponse = await getByIdAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n +context.requestContext.urlTokens.itemId,\r\n input.channelId\r\n );\r\n const baseProduct = Array.isArray(productResponse) ? productResponse[0] : productResponse;\r\n productId = +context.requestContext.urlTokens.itemId;\r\n if (baseProduct.hasOwnProperty('MasterProductId') && baseProduct.MasterProductId > 0) {\r\n productId = baseProduct.MasterProductId;\r\n }\r\n } else {\r\n actionInputError('productId');\r\n }\r\n // The relationship ID must be provided with the list meta data\r\n if (input.listMetadata.relationshipId) {\r\n relationshipId = +input.listMetadata.relationshipId;\r\n } else {\r\n actionInputError('relationshipId');\r\n }\r\n context.telemetry.debug(`Product Id input to productByRelationship action: ${productId}`);\r\n context.telemetry.debug(`Relationship Id input to productByRelationship action: ${relationshipId}`);\r\n\r\n return getRelatedProductsAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n // @ts-ignore\r\n productId,\r\n input.channelId,\r\n input.catalogId,\r\n // @ts-ignore\r\n relationshipId\r\n ).then(\r\n /*VSI Customization - START\r\n This data-action is customized as per Microsoft's guidance to use searchByCriteriaAsync call to get\r\n product attributes for related to products product-collection list\r\n */\r\n async (products: ProductSearchResult[]) => {\r\n context.telemetry.debug('Products returned by getRelatedProducts action', products);\r\n if (products.length) {\r\n if (\r\n semver.gte(\r\n semver.coerce(context.requestContext.apiSettings.retailServerProxyVersion) || '',\r\n MIN_RETAIL_PROXY_VERSION_FOR_PRODUCT_SEARCH_RESULTS\r\n )\r\n ) {\r\n const itemIds: number[] = products.map(value => value.RecordId);\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: itemIds,\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n let productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context, queryResultSettings: { Paging: { Top: input.listMetadata.pageSize || 10 } } },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n getProductImageUrls(productSearchResults, context.requestContext.apiSettings);\r\n productSearchResults = orderProductSearchResults(itemIds, productSearchResults);\r\n return productSearchResults;\r\n }\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n }\r\n }\r\n return getProductImageUrls(products, context.requestContext.apiSettings);\r\n }\r\n }\r\n )\r\n // @ts-ignore\r\n .catch(error => {\r\n context.telemetry.error(`Error running productByRecommendation action: ${error}`);\r\n throw new Error(error);\r\n });\r\n /*VSI Customization - END*/\r\n};\r\n\r\nexport const getProductsByRelationshipIdListAction = createObservableDataAction({\r\n action: >getProductsByRelationshipIdList,\r\n id: '@msdyn365-commerce/products-by-relationship-id'\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n// tslint:disable-next-line: no-duplicate-imports\r\nimport { IActionContext } from '@msdyn365-commerce/core';\r\nimport { CacheType, QueryResultSettings, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getByIdsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * GetProductById Input Action\r\n */\r\n\r\nexport class GetProductsByIdInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public productIdsArr: number[];\r\n\r\n public channelId: number;\r\n public queryResultSettings: QueryResultSettings;\r\n constructor(productIdsArr: number[], channelId: number, queryResultSettings: QueryResultSettings) {\r\n this.productIdsArr = productIdsArr;\r\n this.channelId = channelId;\r\n this.queryResultSettings = queryResultSettings;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n\r\n public getCacheKey = () =>\r\n `Get-Products-By-Id-${this.productIdsArr && this.productIdsArr.length >= 1 ? this.productIdsArr.join('-') : ''}`;\r\n public getCacheObjectType = () => 'GetProductsById';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\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 getProductsByIdAction(input: GetProductsByIdInput, ctx: IActionContext): Promise {\r\n if (input.productIdsArr && input.productIdsArr.length >= 1) {\r\n const ctxObject = { callerContext: ctx, queryResultSettings: input.queryResultSettings, bypass: 'none' };\r\n let result;\r\n try {\r\n result = await getByIdsAsync(ctxObject, input.channelId, input.productIdsArr);\r\n if (result) {\r\n return result;\r\n }\r\n } catch (error) {\r\n console.log('error', error);\r\n }\r\n }\r\n return null;\r\n}\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getProductsByIdAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetProductsById'\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ProgressiveLeasingModalState Input Action\r\n */\r\nexport class ProgressiveLeasingModalStateInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() { }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `ProgressiveLeasingModalState`;\r\n public getCacheObjectType = () => 'ProgressiveLeasingModalState';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IProgressiveLeasingModalStateData {\r\n isOpen: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ProgressiveLeasingModalStateInput();\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: ProgressiveLeasingModalStateInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isOpen: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'ProgressiveLeasingModalState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IPromoCodeAppliedOnCartState {\r\n isInProcess?: boolean;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class PromoCodeAppliedOnCartInput implements IActionInput {\r\n public getCacheKey = () => `PromoCodeAppliedOnCartInput`;\r\n public getCacheObjectType = () => 'PromoCodeAppliedOnCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updatePromoCodeAppliedOnCartProgressAction(input: PromoCodeAppliedOnCartInput, ctx: IActionContext): Promise {\r\n return { isInProcess: undefined };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new PromoCodeAppliedOnCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updatePromoCodeAppliedOnCartProgressAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * RedirectToWmapSubmitPayment Input Action\r\n */\r\nexport class RedirectToWmapSubmitPaymentInput implements Msdyn365.IActionInput {\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `RedirectToWmapSubmitPayment`;\r\n public getCacheObjectType = () => 'RedirectToWmapSubmitPayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\nexport interface IRedirectToWmapSubmitPaymentData {\r\n redirectToWmapSubmitPayment: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new RedirectToWmapSubmitPaymentInput();\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: RedirectToWmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n return { redirectToWmapSubmitPayment: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n id: 'RedirectToWmapSubmitPayment',\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 { createObservableDataAction, IAction, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { IDataServiceRequest, retailAction } from '@msdyn365-commerce/retail-proxy/dist';\r\nimport { createSearchOrgUnitLocationsInput } from '@msdyn365-commerce/retail-proxy/dist/DataActions/OrgUnitsDataActions.g';\r\nimport { ProductSearchResult, QueryResultSettings } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n\r\nexport const buildQueryResultSettings = (inputData: ICreateActionContext, IGeneric>): QueryResultSettings => {\r\n try {\r\n // not using this data-action for now, so overriding Top value to 4.\r\n // incase original functionality is required please remove this file.\r\n return { Paging: { Top: 4, Skip: 0 } };\r\n } catch {\r\n return {};\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Search Org Unit Locations action createInput method.\r\n * @param inputData\r\n */\r\nexport function createSearchOrgUnitLocationsInputFunc(inputData: ICreateActionContext, IGeneric>): IDataServiceRequest {\r\n return createSearchOrgUnitLocationsInput(buildQueryResultSettings(inputData), {});\r\n}\r\n\r\nexport const retailActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/search-org-unit-locations',\r\n action: >retailAction,\r\n input: createSearchOrgUnitLocationsInputFunc\r\n});\r\n\r\nexport default retailActionDataAction;\r\n\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * ToggleSynchronySubmitOrderButton Input Action\r\n */\r\nexport class ToggleSubmitOrderButtonInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `toggle-submit-order-button`;\r\n public getCacheObjectType = () => 'toggle-submit-order-button';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IToggleSubmitOrderButtonData {\r\n isSynchronySelected: boolean;\r\n isPaypalSelected: boolean;\r\n isCreditcardSelected: boolean;\r\n isCcFieldsNotPopulated: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new ToggleSubmitOrderButtonInput();\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: ToggleSubmitOrderButtonInput, 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 Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { isSynchronySelected: false, isPaypalSelected: false, isCreditcardSelected: false, isCcFieldsNotPopulated: true };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'ToggleSubmitOrderButton',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\r\nexport interface IUpdateEmailCart {\r\n checkEmail: boolean | null;\r\n}\r\n\r\n/**\r\n * SampleState - action input\r\n */\r\nexport class UpdateEmailCartInput implements IActionInput {\r\n public getCacheKey = () => `UpdateEmailCartInput`;\r\n public getCacheObjectType = () => 'UpdateEmailCartInput';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * SampleState - action\r\n */\r\nexport async function updateEmailCartAction(input: UpdateEmailCartInput, ctx: IActionContext): Promise {\r\n return { checkEmail: null };\r\n}\r\n\r\n/**\r\n * SampleState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new UpdateEmailCartInput();\r\n};\r\n\r\n/**\r\n * SampleState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >updateEmailCartAction,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport axios from 'axios';\r\n/**\r\n * WmapGetOrderDetails Input Action\r\n */\r\nexport class WmapGetOrderDetailsInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n private orderDetailsAPIurl: string = '';\r\n private orderId: string = '';\r\n constructor(orderDetailsAPIurl: string, orderId: string) {\r\n super({ shouldCacheOutput: false, cacheObjectType: 'WmapGetOrderDetails', cacheKey: 'WmapGetOrderDetails' });\r\n this.orderDetailsAPIurl = orderDetailsAPIurl;\r\n this.orderId = orderId;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getOrderDetailsAPIurl = () => this.orderDetailsAPIurl;\r\n public getOrderId = () => this.orderId;\r\n public getCacheKey = () => `WmapGetOrderDetails`;\r\n public getCacheObjectType = () => 'WmapGetOrderDetails';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IWmapGetOrderDetailsData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n\r\n if (inputData.config && inputData.config.orderDetailsAPIurl) {\r\n if (inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.orderId) {\r\n // console.log(\"input data: \" + inputData.requestContext.query.orderId);\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, inputData.requestContext.query.orderId);\r\n } else {\r\n return new WmapGetOrderDetailsInput(inputData.config.orderDetailsAPIurl, '');\r\n }\r\n }\r\n return new WmapGetOrderDetailsInput('', '');\r\n};\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\n// tslint:disable: no-any\r\nasync function action(input: WmapGetOrderDetailsInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderDetailsApiUrl = input.getOrderDetailsAPIurl();\r\n const salesOrderId = input.getOrderId();\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n const makeaPaymentLink = ctx.requestContext.app.config.wmapPageUrlSuffix?.toLowerCase();\r\n const pathName = ctx.requestContext && ctx.requestContext.url.requestUrl.pathname?.toLowerCase().replace(`/`, '');\r\n try {\r\n if (makeaPaymentLink === pathName) {\r\n const response = await axios.post(`${apiResponseUrl}/${orderDetailsApiUrl}`, {\r\n SalesId: salesOrderId\r\n }, {\r\n headers: {\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n return response.data;\r\n } else {\r\n console.log('Make a Payment URL is not Configured or URL is not valid');\r\n }\r\n\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('error for getting Sales Order Balance', e);\r\n }\r\n}\r\n\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'WmapGetOrderDetails',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { CartTenderLine } from '@msdyn365-commerce/retail-proxy';\r\nimport axios from 'axios';\r\n/**\r\n * GetAuthTokenInput Input Action\r\n */\r\nexport interface ISubmitPaymentPayload {\r\n cartId: string,\r\n receiptEmail: string | undefined,\r\n cartTenderLines: CartTenderLine[] | undefined,\r\n cartVersion: number | undefined\r\n}\r\n\r\nexport class WmapSubmitPaymentInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n public submitPaymentAPIurl: string | undefined;\r\n public submitPaymentPayload: ISubmitPaymentPayload | {};\r\n constructor(submitPaymentAPIurl: string | undefined, submitPaymentPayload: ISubmitPaymentPayload | {}) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'wmapauthorizepayment', cacheKey: 'wmapcapturepayment' });\r\n this.submitPaymentAPIurl = submitPaymentAPIurl;\r\n this.submitPaymentPayload = submitPaymentPayload;\r\n }\r\n\r\n public getCacheKey = () => `wmapcapturepayment`;\r\n public getCacheObjectType = () => 'wmapcapturepayment';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createGetCardPaymentAcceptPointInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.submitPaymentAPIurl) {\r\n return new WmapSubmitPaymentInput(inputData.config.submitPaymentAPIurl, {});\r\n }\r\n return new WmapSubmitPaymentInput('', {});\r\n};\r\n\r\n// tslint:disable: no-any\r\nexport async function WmapSubmitPaymentAction(input: WmapSubmitPaymentInput, ctx: Msdyn365.IActionContext): Promise {\r\n const apiResponseUrl = ctx.requestContext.apiSettings.baseUrl;\r\n const orderIdOun = ctx.requestContext.apiSettings.oun;\r\n try {\r\n const response = await axios.post(`${apiResponseUrl}${input.submitPaymentAPIurl}`,\r\n input.submitPaymentPayload\r\n , {\r\n headers: {\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n 'oun': orderIdOun,\r\n 'Content-Type': 'application/json'\r\n }\r\n });\r\n return response.data;\r\n } catch (e) {\r\n // TODO: will be removed after unit test and deployment on lower environment\r\n console.log('Error for Submit Payment', e);\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >WmapSubmitPaymentAction,\r\n input: createGetCardPaymentAcceptPointInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport Cookies from 'universal-cookie';\r\nexport class GetUnbxdSearchAutoSuggestDataInput implements Msdyn365.IActionInput {\r\n public queryText?: string | undefined;\r\n public popularProducts?: number | undefined;\r\n public inFields?: number | undefined;\r\n public topQueries?: number | undefined;\r\n public keywordSuggestions?: number | undefined;\r\n public promotedSuggestion?: number | undefined;\r\n\r\n public getCacheKey = () => `Unbxd-autoSuggest-data-${this.queryText}`;\r\n public getCacheObjectType = () => 'Unbxd-autoSuggest-data';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n constructor(queryText?: string | undefined, popularProducts?: number | undefined, inFields?: number | undefined, topQueries?: number | undefined, keywordSuggestions?: number | undefined, promotedSuggestion?: number\r\n | undefined) {\r\n this.queryText = queryText;\r\n this.popularProducts = popularProducts;\r\n this.inFields = inFields;\r\n this.topQueries = topQueries;\r\n this.keywordSuggestions = keywordSuggestions;\r\n this.promotedSuggestion = promotedSuggestion;\r\n }\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 getUnbxdSearchAutoSuggestData(input: GetUnbxdSearchAutoSuggestDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n const cookies = new Cookies();\r\n const unbxdUid = cookies.get('unbxd.userId');\r\n const queryText = input?.queryText ? input.queryText : \"\";\r\n const popularProductsCount = input?.popularProducts ? input.popularProducts : 0;\r\n const inFieldsCount = input?.inFields ? input.inFields : 0;\r\n const topQueriesCount = input?.topQueries ? input.topQueries : 0;\r\n const keywordSuggestionsCount = input?.keywordSuggestions ? input.keywordSuggestions : 0;\r\n const promotedSuggestionCount = input?.promotedSuggestion ? input.promotedSuggestion : 0;\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n try {\r\n const unbxdUrl = `https://search.unbxd.io/${unbxdApiKey}/${unbxdSiteKey}/autosuggest?q=${queryText}&popularProducts.count=${popularProductsCount}&inFields.count=${inFieldsCount}&topQueries.count=${topQueriesCount}&keywordSuggestions.count=${keywordSuggestionsCount}&promotedSuggestion.count=${promotedSuggestionCount}&uid=${unbxdUid}`;\r\n const response = await Msdyn365.sendRequest(unbxdUrl, 'get');\r\n if (response) {\r\n return response.data;\r\n }\r\n else { return null; }\r\n } catch (e) {\r\n return null;\r\n }\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getUnbxdSearchAutoSuggestData,\r\n id: 'getUnbxdSearchAutoSuggestData'\r\n});\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IPageSummaryData } from '@msdyn365-commerce-modules/page-summary';\r\nimport { buildCacheKeyWithUrlTokens, CurrentCategoryInput, getCategoryUrl, getCurrentCategory } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CategoryHierarchy, IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getFriendlyName,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext,\r\n IRequestContext\r\n} from '@msdyn365-commerce/core';\r\nimport flatten from 'lodash/flatten';\r\n// VSI customization: 7924 Start\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { canonicalURL, getSortedVirtualRefinerConfig, getVirtualRefinerNames, regExSpecialChars, removeKeywords } from '../../Utilities/plp-url-utils';\r\nimport getSEOData, { GetSeoDataInput } from '../../data-actions/get-seo-data.action';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductRefiner } from '@msdyn365-commerce/retail-proxy';\r\nimport { IMfrmCategoryPageSummaryConfig } from './mfrm-category-page-summary.props.autogenerated';\r\n// VSI customization: 7924 End\r\n\r\n/** Category Page Summary Input */\r\nexport class MFRMCategoryPageSummaryInput implements IActionInput {\r\n public requestContext: IRequestContext;\r\n public config: IMfrmCategoryPageSummaryConfig;\r\n constructor(config: IMfrmCategoryPageSummaryConfig, requestContext: IRequestContext) {\r\n this.config = config || {};\r\n this.requestContext = requestContext;\r\n }\r\n\r\n public getCacheObjectType = (): string => 'MFRMCategoryPageSummary';\r\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('MFRMCategoryPageSummary', this.requestContext)}-${this.requestContext?.url?.requestUrl?.pathname?.toLowerCase()}`;\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nconst createGetCurrentCategoryInput = (inputData: IActionContext): CurrentCategoryInput => {\r\n if (inputData && inputData.requestContext) {\r\n return new CurrentCategoryInput(inputData.requestContext);\r\n }\r\n\r\n throw new Error('Please specify categoryId query string in request.');\r\n};\r\n\r\nconst _getSEOMetaTagValue = (currentCategory: CategoryHierarchy, keyValue: string) => {\r\n return currentCategory?.ExtensionProperties?.find((attr) => attr.Key === keyValue)?.Value?.StringValue;\r\n};\r\n\r\nconst _getActiveRefiners = (refiners: IProductRefinerHierarchy[], requestContext: IRequestContext, CategoryHierarchy: any): string[] | undefined => {\r\n // get refiners from URL\r\n const configVirtualRefinerNames = getVirtualRefinerNames(requestContext, false);\r\n const filteredRefiners = refiners && refiners.filter((refiner) => {\r\n return refiner.KeyName && configVirtualRefinerNames.indexOf(refiner.KeyName.toLowerCase()) !== -1;\r\n });\r\n // get category slug\r\n let slug = (CategoryHierarchy && CategoryHierarchy.Slug) || '';\r\n let slugArray: string[];\r\n let pathArray: string[];\r\n const sortedConfigValues = getSortedVirtualRefinerConfig(requestContext, false);\r\n if (sortedConfigValues && slug) {\r\n slugArray = slug.split('/').splice(1);\r\n // remove keywords form slugArray\r\n slugArray = removeKeywords(slugArray, requestContext);\r\n // FIX reset slug to without keywords\r\n slug = slugArray.join('/');\r\n // path of URL\r\n let path = requestContext.url.requestUrl.pathname.toLowerCase();\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n path = path.replace(`/${categoryId}`, '');\r\n }\r\n // remove category slug\r\n pathArray = removeKeywords(path.split('\\/').splice(1), requestContext);\r\n path = pathArray.join('\\/');\r\n const removedCategorySlug = path.split(slug).splice(1)[0];\r\n let refinerParts: string[] = [];\r\n if (removedCategorySlug !== '') {\r\n refinerParts = decodeURIComponent(removedCategorySlug).split('/');\r\n }\r\n if (refinerParts && refinerParts.length > 0 && slugArray && slugArray.length > 0) {\r\n // remove duplicates if any from the first url part\r\n slugArray.forEach(_slug => {\r\n refinerParts.forEach(refinerPart => {\r\n const index = slugArray.indexOf(refinerPart);\r\n if (index !== -1) {\r\n slugArray.splice(index, 1);\r\n }\r\n });\r\n });\r\n }\r\n const finalRefinerParts: string[] = [];\r\n refinerParts.forEach(refinerPart => {\r\n refinerPart.split('|').map(item => finalRefinerParts.push(item.includes('-') ? item : item.split('-').join(' ')));\r\n });\r\n refinerParts = finalRefinerParts && flatten(finalRefinerParts);\r\n // setup object with refiner values\r\n const sortedValues: { [key: string]: string[] } = {};\r\n filteredRefiners?.forEach(refinerSet => {\r\n let refinerName = refinerSet.KeyName;\r\n if (refinerName) {\r\n refinerName = refinerName.toLowerCase();\r\n sortedValues[refinerName] = []; // size, brand, price\r\n }\r\n refinerSet.Values.forEach((refiner) => {\r\n refinerParts.forEach((refinerPart) => {\r\n if (refinerName && refiner.LeftValueBoundString &&\r\n (refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase().split('-').join(' ')\r\n || refiner.LeftValueBoundString.toLowerCase().replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase())) {\r\n sortedValues[refinerName].push(refiner.LeftValueBoundString);\r\n } else if (refinerName && refiner.LeftValueBoundString &&\r\n refiner.LeftValueBoundString.toLowerCase() === refinerPart.toLowerCase().split('-').join(' ')) {\r\n sortedValues[refinerName].push(refinerPart);\r\n }\r\n });\r\n });\r\n });\r\n // alpha sort\r\n // @ts-ignore\r\n for (const sortedValue of Object.keys(sortedValues)) {\r\n sortedValues[sortedValue].length > 0 &&\r\n sortedValues[sortedValue].sort((a: string, b: string) => {\r\n if (a < b) {\r\n return -1;\r\n }\r\n if (a > b) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n // @ts-ignore\r\n const finalRefiners: string[] = [];\r\n sortedConfigValues.forEach(sortedConfigValue => {\r\n const sortedRefinerName = sortedConfigValue.refinerName.toLowerCase();\r\n if (sortedValues[sortedRefinerName] !== undefined && sortedValues[sortedRefinerName].length > 0) {\r\n // @ts-ignore\r\n finalRefiners.push(sortedValues[sortedRefinerName].join(' '));\r\n }\r\n });\r\n return finalRefiners;\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function getAllRefinersAction(ctx: IActionContext): Promise {\r\n const searchCriteria = {\r\n SearchCondition: '*',\r\n Context: {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n }\r\n };\r\n return getProductSearchRefinersAsync({ callerContext: ctx }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n ).catch((err) => {\r\n console.log('[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects', err);\r\n ctx.telemetry.error(`[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects ${err}`);\r\n return [];\r\n });\r\n}\r\n\r\nasync function getFallbackTitle(context: IActionContext, requestContext: IRequestContext, currentCategory: any): Promise {\r\n let activeRefinerList: string[] | undefined = [];\r\n return getAllRefinersAction(context).then(refiners => {\r\n activeRefinerList = _getActiveRefiners(refiners, requestContext, currentCategory);\r\n const concateTitle = `${activeRefinerList && activeRefinerList?.length > 0 ? activeRefinerList.length === 1 ? ` ${activeRefinerList[0]} ` : ` ${activeRefinerList?.join(' ')} ` : ''}`;\r\n const fallbackTitle = concateTitle && `Shop for${concateTitle}Products | Mattress Firm`;\r\n return fallbackTitle;\r\n }).catch((err) => {\r\n console.log('[getFallbackTitle Category-page-summary] has some errors', err);\r\n context.telemetry.error(`[getFallbackTitle Category-page-summary] has some errors- ${err}`);\r\n return \"\";\r\n });\r\n}\r\n\r\nconst action = async (input: MFRMCategoryPageSummaryInput, context: IActionContext): Promise => {\r\n const { config } = input;\r\n const seoInput = new GetSeoDataInput(context.requestContext.app.config.seoDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7');\r\n const seoData = await getSEOData(seoInput, context);\r\n const seoPageTitle = seoData && seoData['SEO State'] === 'Active' && seoData['Title Tag'];\r\n const seoPageMetaData = seoData && seoData['SEO State'] === 'Active' && seoData['Meta Description'];\r\n let currentCategory: any;\r\n try {\r\n currentCategory = await getCurrentCategory(createGetCurrentCategoryInput(context), context);\r\n } catch (e) {\r\n // Do nothing, if the action fails fallback to values defined in data\r\n }\r\n if (currentCategory) {\r\n let categoryUrl: string | undefined;\r\n let fallbackTitle;\r\n if (!seoPageTitle) {\r\n fallbackTitle = await getFallbackTitle(context, input.requestContext, currentCategory);\r\n }\r\n const pageTitle = seoPageTitle || fallbackTitle || _getSEOMetaTagValue(currentCategory, 'CategoryPageTitle');\r\n const pageTitleParser = getHtmlParserValue(pageTitle);\r\n\r\n const fallBackMeta = 'Find comfortable mattresses, high quality beds, and accessories from top brands all at great low prices at Mattress Firm';\r\n const categoryPageMetaData = seoPageMetaData || fallBackMeta || _getSEOMetaTagValue(currentCategory, 'CategoryPageMetaData');\r\n const categoryPageMetaDataParser = getHtmlParserValue(categoryPageMetaData);\r\n try {\r\n // reset category's name neutralizedName\r\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\r\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\r\n currentCategory.Name = localName;\r\n currentCategory.NeutralizedName = neutralizedName;\r\n categoryUrl = getCategoryUrl(currentCategory);\r\n // @ts-ignore - TODO: property exits in new version of SDK. Remove once released.\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (categoryUrl && canonicalDomain) {\r\n categoryUrl = canonicalURL(context.requestContext).toLocaleLowerCase();\r\n } else {\r\n categoryUrl = undefined;\r\n }\r\n } catch (e) {\r\n categoryUrl = undefined;\r\n }\r\n return {\r\n title: pageTitleParser || currentCategory.Name,\r\n description: categoryPageMetaDataParser || '',\r\n sharingImageUrl: currentCategory.OfflineImage,\r\n canonicalUrl: categoryUrl,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n // If the action fails fallback to values defined from data\r\n } else if (config) {\r\n return {\r\n title: config.title,\r\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n } else {\r\n return {};\r\n }\r\n};\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\r\n action: >action,\r\n input: (args: ICreateActionContext) => {\r\n return new MFRMCategoryPageSummaryInput(args.config, args.requestContext);\r\n }\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getByIdAsync,\r\n getVariantsByDimensionValuesAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n ProductDimension,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n\r\nexport class GetProductRecordidInput implements Msdyn365.IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n public getCacheKey = () => `GetProductRecord`;\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n public dataCacheType = (): Msdyn365.CacheType => 'none';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetProductRecordidData {\r\n text: string;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext): GetProductRecordidInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new GetProductRecordidInput(+productId, +inputData.requestContext.apiSettings.channelId, []);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\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: GetProductRecordidInput, ctx: Msdyn365.IActionContext): Promise {\r\n let baseProduct: SimpleProduct | null = null;\r\n if (!ctx.requestContext.app.config.queryBasedVariantSelection) {\r\n const response = await getByIdAsync({ callerContext: ctx }, input.productId, input.channelId);\r\n baseProduct = Array.isArray(response) ? response[0] : response;\r\n }\r\n const matchingDimensionValues = input.matchingDimensionValues ?? [];\r\n const data = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct && baseProduct?.MasterProductId ? baseProduct.MasterProductId : input.productId,\r\n input.channelId,\r\n matchingDimensionValues\r\n );\r\n\r\n return data;\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetProductRecordId',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365All from '@msdyn365-commerce/core';\r\nimport Msdyn365 from '@msdyn365-commerce/core';\r\nimport fetchChooseYourFoundationDatabaseDataAction, { FetchChooseYourFoundationDatabaseInput } from '../../actions/fetch-choose-your-foundation-database.action';\r\nimport { getQueryParamsFromQueryByName, getSelectedProductIdFromActionInput } from '../../data-actions/utilities/utils';\r\nimport { getDefaultVariantId } from '../../data-actions/get-selected-variant.override.action';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n\r\n/**\r\n * GetUnbxdCollectionCompareData Input Action\r\n */\r\nexport class GetUnbxdCollectionCompareDataInput implements Msdyn365All.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n public configs?: any;\r\n public recordId?: string;\r\n constructor(configs?: any, recordId?: string) {\r\n this.configs = configs;\r\n this.recordId = recordId;\r\n }\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `VariantIDs-${this.recordId}`;\r\n public getCacheObjectType = () => 'VariantIDs';\r\n public dataCacheType = (): Msdyn365All.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetUnbxdCollectionCompareDataData {\r\n collectionData: any | null;\r\n productId: number | undefined | null;\r\n variantIds: string[] | undefined;\r\n collectionDescription: string | undefined;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365All.ICreateActionContext): Msdyn365All.IActionInput => {\r\n const variantId = args.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n Msdyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : args.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n return new GetUnbxdCollectionCompareDataInput(args, variantId);\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 getUnbxdCollectionCompare(input: GetUnbxdCollectionCompareDataInput, ctx: Msdyn365All.IActionContext): Promise {\r\n let variantIdNumber: number | null | undefined;\r\n const actionInput = new FetchChooseYourFoundationDatabaseInput(input?.configs?.jsonSrc);\r\n const unbxdApiKey = ctx.requestContext.app.config.unbxdApiKey;\r\n const unbxdSiteKey = ctx.requestContext.app.config.unbxdSiteKey;\r\n const collectionJson: any = await fetchChooseYourFoundationDatabaseDataAction(actionInput, ctx);\r\n let collectionData: any | null = {};\r\n let variantIds: string[] | undefined = [];\r\n let collectionDescription: string | undefined;\r\n let response: any = {};\r\n if (collectionJson) {\r\n const baseURL = 'https://search.unbxd.io';\r\n variantIdNumber = input.recordId && !Number.isNaN(Number(input.recordId))\r\n ? Number(input.recordId)\r\n : await getDefaultVariantId(Number(getSelectedProductIdFromActionInput(ctx)), ctx);\r\n if (collectionJson.length > 0 && variantIdNumber) {\r\n variantIds = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.mattressComparisonReqIdList?.map((value: any) => value);\r\n collectionDescription = collectionJson?.find((item: any) => Number(item.mattressVariantReqId) === variantIdNumber)?.collectionDescription;\r\n variantIds && variantIds?.length >= 1 && variantIds?.unshift(`${variantIdNumber}`);\r\n let collectionCompareIds = '';\r\n if (variantIds && variantIds?.length >= 2) {\r\n for (let index = 0; index < variantIds?.length; index++) {\r\n // eslint-disable-next-line security/detect-object-injection\r\n collectionCompareIds += index === 0 ? `variantId:${variantIds[index]}` : ` OR variantId:${variantIds[index]}`;\r\n }\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n if (collectionCompareIds.length) {\r\n const unbxdUrl = `${baseURL}/${unbxdApiKey}/${unbxdSiteKey}/search?q=*&variants=true&variants.count=*&filter= ${collectionCompareIds}`;\r\n response = await Msdyn365All.sendRequest(unbxdUrl, 'get');\r\n } else {\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n }\r\n\r\n collectionData = response?.data?.response;\r\n return { collectionData, productId: variantIdNumber, variantIds: variantIds, collectionDescription };\r\n }\r\n }\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { collectionData: null, productId: null, variantIds: undefined, collectionDescription };\r\n}\r\n\r\nexport default Msdyn365All.createObservableDataAction({\r\n action: >getUnbxdCollectionCompare,\r\n // TODO: Give your data action a unique id\r\n id: 'GetUnbxdCollectionCompareData',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n\r\n\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n { \n const actionPath = 'actions/bonus-coupon-details.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-coupon-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/bonus-item-product.action';\n binding.dataActions[actionPath] = require('partner/actions/bonus-item-product.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/checkout-billing-validity.action';\n binding.dataActions[actionPath] = require('partner/actions/checkout-billing-validity.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/complete-your-bed-pillow.action';\n binding.dataActions[actionPath] = require('partner/actions/complete-your-bed-pillow.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/complete-your-bed-protector.action';\n binding.dataActions[actionPath] = require('partner/actions/complete-your-bed-protector.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-choose-your-foundation-database.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-choose-your-foundation-database.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-complete-your-bed.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-complete-your-bed.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/fetch-core-delivery-list.action';\n binding.dataActions[actionPath] = require('partner/actions/fetch-core-delivery-list.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-fee-update.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-fee-update.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-delivery-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-delivery-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-eyebrow-message.action';\n binding.dataActions[actionPath] = require('partner/actions/get-eyebrow-message.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mattress-foundations-to-add.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mattress-foundations-to-add.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-mfrm-products-category-paths.action';\n binding.dataActions[actionPath] = require('partner/actions/get-mfrm-products-category-paths.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-recycle-fee-checkout.action';\n binding.dataActions[actionPath] = require('partner/actions/get-recycle-fee-checkout.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-sm-inventory-status.action';\n binding.dataActions[actionPath] = require('partner/actions/get-sm-inventory-status.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-soci-data.action';\n binding.dataActions[actionPath] = require('partner/actions/get-soci-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-try-in-store-info.action';\n binding.dataActions[actionPath] = require('partner/actions/get-try-in-store-info.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/get-unbxd-product-recommendations.action';\n binding.dataActions[actionPath] = require('partner/actions/get-unbxd-product-recommendations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/payment-redirect-to-order-confirmation.action';\n binding.dataActions[actionPath] = require('partner/actions/payment-redirect-to-order-confirmation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/paypalsuccesstrigger.action';\n binding.dataActions[actionPath] = require('partner/actions/paypalsuccesstrigger.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/select-your-foundation.action';\n binding.dataActions[actionPath] = require('partner/actions/select-your-foundation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/social-icons-state.action';\n binding.dataActions[actionPath] = require('partner/actions/social-icons-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/srp-breadcrumb-page.action';\n binding.dataActions[actionPath] = require('partner/actions/srp-breadcrumb-page.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/trigger-special-synchrony-financing.action';\n binding.dataActions[actionPath] = require('partner/actions/trigger-special-synchrony-financing.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/update-monthly-payment.action';\n binding.dataActions[actionPath] = require('partner/actions/update-monthly-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/user-defined-promocode.action';\n binding.dataActions[actionPath] = require('partner/actions/user-defined-promocode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/wmap-address-state.action';\n binding.dataActions[actionPath] = require('partner/actions/wmap-address-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-state.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'actions/zip-code-validation.action';\n binding.dataActions[actionPath] = require('partner/actions/zip-code-validation.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/bonuscoupons-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/bonuscoupons-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/brightspot-content-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/brightspot-content-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/financing-offer-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/financing-offer-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-address-from-zipcode.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-address-from-zipcode.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-card-payment-accept-point.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-card-payment-accept-point.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-comfort-type.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-comfort-type.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-dimensions-for-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-dimensions-for-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-franchise-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-franchise-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefit-enhanced-content.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefit-enhanced-content.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-product-benefits-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-product-benefits-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-promocode-value.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-promocode-value.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-resons-to-buy-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-resons-to-buy-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sales-order-details-action.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sales-order-details-action.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-selected-variant.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-selected-variant.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-seo-data.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-seo-data.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-sleep-disruptor-icons.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-sleep-disruptor-icons.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/get-store-location-information.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/get-store-location-information.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfi-atp-inventory.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfi-atp-inventory.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-mfi-bonusitem.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-mfi-bonusitem.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/mfrm-notification.action';\n binding.dataActions[actionPath] = require('partner/data-actions/mfrm-notification.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-cc-card-types.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-cc-card-types.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/payment-error-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/payment-error-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-category.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-category.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-recommendation.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-recommendation.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-by-relationship-id.override.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-by-relationship-id.override.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/products-get-by-id.action';\n binding.dataActions[actionPath] = require('partner/data-actions/products-get-by-id.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/progressive-leasing-modal-state.action';\n binding.dataActions[actionPath] = require('partner/data-actions/progressive-leasing-modal-state.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/promocode-applied-in-progress.action';\n binding.dataActions[actionPath] = require('partner/data-actions/promocode-applied-in-progress.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/redirect-to-wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/redirect-to-wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/search-org-unit-locations.action';\n binding.dataActions[actionPath] = require('partner/data-actions/search-org-unit-locations.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/toggle-submit-order-button.action';\n binding.dataActions[actionPath] = require('partner/data-actions/toggle-submit-order-button.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/update-email-call.action';\n binding.dataActions[actionPath] = require('partner/data-actions/update-email-call.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-get-order-details.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-get-order-details.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'data-actions/wmap-submit-payment.action';\n binding.dataActions[actionPath] = require('partner/data-actions/wmap-submit-payment.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-autosuggest/actions/get-unbxd-search-autosuggest.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-category-page-summary/mfrm-category-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-category-page-summary/mfrm-category-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/get-product-recordId.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/get-product-recordId.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-product-page-summary/mfrm-product-page-summary.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-product-page-summary/mfrm-product-page-summary.action');\n registerActionId(actionPath);\n }\n\n { \n const actionPath = 'modules/mfrm-products-compare/get-unbxd-collection-compare-data.action';\n binding.dataActions[actionPath] = require('partner/modules/mfrm-products-compare/get-unbxd-collection-compare-data.action');\n registerActionId(actionPath);\n }\n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.packageDataActions = {};\n window.__bindings__.packageDataActions['__local__'] = {\n ...binding.dataActions\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["getSetLocalStorage","key","getSet","valueToSet","returnType","MsDyn365","localStorage","setItem","JSON","stringify","parse","getItem","getSetProductData","products","getSetProductSpec","getSetPromoCodeApplyList","getSetPromoCode","getSetGrandTotal","total","getSetBonusItemProd","globalBonusItems","getSetSelectedBonasItem","bonusItemArray","getSetBonusCouponDetail","getCoupons","getSetPrevBonasModalState","previousBonasModal","getSetBonusItemBrandName","bonusItemsBrandName","getSetDateGroupedProducts","getSetWmapCartLines","canonicalURL","requestContext","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","undefined","length","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","async","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","dayjs","tz","utc","isBetween","format","getValidSpecialCampaign","financingOffer","specialCampaign","enableCampaign","initialMonthlyAmount","numOfDiscountedMonths","isCampaignScheduled","getCampaignRemainingCost","campaign","totalPrice","remainingCost","remainingMonths","numOfMonths","cost","months","offer","tempOffer","Object","create","campaignValidStartDate","campaignValidEndDate","startDate","endDate","isScheduled","add","startDateCentralTime","isValid","local","endDateCentralTime","now","selectFinancingOffer","returnCustomOfferArray","campaignFound","limitedTimeFinancingOffers","everydayFinancingOffers","specialFinancingOffer","synchronySpecialFinancingCondition","specialFinancingEnable","highestMinimumPurchase","bestOffer","costPerMonth","isLTO","minPurchase","everydayFinancingOfferMessage","limitedFinancingOfferMessage","monthlyOfferDetails","financingOfferDescription","disclaimer","offerFound","everydayOffers","specialOffer","validLimitedTimeFinancingOffers","offerValidStartDate","offerValidEndDate","isValidLimitedTimeOffer","currentOfferAccepted","noInterestFor","Math","ceil","offerName","isAfter","currentOffer","specialCampaignOffer","checkoutDisplay","validCampaign","MFIGetBonusItemsParametersExtensionClass","constructor","odataObject","this","CartId","Coupons","i","Id","ExtensionProperties","className","substr","lastIndexOf","concat","EntityClasses","MFIBonusItemsDetailsEntityExtensionClass","Coupon","IsBonusCoupon","CouponMessage","Items","MFIQualifyingItemDetailsExtensionClass","QualifyingItemId","QualifyingProductId","BonusProductQty","parseFloat","BonusItems","MFIBonusItemDetailsExtensionClass","BonusItemId","PrimaryImageUrl","ProductTypeValue","BonusProductId","Name","AdditionToCart","AdjustedPrice","BasePrice","CustomerContextualPrice","DiscountAmount","DiscountTypeValue","DiscountType","DealPriceOrDiscountPercentage","BonusCalculatedDiscountPrice","MFIGetBonusCouponsDetailsResponseExtensionClass","BonusCoupons","MFIBonusCouponsDetailExtensionClass","MFIBonusItemsResponseExtensionClass","BonusItemsDetails","Message","BonusCoupon","BonusCouponMessage","ChildCoupons","bonusItemsQuery","id","DataServiceQuery","DataServiceEntities","mFIGetBonusCouponsDetailsAsync","context","bonusCoupons","request","createDataServiceRequestForOperation","bypassCache","returnEntity","createMFIGetBonusCouponsDetailsInput","callActionOrExecute","callerContext","mFIGetBonusItemsDetailAsync","bonusItemParams","createMFIGetBonusItemsDetailInput","BonusCouponDetailsInput","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","input","ctx","bonusCouponDetail","args","BonusItemProductInput","bonusItemProduct","BillingStateInput","BillingStateAction","isBillingFormValid","createObservableDataAction","inputData","CompleteYourBedPillowInput","pillow","CompleteyourBedProtectorInput","protector","FetchChooseYourFoundationDatabaseInput","jsonSrc","data","FetchCompleteYourBedDataInput","jsonData","GetDeliveryFeeUpdateInput","deliveryAmount","GetMattressFoundationsToAddInput","console","log","text","GetCategoryPathsInput","catalogId","productIds","constructedCacheKey","ChannelId","apiSettings","channelId","CatalogId","ids","toString","createGetCategoryPathsInput","Error","getProductsCategoryPathsAction","catPaths","hasArray","productsIter","ProductId","getCategoryPathsAsync","queryResultSettings","Paging","Top","Sorting","err","getCategoryPathsActionDataAction","GetRecycleFeeCheckoutInput","recycleFee","tax","GetATPInventoryStatusInput","isCached","Array","prototype","call","ItemLines","item","VariantRecordId","ZipCode","ItemId","Weeks","RequestedDate","result","mFIATPInventoryStatusAsync","error","GetSociDataInput","searchradius","searchLimit","zipCode","getZipCode","response","axios","headers","e","lookupRadius","maxNoOfFranchise","MFITryInStoreExtensionClass","StoreId","Products","Limit","Radius","MFITryInStoreInfoResponseExtensionClass","Status","Inventory","createMFIGetTryInStoreInfoInput","tryInStoreProductIDs","storeId","tryInStoresQuery","GetTryInStoreInfoInput","mFIGetTryInStoreInfoAsync","GetUnbxdRecommendationsDataInput","pageType","widgetNumber","productID","catLevels","cartItemIDs","unbxdUid","Cookies","get","toUpperCase","unbxdApiKey","unbxdSiteKey","unbxdUrl","catnames","catName","index","categoryLevelName","productitemIds","itemId","PaymentRedirectToOrderConfirmationInput","redirectToOrderConfirmation","PaypalsuccesstriggerInput","isPaymentSuccess","paymentSuccessEmail","SelectYourFoundationInput","foundation","SocialIconsStateInput","socialIconStateAction","copyLinkClick","SrpBreadcrumbPageInput","breadcrumbCheck","TriggerSpecialSynchronyFinancingInput","triggerSpecialFinancing","UpdateMonthlyPaymentInput","updateTotal","UserDefinedPromocodeInput","userDefinedPromos","WmapAddressStateInput","preFilledAddress","isAddressUpdate","ZipCodeStateInput","ZipCodeStateAction","isStateValid","ZipCodeValidationInput","ZipcodeValidationAction","isZipcodeValid","BonusCouponsInfoInput","bonusCoupon","getAllBonusCouponsDetails","couponsDetails","telemetry","warning","debug","BrightSpotContentInput","brightspotUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getBrightspotUrl","brightspotPageUrl","FinancingOfferStateInput","isOpen","GetAddressByZipcodeInput","country","zipcode","getAddressFromZipCodeAsync","GetCardPaymentAcceptPointInput","buildCacheKey","paymenTenderType","showBillingAddress","selectedOfferName","isReload","amountDue","createCheckoutPaymentInstrumentInput","getCardPaymentAcceptPointInput","showBillingAddres","getCardPaymentAcceptPointAction","exception","checkoutState","getCheckoutState","catch","isEmptyOrNullObject","checkoutCart","cart","CartLines","URL","window","cardPaymentAcceptSettings","HostPageOrigin","AdaptorPath","CardPaymentEnabled","CardTokenizationEnabled","HideBillingAddress","TenderTypeId","PaymentAmount","addPaymentMethodName","extensionKeyPlanId","getOffer","allOffers","defaultVal","find","isSynchrony","set","planID","ep","Key","Value","StringValue","getCardPaymentAcceptPointAsync","then","cardPaymentAcceptPoint","AcceptPageUrl","AcceptPageContent","getCardPaymentAcceptPointActionDataAction","GetComfortTypesData","comfortTypesDataUrl","getComfortTypesDataUrl","jsonUrl","comfortTypesDataJsonUrl","res","GetDimensionsForSelectedVariantInput","productId","matchingDimensionValues","getDimensionsForSelectedVariantAction","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","location","href","variantQueryStringName","activeProduct","ProductsDataActions","Number","isNaN","ArrayExtensions","Dimensions","promises","dimension","shippingInventoryConfiguration","createInventoryAvailabilitySearchCriteria","searchCriteria","RequestedDimensionTypeValue","DimensionTypeValue","MatchingDimensionValues","DefaultWarehouseOnly","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","MasterProductId","RecordId","dimensionValues","dimensionValuesWithInventory","dimensionValuesResults","Promise","all","newDimension","oldDimension","DimensionValues","value","DimensionValue","getDimensionsForSelectedVariantActionDataAction","getSelectedProductIdFromActionInput","getDimensionValuesFromQuery","GetFranchiseData","_Latitude","_Longitude","_Radius","Latitude","Longitude","getFranchiseInput","getFranchise","sociFranchiseDataUrl","franchiseDataJson","franchiseStores","franchise","miles","latitude1","longitude1","latitude2","longitude2","long1","PI","long2","lat1","lat2","dlon","dlat","pow","sin","cos","asin","sqrt","_calculateDistance","lat","long","GetProductBenefitsEnhancedContentInput","masterProductID","jsonUrlFromGlobals","productBenefitsEnhancedContentUrl","masterProductid","GetProductBenefitsData","productBenefitsDataUrl","getProductBenefitsDataUrl","GetPromocodeValueInput","GetReasonsToBuyDataInput","categoryName","reasonsToBuyJsonUrl","orderTypes","GetSalesOrderWithHydrationsInput","orderType","orderId","getSalesOrderWithHydrationsAction","trace","salesOrder","getSalesOrderDetailsBySalesIdAsync","getSalesOrderDetailsByTransactionIdAsync","getSalesOrder","TransactionTypeValue","SalesLines","salesLine","productInputs","ProductInput","getSimpleProducts","getProducts","deliveryOptions","getDeliveryOptionsAsync","x","message","getSalesOrderWithHydrationsActionDataAction","salesId","transactionId","query","transaction","GetSeoDataInput","seoDataUrl","getSeoDataUrl","filteredUrlPath","seoData","GetSleepDisruptorIcons","sleepDisuptorIconsDataUrl","getSleepDisuptorIconsDataUrl","sleepDisruptorIconDataUrl","GetOrgUnitLocationsByAreaInput","_DistanceUnitValue","_IgnoreLocation","DistanceUnitValue","IgnoreLocation","createGetOrgUnitLocationsByAreaInput","getOrgUnitLocationsByArea","searchArea","getOrgUnitLocationsByAreaAsync","locationDeliveryOptions","locationPromiseList","stores","store","locationDeliveryOption","_channeldeliveryoption","orgUnitLocation","channelDeleiveryOptions","OrgUnitNumber","OrgUnitAvailability","getStoreHoursAsync","hours","availability","OrgUnitLocation","OrgUnitPickUpDeliveryModes","StoreHours","_getLocationWithHours","getOrgUnitLocationsByAreaDataAction","MfiAtpInventoryInput","inventoryType","weeks","page","requestedDate","itemLines","mfiAtpInventoryAction","requestBody","InventoryType","Page","mFIATPInventoryDynamicAsync","MFIbonusitemsInput","MfrmNotificationInput","PaymentCcCardTypesInput","cardType","PaymentErrorStateInput","errorTitle","errorMessage","progressiveLinkText","getProductsByCategoryList","categoryId","listMetadata","categoryIds","CATEGORY_PAGE_NAME","categories","productSearchCriteria","Context","CategoryIds","IncludeAttributes","searchByCriteriaAsync","pageSize","getProductImageUrls","getProductsByCategoryListAction","CartTokenPrefix","getProductIdForReco","recommendationCriteria","includeCart","cookies","cartCookieParts","getCartCookie","user","isAuthenticated","Auth","Anon","readCart","readAsync","getCart","cartProductIds","element","product","includePageContext","PDP_PAGE_NAME","ProductIds","getProductsByRecommendationList","customerAccountNumber","recommendationListId","PICKS_FOR_YOU_LIST","proxyContext","reccomendationListId","missingType","actionInputError","getCategoryIdForReco","personalization","CustomerAccountNumber","getElementsAsync","recommendedElements","productTypeId","ElementId","ElementTypeValue","semver","retailServerProxyVersion","itemIds","Ids","SearchCondition","productSearchResults","orderProductSearchResults","productRatingsPromise","getProductRatingsAsync","productInput","productRatings","productRating","unratedProduct","mappedProduct","TotalRatings","AverageRating","getProductsByRecommendationListAction","getProductsByRelationshipIdList","relationshipId","productResponse","getByIdAsync","baseProduct","isArray","hasOwnProperty","getRelatedProductsAsync","getProductsByRelationshipIdListAction","GetProductsByIdInput","productIdsArr","ctxObject","bypass","getByIdsAsync","ProgressiveLeasingModalStateInput","PromoCodeAppliedOnCartInput","updatePromoCodeAppliedOnCartProgressAction","isInProcess","RedirectToWmapSubmitPaymentInput","redirectToWmapSubmitPayment","buildQueryResultSettings","Skip","createSearchOrgUnitLocationsInputFunc","createSearchOrgUnitLocationsInput","retailActionDataAction","retailAction","ToggleSubmitOrderButtonInput","isSynchronySelected","isPaypalSelected","isCreditcardSelected","isCcFieldsNotPopulated","UpdateEmailCartInput","updateEmailCartAction","checkEmail","WmapGetOrderDetailsInput","orderDetailsAPIurl","getOrderDetailsAPIurl","getOrderId","apiResponseUrl","baseUrl","orderDetailsApiUrl","salesOrderId","orderIdOun","oun","makeaPaymentLink","wmapPageUrlSuffix","pathName","SalesId","WmapSubmitPaymentInput","submitPaymentAPIurl","submitPaymentPayload","WmapSubmitPaymentAction","GetUnbxdSearchAutoSuggestDataInput","queryText","popularProducts","inFields","topQueries","keywordSuggestions","promotedSuggestion","popularProductsCount","inFieldsCount","topQueriesCount","keywordSuggestionsCount","promotedSuggestionCount","MFRMCategoryPageSummaryInput","buildCacheKeyWithUrlTokens","_getSEOMetaTagValue","currentCategory","keyValue","attr","getFallbackTitle","activeRefinerList","getProductSearchRefinersAsync","productRefiners","productRefiner","getAllRefinersAction","refiners","CategoryHierarchy","configVirtualRefinerNames","filteredRefiners","refiner","KeyName","slugArray","pathArray","slug","Slug","sortedConfigValues","removedCategorySlug","refinerParts","_slug","refinerPart","finalRefinerParts","includes","flatten","sortedValues","refinerSet","toLocaleLowerCase","sortedValue","keys","finalRefiners","sortedConfigValue","sortedRefinerName","_getActiveRefiners","concateTitle","seoInput","getSEOData","seoPageTitle","seoPageMetaData","getCurrentCategory","CurrentCategoryInput","createGetCurrentCategoryInput","categoryUrl","fallbackTitle","pageTitle","pageTitleParser","getHtmlParserValue","fallBackMeta","categoryPageMetaData","categoryPageMetaDataParser","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","title","description","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","src","GetProductRecordidInput","getVariantsByDimensionValuesAsync","GetUnbxdCollectionCompareDataInput","configs","Msdyn365All","variantIdNumber","actionInput","collectionJson","fetchChooseYourFoundationDatabaseDataAction","collectionDescription","collectionData","variantIds","baseURL","getDefaultVariantId","mattressVariantReqId","mattressComparisonReqIdList","unshift","collectionCompareIds","binding","modules","dataActions","registerActionId","actionPath","default","exportName","Action","require","__bindings__","packageDataActions","module","exports","React","ReactDOM"],"sourceRoot":""}