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OAAOghC,aAAeH,EAGzB9gC,EAAEC,OAAOihC,kBAAkBJ,EAAgBA,GAG9C,CACD,CAoFkBK,CAAcnhC,EAAG++B,GACjC/pC,MAAOuqC,EACPx/B,SAAUy/B,EACV3H,WAAY4H,EACZ3I,cAAe4I,EACfT,YAAaA,EACbC,QAASA,KACNC,EAEL","sources":["webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/businessdesk-edit-link/svgs/edit_pencil_white.svg","webpack://@logos/commerceweb-frontend/./Scripts/site/clients/products-client.js","webpack://@logos/commerceweb-frontend/./Scripts/site/util/hooks/use-in-view.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/recommendations/recommendations-context.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/recommendations/recommendations-carousel.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/recommendations/buy-in-collection.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/recommendations/containing-subscriptions.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/recommendations/customers-also-bought.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/featured-products/featured-products.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/featured-products/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/clients/reviews-client.js","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/rating-selector.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/text-area.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/review-editor.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/review-header.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/link-button.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/review-item.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/reviews-list.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/sort-mode-selector.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/divider.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/reviews-anchor.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/reviews/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/display-content.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/execute-scripts.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/embedded-video.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/embedded-video-section.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/product-details-metadata.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/author-bio-section.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/section-config.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-content-sections/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/authors-and-publishers.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/sale-price-popover.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/prices.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/subscription-promotion/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/purchase-actions.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/gallery.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/types.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/logos-edition-callout/collapsible-callout.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/logos-edition-callout/video-popover.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/logos-edition-callout/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/see-inside.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/preordered-product-label.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/selected-sku-and-quantity-util.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/sku-selector.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/metadata-row.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/review-summary.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/product-description.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/right-column/details.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/sticky-add-to-cart/sticky-add-to-cart-bar.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/sticky-add-to-cart/sticky-add-to-cart-content.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/sticky-add-to-cart/sticky-add-to-cart.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/adzone-block.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/time-sensitive-callout-block.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/pdp-banner.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/businessdesk-edit-link/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/left-column/sample-pages.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/left-column/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/library-greeting.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/hooks/use-unowned-resources.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/index.tsx","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/hooks/use-see-inside-url.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/components/product/product-details-page/sticky-add-to-cart/use-sticky-add-to-cart-handler.ts","webpack://@logos/commerceweb-frontend/./Scripts/site/util/hooks/use-resource-formats-and-texts.js","webpack://@logos/commerceweb-frontend/./Scripts/vendor/styled-ui/components/text-input/debounced-async.jsx","webpack://@logos/commerceweb-frontend/./Scripts/vendor/styled-ui/components/utils/use-optionally-controlled-state.js","webpack://@logos/commerceweb-frontend/./Scripts/vendor/styled-ui/components/text-input/styled.jsx","webpack://@logos/commerceweb-frontend/./Scripts/vendor/styled-ui/components/text-input/select.jsx","webpack://@logos/commerceweb-frontend/./Scripts/vendor/styled-ui/components/text-input/use-clearable-select-value.js"],"sourcesContent":["module.exports = \"data:image/svg+xml,%3csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3e%3cg fill='%23FFF' fill-rule='evenodd'%3e%3cpath d='M8.442 1.99l-7.03 7.074v.818h.892L9.292 2.82l-.85-.83zm2.346.32c.28.272.28.72.006 1l-7.9 7.984H0V8.482L7.925.505c.278-.28.727-.285 1.008-.01l1.855 1.814z'/%3e%3cpath d='M8.998 4.472L7.116 2.355l-1.055.937L7.944 5.41M4.94 10.588h6.455v.807H4.94'/%3e%3c/g%3e%3c/svg%3e\"","import { fetch } from '../util/fetch';\n\nexport default class ProductsClient {\n\tstatic async getContainingProductsAsync({ containingProductsUrl }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: containingProductsUrl,\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getHasContainingProductsAsync({ hasContainingProductsUrl }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: hasContainingProductsUrl,\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getContainingSubscriptionsAsync({ containingSubscriptionsUrl }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: containingSubscriptionsUrl,\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getProductsCustomersAlsoBoughtAsync({ customersAlsoBoughtUrl, skuIds }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: customersAlsoBoughtUrl,\n\t\t\tparams: { skuIds },\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getTooltipAsync({ url }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: url,\n\t\t});\n\t\treturn await response.json();\n\t}\n\n\tstatic async getProductDownloadsAsync({ downloadsUrl, skuIds }) {\n\t\tconst response = await fetch.get({\n\t\t\turl: downloadsUrl,\n\t\t\tparams: { skuIds },\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getFeaturedProducts(featuredProductIdsUrl) {\n\t\tlet response;\n\n\t\ttry {\n\t\t\tresponse = await fetch.get({\n\t\t\t\turl: featuredProductIdsUrl,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 404) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn (await response.json()).featuredProducts;\n\t}\n\n\tstatic async getQuickCompare(quickCompareUrl) {\n\t\tlet response;\n\n\t\ttry {\n\t\t\tresponse = await fetch.get({\n\t\t\t\turl: quickCompareUrl,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 404) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async getUnownedResourcesInfos(unownedResourcesInfosBaseUrl, productIds) {\n\t\tlet response;\n\n\t\ttry {\n\t\t\tresponse = await fetch.get({\n\t\t\t\turl: `${unownedResourcesInfosBaseUrl}?productIds=${productIds.join()}`,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 404) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn (await response.json()).infos;\n\t}\n\n\tstatic async getShortBlurbsForProductIds(getShortBlurbsUrl, productIds) {\n\t\tconst response = await fetch.postWithBody({\n\t\t\turl: getShortBlurbsUrl,\n\t\t\tbody: {\n\t\t\t\tproductIds: productIds,\n\t\t\t},\n\t\t});\n\t\treturn await response.json();\n\t}\n\n\tstatic async getSubscriptionPromotionsForSkuIds(getSubscriptionPromotionsUrl, skuIds) {\n\t\tconst response = await fetch.get({\n\t\t\turl: getSubscriptionPromotionsUrl,\n\t\t\tparams: { skuIds },\n\t\t});\n\n\t\treturn await response.json();\n\t}\n}\n","import { useEffect, useRef, useState } from 'react';\n\nexport function useInView<T extends HTMLElement>({ threshold = 0.1, rootMargin = '0px' } = {}) {\n\tconst ref = useRef<T | null>(null);\n\tconst [isInView, setIsInView] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst observer = new IntersectionObserver(\n\t\t\t([entry]) => {\n\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\tsetIsInView(true);\n\t\t\t\t\tobserver.disconnect();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ threshold, rootMargin }\n\t\t);\n\n\t\tobserver.observe(element);\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [threshold, rootMargin]);\n\n\treturn { ref, isInView };\n}\n","import React, { useMemo } from 'react';\nimport type { CatalogProductData } from '@faithlife/commerce-components';\n\nimport { RecommendationsCartProvider } from '../../../commerce-contexts/cart';\nimport type { ProductPricingData } from '../../per-user-data/per-user-data-context';\nimport { useLocalization } from '../../../localization';\nimport { mapPricingToUserProductData } from '../../../util/map-pricing-to-user-product-data';\nimport {\n\tInitialSkuOwnershipProvider,\n\ttype InitialSkuOwnership,\n\tRecommendationsProductProvider,\n\tStaticProductDataProvider,\n} from '../../../commerce-contexts/product';\nimport { RecommendationsResourcesProvider } from '../../../commerce-contexts/resources';\nimport { StaticWishlistDataProvider, StaticWishlistProvider } from '../../../commerce-contexts/wishlist';\nimport { hasValidReviewData } from '../../shared/ratings/review-data';\n\nexport interface RecommendationProduct {\n\tproductId: string;\n\tname: string;\n\timageUrl: string | null;\n\tproductPageUrl: string | null;\n\tpricing: ProductPricingData;\n\tratings: {\n\t\tnumberOfRatings: number;\n\t\taverageRating: number | null;\n\t\tshouldDisplayStars: boolean;\n\t\thyperlink: string;\n\t} | null;\n\ttooltipUrl?: string | null;\n\tunavailabilityReason?: string | null;\n\tprimarySkuId?: string | null;\n\tauthor?: string | null;\n\tisOwned?: boolean;\n\tisInCart?: boolean;\n}\n\nfunction mapToProductData(\n\tproduct: RecommendationProduct,\n\tresources: Parameters<typeof mapPricingToUserProductData>[1]\n): CatalogProductData {\n\tconst averageRating = product.ratings?.averageRating ?? 0;\n\tconst reviewCount = product.ratings?.numberOfRatings ?? 0;\n\tconst shouldDisplayRatings =\n\t\tproduct.ratings?.shouldDisplayStars === true && hasValidReviewData(averageRating, reviewCount);\n\n\treturn {\n\t\tid: product.productId,\n\t\tname: product.name,\n\t\tprimarySkuId: product.primarySkuId ?? undefined,\n\t\timageUri: product.imageUrl ?? undefined,\n\t\tproductPageUri: product.productPageUrl ?? undefined,\n\t\tauthor: product.author ?? undefined,\n\t\tskus: mapPricingToUserProductData(product.pricing, resources)?.skus,\n\t\trating: shouldDisplayRatings ? averageRating : undefined,\n\t\treviewCount: shouldDisplayRatings ? reviewCount : undefined,\n\t};\n}\n\ninterface RecommendationsContextProps {\n\tproducts: RecommendationProduct[];\n\tchildren: React.ReactNode;\n}\n\nconst RecommendationsProductIdsContext = React.createContext<{ productId: string }[]>([]);\n\nexport function useRecommendationsProductIds() {\n\treturn React.useContext(RecommendationsProductIdsContext);\n}\n\nexport function RecommendationsContext({ products, children }: RecommendationsContextProps) {\n\tconst resources = useLocalization('CommerceWeb.Resources.Shared.AddToMiniCartButton');\n\tconst { staticProductData, productIds, initialOwnership } = useMemo(() => {\n\t\tconst dataMap: Record<string, CatalogProductData> = {};\n\t\tconst ids: { productId: string }[] = [];\n\t\tconst ownership: InitialSkuOwnership = {};\n\n\t\tproducts.forEach(product => {\n\t\t\tconst catalogData = mapToProductData(product, {\n\t\t\t\taddedToCart: resources.addedToCart,\n\t\t\t\taddedToCartTooltip: resources.addedToCartTooltip,\n\t\t\t\tyouAlreadyOwnThisProduct: resources.youAlreadyOwnThisProduct,\n\t\t\t\tyouAlreadyPreorderedThisProduct: resources.youAlreadyPreorderedThisProduct,\n\t\t\t\tpreorder: resources.preorder,\n\t\t\t});\n\t\t\tdataMap[catalogData.id] = catalogData;\n\t\t\tids.push({ productId: catalogData.id });\n\t\t\tif (product.primarySkuId) {\n\t\t\t\townership[product.primarySkuId] = {\n\t\t\t\t\tisOwned: product.isOwned === true,\n\t\t\t\t\tisInCart: product.isInCart === true,\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\treturn { staticProductData: dataMap, productIds: ids, initialOwnership: ownership };\n\t}, [\n\t\tproducts,\n\t\tresources.addedToCart,\n\t\tresources.addedToCartTooltip,\n\t\tresources.youAlreadyOwnThisProduct,\n\t\tresources.youAlreadyPreorderedThisProduct,\n\t\tresources.preorder,\n\t]);\n\n\treturn (\n\t\t<RecommendationsProductIdsContext.Provider value={productIds}>\n\t\t\t<RecommendationsResourcesProvider>\n\t\t\t\t<RecommendationsCartProvider>\n\t\t\t\t\t<StaticProductDataProvider staticProductData={staticProductData}>\n\t\t\t\t\t\t<InitialSkuOwnershipProvider initialOwnership={initialOwnership}>\n\t\t\t\t\t\t\t<RecommendationsProductProvider>\n\t\t\t\t\t\t\t\t<StaticWishlistDataProvider staticProductData={staticProductData} errorContext=\"RecommendationsContext\">\n\t\t\t\t\t\t\t\t\t<StaticWishlistProvider>{children}</StaticWishlistProvider>\n\t\t\t\t\t\t\t\t</StaticWishlistDataProvider>\n\t\t\t\t\t\t\t</RecommendationsProductProvider>\n\t\t\t\t\t\t</InitialSkuOwnershipProvider>\n\t\t\t\t\t</StaticProductDataProvider>\n\t\t\t\t</RecommendationsCartProvider>\n\t\t\t</RecommendationsResourcesProvider>\n\t\t</RecommendationsProductIdsContext.Provider>\n\t);\n}\n","import React from 'react';\nimport { CarouselProduct, ContentSection } from '@faithlife/commerce-components';\n\nimport {\n\tRecommendationsContext,\n\tuseRecommendationsProductIds,\n\ttype RecommendationProduct,\n} from './recommendations-context';\n\ninterface RecommendationsCarouselProps {\n\tdata: RecommendationProduct[] | null | undefined;\n\tisLoading: boolean;\n\theading: string;\n\tsubHeading?: string;\n\tclassName?: string;\n}\n\nconst ProductCardSkeleton = () => (\n\t<div className=\"swiper-slide swiper-slide-active h-auto w-fit mr-[48px]\">\n\t\t<div className=\"h-full w-[180px]\">\n\t\t\t<article className=\"tw-preflight group flex flex-col gap-sp24 h-full\">\n\t\t\t\t<div className=\"relative h-[270px]\">\n\t\t\t\t\t<div className=\"flex h-full w-full items-end justify-center\">\n\t\t\t\t\t\t<div className=\"h-full w-full animate-pulse rounded-sm bg-primary-200\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"flex flex-1 flex-col justify-between gap-sp16 pb-sp16\">\n\t\t\t\t\t<div className=\"flex flex-col gap-sp16\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-sp8\">\n\t\t\t\t\t\t\t<div className=\"w-full h-[20px] animate-pulse rounded-sm bg-primary-200\" />\n\t\t\t\t\t\t\t<div className=\"w-full h-[16px] animate-pulse rounded-sm bg-primary-200\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"flex flex-col gap-sp20\">\n\t\t\t\t\t\t<div className=\"w-[120px] h-[28px] animate-pulse rounded-sm bg-primary-200\" />\n\t\t\t\t\t\t<button className=\"tw-preflight inline-flex items-center justify-center gap-sp12 rounded-[2px] text-center transition-colors duration-short focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary motion-reduce:transition-none buttonTextLg py-sp14 px-sp16 bg-transparent border border-primary text-primary hover:ring-1 hover:ring-inset hover:ring-primary active:border-primary-500 active:ring-1 active:ring-inset active:ring-primary-500 disabled:border-secondary-200 disabled:text-primary disabled:opacity-[0.33] disabled:cursor-not-allowed w-full self-start\">\n\t\t\t\t\t\t\t<span className=\"block w-[120px] h-[18px] animate-pulse rounded-sm bg-primary-200\" />\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t</div>\n\t</div>\n);\n\nconst SkeletonCarousel = () => (\n\t<div className=\"overflow-hidden\">\n\t\t<div className=\"swiper swiper-initialized swiper-horizontal overflow-visible swiper-backface-hidden items-stretch pt-sp36 max-lg:pl-sp18 lg:pl-sp24\">\n\t\t\t<div className=\"swiper-wrapper\">\n\t\t\t\t<ProductCardSkeleton />\n\t\t\t\t<ProductCardSkeleton />\n\t\t\t\t<ProductCardSkeleton />\n\t\t\t\t<ProductCardSkeleton />\n\t\t\t\t<ProductCardSkeleton />\n\t\t\t</div>\n\t\t</div>\n\t</div>\n);\n\nconst CarouselContent = () => {\n\tconst productIds = useRecommendationsProductIds();\n\treturn (\n\t\t<CarouselProduct\n\t\t\tproductIds={productIds}\n\t\t\tshowArrows\n\t\t\tclassName=\"max-lg:[&_.swiper]:pl-sp18 lg:[&_.swiper]:pl-sp24\"\n\t\t\tscale=\"large\"\n\t\t/>\n\t);\n};\n\nexport const RecommendationsCarousel = ({\n\tdata,\n\tisLoading,\n\theading,\n\tsubHeading,\n\tclassName,\n}: RecommendationsCarouselProps) => {\n\tconst isEmpty = !isLoading && (!data || data.length === 0);\n\n\tif (isEmpty) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ContentSection\n\t\t\tsectionHeadline={heading}\n\t\t\theadlineBody={subHeading}\n\t\t\theadlineClassName=\"relative min-h-sp48 items-start lg:pl-sp24 lg:pr-sp24 after:absolute after:bottom-0 after:left-sp18 after:right-sp18 after:border-b after:border-gray lg:after:left-sp24 lg:after:right-sp24\"\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{isLoading ? (\n\t\t\t\t<SkeletonCarousel />\n\t\t\t) : (\n\t\t\t\t<RecommendationsContext products={data ?? []}>\n\t\t\t\t\t<CarouselContent />\n\t\t\t\t</RecommendationsContext>\n\t\t\t)}\n\t\t</ContentSection>\n\t);\n};\n","import React, { useCallback, useEffect, useState } from 'react';\nimport ProductsClient from '../../../clients/products-client';\nimport { useLocalization } from '../../../localization';\nimport { useInView } from '../../../util/hooks/use-in-view';\nimport { type RecommendationProduct } from './recommendations-context';\nimport { RecommendationsCarousel } from './recommendations-carousel';\n\ninterface BuyInCollectionProps {\n\tcontainingProductsUrl: string;\n}\n\nexport const BuyInCollection = ({ containingProductsUrl }: BuyInCollectionProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.ContainingProducts');\n\tconst { ref, isInView } = useInView<HTMLDivElement>({ rootMargin: '0px 0px 300px 0px' });\n\tconst [data, setData] = useState<RecommendationProduct[] | null>(null);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\tconst fetchData = useCallback(async () => {\n\t\ttry {\n\t\t\tconst response = await ProductsClient.getContainingProductsAsync({ containingProductsUrl });\n\t\t\tsetData(response.containingProducts ?? []);\n\t\t} catch {\n\t\t\tsetData([]);\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [containingProductsUrl]);\n\n\tuseEffect(() => {\n\t\tif (isInView) {\n\t\t\tfetchData();\n\t\t}\n\t}, [isInView, fetchData]);\n\n\tconst isEmpty = !isLoading && (!data || data.length === 0);\n\n\tif (isEmpty) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={ref}>\n\t\t\t\t{isInView && (\n\t\t\t\t\t<RecommendationsCarousel\n\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\theading={resources.BuyInCollectionTitle}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tsubHeading={resources.YouCanSave}\n\t\t\t\t\t\tclassName=\"max-lg:mt-sp24 lg:mt-sp32\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n","import React, { useCallback, useEffect, useState } from 'react';\nimport ProductsClient from '../../../clients/products-client';\nimport { useLocalization } from '../../../localization';\nimport useResourceFormatsAndTexts from '../../../util/hooks/use-resource-formats-and-texts';\nimport { useInView } from '../../../util/hooks/use-in-view';\n\ninterface ContainingSubscriptionsData {\n\tstartingAtMonthlyPrice: string;\n\tstartingAtLocalizedPrice: string;\n\tbillingMode: string;\n\tfreeTrialPeriodLength: number | null;\n\tfreeTrialPeriodUnit: string | null;\n\tavailableLogosTieredSubscriptionLevels: string[];\n\tlocale: string;\n\tlogosOrVerbum: string;\n\troutes: Record<string, string>;\n}\n\ninterface ContainingSubscriptionsProps {\n\tcontainingSubscriptionsUrl: string;\n}\n\nexport const ContainingSubscriptions = ({ containingSubscriptionsUrl }: ContainingSubscriptionsProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.ContainingSubscriptions');\n\tconst { ref, isInView } = useInView<HTMLDivElement>({ rootMargin: '0px 0px 300px 0px' });\n\tconst [data, setData] = useState<ContainingSubscriptionsData | null>(null);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\tconst fetchData = useCallback(async () => {\n\t\ttry {\n\t\t\tconst response = await ProductsClient.getContainingSubscriptionsAsync({ containingSubscriptionsUrl });\n\t\t\tsetData(response.containingSubscriptions ?? null);\n\t\t} catch {\n\t\t\tsetData(null);\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [containingSubscriptionsUrl]);\n\n\tuseEffect(() => {\n\t\tif (isInView) {\n\t\t\tfetchData();\n\t\t}\n\t}, [isInView, fetchData]);\n\n\tif (isInView && !isLoading && !data) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{isInView && <hr className=\"hidden lg:block border-gray lg:mx-sp24\" />}\n\t\t\t<div ref={ref} className=\"max-lg:mt-sp24 lg:mt-sp32\">\n\t\t\t\t{data ? (\n\t\t\t\t\t<ContainingSubscriptionsCard\n\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\tresources={{\n\t\t\t\t\t\t\tAccessThisTitleWithAFreeTrialToLogosOrVerbum: resources.AccessThisTitleWithAFreeTrialToLogosOrVerbum,\n\t\t\t\t\t\t\tAccessThisTitleWithASubscriptionToLogosOrVerbum:\n\t\t\t\t\t\t\t\tresources.AccessThisTitleWithASubscriptionToLogosOrVerbum,\n\t\t\t\t\t\t\tAvailableInSubscriptions: resources.AvailableInSubscriptions,\n\t\t\t\t\t\t\tStartingAt: resources.StartingAt,\n\t\t\t\t\t\t\tSubscribe: resources.Subscribe,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"h-[200px] animate-pulse rounded-sm bg-primary-100\" />\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nfunction ContainingSubscriptionsCard({\n\tdata,\n\tresources,\n}: {\n\tdata: ContainingSubscriptionsData;\n\tresources: Record<string, string>;\n}) {\n\tconst formatsAndTexts = useResourceFormatsAndTexts({\n\t\tlocale: data.locale,\n\t\tbillingMode: data.billingMode,\n\t\tfreeTrialPeriodUnit: data.freeTrialPeriodUnit,\n\t\tfreeTrialPeriodLength: data.freeTrialPeriodLength,\n\t\tavailableLogosTieredSubscriptionLevels: data.availableLogosTieredSubscriptionLevels,\n\t\tsubscriptionResources: undefined,\n\t});\n\n\tif (!formatsAndTexts) {\n\t\treturn null;\n\t}\n\n\tconst isFreeTrial = data.freeTrialPeriodLength !== null && data.freeTrialPeriodLength > 0;\n\n\tconst title = isFreeTrial\n\t\t? resources.AccessThisTitleWithAFreeTrialToLogosOrVerbum?.replace('%LOGOSORVERBUM%', data.logosOrVerbum)\n\t\t: resources.AccessThisTitleWithASubscriptionToLogosOrVerbum?.replace('%LOGOSORVERBUM%', data.logosOrVerbum);\n\n\tconst priceText = formatsAndTexts.priceFormat?.replace('%PRICE%', data.startingAtMonthlyPrice);\n\n\tconst availableInText = resources.AvailableInSubscriptions?.replace(\n\t\t'%AVAILABLESUBSCRIPTIONSLIST%',\n\t\tformatsAndTexts.localizedAvailableSubscriptionLevelListText\n\t)?.replace('%SUBSCRIPTIONSTEXT%', formatsAndTexts.subscriptionsText);\n\n\tconst subscribeUrl = data.routes?.ConfigurationWizardSubscriptions;\n\n\treturn (\n\t\t<div className=\"mx-4 lg:mx-sp24 flex flex-col gap-4 rounded-sm border border-black p-4 text-left text-base leading-[1.35]\">\n\t\t\t<p className=\"m-0 text-[22px] font-bold leading-[28px]\">{title}</p>\n\t\t\t<div className=\"flex flex-col gap-2\">\n\t\t\t\t<div className=\"flex flex-row justify-between gap-3 border-t border-primary-200 bg-primary-100 py-2 pl-3 pr-4\">\n\t\t\t\t\t<div className=\"flex flex-col gap-2 text-primary-400\">\n\t\t\t\t\t\t<div>{resources.StartingAt}</div>\n\t\t\t\t\t\t<div className=\"m-0 text-[20px] font-medium\">{priceText}</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t{subscribeUrl && (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tclassName=\"my-auto flex items-center gap-2 text-right font-semibold text-primary no-underline\"\n\t\t\t\t\t\t\thref={subscribeUrl}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>{resources.Subscribe}</span>\n\t\t\t\t\t\t\t<svg fill=\"none\" height=\"16\" viewBox=\"0 0 19 16\" width=\"19\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t\t\t\t<path d=\"m12 1 6 7-6 7M18 8H0\" stroke=\"currentColor\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<div>{availableInText}</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport ProductsClient from '../../../clients/products-client';\nimport { useLocalization } from '../../../localization';\nimport { useInView } from '../../../util/hooks/use-in-view';\nimport { type RecommendationProduct } from './recommendations-context';\nimport { RecommendationsCarousel } from './recommendations-carousel';\n\ninterface CustomersAlsoBoughtProps {\n\tskuIds: string[];\n\tcustomersAlsoBoughtUrl: string;\n}\n\nexport const CustomersAlsoBought = ({ skuIds, customersAlsoBoughtUrl }: CustomersAlsoBoughtProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.CustomersAlsoBought');\n\tconst { ref, isInView } = useInView<HTMLDivElement>({ rootMargin: '0px 0px 300px 0px' });\n\tconst [data, setData] = useState<RecommendationProduct[] | null>(null);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\tconst fetchData = useCallback(async () => {\n\t\tif (!skuIds.length) {\n\t\t\tsetData([]);\n\t\t\tsetIsLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst response = await ProductsClient.getProductsCustomersAlsoBoughtAsync({\n\t\t\t\tcustomersAlsoBoughtUrl,\n\t\t\t\tskuIds: skuIds.join(','),\n\t\t\t});\n\t\t\tsetData(response.products ?? []);\n\t\t} catch {\n\t\t\tsetData([]);\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [customersAlsoBoughtUrl, skuIds]);\n\n\tuseEffect(() => {\n\t\tif (isInView) {\n\t\t\tfetchData();\n\t\t}\n\t}, [isInView, fetchData]);\n\n\tconst isEmpty = !isLoading && (!data || data.length === 0);\n\n\tif (isEmpty) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={ref} className=\"max-lg:mt-sp24 lg:mt-sp32\">\n\t\t\t\t<RecommendationsCarousel data={data} heading={resources.CustomersAlsoBoughtTitle} isLoading={isLoading} />\n\t\t\t</div>\n\t\t</>\n\t);\n};\n","import React from 'react';\nimport { useLocalization } from '../../../localization/use-localization';\nimport { type FeaturedProduct } from './types';\n\ninterface FeaturedProductsProps {\n\tfeaturedProducts: FeaturedProduct[];\n\tclassName?: string;\n}\n\nexport const FeaturedProducts = ({ featuredProducts }: FeaturedProductsProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.FeaturedProducts');\n\tif (featuredProducts.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst [primaryProduct, ...secondaryProducts] = featuredProducts;\n\n\treturn (\n\t\t<div className=\"mx-auto lg:w-3/4\">\n\t\t\t<div className=\"mt-sp20 lg:mx-auto lg:mt-sp36 lg:flex lg:w-3/4 lg:justify-center\">\n\t\t\t\t<a href={primaryProduct.productPageUri}>\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={primaryProduct.imageUri}\n\t\t\t\t\t\tclassName=\"mx-auto max-h-[210px] max-w-[210px] sm:mr-sp20 sm:mx-0 sm:mb-sp12 lg:mb-0\"\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t</a>\n\t\t\t\t<div className=\"sm:text-left\">\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={primaryProduct.productPageUri}\n\t\t\t\t\t\tclassName=\"mt-sp20 block text-base font-bold text-black hover:text-black sm:mt-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{primaryProduct.title}\n\t\t\t\t\t</a>\n\t\t\t\t\t{primaryProduct.authorDisplayString && (\n\t\t\t\t\t\t<p className=\"mt-sp8 text-sm text-black-70\">{primaryProduct.authorDisplayString}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{primaryProduct.blurb && <p className=\"mt-sp12 text-sm text-black-70\">{primaryProduct.blurb}</p>}\n\t\t\t\t\t{primaryProduct.regularPrice && (\n\t\t\t\t\t\t<p className=\"mt-sp8 text-sm font-bold\">\n\t\t\t\t\t\t\t{resources.RegularPrice.replace('{0}', primaryProduct.regularPrice)}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{secondaryProducts.length > 0 && (\n\t\t\t\t<div className=\"sm:flex sm:justify-around\">\n\t\t\t\t\t{secondaryProducts.map(product => (\n\t\t\t\t\t\t<div key={product.title} className=\"mt-sp36 flex flex-col justify-between text-center sm:max-w-[210px]\">\n\t\t\t\t\t\t\t<a href={product.productPageUri} className=\"sm:flex sm:h-[168px] sm:items-center sm:justify-center\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tsrc={product.imageUri}\n\t\t\t\t\t\t\t\t\tclassName=\"mx-auto max-h-[210px] max-w-[210px] sm:max-h-full sm:max-w-full\"\n\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={product.productPageUri}\n\t\t\t\t\t\t\t\tclassName=\"mt-sp20 block text-base font-bold text-black hover:text-black\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{product.title}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{product.authorDisplayString && (\n\t\t\t\t\t\t\t\t<p className=\"mt-sp8 text-sm text-black-70\">{product.authorDisplayString}</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{product.regularPrice && (\n\t\t\t\t\t\t\t\t<p className=\"mt-sp8 text-sm font-bold\">\n\t\t\t\t\t\t\t\t\t{resources.RegularPrice.replace('{0}', product.regularPrice)}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import React, { useCallback, useEffect, useState } from 'react';\nimport ProductsClient from '../../../clients/products-client';\nimport { useLocalization } from '../../../localization/use-localization';\nimport { useInView } from '../../../util/hooks/use-in-view';\nimport { FeaturedProducts } from './featured-products';\nimport { type FeaturedProduct } from './types';\n\ninterface FeaturedProductsSectionProps {\n\tfeaturedProductsUrl: string;\n}\n\nconst FeaturedProductsSkeleton = () => (\n\t<div className=\"animate-pulse\">\n\t\t<div className=\"sm:mx-auto sm:flex sm:w-3/4 sm:justify-center\">\n\t\t\t<div className=\"mx-auto h-[210px] w-[210px] rounded bg-primary-200 sm:mr-sp20 sm:mx-0\" />\n\t\t\t<div className=\"mt-sp20 flex flex-1 flex-col gap-sp8 sm:mt-0\">\n\t\t\t\t<div className=\"h-4 w-3/4 rounded bg-primary-200\" />\n\t\t\t\t<div className=\"h-3 w-1/2 rounded bg-primary-200\" />\n\t\t\t\t<div className=\"h-3 w-full rounded bg-primary-200\" />\n\t\t\t\t<div className=\"h-3 w-5/6 rounded bg-primary-200\" />\n\t\t\t</div>\n\t\t</div>\n\t</div>\n);\n\nexport const FeaturedProductsSection = ({ featuredProductsUrl }: FeaturedProductsSectionProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.FeaturedProducts');\n\tconst { ref, isInView } = useInView<HTMLDivElement>({ rootMargin: '0px 0px 300px 0px' });\n\tconst [data, setData] = useState<FeaturedProduct[] | null>(null);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\tconst fetchData = useCallback(async () => {\n\t\ttry {\n\t\t\tconst result = await ProductsClient.getFeaturedProducts(featuredProductsUrl);\n\t\t\tsetData(result ?? []);\n\t\t} catch {\n\t\t\tsetData([]);\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [featuredProductsUrl]);\n\n\tuseEffect(() => {\n\t\tif (isInView) {\n\t\t\tfetchData();\n\t\t}\n\t}, [isInView, fetchData]);\n\n\tconst isEmpty = !isLoading && (!data || data.length === 0);\n\n\tif (isEmpty) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{isInView && <hr className=\"hidden lg:block border-gray lg:mx-sp24\" />}\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName=\"tw-preflight mx-auto max-w-[1440px] lg:px-6 lg:pb-sp16 lg:pt-sp16 max-lg:mt-sp24 max-lg:mx-sp16 lg:mt-sp32\"\n\t\t\t>\n\t\t\t\t<h2 className=\"mb-8 text-2xl font-bold text-gray-900\">{resources.ResourceHighlights}</h2>\n\t\t\t\t{isLoading ? <FeaturedProductsSkeleton /> : <FeaturedProducts featuredProducts={data ?? []} />}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n","import { fetch } from '../util/fetch';\n\nexport default class ReviewsClient {\n\tstatic async getReviews(requestUrl) {\n\t\tconst response = await fetch.get({\n\t\t\turl: requestUrl,\n\t\t});\n\n\t\tconst responseData = await response.json();\n\n\t\treturn responseData.reviews;\n\t}\n\n\tstatic async getAdditionalReviews(requestUrl, offset) {\n\t\tconst response = await fetch.get({\n\t\t\turl: `${requestUrl}?offset=${offset}`,\n\t\t});\n\n\t\tconst responseData = await response.json();\n\n\t\treturn responseData.reviews;\n\t}\n\n\tstatic async getRatings(requestUrl) {\n\t\tconst response = await fetch.get({\n\t\t\turl: requestUrl,\n\t\t});\n\n\t\tconst responseData = await response.json();\n\n\t\treturn responseData;\n\t}\n\n\tstatic async getReview(url) {\n\t\tlet response;\n\n\t\ttry {\n\t\t\tresponse = await fetch.get({\n\t\t\t\turl,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 404) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async deleteReview(url) {\n\t\tconst response = await fetch.delete({\n\t\t\turl,\n\t\t});\n\n\t\treturn response;\n\t}\n\n\tstatic async createReview(requestUrl, productId, userId, reviewText, rating) {\n\t\tconst response = await fetch.postWithBody({\n\t\t\turl: requestUrl,\n\t\t\tbody: {\n\t\t\t\tproductId,\n\t\t\t\tuserId,\n\t\t\t\treviewText,\n\t\t\t\trating: rating === 0 ? null : rating,\n\t\t\t},\n\t\t});\n\n\t\treturn await response.json();\n\t}\n\n\tstatic async addReactionToReview(url) {\n\t\ttry {\n\t\t\tawait fetch.post({\n\t\t\t\turl,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 500) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic async removeReactionFromReview(url) {\n\t\ttry {\n\t\t\tawait fetch.delete({\n\t\t\t\turl,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error.response.status === 500) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic async flagReview(url) {\n\t\tawait fetch.post({\n\t\t\turl,\n\t\t});\n\t}\n\n\tstatic async followPage(requestUrl) {\n\t\tawait fetch.get({\n\t\t\turl: requestUrl,\n\t\t});\n\t}\n\n\tstatic async unfollowPage(requestUrl) {\n\t\tawait fetch.get({\n\t\t\turl: requestUrl,\n\t\t});\n\t}\n}\n","import React, { useCallback, useState } from 'react';\nimport { StarFilledIcon, StarIcon } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../localization';\n\ninterface RatingSelectorProps {\n\tselectedRating: number;\n\tonSelectedRatingChange: (rating: number) => void;\n}\n\nexport const RatingSelector = ({ selectedRating, onSelectedRatingChange }: RatingSelectorProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\tconst [previewRating, setPreviewRating] = useState(0);\n\n\tconst ratingDescriptions = [\n\t\tresources.HatedIt,\n\t\tresources.DidntLikeIt,\n\t\tresources.ItsOkay,\n\t\tresources.LikedIt,\n\t\tresources.LovedIt,\n\t] as const;\n\n\tconst activeRating = selectedRating || previewRating;\n\n\tconst handleMouseEnter = useCallback((point: number) => setPreviewRating(point), []);\n\tconst handleMouseLeave = useCallback(() => setPreviewRating(0), []);\n\tconst handleClick = useCallback((point: number) => onSelectedRatingChange(point), [onSelectedRatingChange]);\n\n\tconst iconSize = 16; // 16px, is the md scale of <StarRating /> component\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-sp4\">\n\t\t\t<div className={`group/star-rating flex flex-row gap-sp4`}>\n\t\t\t\t{ratingDescriptions.map((_desc, index) => {\n\t\t\t\t\tconst point = index + 1;\n\t\t\t\t\tconst isFilled = point <= activeRating;\n\t\t\t\t\tconst isPreviewed = point <= previewRating;\n\t\t\t\t\tconst starClassName = `${isPreviewed ? 'scale-125' : ''}`;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tkey={point}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label={ratingDescriptions[index]}\n\t\t\t\t\t\t\tclassName={`cursor-pointer p-sp2 focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary text-primary-400 disabled:text-black group-has-[button:active]/star-rating:opacity-60`}\n\t\t\t\t\t\t\tonMouseEnter={() => handleMouseEnter(point)}\n\t\t\t\t\t\t\tonMouseLeave={handleMouseLeave}\n\t\t\t\t\t\t\tonClick={() => handleClick(point)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{isFilled ? (\n\t\t\t\t\t\t\t\t<StarFilledIcon className={starClassName} size={iconSize} />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<StarIcon className={starClassName} size={iconSize} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import React from 'react';\n\nimport { ComponentPropsWithRef, ComponentRef, forwardRef } from 'react';\nimport { cn } from '../../../util/cn';\n\nconst textAreaClassName =\n\t'focus-visible:ring-primary/20 border-2 border-tailwind-gray-200 py-sp10 px-sp16 placeholder:text-tailwind-gray-500 hover:border-primary focus-visible:border-primary focus-visible:outline-hidden focus-visible:ring-2 disabled:bg-tailwind-gray-100';\n\ntype TextAreaProps = ComponentPropsWithRef<'textarea'>;\n\nexport const TextArea = forwardRef<ComponentRef<'textarea'>, TextAreaProps>(({ className, ...props }, ref) => {\n\treturn <textarea className={cn(textAreaClassName, className)} ref={ref} {...props} />;\n});\n\nTextArea.displayName = 'TextArea';\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { Button, Typography } from '@faithlife/commerce-components';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { LoadingSpinner } from '../../../../vendor/styled-ui';\nimport { useLocalization } from '../../../localization';\nimport { useLocation } from '../../../location';\nimport ReviewsClient from '../../../clients/reviews-client';\nimport { RatingSelector } from './rating-selector';\nimport type { ReviewViewModel, ReviewsRoutes, ReviewsUserViewModel } from './types';\nimport { TextArea } from './text-area';\n\ninterface ReviewEditorProps {\n\tuser?: ReviewsUserViewModel;\n\tisUserLoggedIn: boolean;\n\tcurrentUserReview?: ReviewViewModel;\n\tproductId: string;\n\troutes: ReviewsRoutes;\n\tonReviewSubmit: () => Promise<void>;\n\tonDeleteReview: (review: ReviewViewModel) => Promise<void>;\n}\n\nexport const ReviewEditor = ({\n\tuser,\n\tisUserLoggedIn,\n\tcurrentUserReview,\n\tproductId,\n\troutes,\n\tonReviewSubmit,\n\tonDeleteReview,\n}: ReviewEditorProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\tconst { navigate } = useLocation();\n\tconst [selectedRating, setSelectedRating] = useState(0);\n\tconst [reviewText, setReviewText] = useState('');\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\n\tconst trimmedReviewText = reviewText.trim();\n\n\t// Auto-focus textarea when a rating is selected\n\tuseEffect(() => {\n\t\tif (selectedRating > 0) {\n\t\t\ttextareaRef.current?.focus();\n\t\t}\n\t}, [selectedRating]);\n\n\tconst handleSubmitReview = useCallback(async () => {\n\t\tsetIsLoading(true);\n\t\ttry {\n\t\t\tawait ReviewsClient.createReview(\n\t\t\t\troutes.CreateReviewUrl,\n\t\t\t\tproductId,\n\t\t\t\tuser?.userId,\n\t\t\t\ttrimmedReviewText,\n\t\t\t\tselectedRating\n\t\t\t);\n\t\t\tawait onReviewSubmit();\n\t\t} finally {\n\t\t\tsetIsLoading(false);\n\t\t}\n\t}, [routes, productId, user, trimmedReviewText, selectedRating, onReviewSubmit]);\n\n\tconst handleDeleteClick = useCallback(async () => {\n\t\tif (!currentUserReview) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsLoading(true);\n\t\tawait onDeleteReview(currentUserReview);\n\t\tsetIsLoading(false);\n\t}, [currentUserReview, onDeleteReview]);\n\n\tconst handleSignInClick = useCallback(() => {\n\t\tnavigate(routes.SignInUrl);\n\t}, [navigate, routes.SignInUrl]);\n\n\tif (!isUserLoggedIn) {\n\t\treturn (\n\t\t\t<div className=\"flex justify-start\">\n\t\t\t\t{/* TODO: Replace this with a real link styled like a button when commerce-components supports link semantics here. */}\n\t\t\t\t<Button onClick={handleSignInClick} scale=\"small\" variant=\"secondary\">\n\t\t\t\t\t{resources.SignIn}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (currentUserReview) {\n\t\treturn (\n\t\t\t<div className=\"flex items-center justify-between\">\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.AlreadyReviewed}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"REVIEWDATE\">{currentUserReview.localeDate ?? ''}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</Typography>\n\t\t\t\t<div>\n\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t<LoadingSpinner small />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Button onClick={handleDeleteClick} scale=\"small\" variant=\"secondary\">\n\t\t\t\t\t\t\t{resources.Delete}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-sp16\">\n\t\t\t<Typography className=\"text-primary-400\" variant=\"headingH6\">\n\t\t\t\t{resources.ReviewThisProduct}\n\t\t\t</Typography>\n\t\t\t<div className=\"flex items-center gap-sp8\">\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t{resources.StarRating}\n\t\t\t\t\t{':'}\n\t\t\t\t</Typography>\n\t\t\t\t<RatingSelector onSelectedRatingChange={setSelectedRating} selectedRating={selectedRating} />\n\t\t\t</div>\n\t\t\t<TextArea\n\t\t\t\tref={textareaRef}\n\t\t\t\tclassName=\"w-full resize-none\"\n\t\t\t\tonChange={e => setReviewText(e.target.value)}\n\t\t\t\tplaceholder={resources.ShareYourThoughtsHere}\n\t\t\t\trows={4}\n\t\t\t\tvalue={reviewText}\n\t\t\t/>\n\t\t\t<div className=\"flex flex-col gap-sp8\">\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.PleaseFollowOur}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"GUIDELINESLINK\">\n\t\t\t\t\t\t\t<a className=\"underline\" href={resources.ReviewGuidelinesLink} rel=\"noopener noreferrer\" target=\"_blank\">\n\t\t\t\t\t\t\t\t{resources.ReviewGuidelines}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</Typography>\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.AllPostedReviews}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"TOSLINK\">\n\t\t\t\t\t\t\t<a className=\"underline\" href={resources.TermsOfServiceLink} rel=\"noopener noreferrer\" target=\"_blank\">\n\t\t\t\t\t\t\t\t{resources.TermsOfService}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</Typography>\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.CanSeeThis}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"EVERYONE\">{resources.Everyone}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</Typography>\n\t\t\t</div>\n\t\t\t<div className=\"flex justify-start\">\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<LoadingSpinner small />\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdisabled={!selectedRating && !trimmedReviewText.length}\n\t\t\t\t\t\tonClick={handleSubmitReview}\n\t\t\t\t\t\tscale=\"small\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{resources.SubmitReview}\n\t\t\t\t\t</Button>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { StarRating, Typography } from '@faithlife/commerce-components';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { useLocalization } from '../../../localization';\nimport { hasValidReviewData } from '../../shared/ratings/review-data';\nimport type { RatingsViewModel } from './types';\n\ninterface ReviewHeaderProps {\n\tratings?: RatingsViewModel;\n}\n\nexport const ReviewHeader = ({ ratings }: ReviewHeaderProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\tconst averageRating = ratings?.averageRating ?? 0;\n\tconst reviewCount = ratings?.numberOfRatings ?? 0;\n\tconst shouldDisplayRatings = ratings?.shouldDisplayStars === true && hasValidReviewData(averageRating, reviewCount);\n\tconst reviewsTemplate = reviewCount === 1 ? resources.BasedOnSingleReview : resources.BasedOnReviews;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-sp8\">\n\t\t\t{/* Title */}\n\t\t\t<Typography className=\"text-primary-400\" variant=\"headingH4\">\n\t\t\t\t{resources.CustomerReviews}\n\t\t\t</Typography>\n\n\t\t\t{/* Aggregate rating */}\n\t\t\t{shouldDisplayRatings && (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"flex flex-row items-center gap-sp8\">\n\t\t\t\t\t\t<StarRating rating={averageRating} scale=\"md\" />\n\t\t\t\t\t\t<Typography className=\"text-black\" variant=\"bodySmall\">\n\t\t\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.RatingOutOfMax}>\n\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"RATING\">{averageRating.toFixed(1)}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"MAXRATING\">{'5'}</CommandSentence.Field>\n\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Typography className=\"text-black\" variant=\"bodySmall\">\n\t\t\t\t\t\t<CommandSentence key={reviewsTemplate} Container=\"span\" template={reviewsTemplate}>\n\t\t\t\t\t\t\t<CommandSentence.Field name=\"REVIEWCOUNT\">{String(reviewCount)}</CommandSentence.Field>\n\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t</Typography>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { cn } from '../../../util/cn';\n\ntype LinkButtonScale = 'sm' | 'lg';\nconst classesByScale: Record<LinkButtonScale, string> = {\n\tsm: 'text-sm',\n\tlg: 'text-lg',\n};\ntype LinkButtonProps = {\n\tscale: LinkButtonScale;\n\tchildren: React.ReactNode;\n} & React.ComponentPropsWithoutRef<'button'>;\n\nexport default function LinkButton({ scale, children, ...props }: LinkButtonProps) {\n\treturn (\n\t\t<button\n\t\t\tclassName={cn(\n\t\t\t\t'cursor-pointer text-primary hover:text-secondary-200 active:text-secondary-400 disabled:pointer-events-none disabled:text-black disabled:opacity-25 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n\t\t\t\tclassesByScale[scale]\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n","import React, { useCallback } from 'react';\nimport { StarRating, Typography } from '@faithlife/commerce-components';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { useLocalization } from '../../../localization';\nimport ReviewsClient from '../../../clients/reviews-client';\nimport type { ReviewViewModel, ReviewsRoutes } from './types';\nimport LinkButton from './link-button';\n\ninterface ReviewItemProps {\n\treview: ReviewViewModel;\n\troutes: ReviewsRoutes;\n\tonDeleteReview: (review: ReviewViewModel) => Promise<void>;\n}\n\nexport const ReviewItem = ({ review, onDeleteReview }: ReviewItemProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\n\tconst { author, localeDate, text, rating, routes: reviewRoutes } = review;\n\n\tconst canDelete = reviewRoutes.DeleteReviewUrl !== undefined;\n\tconst canFlag = reviewRoutes.FlagReviewUrl !== undefined;\n\n\tconst handleFlagClick = useCallback(() => {\n\t\tif (reviewRoutes.FlagReviewUrl) {\n\t\t\tvoid ReviewsClient.flagReview(reviewRoutes.FlagReviewUrl);\n\t\t}\n\t}, [reviewRoutes.FlagReviewUrl]);\n\n\treturn (\n\t\t<li className=\"flex flex-col gap-sp16 border-b border-b-gray pb-sp16 lg:pb-[32px]\">\n\t\t\t{/* Author row */}\n\t\t\t<div className=\"flex flex-row justify-between items-start\">\n\t\t\t\t<Typography className=\"text-black\" variant=\"bodySmall\">\n\t\t\t\t\t{author?.name}\n\t\t\t\t</Typography>\n\t\t\t\t<Typography className=\"text-black-100\" variant=\"bodySmall\">\n\t\t\t\t\t{localeDate}\n\t\t\t\t</Typography>\n\t\t\t</div>\n\n\t\t\t{/* Star rating */}\n\t\t\t{rating !== undefined && (\n\t\t\t\t<div className=\"flex flex-col gap-sp8 lg:flex-row\">\n\t\t\t\t\t<p className=\"flex flex-nowrap text-primary\">\n\t\t\t\t\t\t<StarRating scale=\"md\" rating={rating} />\n\t\t\t\t\t\t<CommandSentence Container=\"span\" className=\"sr-only\" template={resources.SingleRating}>\n\t\t\t\t\t\t\t<CommandSentence.Field name=\"RATINGSCOUNT\">{String(rating)}</CommandSentence.Field>\n\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Review text */}\n\t\t\t{text && (\n\t\t\t\t<Typography className=\"text-black\" variant=\"bodyRegular\">\n\t\t\t\t\t{text}\n\t\t\t\t</Typography>\n\t\t\t)}\n\n\t\t\t{/* Actions row: flag / delete (for logged-in users) */}\n\t\t\t{(canDelete || canFlag) && (\n\t\t\t\t<div className=\"flex flex-row items-center gap-sp12\">\n\t\t\t\t\t{canDelete && (\n\t\t\t\t\t\t<LinkButton onClick={() => void onDeleteReview(review)} scale=\"sm\">\n\t\t\t\t\t\t\t{resources.Delete}\n\t\t\t\t\t\t</LinkButton>\n\t\t\t\t\t)}\n\t\t\t\t\t{canFlag && (\n\t\t\t\t\t\t<LinkButton onClick={handleFlagClick} scale=\"sm\">\n\t\t\t\t\t\t\t{resources.Flag}\n\t\t\t\t\t\t</LinkButton>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</li>\n\t);\n};\n","import React from 'react';\nimport { ReviewItem } from './review-item';\nimport type { ReviewViewModel, ReviewsRoutes } from './types';\n\ninterface ReviewsListProps {\n\treviews: ReviewViewModel[];\n\troutes: ReviewsRoutes;\n\tonDeleteReview: (review: ReviewViewModel) => Promise<void>;\n}\n\nexport const ReviewsList = ({ reviews, routes, onDeleteReview }: ReviewsListProps) => {\n\treturn (\n\t\t<ol className=\"flex w-full flex-col gap-sp16 lg:gap-[32px]\">\n\t\t\t{reviews.map(review => (\n\t\t\t\t<ReviewItem key={review.id} onDeleteReview={onDeleteReview} review={review} routes={routes} />\n\t\t\t))}\n\t\t</ol>\n\t);\n};\n","import React from 'react';\nimport { DropdownButton } from '@faithlife/commerce-components';\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuTrigger,\n} from '../../shared/dropdown-menu';\nimport { useLocalization } from '../../../localization';\nimport { cn } from '../../../util/cn';\n\nexport type SortMode = 'latest' | 'earliest' | 'rating';\n\nconst sortModes = ['latest', 'earliest', 'rating'] as SortMode[];\n\ninterface SortModeSelectorProps {\n\tsortMode: SortMode;\n\tonSortModeChanged: (mode: SortMode) => void;\n\tclassName?: string;\n}\n\n/* we're sort of fighting with DropdownButton's styling to get this looking somewhat like spec */\n/* TODO this appears to be an input field with dropdown, in terms of styling */\nexport const SortModeSelector = ({ sortMode, onSortModeChanged, className }: SortModeSelectorProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\n\tconst sortModeLabels: Record<SortMode, string> = {\n\t\tlatest: resources.LatestFirst ?? 'Latest first',\n\t\tearliest: resources.EarliestFirst ?? 'Earliest first',\n\t\trating: resources.ByRating ?? 'By rating',\n\t};\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<DropdownButton\n\t\t\t\t\tclassName={cn('border rounded-sm border-tailwind-gray-400 w-full justify-between', className)}\n\t\t\t\t\tscale=\"sm\"\n\t\t\t\t\ttext={sortModeLabels[sortMode]}\n\t\t\t\t\tvariant=\"subtle\"\n\t\t\t\t/>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent className=\"mt-sp4 w-(--radix-popper-anchor-width) min-w-0 rounded-sm border border-gray bg-white py-sp4 shadow-md\">\n\t\t\t\t<DropdownMenuRadioGroup\n\t\t\t\t\tonValueChange={(value: string) => onSortModeChanged(value as SortMode)}\n\t\t\t\t\tvalue={sortMode}\n\t\t\t\t>\n\t\t\t\t\t{sortModes.map(mode => (\n\t\t\t\t\t\t<DropdownMenuRadioItem\n\t\t\t\t\t\t\tclassName=\"w-full px-sp12 py-sp8 text-left text-sm text-black hover:bg-gray active:bg-primary-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary data-[state=checked]:text-primary-500\"\n\t\t\t\t\t\t\tkey={mode}\n\t\t\t\t\t\t\tvalue={mode}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{sortModeLabels[mode]}\n\t\t\t\t\t\t</DropdownMenuRadioItem>\n\t\t\t\t\t))}\n\t\t\t\t</DropdownMenuRadioGroup>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import React from 'react';\n\nexport const Divider = () => {\n\treturn <div className=\"border-t border-t-gray\" />;\n};\n","export const REVIEWS_ANCHOR_ID = 'customer-reviews';\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { Button } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../localization';\nimport ReviewsClient from '../../../clients/reviews-client';\nimport { ReviewEditor } from './review-editor';\nimport { ReviewHeader } from './review-header';\nimport { ReviewsList } from './reviews-list';\nimport { SortModeSelector, type SortMode } from './sort-mode-selector';\nimport type { RatingsViewModel, ReviewViewModel, ReviewsViewModel } from './types';\nimport { Divider } from './divider';\nimport { REVIEWS_ANCHOR_ID } from './reviews-anchor';\n\nexport { REVIEWS_ANCHOR_ID };\n\n// Number of reviews to show per \"page\" / load-more increment\nconst REVIEW_LIMIT_INCREMENT = 10;\n\nconst sortReviews = (a: ReviewViewModel, b: ReviewViewModel, mode: SortMode): number => {\n\tif (mode === 'earliest') {\n\t\tconst da = a.createdDate ?? '';\n\t\tconst db = b.createdDate ?? '';\n\t\treturn da > db ? 1 : db > da ? -1 : 0;\n\t}\n\tif (mode === 'latest') {\n\t\tconst da = a.createdDate ?? '';\n\t\tconst db = b.createdDate ?? '';\n\t\treturn da < db ? 1 : db < da ? -1 : 0;\n\t}\n\t// By rating descending\n\treturn (b.rating ?? 0) - (a.rating ?? 0);\n};\n\ninterface ReviewsProps {\n\treviews: ReviewsViewModel;\n}\n\nconst Reviews = ({ reviews: reviewsProps }: ReviewsProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Reviews');\n\tconst { user, isUserLoggedIn, productId, routes } = reviewsProps;\n\n\tconst [sortMode, setSortMode] = useState<SortMode>('latest');\n\tconst [reviewLimit, setReviewLimit] = useState(REVIEW_LIMIT_INCREMENT);\n\tconst [allReviews, setAllReviews] = useState<ReviewViewModel[]>([]);\n\tconst [serverMayHaveMoreReviews, setServerMayHaveMoreReviews] = useState(true);\n\tconst [ratings, setRatings] = useState<RatingsViewModel | undefined>(reviewsProps.ratings);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\t// Reviews visible after sort + pagination\n\tconst sortedReviews = [...allReviews].sort((a, b) => sortReviews(a, b, sortMode)).slice(0, reviewLimit);\n\n\t// The current logged-in user's own review (to show \"already reviewed\" state)\n\tconst currentUserReview = allReviews.find(r => r.author?.id === user?.userId);\n\n\t// ─── Initial load ────────────────────────────────────────────────────────────\n\tuseEffect(() => {\n\t\tlet cancelled = false;\n\n\t\tconst loadInitialReviews = async () => {\n\t\t\tsetIsLoading(true);\n\t\t\ttry {\n\t\t\t\tconst loadedReviews = await ReviewsClient.getReviews(routes.GetReviewsUrl);\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetAllReviews(loadedReviews ?? []);\n\t\t\t\t\tsetServerMayHaveMoreReviews((loadedReviews?.length ?? 0) >= REVIEW_LIMIT_INCREMENT);\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tvoid loadInitialReviews();\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t};\n\t}, [routes.GetReviewsUrl]);\n\n\t// ─── Refresh helpers ─────────────────────────────────────────────────────────\n\tconst refreshRatings = useCallback(async () => {\n\t\tconst newRatings = await ReviewsClient.getRatings(routes.GetRatingsUrl);\n\t\tsetRatings(newRatings);\n\t}, [routes.GetRatingsUrl]);\n\n\tconst refreshReviews = useCallback(async () => {\n\t\tconst newReviews = await ReviewsClient.getReviews(routes.GetReviewsUrl);\n\t\tsetAllReviews(newReviews ?? []);\n\t\tawait refreshRatings();\n\t}, [routes.GetReviewsUrl, refreshRatings]);\n\n\t// ─── Delete ───────────────────────────────────────────────────────────────────\n\tconst handleDeleteReview = useCallback(\n\t\tasync (review: ReviewViewModel) => {\n\t\t\tif (!review.routes.DeleteReviewUrl) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait ReviewsClient.deleteReview(review.routes.DeleteReviewUrl);\n\t\t\tsetAllReviews(prev => prev.filter(r => r.id !== review.id));\n\t\t\tawait refreshRatings();\n\t\t},\n\t\t[refreshRatings]\n\t);\n\n\t// ─── Pagination ───────────────────────────────────────────────────────────────\n\n\tconst canReadMore = allReviews.length > reviewLimit || serverMayHaveMoreReviews;\n\tconst canReadLess = reviewLimit > REVIEW_LIMIT_INCREMENT;\n\n\tconst [isLoadingMore, setIsLoadingMore] = useState(false);\n\tconst handleReadMoreClick = useCallback(async () => {\n\t\t// Fetch the next chunk from the server if we don't have it yet\n\t\tif (allReviews.length <= reviewLimit) {\n\t\t\tsetIsLoadingMore(true);\n\t\t\ttry {\n\t\t\t\tconst additionalReviews = await ReviewsClient.getAdditionalReviews(routes.GetReviewsUrl, reviewLimit);\n\t\t\t\tsetAllReviews(prev => prev.concat(additionalReviews ?? []));\n\t\t\t\tsetServerMayHaveMoreReviews((additionalReviews?.length ?? 0) >= REVIEW_LIMIT_INCREMENT);\n\t\t\t} finally {\n\t\t\t\tsetIsLoadingMore(false);\n\t\t\t}\n\t\t}\n\t\tsetReviewLimit(prev => prev + REVIEW_LIMIT_INCREMENT);\n\t}, [allReviews.length, reviewLimit, routes.GetReviewsUrl]);\n\n\tconst handleReadLessClick = useCallback(() => {\n\t\tsetReviewLimit(prev => prev - REVIEW_LIMIT_INCREMENT);\n\t}, []);\n\n\treturn (\n\t\t<div className=\"tw-preflight flex flex-col lg:flex-row gap-sp16 lg:gap-8 xl:gap-15\" id={REVIEWS_ANCHOR_ID}>\n\t\t\t{/* Left sidebar: aggregate rating summary + editor */}\n\t\t\t<div className=\"lg:w-[338px] shrink-0 flex flex-col gap-sp16 lg:gap-[32px]\">\n\t\t\t\t<ReviewHeader ratings={ratings} />\n\t\t\t\t<Divider />\n\t\t\t\t<ReviewEditor\n\t\t\t\t\tcurrentUserReview={currentUserReview}\n\t\t\t\t\tisUserLoggedIn={isUserLoggedIn}\n\t\t\t\t\tonDeleteReview={handleDeleteReview}\n\t\t\t\t\tonReviewSubmit={refreshReviews}\n\t\t\t\t\tproductId={productId}\n\t\t\t\t\troutes={routes}\n\t\t\t\t\tuser={user}\n\t\t\t\t/>\n\t\t\t</div>\n\n\t\t\t{/* Right content: reviews list */}\n\t\t\t<div className=\"min-w-0 flex-1 flex flex-col gap-sp16 lg:gap-[32px]\">\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t<p className=\"text-sm text-black-100\">{resources.LoadingReviews}</p>\n\t\t\t\t) : sortedReviews.length === 0 ? (\n\t\t\t\t\t<p className=\"pb-sp24 pt-sp4 text-sm text-black-100\">{resources.WriteAReview}</p>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<SortModeSelector onSortModeChanged={setSortMode} sortMode={sortMode} className=\"w-full lg:max-w-[400px]\" />\n\n\t\t\t\t\t\t<Divider />\n\n\t\t\t\t\t\t<ReviewsList onDeleteReview={handleDeleteReview} reviews={sortedReviews} routes={routes} />\n\n\t\t\t\t\t\t{/* Read more / Read less */}\n\t\t\t\t\t\t<div className=\"mt-sp24 flex items-center gap-sp12\">\n\t\t\t\t\t\t\t{canReadMore && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tonClick={() => void handleReadMoreClick()}\n\t\t\t\t\t\t\t\t\tscale=\"small\"\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tloading={isLoadingMore}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{resources.ReadMore}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{canReadMore && canReadLess && <span className=\"text-black-100\">{'|'}</span>}\n\t\t\t\t\t\t\t{canReadLess && (\n\t\t\t\t\t\t\t\t<Button onClick={handleReadLessClick} scale=\"small\" variant=\"secondary\">\n\t\t\t\t\t\t\t\t\t{resources.ReadLess}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default Reviews;\n","import React from 'react';\n\nimport { useExecuteContentScripts } from './execute-scripts';\n\nconst c_businessDeskProductContentClass = 'bd-product-display-content';\n\n// Amber embed URLs are rewritten into a responsive 16:9 iframe container, matching Skeletor's DisplayContent renderer.\nconst c_amberVideoEmbedRegex = /https:\\/\\/(test\\.)?amber\\.faithlife\\.com\\/shares\\/\\w*\\/embed\\S*/g;\n\ninterface DisplayContentProps {\n\thtml: string;\n\tclassName?: string;\n}\n\nexport const DisplayContent = ({ html, className }: DisplayContentProps) => {\n\tconst rewritten = html.replace(\n\t\tc_amberVideoEmbedRegex,\n\t\t'<div class=\"pcs-embed-16x9\"><iframe frameborder=\"0\" scrolling=\"no\" allowfullscreen src=\"$&\"></iframe></div>'\n\t);\n\n\tconst ref = useExecuteContentScripts(rewritten);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={className}\n\t\t\t// eslint-disable-next-line react/no-danger\n\t\t\tdangerouslySetInnerHTML={{ __html: rewritten }}\n\t\t/>\n\t);\n};\n\nexport { c_businessDeskProductContentClass };\n","import { useEffect, useRef } from 'react';\n\n// Browsers do not execute <script> tags inserted via innerHTML (which is what\n// dangerouslySetInnerHTML does). CMS \"Business Desk\" content bodies can embed\n// inline and src scripts (e.g. Wistia embeds, refTagger hooks) that must run, so\n// we clone each script into a fresh element to force execution — mirroring\n// Skeletor's executeScriptTagsInContainer.\nexport function executeScriptTagsInContainer(container: HTMLElement) {\n\tconst scripts = Array.from(container.querySelectorAll('script'));\n\tfor (const oldScript of scripts) {\n\t\tconst newScript = document.createElement('script');\n\t\tfor (const attribute of Array.from(oldScript.attributes)) {\n\t\t\tnewScript.setAttribute(attribute.name, attribute.value);\n\t\t}\n\t\t// document.createElement('script') defaults async to true, unlike scripts parsed from HTML.\n\t\t// Force it back off (unless the markup opted in) so a following inline script that depends on\n\t\t// this one's globals isn't racing an in-flight fetch of `src`.\n\t\tnewScript.async = oldScript.hasAttribute('async');\n\t\tnewScript.text = oldScript.text;\n\t\toldScript.parentNode?.replaceChild(newScript, oldScript);\n\t}\n}\n\n// Clones and re-executes any embedded scripts, then re-runs RefTagger so Bible\n// references inside the freshly injected HTML get tagged. Runs on mount / when the\n// html changes, and again whenever the desktop/mobile breakpoint flips, because\n// Skeletor re-renders section bodies on that transition and re-runs their scripts.\nexport function useExecuteContentScripts(html: string, breakpointQuery = '(min-width: 1024px)') {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst container = ref.current;\n\t\tif (!container) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst runContentScripts = (target: HTMLElement) => {\n\t\t\texecuteScriptTagsInContainer(target);\n\t\t\ttry {\n\t\t\t\tif (typeof window !== 'undefined' && typeof window.refTagger?.tag === 'function') {\n\t\t\t\t\twindow.refTagger.tag();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to run RefTagger tag():', error);\n\t\t\t}\n\t\t};\n\n\t\trunContentScripts(container);\n\n\t\tif (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst mediaQuery = window.matchMedia(breakpointQuery);\n\t\tconst handleChange = () => {\n\t\t\tif (ref.current) {\n\t\t\t\trunContentScripts(ref.current);\n\t\t\t}\n\t\t};\n\n\t\tif (typeof mediaQuery.addEventListener === 'function') {\n\t\t\tmediaQuery.addEventListener('change', handleChange);\n\t\t\treturn () => mediaQuery.removeEventListener('change', handleChange);\n\t\t}\n\n\t\t// Safari < 14 fallback.\n\t\tmediaQuery.addListener(handleChange);\n\t\treturn () => mediaQuery.removeListener(handleChange);\n\t}, [html, breakpointQuery]);\n\n\treturn ref;\n}\n","import React, { useEffect } from 'react';\n\nimport { cn } from '../../../util/cn';\n\nconst c_wistiaPlaylistScriptSrc = 'https://fast.wistia.com/assets/external/playlist-v1.js';\nconst c_wistiaSingleScriptSrc = 'https://fast.wistia.net/assets/external/E-v1.js';\n\ninterface EmbeddedVideoProps {\n\tvideoUrl: string;\n\tallowAutoplay?: boolean;\n\tclassName?: string;\n}\n\nfunction scriptAlreadyPresent(src: string): boolean {\n\treturn Boolean(document.querySelector(`script[src=\"${src}\"]`));\n}\n\n// Faithful port of Skeletor's embedded-video component. The raw section content is a URL with three\n// branches: a Wistia playlist (placeholder div + injected Wistia.playlist script), a single Wistia\n// video (iframe + injected E-v1 loader), or any other embed (wrapped in a responsive 16:9 container).\nexport const EmbeddedVideo = ({ videoUrl, allowAutoplay = false, className }: EmbeddedVideoProps) => {\n\tconst isWistiaUrl = videoUrl.includes('wistia');\n\tconst playlistMatch = isWistiaUrl ? videoUrl.match(/playlists\\/(\\w*)/) : null;\n\tconst wistiaPlaylistId = playlistMatch ? playlistMatch[1] : null;\n\n\tconst allowAttributeEntries = ['fullscreen'];\n\tif (allowAutoplay) {\n\t\tallowAttributeEntries.push('autoplay');\n\t}\n\tconst allowAttribute = allowAttributeEntries.join(';');\n\n\tuseEffect(() => {\n\t\tif (!isWistiaUrl) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (wistiaPlaylistId) {\n\t\t\t// Guard against re-injecting the loader on repeated mounts; Skeletor appends these to the\n\t\t\t// body and never cleans them up.\n\t\t\tif (scriptAlreadyPresent(c_wistiaPlaylistScriptSrc)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst wistiaPlaylistsScript = document.createElement('script');\n\t\t\twistiaPlaylistsScript.src = c_wistiaPlaylistScriptSrc;\n\t\t\twistiaPlaylistsScript.async = false;\n\t\t\twistiaPlaylistsScript.onload = () => {\n\t\t\t\tconst playlistDetailsScript = document.createElement('script');\n\t\t\t\tplaylistDetailsScript.type = 'text/javascript';\n\t\t\t\tplaylistDetailsScript.async = false;\n\t\t\t\tplaylistDetailsScript.text = `wistiaPlaylist = Wistia.playlist(\"${wistiaPlaylistId}\", {\n\t\t\t\t\tversion: \"v1\", theme: \"tab\",\n\t\t\t\t\tvideoOptions: { volumeControl: true, autoPlay: true, videoWidth: \"640\", videoHeight: \"360\", inlineOptionsOnly: true, version: \"v1\" },\n\t\t\t\t\tvideoFoam: \"true\",\n\t\t\t\t\tmedia_0_0: { autoPlay: false, controlsVisibleOnLoad: false }\n\t\t\t\t});`;\n\t\t\t\tdocument.body.appendChild(playlistDetailsScript);\n\t\t\t};\n\t\t\tdocument.body.appendChild(wistiaPlaylistsScript);\n\t\t} else if (!scriptAlreadyPresent(c_wistiaSingleScriptSrc)) {\n\t\t\tconst script = document.createElement('script');\n\t\t\tscript.src = c_wistiaSingleScriptSrc;\n\t\t\tscript.async = true;\n\t\t\tdocument.body.appendChild(script);\n\t\t}\n\t}, [isWistiaUrl, wistiaPlaylistId]);\n\n\tif (wistiaPlaylistId) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tid={`wistia_${wistiaPlaylistId}`}\n\t\t\t\tclassName={cn('wistia_embed', className)}\n\t\t\t\tstyle={{ width: '640px', height: '360px' }}\n\t\t\t\tdata-video-width=\"640\"\n\t\t\t\tdata-video-height=\"360\"\n\t\t\t>\n\t\t\t\t&nbsp;\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (isWistiaUrl) {\n\t\treturn (\n\t\t\t<iframe\n\t\t\t\tsrc={videoUrl}\n\t\t\t\ttitle=\"EmbeddedVideo\"\n\t\t\t\tframeBorder=\"0\"\n\t\t\t\tscrolling=\"no\"\n\t\t\t\tname=\"wistia_embed\"\n\t\t\t\tclassName={cn('wistia_embed', className)}\n\t\t\t\tallowFullScreen\n\t\t\t\tallow={allowAttribute}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"pcs-embed-16x9\">\n\t\t\t<iframe\n\t\t\t\tsrc={videoUrl}\n\t\t\t\ttitle=\"EmbeddedVideo\"\n\t\t\t\tframeBorder=\"0\"\n\t\t\t\tscrolling=\"no\"\n\t\t\t\tclassName={className}\n\t\t\t\tallowFullScreen\n\t\t\t\tallow={allowAttribute}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default EmbeddedVideo;\n","import React from 'react';\n\nimport { EmbeddedVideo } from './embedded-video';\n\ninterface EmbeddedVideoSectionProps {\n\tvideoUrl: string;\n}\n\nexport const EmbeddedVideoSection = ({ videoUrl }: EmbeddedVideoSectionProps) => {\n\tif (!videoUrl) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"video mb-sp24\">\n\t\t\t<EmbeddedVideo videoUrl={videoUrl} />\n\t\t</div>\n\t);\n};\n","import React from 'react';\n\nimport { useLocalization } from '../../../localization';\n\nimport { NamedLink, ProductDetailsMetadata as ProductDetailsMetadataData } from './types';\n\ninterface ProductDetailsMetadataProps {\n\tproductDetailsMetadata: ProductDetailsMetadataData;\n}\n\ninterface MetadataRow {\n\tkey: string;\n\tlabel: string;\n\tvalue: React.ReactNode;\n}\n\n// Interleaves a separator between rendered nodes (e.g. \", \" between author links).\nconst joinNodes = (nodes: React.ReactNode[], separator: string): React.ReactNode[] =>\n\tnodes.flatMap((node, index) => (index === 0 ? [node] : [separator, node]));\n\nconst renderNamedLinks = (items: readonly NamedLink[]): React.ReactNode =>\n\tjoinNodes(\n\t\titems.map((item, index) =>\n\t\t\titem.searchUrl ? (\n\t\t\t\t<a key={index} href={item.searchUrl}>\n\t\t\t\t\t{item.name}\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<React.Fragment key={index}>{item.name}</React.Fragment>\n\t\t\t)\n\t\t),\n\t\t', '\n\t);\n\n// Strip trailing period and convert \"--\" hierarchy separator into \"›\".\nconst formatSubject = (subject: string): string => subject.replace(/\\.$/, '').replace(/--/g, ' › ');\n\nexport const ProductDetailsMetadata = ({ productDetailsMetadata: data }: ProductDetailsMetadataProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\tconst rows: MetadataRow[] = [];\n\n\tif (data.title) {\n\t\trows.push({ key: 'title', label: resources.Title, value: <span className=\"italic\">{data.title}</span> });\n\t}\n\tif (data.authors?.length) {\n\t\trows.push({\n\t\t\tkey: 'authors',\n\t\t\tlabel: data.authors.length > 1 ? resources.Authors : resources.Author,\n\t\t\tvalue: renderNamedLinks(data.authors),\n\t\t});\n\t}\n\tif (data.edition) {\n\t\trows.push({ key: 'edition', label: resources.Edition, value: data.edition });\n\t}\n\tif (data.series) {\n\t\trows.push({ key: 'series', label: resources.Series, value: data.series });\n\t}\n\tif (data.volume) {\n\t\trows.push({ key: 'volume', label: resources.Volume, value: data.volume });\n\t}\n\tif (data.publishers?.length) {\n\t\trows.push({\n\t\t\tkey: 'publishers',\n\t\t\tlabel: data.publishers.length > 1 ? resources.Publishers : resources.Publisher,\n\t\t\tvalue: renderNamedLinks(data.publishers),\n\t\t});\n\t}\n\tif (data.printPublicationYear) {\n\t\trows.push({ key: 'printPublicationYear', label: resources.PrintPublicationDate, value: data.printPublicationYear });\n\t}\n\tif (data.electronicPublicationYear) {\n\t\trows.push({\n\t\t\tkey: 'electronicPublicationYear',\n\t\t\tlabel: resources.LogosReleaseDate,\n\t\t\tvalue: data.electronicPublicationYear,\n\t\t});\n\t}\n\tif (data.pageCount) {\n\t\trows.push({ key: 'pageCount', label: resources.Pages, value: String(data.pageCount) });\n\t}\n\tif (data.era) {\n\t\trows.push({ key: 'era', label: resources.Era, value: data.era });\n\t}\n\tif (data.languages?.length) {\n\t\trows.push({\n\t\t\tkey: 'languages',\n\t\t\tlabel: data.languages.length > 1 ? resources.Languages : resources.Language,\n\t\t\tvalue: data.languages.join(', '),\n\t\t});\n\t}\n\tif (data.resourceCount) {\n\t\trows.push({ key: 'resourceCount', label: resources.Resources, value: String(data.resourceCount) });\n\t}\n\t// Format always renders, even when the other rows are empty.\n\tif (data.format) {\n\t\trows.push({\n\t\t\tkey: 'format',\n\t\t\tlabel: resources.Format,\n\t\t\tvalue: (\n\t\t\t\t<>\n\t\t\t\t\t{data.format.formatType}\n\t\t\t\t\t{data.format.searchUrl ? (\n\t\t\t\t\t\t<a href={data.format.searchUrl}>{data.format.name}</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<span>{data.format.name}</span>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t),\n\t\t});\n\t}\n\tif (data.subjects?.length) {\n\t\trows.push({\n\t\t\tkey: 'subjects',\n\t\t\tlabel: data.subjects.length > 1 ? resources.Subjects : resources.Subject,\n\t\t\tvalue: data.subjects.map(formatSubject).join('; '),\n\t\t});\n\t}\n\tif (data.isbns?.length) {\n\t\trows.push({\n\t\t\tkey: 'isbns',\n\t\t\tlabel: data.isbns.length > 1 ? resources.Isbns : resources.Isbn,\n\t\t\tvalue: joinNodes(\n\t\t\t\tdata.isbns.map((isbn, index) => (\n\t\t\t\t\t<a key={index} href={`/search?query=${isbn}`}>\n\t\t\t\t\t\t{isbn}\n\t\t\t\t\t</a>\n\t\t\t\t)),\n\t\t\t\t', '\n\t\t\t),\n\t\t});\n\t}\n\tif (data.resourceId) {\n\t\trows.push({ key: 'resourceId', label: resources.ResourceId, value: data.resourceId });\n\t}\n\tif (data.resourceType) {\n\t\trows.push({ key: 'resourceType', label: resources.ResourceType, value: data.resourceType });\n\t}\n\tif (data.version) {\n\t\trows.push({ key: 'version', label: resources.MetadataLastUpdated, value: data.version });\n\t}\n\n\treturn (\n\t\t<ul className=\"product-details-metadata\">\n\t\t\t{rows.map(row => (\n\t\t\t\t<li key={row.key}>\n\t\t\t\t\t{`${row.label}: `}\n\t\t\t\t\t{row.value}\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n};\n\nexport default ProductDetailsMetadata;\n","import React from 'react';\nimport { AuthorBio as SharedAuthorBio } from '../../shared/author-bio';\nimport { useLocalization } from '../../../localization';\nimport { AuthorBio as AuthorBioData } from './types';\n\ninterface AuthorBioSectionProps {\n\tauthorBio: AuthorBioData;\n}\n\nexport const AuthorBioSection = ({ authorBio }: AuthorBioSectionProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Search.AuthorBio');\n\n\treturn (\n\t\t<SharedAuthorBio\n\t\t\tdisplayName={authorBio.name}\n\t\t\timageUrl={authorBio.imageUrl}\n\t\t\tbio={authorBio.bio}\n\t\t\tresources={{ showMore: resources.showMore, showLess: resources.showLess }}\n\t\t/>\n\t);\n};\n","import { DisplayContentKind, DisplayTemplateKind } from './types';\n\nexport type SectionRenderMode = 'inline' | 'video' | 'accordion' | 'hidden' | 'containedResources';\n\nexport interface SectionDescriptor {\n\t// `kind` is set for every CMS-authored section. It is omitted only for the dynamic\n\t// `containedResources` section, which is API-driven rather than CMS content.\n\tkind?: DisplayContentKind;\n\tmode: SectionRenderMode;\n\t// Localization key (in CommerceWeb.Resources.Product.Details) for the dynamic\n\t// contained-resources accordion header. Skeletor titles it \"Resources included\" for\n\t// collections/mobile-ed single resources and \"Courses included\" for mobile-ed bundles.\n\tcontainedResourcesTitleKey?: 'ResourcesIncluded' | 'CoursesIncluded';\n}\n\n// CMS content sections rendered in the content region, in Skeletor's per-template relative order.\n// Dynamic sections (ContainingProducts, SamplePages, Reviews, AdZone, etc.) keep their existing\n// CommerceWeb positions and are not listed here. TimeSensitiveCallOut is rendered above the body by\n// the existing TimeSensitiveCalloutBlock, and the Overview renders in the right column via the\n// ProductDescription component, so both are intentionally omitted here.\nconst c_default: SectionDescriptor[] = [\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'KeyFeatures', mode: 'accordion' },\n\t{ kind: 'TopHighlights', mode: 'accordion' },\n\t{ kind: 'TableOfContents', mode: 'accordion' },\n\t{ kind: 'Contributors', mode: 'accordion' },\n\t{ kind: 'Endorsements', mode: 'accordion' },\n\t{ kind: 'ProductDetails', mode: 'accordion' },\n\t{ kind: 'AboutAuthor', mode: 'accordion' },\n\t{ kind: 'ExtraProductImages', mode: 'accordion' },\n\t{ kind: 'Extras', mode: 'accordion' },\n];\n\nconst c_singleVolume: SectionDescriptor[] = [\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'MessagingBanner', mode: 'inline' },\n\t{ kind: 'EmbeddedVideo', mode: 'video' },\n\t{ kind: 'KeyFeatures', mode: 'accordion' },\n\t{ kind: 'TopHighlights', mode: 'accordion' },\n\t{ kind: 'TableOfContents', mode: 'accordion' },\n\t{ kind: 'Contributors', mode: 'accordion' },\n\t{ kind: 'Endorsements', mode: 'accordion' },\n\t{ kind: 'ProductDetails', mode: 'accordion' },\n\t{ kind: 'BenefitsOfLogos', mode: 'accordion' },\n\t{ kind: 'AboutAuthor', mode: 'accordion' },\n\t{ kind: 'ExtraProductImages', mode: 'accordion' },\n\t{ kind: 'Extras', mode: 'accordion' },\n];\n\nconst c_collection: SectionDescriptor[] = [\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'MessagingBanner', mode: 'inline' },\n\t{ kind: 'EmbeddedVideo', mode: 'video' },\n\t{ kind: 'KeyFeatures', mode: 'accordion' },\n\t{ kind: 'Contributors', mode: 'accordion' },\n\t{ kind: 'Endorsements', mode: 'accordion' },\n\t{ kind: 'ProductDetails', mode: 'accordion' },\n\t{ kind: 'IndividualTitles', mode: 'hidden' },\n\t{ kind: 'BenefitsOfLogos', mode: 'accordion' },\n\t{ kind: 'IndividualOverviews', mode: 'accordion' },\n\t{ kind: 'AboutAuthor', mode: 'accordion' },\n\t{ kind: 'ExtraProductImages', mode: 'accordion' },\n\t{ kind: 'Extras', mode: 'accordion' },\n\t{ mode: 'containedResources', containedResourcesTitleKey: 'ResourcesIncluded' },\n];\n\n// Skeletor's library-details-page renders only: InformationalCallOut, MessagingBanner,\n// EmbeddedVideo, BenefitsOfLogos, and ContainedResources (plus Overview/TimeSensitiveCallOut\n// which are handled outside ProductContentSections). No KeyFeatures, Contributors, or other\n// accordion sections are rendered for library products.\nconst c_library: SectionDescriptor[] = [\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'MessagingBanner', mode: 'inline' },\n\t{ kind: 'EmbeddedVideo', mode: 'video' },\n\t{ kind: 'BenefitsOfLogos', mode: 'accordion' },\n\t{ kind: 'Extras', mode: 'accordion' },\n\t{ mode: 'containedResources', containedResourcesTitleKey: 'ResourcesIncluded' },\n];\n\nconst c_mobileEdSingleResource: SectionDescriptor[] = [\n\t{ kind: 'EmbeddedVideo', mode: 'video' },\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'MessagingBanner', mode: 'inline' },\n\t{ kind: 'LearningObjectives', mode: 'accordion' },\n\t{ kind: 'CourseOutline', mode: 'accordion' },\n\t{ kind: 'AssociatedReading', mode: 'accordion' },\n\t{ kind: 'ProductDetails', mode: 'accordion' },\n\t{ kind: 'AboutInstructor', mode: 'accordion' },\n\t{ kind: 'BenefitsOfMobileEd', mode: 'hidden' },\n\t{ kind: 'Extras', mode: 'accordion' },\n\t{ mode: 'containedResources', containedResourcesTitleKey: 'ResourcesIncluded' },\n];\n\nconst c_mobileEdBundle: SectionDescriptor[] = [\n\t{ kind: 'EmbeddedVideo', mode: 'video' },\n\t{ kind: 'InformationalCallOut', mode: 'inline' },\n\t{ kind: 'MessagingBanner', mode: 'inline' },\n\t{ kind: 'LearningObjectives', mode: 'accordion' },\n\t{ kind: 'IndividualCourses', mode: 'hidden' },\n\t{ kind: 'ProductDetails', mode: 'accordion' },\n\t{ kind: 'IndividualOverviews', mode: 'accordion' },\n\t{ kind: 'Extras', mode: 'accordion' },\n\t{ mode: 'containedResources', containedResourcesTitleKey: 'CoursesIncluded' },\n];\n\nexport function getSectionsForTemplate(kind: DisplayTemplateKind): SectionDescriptor[] {\n\tswitch (kind) {\n\t\tcase 'singleVolume':\n\t\t\treturn c_singleVolume;\n\t\tcase 'collection':\n\t\tcase 'featureSet':\n\t\t\treturn c_collection;\n\t\tcase 'library':\n\t\t\treturn c_library;\n\t\tcase 'mobileEdSingleResource':\n\t\t\treturn c_mobileEdSingleResource;\n\t\tcase 'mobileEdBundle':\n\t\t\treturn c_mobileEdBundle;\n\t\tdefault:\n\t\t\treturn c_default;\n\t}\n}\n","import React from 'react';\nimport {\n\tAccordion,\n\tAccordionContent,\n\tAccordionItem,\n\tAccordionTrigger,\n\tContainedResources,\n\tContentSection,\n\tTrustedGuideIcon,\n\tTypography,\n\tuseContainedResourcesContext,\n\ttype ContainedResourcesData,\n\ttype DataResult,\n} from '@faithlife/commerce-components';\n\nimport { useLocalization } from '../../../localization';\nimport { useCurrentUser } from '../../per-user-data/per-user-data-context';\n\nimport '../product-details-page/product-details.css';\nimport './product-content-sections.css';\n\nimport { DisplayContent, c_businessDeskProductContentClass } from './display-content';\nimport { EmbeddedVideoSection } from './embedded-video-section';\nimport { ProductDetailsMetadata } from './product-details-metadata';\nimport { AuthorBioSection } from './author-bio-section';\nimport { getSectionsForTemplate } from './section-config';\nimport {\n\tDisplayContent as DisplayContentData,\n\tDisplayTemplate,\n\tProductDetailsMetadata as ProductDetailsMetadataData,\n\tAuthorBio as AuthorBioData,\n} from './types';\n\ninterface ProductContentSectionsProps {\n\tdisplayTemplate?: DisplayTemplate | null;\n\tproductId?: string;\n\tproductDetailsMetadata?: ProductDetailsMetadataData | null;\n\tauthorBio?: AuthorBioData | null;\n}\n\ninterface AccordionSectionData {\n\ttitle: string;\n\tchildren: React.ReactNode;\n}\n\n// CMS-authored content-section titles can contain inline markup (e.g. <i>Book Title</i>),\n// drawn from the same trusted \"Business Desk\" HTML as the section body. This node is passed\n// directly as children to <AccordionTrigger>, which renders it as a React child so the\n// markup displays correctly. Plain localized/resource titles pass through unchanged\n// (rendering a plain string as HTML is a no-op). The codebase trusts CMS HTML directly;\n// there is no separate sanitizer.\nconst AccordionHtmlTitle = ({ html }: { html: string }) => (\n\t<Typography className=\"line-clamp-2 text-primary-500\" tag=\"span\" variant=\"headingH5\">\n\t\t{/* eslint-disable-next-line react/no-danger */}\n\t\t<span dangerouslySetInnerHTML={{ __html: html }} />\n\t</Typography>\n);\n\nconst c_noProductComponents: DataResult<ContainedResourcesData> = {\n\tdata: null,\n\tisLoading: false,\n\tisRefetching: false,\n\terror: null,\n};\n\nconst useNoProductComponents = () => c_noProductComponents;\n\nexport const ProductContentSections = ({\n\tdisplayTemplate,\n\tproductId,\n\tproductDetailsMetadata,\n\tauthorBio,\n}: ProductContentSectionsProps) => {\n\tconst { useProductComponents = useNoProductComponents } = useContainedResourcesContext();\n\tconst { data: currentUser } = useCurrentUser();\n\tconst { isLoggedIn } = currentUser;\n\tconst detailsResources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst authorBioResources = useLocalization('CommerceWeb.Resources.Search.AuthorBio');\n\n\tconst templateKind = displayTemplate?.kind;\n\t// Skeletor fetches contained resources (and thus can suppress the legacy CMS\n\t// IndividualTitles/IndividualOverviews sections) only for templates that actually\n\t// render a dynamic contained-resources section.\n\tconst templateFetchesContainedResources =\n\t\t!!templateKind && getSectionsForTemplate(templateKind).some(descriptor => descriptor.mode === 'containedResources');\n\n\tconst { data: productComponents } = useProductComponents(templateFetchesContainedResources ? productId : undefined);\n\tconst hasContainedResources = (productComponents?.sections?.length ?? 0) > 0;\n\tconst isProductOwned = !!productComponents?.isOwnedByUser;\n\n\tif (!displayTemplate) {\n\t\treturn null;\n\t}\n\n\tconst descriptors = getSectionsForTemplate(displayTemplate.kind);\n\tconst groups: React.ReactNode[] = [];\n\tlet nodes: React.ReactNode[] = [];\n\tlet containedResourcesTitle: string | null = null;\n\tlet pendingAccordion: AccordionSectionData[] = [];\n\tlet accordionGroupIndex = 0;\n\tconst c_innerSpacing = 'max-lg:mx-sp16 lg:px-6 lg:pb-6 lg:pr-sp16';\n\n\tconst flushNodes = () => {\n\t\tif (nodes.length > 0) {\n\t\t\tgroups.push(\n\t\t\t\t<div key={`content-${groups.length}`} className={c_innerSpacing}>\n\t\t\t\t\t{nodes}\n\t\t\t\t</div>\n\t\t\t);\n\t\t\tnodes = [];\n\t\t}\n\t};\n\n\tconst flushAccordion = () => {\n\t\tif (pendingAccordion.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tnodes.push(\n\t\t\t<Accordion key={`accordion-${accordionGroupIndex}`} defaultValue={accordionGroupIndex === 0 ? ['section-0'] : []}>\n\t\t\t\t{pendingAccordion.map((section, sectionIndex) => (\n\t\t\t\t\t<AccordionItem key={`section-${sectionIndex}`} value={`section-${sectionIndex}`}>\n\t\t\t\t\t\t<AccordionTrigger>\n\t\t\t\t\t\t\t<AccordionHtmlTitle html={section.title} />\n\t\t\t\t\t\t</AccordionTrigger>\n\t\t\t\t\t\t<AccordionContent>{section.children}</AccordionContent>\n\t\t\t\t\t</AccordionItem>\n\t\t\t\t))}\n\t\t\t</Accordion>\n\t\t);\n\t\taccordionGroupIndex += 1;\n\t\tpendingAccordion = [];\n\t};\n\n\tdescriptors.forEach(descriptor => {\n\t\tif (descriptor.mode === 'containedResources') {\n\t\t\tif (hasContainedResources && productId) {\n\t\t\t\tcontainedResourcesTitle =\n\t\t\t\t\tdescriptor.containedResourcesTitleKey === 'CoursesIncluded'\n\t\t\t\t\t\t? detailsResources.CoursesIncluded\n\t\t\t\t\t\t: detailsResources.ResourcesIncluded;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { kind } = descriptor;\n\t\tif (!kind) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When dynamic contained-resources data is present, it supersedes the legacy CMS\n\t\t// IndividualTitles/IndividualOverviews sections (matching Skeletor's suppression).\n\t\tif (hasContainedResources && (kind === 'IndividualTitles' || kind === 'IndividualOverviews')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// The ProductDetails slot is mutually exclusive: CMS-authored HTML wins, otherwise the\n\t\t// dynamic metadata list (supplied by the backend only for single-volume products lacking\n\t\t// authored ProductDetails HTML) renders in the same accordion slot.\n\t\tif (kind === 'ProductDetails') {\n\t\t\tconst productDetailsSection = displayTemplate.content.ProductDetails;\n\t\t\tconst productDetailsContent = productDetailsSection?.content;\n\t\t\tif (productDetailsContent) {\n\t\t\t\tpendingAccordion.push({\n\t\t\t\t\ttitle: productDetailsSection?.title ?? '',\n\t\t\t\t\tchildren: <DisplayContent html={productDetailsContent} />,\n\t\t\t\t});\n\t\t\t} else if (productDetailsMetadata) {\n\t\t\t\tpendingAccordion.push({\n\t\t\t\t\ttitle: detailsResources.ProductDetails,\n\t\t\t\t\tchildren: <ProductDetailsMetadata productDetailsMetadata={productDetailsMetadata} />,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// The AboutAuthor / AboutInstructor slot is mutually exclusive with the OPPOSITE precedence\n\t\t// from ProductDetails: the dynamically-fetched author bio wins, and the authored content\n\t\t// section is only the fallback. Per product decision, the slot renders only when there is\n\t\t// either an author bio or non-whitespace authored content (no empty accordion).\n\t\tif (kind === 'AboutAuthor' || kind === 'AboutInstructor') {\n\t\t\tif (authorBio) {\n\t\t\t\tpendingAccordion.push({\n\t\t\t\t\ttitle: authorBioResources.aboutName.replace('%NAME%', authorBio.name),\n\t\t\t\t\tchildren: <AuthorBioSection authorBio={authorBio} />,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst authorSection = displayTemplate.content[kind];\n\t\t\t\tconst authorContent = authorSection?.content;\n\t\t\t\tif (authorContent && authorContent.trim()) {\n\t\t\t\t\tpendingAccordion.push({\n\t\t\t\t\t\ttitle: authorSection?.title ?? '',\n\t\t\t\t\t\tchildren: <DisplayContent html={authorContent} />,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst section: DisplayContentData | undefined = displayTemplate.content[kind];\n\t\tconst content = section?.content;\n\t\tif (!content) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (descriptor.mode) {\n\t\t\tcase 'inline':\n\t\t\t\tflushAccordion();\n\t\t\t\tif (kind === 'InformationalCallOut') {\n\t\t\t\t\tif (content.trim()) {\n\t\t\t\t\t\tflushNodes();\n\t\t\t\t\t\tgroups.push(\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tkey={kind}\n\t\t\t\t\t\t\t\tclassName=\"pdp-informational-callout mx-sp16 border-b border-gray py-sp24 text-primary-500 lg:mx-sp24\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TrustedGuideIcon aria-hidden=\"true\" size={24} className=\"mb-sp16\" />\n\t\t\t\t\t\t\t\t<DisplayContent className=\"max-w-[696px] lg:w-1/2 lg:pr-sp16\" html={content} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnodes.push(<DisplayContent key={kind} className=\"max-w-[696px] lg:w-1/2\" html={content} />);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'video':\n\t\t\t\tflushAccordion();\n\t\t\t\tnodes.push(\n\t\t\t\t\t<div key={kind} className=\"max-w-[696px] lg:w-1/2\">\n\t\t\t\t\t\t<EmbeddedVideoSection videoUrl={content} />\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'hidden':\n\t\t\t\tflushAccordion();\n\t\t\t\tnodes.push(\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={kind}\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t\t// eslint-disable-next-line react/no-danger\n\t\t\t\t\t\tdangerouslySetInnerHTML={{ __html: content }}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'accordion':\n\t\t\tdefault:\n\t\t\t\t// The accordion chrome requires a title to render its collapse toggle, so\n\t\t\t\t// a missing title falls back to an empty string rather than rendering the\n\t\t\t\t// section outside the accordion. The backend always supplies a title when the\n\t\t\t\t// CMS title is blank (deriving one from the content's first heading, or a\n\t\t\t\t// per-kind default such as \"Benefits of Logos Edition\" for BenefitsOfLogos).\n\t\t\t\tpendingAccordion.push({\n\t\t\t\t\ttitle: section?.title || '',\n\t\t\t\t\tchildren: (\n\t\t\t\t\t\t<DisplayContent className={kind === 'KeyFeatures' ? 'pcs-key-features' : undefined} html={content} />\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tflushAccordion();\n\tflushNodes();\n\n\tconst hasContainedSection = !!containedResourcesTitle && !!productId;\n\n\tif (groups.length === 0 && !hasContainedSection) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={c_businessDeskProductContentClass}>\n\t\t\t{groups}\n\t\t\t{hasContainedSection && (\n\t\t\t\t<>\n\t\t\t\t\t<hr className=\"hidden lg:block border-gray lg:mx-sp24\" />\n\t\t\t\t\t<div className={`max-w-[696px] lg:w-1/2 ${c_innerSpacing}`}>\n\t\t\t\t\t\t<ContentSection sectionHeadline={containedResourcesTitle ?? ''}>\n\t\t\t\t\t\t\t<ContainedResources defaultHideOwned={isLoggedIn && !isProductOwned} productId={productId ?? ''} />\n\t\t\t\t\t\t</ContentSection>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default ProductContentSections;\n","import React, { useState } from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { LinkButton } from '@faithlife/commerce-components';\nimport * as Popover from '@radix-ui/react-popover';\nimport { ChevronDown } from 'lucide-react';\nimport { useLocalization } from '../../../../localization';\nimport useScreensize from '../../../../util/hooks/use-screensize';\n\nconst formatName = (name: string) => {\n\tconst [lastName, firstName] = name.split(', ');\n\n\treturn firstName && lastName ? `${firstName} ${lastName}` : name;\n};\n\ninterface Chip {\n\tname: string;\n\turl: string | null | undefined;\n}\n\ninterface AttributeChipsProps {\n\tchips: readonly Chip[];\n\tlabel?: string;\n\tlabelClassName?: string;\n\ttrailingContent?: React.ReactNode;\n}\n\nconst linkClassName =\n\t'text-primary text-sm underline hover:text-primary-400 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary [&>span]:text-sm';\n\nexport const AttributeChips = ({ chips, label, labelClassName, trailingContent }: AttributeChipsProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst { isMobile } = useScreensize();\n\tconst [open, setOpen] = useState(false);\n\n\tif (!chips.length) {\n\t\treturn null;\n\t}\n\n\tconst visibleChipCount = isMobile ? 1 : 4;\n\tconst visibleChips = chips.slice(0, visibleChipCount);\n\tconst overflowChips = chips.slice(visibleChipCount);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap items-baseline gap-x-1 text-sm leading-5 text-black-200\">\n\t\t\t{label ? <span className={labelClassName}>{label}</span> : null}\n\t\t\t{visibleChips.map((chip, i) => (\n\t\t\t\t<span data-testid=\"attribute-chip\" key={i}>\n\t\t\t\t\t<LinkButton className={linkClassName} href={chip.url ?? undefined} intent=\"none\" scale=\"sm\" touchTarget=\"sm\">\n\t\t\t\t\t\t{formatName(chip.name)}\n\t\t\t\t\t</LinkButton>\n\t\t\t\t\t{i < visibleChips.length - 1 ? <span>{';'}</span> : null}\n\t\t\t\t</span>\n\t\t\t))}\n\t\t\t{overflowChips.length ? (\n\t\t\t\t<CommandSentence\n\t\t\t\t\tContainer=\"span\"\n\t\t\t\t\tclassName=\"inline-flex items-baseline gap-x-1\"\n\t\t\t\t\ttemplate={resources.AndMoreTooltip}\n\t\t\t\t>\n\t\t\t\t\t<CommandSentence.Field name=\"MORETOOLTIP\">\n\t\t\t\t\t\t<Popover.Root onOpenChange={setOpen} open={open}>\n\t\t\t\t\t\t\t<Popover.Trigger\n\t\t\t\t\t\t\t\tclassName=\"inline-flex cursor-pointer items-center gap-0.5 text-primary underline decoration-dashed underline-offset-2 hover:text-primary-400 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary\"\n\t\t\t\t\t\t\t\tonClick={() => setOpen(true)}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CommandSentence Container=\"span\" template={resources.MoreTooltipText}>\n\t\t\t\t\t\t\t\t\t<CommandSentence.Field name=\"AMOUNT\">{String(overflowChips.length)}</CommandSentence.Field>\n\t\t\t\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t\t\t\t<ChevronDown className=\"size-4\" />\n\t\t\t\t\t\t\t</Popover.Trigger>\n\t\t\t\t\t\t\t<Popover.Content className=\"z-50 flex max-h-[40vh] max-w-sm flex-col gap-1 overflow-y-auto rounded-sm bg-white p-4 text-sm shadow\">\n\t\t\t\t\t\t\t\t{overflowChips.map((chip, i) => (\n\t\t\t\t\t\t\t\t\t<LinkButton\n\t\t\t\t\t\t\t\t\t\tclassName={linkClassName}\n\t\t\t\t\t\t\t\t\t\thref={chip.url ?? undefined}\n\t\t\t\t\t\t\t\t\t\tintent=\"none\"\n\t\t\t\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\t\t\t\tscale=\"sm\"\n\t\t\t\t\t\t\t\t\t\ttouchTarget=\"sm\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{formatName(chip.name)}\n\t\t\t\t\t\t\t\t\t</LinkButton>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</Popover.Content>\n\t\t\t\t\t\t</Popover.Root>\n\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t</CommandSentence>\n\t\t\t) : null}\n\t\t\t{trailingContent}\n\t\t</div>\n\t);\n};\n\ninterface AuthorsAndPublishersProps {\n\tauthors: readonly Chip[];\n\tpublishers: readonly Chip[];\n\tpublisherMetadata?: React.ReactNode;\n}\n\nexport const AuthorsAndPublishers = ({ authors, publishers, publisherMetadata }: AuthorsAndPublishersProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-1 text-black-200\">\n\t\t\t<AttributeChips chips={authors} label={resources.By} />\n\t\t\t{publishers.length || publisherMetadata ? (\n\t\t\t\t<div className=\"flex flex-wrap items-baseline gap-x-2 gap-y-1\">\n\t\t\t\t\t<AttributeChips\n\t\t\t\t\t\tchips={publishers}\n\t\t\t\t\t\tlabel={`${resources.Publisher}:`}\n\t\t\t\t\t\tlabelClassName=\"font-semibold\"\n\t\t\t\t\t\ttrailingContent={publisherMetadata}\n\t\t\t\t\t/>\n\t\t\t\t\t{publishers.length ? null : publisherMetadata}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport cn from 'classnames';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../localization';\nimport { ProductPricingSkuData } from '../../per-user-data/per-user-data-context';\n\ninterface SalePricePopoverProps {\n\tprices: NonNullable<ProductPricingSkuData['prices']>;\n\tclassName?: string;\n}\n\nexport const SalePricePopover = ({ prices, className }: SalePricePopoverProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.DisplayTemplates.PricingSidebarViewModel');\n\n\tconst triggerLabel = prices.breakdownTriggerLabel;\n\tconst lines = prices.breakdownLines ?? [];\n\tif (!triggerLabel || lines.length === 0) {\n\t\treturn null;\n\t}\n\n\t// Reference/list prices display in USD; savings and collection rows display in the user's\n\t// localized currency. The server decides per row via `displayInUsd`.\n\tconst resolveAmount = (line: (typeof lines)[number]) =>\n\t\tline.displayInUsd\n\t\t\t? (line.amount.displayAmount ?? line.amount.localizedDisplayAmount ?? '')\n\t\t\t: (line.amount.localizedDisplayAmount ?? line.amount.displayAmount ?? '');\n\n\tconst finalAmount = prices.salePrice?.displayAmount ?? prices.salePrice?.localizedDisplayAmount ?? '';\n\n\treturn (\n\t\t<Popover.Root>\n\t\t\t<Popover.Trigger asChild>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\taria-label={resources.SeePricingBreakdown}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'w-fit cursor-pointer whitespace-nowrap text-sm font-semibold text-primary underline decoration-dashed underline-offset-2 hover:text-primary-400 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<Typography variant=\"ui2\" className=\"font-semibold\">\n\t\t\t\t\t\t{triggerLabel}\n\t\t\t\t\t</Typography>\n\t\t\t\t</button>\n\t\t\t</Popover.Trigger>\n\t\t\t<Popover.Portal>\n\t\t\t\t<Popover.Content\n\t\t\t\t\tsideOffset={8}\n\t\t\t\t\talign=\"start\"\n\t\t\t\t\tclassName=\"z-50 flex w-max min-w-72 max-w-[90vw] flex-col gap-2 rounded-sm bg-white p-6 text-sm shadow-lg\"\n\t\t\t\t>\n\t\t\t\t\t{lines.map((line, index) => {\n\t\t\t\t\t\tconst amount = resolveAmount(line);\n\t\t\t\t\t\tconst label = line.href ? (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\thref={line.href}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\tclassName=\"text-black-200 underline hover:text-primary\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{line.label}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tline.label\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div className=\"flex items-baseline justify-between gap-6\" key={`${line.label}-${index}`}>\n\t\t\t\t\t\t\t\t<Typography aria-label={line.label} className=\"text-black-200\" tag=\"span\" variant=\"ui2\">\n\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\tclassName={cn('whitespace-nowrap', line.isDeduction ? 'text-danger' : 'text-black-200')}\n\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\tvariant=\"ui2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{line.isDeduction ? `-${amount}` : amount}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t\t<hr className=\"my-1 border-black-50\" />\n\t\t\t\t\t<div className=\"flex items-baseline justify-between gap-6\">\n\t\t\t\t\t\t<Typography className=\"font-semibold\" tag=\"span\" variant=\"ui1\">\n\t\t\t\t\t\t\t{triggerLabel}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t<Typography className=\"whitespace-nowrap font-semibold\" tag=\"span\" variant=\"ui1\">\n\t\t\t\t\t\t\t{finalAmount}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Popover.Arrow className=\"fill-white\" />\n\t\t\t\t</Popover.Content>\n\t\t\t</Popover.Portal>\n\t\t</Popover.Root>\n\t);\n};\n","import React from 'react';\nimport cn from 'classnames';\nimport { Typography } from '@faithlife/commerce-components';\nimport { ProductPriceDiscount, ProductPricingSkuData } from '../../per-user-data/per-user-data-context';\nimport { SalePricePopover } from './sale-price-popover';\n\ntype PricesVariant = 'full' | 'salePriceOnly';\n\ninterface PricesProps {\n\tprices: ProductPricingSkuData['prices'];\n\tisRestricted: boolean;\n\tvariant?: PricesVariant;\n}\n\nexport const Prices = ({ prices, isRestricted, variant = 'full' }: PricesProps) => {\n\tif (!prices) {\n\t\treturn null;\n\t}\n\n\tconst salePrice = prices.salePrice?.displayAmount ?? '';\n\tconst discounts = prices.discounts?.filter(discount => discount.description);\n\tconst nonStackingDiscounts = discounts?.filter(discount => !discount.shouldStack);\n\tconst stackingDiscounts = discounts?.filter(discount => discount.shouldStack);\n\n\tconst localizedSalePrice = prices.salePrice?.localizedDisplayAmount;\n\n\tconst salePriceTemplate = (\n\t\t<Typography\n\t\t\taria-label=\"Sale Price\"\n\t\t\tvariant=\"bodyLarge\"\n\t\t\tclassName={cn('font-semibold', isRestricted && 'text-black-100')}\n\t\t\ttag=\"span\"\n\t\t>\n\t\t\t{salePrice}\n\t\t</Typography>\n\t);\n\n\tconst renderDiscountPills = (discounts: ProductPriceDiscount[] | undefined, className: string) =>\n\t\tdiscounts &&\n\t\tdiscounts.map((discount, index) => (\n\t\t\t<Typography\n\t\t\t\tkey={`${discount.description}-${index}`}\n\t\t\t\taria-label=\"Discount Description\"\n\t\t\t\tvariant=\"ui2\"\n\t\t\t\tclassName={cn('rounded-full px-sp8 py-sp2', className)}\n\t\t\t\ttag=\"span\"\n\t\t\t>\n\t\t\t\t{discount.description}\n\t\t\t</Typography>\n\t\t));\n\n\tif (variant === 'salePriceOnly') {\n\t\treturn salePriceTemplate;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-sp12\">\n\t\t\t{nonStackingDiscounts && nonStackingDiscounts.length > 0 ? (\n\t\t\t\t<div className=\"flex flex-wrap gap-2\">{renderDiscountPills(nonStackingDiscounts, `bg-red-200 text-black`)}</div>\n\t\t\t) : null}\n\t\t\t<div className=\"flex flex-wrap items-center gap-2\">\n\t\t\t\t<SalePricePopover prices={prices} className=\"shrink-0\" />\n\t\t\t\t{renderDiscountPills(stackingDiscounts, 'bg-primary-200 text-primary-400')}\n\t\t\t</div>\n\t\t\t{salePriceTemplate}\n\t\t\t{localizedSalePrice ? (\n\t\t\t\t<Typography\n\t\t\t\t\taria-label=\"Localized Sale Price\"\n\t\t\t\t\tvariant=\"ui2\"\n\t\t\t\t\tclassName=\"text-black-200 font-normal\"\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t>{`(${localizedSalePrice})`}</Typography>\n\t\t\t) : null}\n\t\t\t{(prices.anchorPriceLines ?? []).map(({ label, displayAmount, localizedDisplayAmount }) => {\n\t\t\t\tconst amount = localizedDisplayAmount ?? displayAmount;\n\t\t\t\treturn (\n\t\t\t\t\t<Typography\n\t\t\t\t\t\tkey={label}\n\t\t\t\t\t\taria-label={`Anchor Price ${label}`}\n\t\t\t\t\t\tvariant=\"ui2\"\n\t\t\t\t\t\tclassName=\"text-black-200\"\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{label} <span className={cn('line-through', isRestricted && 'text-black-100')}>{amount}</span>\n\t\t\t\t\t</Typography>\n\t\t\t\t);\n\t\t\t})}\n\t\t\t{prices.savingsDescription ? (\n\t\t\t\t<Typography\n\t\t\t\t\taria-label=\"Savings Description\"\n\t\t\t\t\tvariant=\"ui2\"\n\t\t\t\t\tclassName={cn('text-black-200', prices.discountSavings && 'text-danger')}\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t>\n\t\t\t\t\t{prices.savingsDescription}\n\t\t\t\t</Typography>\n\t\t\t) : null}\n\t\t</div>\n\t);\n};\n","import React, { Fragment } from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { Checkbox, LinkButton, Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../../localization';\nimport { ProductSubscriptionPromotion } from '../../../per-user-data/per-user-data-context';\n\ntype PeriodUnit = 'day' | 'month' | 'year';\n\nconst singularPeriodUnitResourceKey: Record<PeriodUnit, string> = {\n\tday: 'DayPeriodUnit',\n\tmonth: 'MonthPeriodUnit',\n\tyear: 'YearPeriodUnit',\n};\n\nconst pluralPeriodUnitResourceKey: Record<PeriodUnit, string> = {\n\tday: 'DaysPeriodUnit',\n\tmonth: 'MonthsPeriodUnit',\n\tyear: 'YearsPeriodUnit',\n};\n\nfunction getPeriodUnitText(periodLength: number, periodUnit: PeriodUnit, resources: Record<string, string>): string {\n\tconst resourceKey =\n\t\tperiodLength === 1 ? singularPeriodUnitResourceKey[periodUnit] : pluralPeriodUnitResourceKey[periodUnit];\n\treturn resources[resourceKey] ?? '';\n}\n\ninterface SubscriptionPromotionProps {\n\tpromotion: ProductSubscriptionPromotion;\n\tchecked: boolean;\n\tonChange: (checked: boolean) => void;\n\tdisabled?: boolean;\n}\n\nexport const SubscriptionPromotion = ({\n\tpromotion,\n\tchecked,\n\tonChange,\n\tdisabled = false,\n}: SubscriptionPromotionProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.SubscriptionPromotion');\n\n\tconst { freeTrialInfo, percentOff, logosOrVerbum, routes } = promotion;\n\n\tconst subscribableProductTitle = (\n\t\t<b>\n\t\t\t<CommandSentence Container=\"span\" template={resources.TitleFormat}>\n\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t<CommandSentence.Field name=\"PROLEVEL\">{resources.ProLevel}</CommandSentence.Field>\n\t\t\t</CommandSentence>\n\t\t</b>\n\t);\n\n\tconst checkboxLabel = freeTrialInfo ? (\n\t\t<CommandSentence Container={Fragment} template={resources.AddFreeTrial}>\n\t\t\t<CommandSentence.Field name=\"PERIODUNITQUANTITY\">{freeTrialInfo.periodLength}</CommandSentence.Field>\n\t\t\t<CommandSentence.Field name=\"PERIODUNIT\">\n\t\t\t\t{getPeriodUnitText(freeTrialInfo.periodLength, freeTrialInfo.periodUnit, {\n\t\t\t\t\tDayPeriodUnit: resources.DayPeriodUnit,\n\t\t\t\t\tDaysPeriodUnit: resources.DaysPeriodUnit,\n\t\t\t\t\tMonthPeriodUnit: resources.MonthPeriodUnit,\n\t\t\t\t\tMonthsPeriodUnit: resources.MonthsPeriodUnit,\n\t\t\t\t\tYearPeriodUnit: resources.YearPeriodUnit,\n\t\t\t\t\tYearsPeriodUnit: resources.YearsPeriodUnit,\n\t\t\t\t})}\n\t\t\t</CommandSentence.Field>\n\t\t</CommandSentence>\n\t) : (\n\t\tresources.SubscribeNow\n\t);\n\tconst savingsTemplate = freeTrialInfo ? resources.StartFreeTrialForSavings : resources.SubscribeForSavings;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-3 rounded bg-primary-100 p-4\">\n\t\t\t<Typography variant=\"ui2\">\n\t\t\t\t<CommandSentence key={savingsTemplate} Container=\"span\" template={savingsTemplate}>\n\t\t\t\t\t<CommandSentence.Field name=\"SUBSCRIBABLEPRODUCTTITLE\">{subscribableProductTitle}</CommandSentence.Field>\n\t\t\t\t\t<CommandSentence.Field name=\"PERCENTAGESAVINGS\">{percentOff}</CommandSentence.Field>\n\t\t\t\t</CommandSentence>\n\t\t\t</Typography>\n\t\t\t<div className=\"flex flex-row flex-wrap justify-between gap-x-6 gap-y-2\">\n\t\t\t\t<Checkbox\n\t\t\t\t\tlabel={checkboxLabel}\n\t\t\t\t\tchecked={checked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonChange={() => onChange(!checked)}\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\ttypography=\"ui2\"\n\t\t\t\t/>\n\t\t\t\t{routes?.learnMore && (\n\t\t\t\t\t<LinkButton as=\"button\" onClick={() => window.open(routes.learnMore, '_blank')}>\n\t\t\t\t\t\t{resources.LearnMore}\n\t\t\t\t\t</LinkButton>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default SubscriptionPromotion;\n","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { AddToCartButton, Button, IdentifierTypes } from '@faithlife/commerce-components';\nimport CartClient from '../../../clients/cart-client';\nimport eventAggregator from '../../../cart/utility/eventaggregator';\nimport { useLocalization } from '../../../localization';\nimport { ProductPricingData, useSubscriptionPromotion } from '../../per-user-data/per-user-data-context';\nimport { SubscriptionPromotion } from './subscription-promotion';\n\ninterface PurchaseActionsProduct {\n\tid: string;\n\tresourceId?: string;\n\tisPrepubProduct?: boolean;\n\tisCollection: boolean;\n}\n\ninterface PurchaseActionsSelectedSku {\n\tid: string;\n\tisGroupLicenseEscrow?: boolean;\n\tisSubscription?: boolean;\n\tallowsMultipleQuantity?: boolean;\n}\n\ninterface PurchaseActionCartItem {\n\tidentifier: string;\n\ttype: (typeof IdentifierTypes)[keyof typeof IdentifierTypes];\n\tquantity: number;\n\tproductId?: string;\n}\n\ntype PurchaseActionProductPricingData = Pick<\n\tProductPricingData,\n\t'accessKind' | 'isOwned' | 'isGeographicallyRestricted' | 'openInLogosBaseUrl' | 'skus'\n>;\n\ninterface PurchaseActionStateInput {\n\tproduct: PurchaseActionsProduct;\n\tselectedSku: PurchaseActionsSelectedSku;\n\tpricingData?: PurchaseActionProductPricingData | null;\n}\n\ninterface PurchaseActionsProps extends PurchaseActionStateInput {\n\tshowGeoRestrictionMessage?: boolean;\n\tshowSubscriptionPromotion?: boolean;\n\tclassName?: string;\n\t/** Quantity to use for add-to-cart. Only propagated when the selected SKU supports multiple quantity. */\n\tquantity?: number;\n\taddToCartButtonRef?: React.Ref<HTMLDivElement>;\n}\n\ninterface QuantityUpdateButtonProps {\n\tcartItemId: number;\n\tcartUpdateUrl: string;\n\tquantity: number;\n\tclassName?: string;\n}\n\nconst QuantityUpdateButton = ({ cartItemId, cartUpdateUrl, quantity, className }: QuantityUpdateButtonProps) => {\n\tconst addToCartButtonResources = useLocalization('CommerceWeb.Resources.Shared.AddToMiniCartButton');\n\tconst errorResources = useLocalization('Logos.CommerceWeb.ShoppingCarts.Resources.ErrorMessages');\n\tconst [isUpdating, setIsUpdating] = useState(false);\n\tconst isUpdatingRef = useRef(false);\n\n\tconst handleUpdate = useCallback(async () => {\n\t\tif (isUpdatingRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tisUpdatingRef.current = true;\n\t\tsetIsUpdating(true);\n\t\teventAggregator.trigger('cart:updating');\n\n\t\ttry {\n\t\t\tconst newCart = await CartClient.updateCartAsync(cartUpdateUrl, {\n\t\t\t\tquantityByCartItemId: {\n\t\t\t\t\t[cartItemId]: quantity,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tfor (const item of newCart.order?.analyticsTelemetry ?? []) {\n\t\t\t\t(window.dataLayer ??= []).push(item);\n\t\t\t}\n\n\t\t\teventAggregator.trigger('cart:updated', newCart);\n\t\t\tdocument.dispatchEvent(new CustomEvent('faithlife.sites.cart.updated', { detail: { cart: newCart } }));\n\t\t\tdocument.dispatchEvent(new CustomEvent('faithlife.sites.minicart.open'));\n\t\t} catch (error) {\n\t\t\tif (window.NotificationUtility) {\n\t\t\t\twindow.NotificationUtility.notify(errorResources.errorOccurredDuringCartUpdate, 'error');\n\t\t\t}\n\t\t\teventAggregator.trigger('cart:error');\n\t\t} finally {\n\t\t\tisUpdatingRef.current = false;\n\t\t\tsetIsUpdating(false);\n\t\t}\n\t}, [cartItemId, cartUpdateUrl, errorResources.errorOccurredDuringCartUpdate, quantity]);\n\n\treturn (\n\t\t<Button variant=\"primary\" scale=\"large\" onClick={handleUpdate} disabled={isUpdating} className={className}>\n\t\t\t{isUpdating ? addToCartButtonResources.updatingQuantity : addToCartButtonResources.updateQuantity}\n\t\t</Button>\n\t);\n};\n\nexport const getPurchaseActionState = ({ product, selectedSku, pricingData }: PurchaseActionStateInput) => {\n\tconst hasTemporaryAccess = pricingData?.accessKind === 'Temporary';\n\tconst hasPermanentAccess = pricingData?.accessKind === 'Permanent' || (pricingData?.isOwned && !hasTemporaryAccess);\n\tconst isRestricted = pricingData?.isGeographicallyRestricted ?? false;\n\tconst isSellable = pricingData?.skus?.[selectedSku.id]?.isSellable ?? true;\n\tconst isPurchasable = pricingData?.skus?.[selectedSku.id]?.isPurchasable ?? true;\n\tconst canShowAddToCart =\n\t\tisSellable && isPurchasable && !isRestricted && (selectedSku.isGroupLicenseEscrow || !hasPermanentAccess);\n\t// Server-decided eligibility (site settings + PreviewKind), mirroring Skeletor: shown regardless\n\t// of purchasability or restrictions.\n\tconst openInLogosUrl =\n\t\tpricingData?.openInLogosBaseUrl && product.resourceId && (hasTemporaryAccess || hasPermanentAccess)\n\t\t\t? `${pricingData.openInLogosBaseUrl}/${encodeURIComponent(product.resourceId)}`\n\t\t\t: null;\n\tconst canShowOpenInLogos = openInLogosUrl !== null;\n\n\treturn {\n\t\thasTemporaryAccess,\n\t\thasPermanentAccess,\n\t\tisRestricted,\n\t\tcanShowAddToCart,\n\t\tcanShowOpenInLogos,\n\t\topenInLogosUrl,\n\t\tshouldRenderButtons: canShowAddToCart || canShowOpenInLogos,\n\t};\n};\n\nexport const PurchaseActions = ({\n\tproduct,\n\tselectedSku,\n\tpricingData,\n\tshowGeoRestrictionMessage = false,\n\tshowSubscriptionPromotion = false,\n\tclassName,\n\tquantity,\n\taddToCartButtonRef,\n}: PurchaseActionsProps) => {\n\tconst openInLogosResources = useLocalization('CommerceWeb.Resources.Shared.OpenInLogos');\n\tconst addToCartButtonResources = useLocalization('CommerceWeb.Resources.Shared.AddToMiniCartButton');\n\tconst { canShowAddToCart, canShowOpenInLogos, openInLogosUrl, isRestricted } = getPurchaseActionState({\n\t\tproduct,\n\t\tselectedSku,\n\t\tpricingData,\n\t});\n\n\tconst { data: subscriptionPromotion } = useSubscriptionPromotion(\n\t\tshowSubscriptionPromotion && !selectedSku.isGroupLicenseEscrow ? selectedSku.id : undefined\n\t);\n\tconst [isSubscriptionPromotionChecked, setIsSubscriptionPromotionChecked] = useState(false);\n\tconst subscribableProductOptionId = subscriptionPromotion?.subscribableProductOptionId ?? null;\n\n\t// Reset the checkbox whenever the applicable promotion changes (e.g. the user selects a different SKU).\n\tuseEffect(() => {\n\t\tsetIsSubscriptionPromotionChecked(false);\n\t}, [subscribableProductOptionId]);\n\n\tconst shouldAddSubscriptionToCart =\n\t\tshowSubscriptionPromotion &&\n\t\tcanShowAddToCart &&\n\t\tisSubscriptionPromotionChecked &&\n\t\tBoolean(subscribableProductOptionId);\n\n\tconst supportsMultipleQuantity =\n\t\tselectedSku.isGroupLicenseEscrow || (!selectedSku.isSubscription && selectedSku.allowsMultipleQuantity);\n\tconst selectedSkuPricingData = pricingData?.skus?.[selectedSku.id];\n\tconst cartUpdateUrl = selectedSkuPricingData?.cartUpdateUrl;\n\tconst effectiveQuantity =\n\t\tsupportsMultipleQuantity && quantity !== null && quantity !== undefined && quantity > 1 ? quantity : 1;\n\tconst cartQuantityUpdate =\n\t\tsupportsMultipleQuantity &&\n\t\t!shouldAddSubscriptionToCart &&\n\t\tselectedSkuPricingData?.isInCart === true &&\n\t\ttypeof selectedSkuPricingData.cartItemId === 'number' &&\n\t\tselectedSkuPricingData.cartItemId > 0 &&\n\t\ttypeof cartUpdateUrl === 'string' &&\n\t\tcartUpdateUrl.length > 0\n\t\t\t? {\n\t\t\t\t\tcartItemId: selectedSkuPricingData.cartItemId,\n\t\t\t\t\tcartUpdateUrl,\n\t\t\t\t}\n\t\t\t: null;\n\tconst cartItems = useMemo(() => {\n\t\tconst items: PurchaseActionCartItem[] = [\n\t\t\t{ identifier: selectedSku.id, type: IdentifierTypes.SKU, quantity: effectiveQuantity, productId: product.id },\n\t\t];\n\n\t\tif (shouldAddSubscriptionToCart && subscribableProductOptionId) {\n\t\t\titems.push({ identifier: subscribableProductOptionId, type: IdentifierTypes.SPOID, quantity: 1 });\n\t\t}\n\n\t\treturn items;\n\t}, [product.id, selectedSku.id, shouldAddSubscriptionToCart, subscribableProductOptionId, effectiveQuantity]);\n\n\tif (isRestricted && !canShowOpenInLogos) {\n\t\treturn showGeoRestrictionMessage ? <div className={className}>{'Geo Restriction'}</div> : null;\n\t}\n\n\tif (!canShowAddToCart && !canShowOpenInLogos) {\n\t\treturn null;\n\t}\n\n\tconst showPromotion = showSubscriptionPromotion && canShowAddToCart && Boolean(subscriptionPromotion);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t{(canShowAddToCart || canShowOpenInLogos) && (\n\t\t\t\t<div ref={addToCartButtonRef} className={className}>\n\t\t\t\t\t{canShowAddToCart ? (\n\t\t\t\t\t\tcartQuantityUpdate ? (\n\t\t\t\t\t\t\t<QuantityUpdateButton\n\t\t\t\t\t\t\t\tcartItemId={cartQuantityUpdate.cartItemId}\n\t\t\t\t\t\t\t\tcartUpdateUrl={cartQuantityUpdate.cartUpdateUrl}\n\t\t\t\t\t\t\t\tquantity={cartItems[0].quantity}\n\t\t\t\t\t\t\t\tclassName=\"w-full md:w-auto\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<AddToCartButton\n\t\t\t\t\t\t\t\tkey={selectedSku.id}\n\t\t\t\t\t\t\t\tbuttonTextOverride={product.isPrepubProduct ? addToCartButtonResources.preorder : undefined}\n\t\t\t\t\t\t\t\titems={cartItems}\n\t\t\t\t\t\t\t\tscale=\"large\"\n\t\t\t\t\t\t\t\tclassName=\"w-full md:w-auto\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t) : null}\n\t\t\t\t\t{canShowOpenInLogos && openInLogosUrl ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={() => window.open(openInLogosUrl, '_blank')}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tscale=\"large\"\n\t\t\t\t\t\t\tclassName=\"w-full md:w-auto\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{openInLogosResources.OpenInLogosLinkText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{showPromotion && subscriptionPromotion ? (\n\t\t\t\t<SubscriptionPromotion\n\t\t\t\t\tpromotion={subscriptionPromotion}\n\t\t\t\t\tchecked={isSubscriptionPromotionChecked}\n\t\t\t\t\tonChange={setIsSubscriptionPromotionChecked}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { useLocalization } from '../../../localization';\nimport { cn } from '../../../util/cn';\nimport { Image } from '../../shared/enhanced-image-tag/image';\n\ninterface GalleryProps {\n\timageUri: string | null | undefined;\n\tproductName: string;\n}\n\nexport const Gallery = ({ imageUri, productName }: GalleryProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t'border border-gray p-6 mx-auto sm:max-w-[343px] md:ml-0 md:mr-auto lg:mx-0 lg:max-w-full lg:px-4 lg:py-12',\n\t\t\t\t!imageUri && '!p-0'\n\t\t\t)}\n\t\t>\n\t\t\t{/* Fixed square dimensions per breakpoint keep the rendered image width constant within each\n\t\t\t    `sizes` band, so every viewport in a band selects the same srcset candidate. */}\n\t\t\t<figure className=\"relative mx-auto aspect-square max-h-[268px] w-full lg:h-[400px] lg:max-h-none lg:w-[400px] xl:h-[504px] xl:w-[504px]\">\n\t\t\t\t{imageUri ? (\n\t\t\t\t\t<Image\n\t\t\t\t\t\tsrc={imageUri}\n\t\t\t\t\t\talt={productName ?? ''}\n\t\t\t\t\t\tclassName=\"absolute inset-0 h-full w-full object-scale-down object-center\"\n\t\t\t\t\t\tfetchPriority=\"high\"\n\t\t\t\t\t\ttargetAspectRatio={[1, 1]}\n\t\t\t\t\t\tsizes={{\n\t\t\t\t\t\t\tmobile: 268,\n\t\t\t\t\t\t\tdesktop: 400,\n\t\t\t\t\t\t\tlargeDesktop: 504,\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"absolute inset-0 flex items-center justify-center bg-tailwind-gray-200\">\n\t\t\t\t\t\t<div className=\"text-base font-semibold text-tailwind-gray-500\">{resources.ComingSoon}</div>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</figure>\n\t\t</div>\n\t);\n};\n","import { SubscriptionInfo } from '../../per-user-data/per-user-data-context';\n\nexport type PurchaseOptionType = 'payInFull' | 'subscription';\n\nexport interface PurchaseOption {\n\ttype: PurchaseOptionType;\n\ttitle: string;\n}\n\nexport type FormatGroup = 'logosEdition' | 'ebook' | 'other';\n\nexport const ResourceFormats = {\n\tEbook: 'ebook',\n\tReaderEdition: 'reader-edition',\n\tResearchEdition: 'research-edition',\n\tLogosEditionCollection: 'logos-edition-collection',\n} as const;\n\ninterface Chip {\n\tname: string;\n\turl: string | null | undefined;\n}\n\ninterface RatingSummary {\n\taverageRating: number | null | undefined;\n\tnumberOfReviews: number;\n}\n\nexport interface StaticProduct {\n\tid: string;\n\tresourceId: string;\n\tname: string;\n\tisCollection: boolean;\n\tsourceToken: string;\n\timageUri?: string | null;\n\tsamplePageImageUrls?: readonly string[] | null;\n\tauthors?: readonly Chip[] | null;\n\tpublishers?: readonly Chip[] | null;\n\tisbn?: string | null;\n\tpublicationPeriod?: string | null;\n\tdescriptionHtml?: string | null;\n\tratingSummary?: RatingSummary | null;\n\tisPrepubProduct: boolean;\n\tallowsSeeInside: boolean;\n}\n\nexport interface SkuPriceAmount {\n\tamount: number;\n\tdisplayAmount: string;\n\tdisplayAmountCurrencyCode?: string | null;\n\tlocalizedDisplayAmount?: string | null;\n\tcurrencyCode: string;\n\tdisplayAmountByCurrency?: Record<string, string> | null;\n}\n\nexport interface SkuPriceBreakdownLine {\n\tlabel: string;\n\tisDeduction: boolean;\n\tdisplayInUsd: boolean;\n\thref?: string | null;\n\tamount: SkuPriceAmount;\n}\n\nexport interface SkuPriceDiscount {\n\tdescription: string;\n\tshouldStack: boolean;\n}\n\ninterface SkuPrices {\n\tsalePrice?: SkuPriceAmount | null;\n\tanchorPrice?: SkuPriceAmount | null;\n\tanchorSavings?: SkuPriceAmount | null;\n\tdiscountSavings?: SkuPriceAmount | null;\n\tdiscounts?: SkuPriceDiscount[] | null;\n\tbreakdownTriggerLabel?: string | null;\n\tbreakdownLines?: SkuPriceBreakdownLine[] | null;\n\tanchorPriceLines?:\n\t\t| { label: string; displayAmount?: string | null; displayAmountByCurrency?: Record<string, string> | null }[]\n\t\t| null;\n\tsavingsDescription?: string | null;\n}\n\nexport interface StaticSku {\n\tid: string;\n\tformatDisplayName: string;\n\tsubscriptionInfo?: SubscriptionInfo | null;\n\tisSubscription: boolean;\n\tprice: SkuPrices;\n\tisSellable: boolean;\n\tisPurchasable?: boolean;\n\tisPreorder?: boolean;\n\taddToCartSkuId?: string | null;\n\tisGroupLicenseEscrow: boolean;\n\tallowsMultipleQuantity: boolean;\n\tformatGroup: FormatGroup;\n\tresourceFormat?: string | null;\n}\n\nexport interface User {\n\tuserId?: number;\n\tdisplayName?: string | null;\n}\n","import React, { useState } from 'react';\nimport { ChevronDown, X } from 'lucide-react';\nimport { LinkButton } from '@faithlife/commerce-components';\nimport { cn } from '../../../../util/cn';\n\ninterface CollapsibleCalloutProps {\n\tvariant?: 'default' | 'logos-edition';\n\tcollapsedContent: React.ReactNode;\n\texpandText: string;\n\tcollapseText: string;\n\tchildren: React.ReactNode;\n}\n\nexport const CollapsibleCallout = ({\n\tvariant = 'default',\n\tcollapsedContent,\n\texpandText,\n\tcollapseText,\n\tchildren,\n}: CollapsibleCalloutProps) => {\n\tconst [isExpanded, setIsExpanded] = useState(false);\n\n\tconst panelClass = cn('rounded-[6px] text-sm', variant === 'logos-edition' ? 'bg-primary-100' : 'bg-gray-200');\n\treturn (\n\t\t<div className={panelClass}>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex flex-col items-center justify-between gap-sp8 px-sp12 py-sp8 sm:p-sp16 sm:flex-row sm:text-left',\n\t\t\t\t\tisExpanded && 'flex-row justify-end'\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{!isExpanded && <span>{collapsedContent}</span>}\n\t\t\t\t<LinkButton\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\taria-expanded={isExpanded}\n\t\t\t\t\tclassName=\"inline-flex shrink-0 items-center gap-sp4\"\n\t\t\t\t\tintent=\"none\"\n\t\t\t\t\tscale=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={() => setIsExpanded(prev => !prev)}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"inline-flex shrink-0 items-center gap-sp4 whitespace-nowrap\">\n\t\t\t\t\t\t{isExpanded ? collapseText : expandText}\n\t\t\t\t\t\t{isExpanded ? (\n\t\t\t\t\t\t\t<X aria-hidden=\"true\" className=\"h-3 w-3 shrink-0\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ChevronDown aria-hidden=\"true\" className=\"h-3 w-3 shrink-0\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</LinkButton>\n\t\t\t</div>\n\n\t\t\t{isExpanded && <div className=\"sm:px-sp90 sm:pb-sp32 p-sp16\">{children}</div>}\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { EmbeddedVideo } from '@faithlife/commerce-components';\nimport { X } from 'lucide-react';\nimport { Modal, UtilityButton } from '../../../../../vendor/styled-ui';\n\ninterface VideoPopoverProps {\n\tvideoUrl: string;\n\tisModalOpen: boolean;\n\tonClose: () => void;\n}\n\nexport const VideoPopover = ({ videoUrl, isModalOpen, onClose }: VideoPopoverProps) => (\n\t<Modal isOpen={isModalOpen} onClose={onClose} container=\"body\" width=\"1280px\" background=\"transparent\">\n\t\t<Modal.Header\n\t\t\tpadding={0}\n\t\t\tactions={\n\t\t\t\t<UtilityButton onClick={onClose}>\n\t\t\t\t\t<X color=\"white\" />\n\t\t\t\t</UtilityButton>\n\t\t\t}\n\t\t/>\n\t\t<EmbeddedVideo className=\"border-0 bg-[#1f1f1f]\" videoUrl={videoUrl} />\n\t</Modal>\n);\n","import React, { Fragment, useState } from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { PlayIcon, Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../../localization';\nimport { cn } from '../../../../util/cn';\nimport { ResourceFormats } from '../types';\nimport { CollapsibleCallout } from './collapsible-callout';\nimport { VideoPopover } from './video-popover';\n\nconst resourceGroupKey = 'CommerceWeb.Resources.Product.ResourceFormatCallout';\n\nconst calloutResourceFormats: readonly string[] = [\n\tResourceFormats.Ebook,\n\tResourceFormats.ReaderEdition,\n\tResourceFormats.ResearchEdition,\n\tResourceFormats.LogosEditionCollection,\n];\n\nexport const hasResourceFormatCallout = (resourceFormat?: string | null): boolean =>\n\t!!resourceFormat && calloutResourceFormats.includes(resourceFormat);\n\ninterface LogosEditionCalloutProps {\n\tresourceFormat?: string | null;\n\tlogosOrVerbum: string;\n\tlogosEditionLearnMoreVideoUrl?: string | null;\n}\n\ninterface EditionFlags {\n\tisEbook: boolean;\n\tisVerbum: boolean;\n\tisReaderEdition: boolean;\n\tisLogosEditionCollection: boolean;\n}\n\nconst CalloutSummary = ({ isEbook, isVerbum }: Pick<EditionFlags, 'isEbook' | 'isVerbum'>) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\treturn isEbook ? (\n\t\t<CommandSentence template={resources.EbooksCalloutSummary} Container={Fragment}>\n\t\t\t<CommandSentence.Field name=\"EBOOKS\">\n\t\t\t\t<strong>{resources.Ebooks}</strong>\n\t\t\t</CommandSentence.Field>\n\t\t</CommandSentence>\n\t) : (\n\t\t<CommandSentence template={resources.LogosEditionsCalloutSummary} Container={Fragment}>\n\t\t\t<CommandSentence.Field name=\"LOGOSEDITIONS\">\n\t\t\t\t<strong>{isVerbum ? resources.VerbumEditions : resources.LogosEditions}</strong>\n\t\t\t</CommandSentence.Field>\n\t\t</CommandSentence>\n\t);\n};\n\nconst EditionBadge = ({\n\tisEbook,\n\tisVerbum,\n\tisReaderEdition,\n}: Pick<EditionFlags, 'isEbook' | 'isVerbum' | 'isReaderEdition'>) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\treturn (\n\t\t<span\n\t\t\tclassName={cn('rounded-[3px] px-sp12 py-sp4', isEbook ? 'bg-gray-400 font-bold' : 'bg-primary-200 font-normal')}\n\t\t>\n\t\t\t{isEbook ? (\n\t\t\t\tresources.Ebook\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"font-bold\">\n\t\t\t\t\t\t<span>{isVerbum ? resources.VerbumEdition : resources.LogosEdition}</span>\n\t\t\t\t\t\t{':'}\n\t\t\t\t\t</span>{' '}\n\t\t\t\t\t<span>{isReaderEdition ? resources.ReaderEdition : resources.ResearchEdition}</span>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n};\n\nconst CalloutHeader = ({\n\tisEbook,\n\tisVerbum,\n\tisReaderEdition,\n\tisLogosEditionCollection,\n\tlogosOrVerbum,\n}: EditionFlags & { logosOrVerbum: string }) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\treturn (\n\t\t<div className=\"mb-sp20 flex flex-row flex-wrap items-center gap-x-sp12 gap-y-sp8 sm:flex-col sm:items-start sm:gap-sp8\">\n\t\t\t{isLogosEditionCollection ? (\n\t\t\t\t<Typography tag=\"span\" variant=\"headingH5\">\n\t\t\t\t\t<CommandSentence template={resources.ThisCollectionContainsLogosEditions} Container={Fragment}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</Typography>\n\t\t\t) : (\n\t\t\t\t<div className=\"flex gap-x-sp12 gap-y-sp8 align-items-baseline\">\n\t\t\t\t\t<Typography tag=\"span\" variant=\"headingH5\">\n\t\t\t\t\t\t{resources.ThisResource}\n\t\t\t\t\t\t{':'}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<EditionBadge isEbook={isEbook} isVerbum={isVerbum} isReaderEdition={isReaderEdition} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst TwoTypesOfLogosEditionsHeading = ({ logosOrVerbum }: { logosOrVerbum: string }) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\treturn (\n\t\t<Typography tag=\"div\" variant=\"headingH5\">\n\t\t\t<CommandSentence template={resources.TwoTypesOfLogosEditions} Container={Fragment}>\n\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t</CommandSentence>\n\t\t</Typography>\n\t);\n};\n\nconst CalloutBody = ({\n\tisEbook,\n\tisVerbum,\n\tlogosOrVerbum,\n}: Pick<EditionFlags, 'isEbook' | 'isVerbum'> & { logosOrVerbum: string }) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-sp20\">\n\t\t\t{isEbook ? (\n\t\t\t\t<CommandSentence template={resources.EbooksCallout} Container={Fragment}>\n\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t</CommandSentence>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<CommandSentence template={resources.LogosEditionsCallout}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSEDITIONS\">\n\t\t\t\t\t\t\t<strong>{isVerbum ? resources.VerbumEditions : resources.LogosEditions}</strong>\n\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t<div className=\"order-first md:order-none\">\n\t\t\t\t\t\t<TwoTypesOfLogosEditionsHeading logosOrVerbum={logosOrVerbum} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<CommandSentence template={resources.ResearchEditionsCallout}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t<CommandSentence.Field name=\"RESEARCHEDITIONS\">\n\t\t\t\t\t\t\t<strong>{resources.ResearchEditions}</strong>\n\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t\t<CommandSentence template={resources.ReaderEditionsCallout}>\n\t\t\t\t\t\t<CommandSentence.Field name=\"LOGOSORVERBUM\">{logosOrVerbum}</CommandSentence.Field>\n\t\t\t\t\t\t<CommandSentence.Field name=\"READEREDITIONS\">\n\t\t\t\t\t\t\t<strong>{resources.ReaderEditions}</strong>\n\t\t\t\t\t\t</CommandSentence.Field>\n\t\t\t\t\t</CommandSentence>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst LearnMoreVideoButton = ({ videoUrl }: { videoUrl: string }) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\tconst [isVideoShown, setIsVideoShown] = useState(false);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"mt-sp16\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"inline-flex flex-row items-center gap-sp8 border-none bg-transparent p-sp0 font-semibold text-primary cursor-pointer hover:text-primary-400\"\n\t\t\t\t\tonClick={() => setIsVideoShown(true)}\n\t\t\t\t>\n\t\t\t\t\t<PlayIcon size={16} />\n\t\t\t\t\t{resources.LearnMore}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<VideoPopover isModalOpen={isVideoShown} videoUrl={videoUrl} onClose={() => setIsVideoShown(false)} />\n\t\t</>\n\t);\n};\n\nexport const LogosEditionCallout = ({\n\tresourceFormat,\n\tlogosOrVerbum,\n\tlogosEditionLearnMoreVideoUrl,\n}: LogosEditionCalloutProps) => {\n\tconst resources = useLocalization(resourceGroupKey);\n\n\tconst isEbook = resourceFormat === ResourceFormats.Ebook;\n\tconst isReaderEdition = resourceFormat === ResourceFormats.ReaderEdition;\n\tconst isResearchEdition = resourceFormat === ResourceFormats.ResearchEdition;\n\tconst isLogosEditionCollection = resourceFormat === ResourceFormats.LogosEditionCollection;\n\tconst isLogosEdition = isReaderEdition || isResearchEdition || isLogosEditionCollection;\n\n\tif (!hasResourceFormatCallout(resourceFormat)) {\n\t\treturn null;\n\t}\n\n\tconst isVerbum = logosOrVerbum.toLowerCase() === 'verbum';\n\n\treturn (\n\t\t<CollapsibleCallout\n\t\t\tcollapseText={resources.Close}\n\t\t\tcollapsedContent={<CalloutSummary isEbook={isEbook} isVerbum={isVerbum} />}\n\t\t\texpandText={resources.LearnMore}\n\t\t\tvariant={isEbook ? 'default' : 'logos-edition'}\n\t\t>\n\t\t\t<CalloutHeader\n\t\t\t\tisEbook={isEbook}\n\t\t\t\tisVerbum={isVerbum}\n\t\t\t\tisReaderEdition={isReaderEdition}\n\t\t\t\tisLogosEditionCollection={isLogosEditionCollection}\n\t\t\t\tlogosOrVerbum={logosOrVerbum}\n\t\t\t/>\n\t\t\t<CalloutBody isEbook={isEbook} isVerbum={isVerbum} logosOrVerbum={logosOrVerbum} />\n\t\t\t{isLogosEdition && logosEditionLearnMoreVideoUrl && (\n\t\t\t\t<LearnMoreVideoButton videoUrl={logosEditionLearnMoreVideoUrl} />\n\t\t\t)}\n\t\t</CollapsibleCallout>\n\t);\n};\n","import React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { Button } from '@faithlife/commerce-components';\nimport { Eye, X } from 'lucide-react';\nimport { useLocalization } from '../../../localization';\n\ninterface SeeInsideProps {\n\tseeInsideIframeUrl: string | null | undefined;\n}\n\nexport const SeeInside = ({ seeInsideIframeUrl }: SeeInsideProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\tif (!seeInsideIframeUrl) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DialogPrimitive.Root>\n\t\t\t<DialogPrimitive.Trigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tscale=\"small\"\n\t\t\t\t\tclassName=\"mx-auto mt-sp16! flex w-fit rounded-full border-primary-500 px-sp12! py-sp6! text-primary-500\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"inline-flex items-center gap-sp4\">\n\t\t\t\t\t\t{resources.SeeInside}\n\t\t\t\t\t\t<Eye aria-hidden=\"true\" className=\"size-4\" />\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t</DialogPrimitive.Trigger>\n\t\t\t<DialogPrimitive.Portal>\n\t\t\t\t<DialogPrimitive.Overlay className=\"fixed inset-0 z-[50] h-screen w-screen bg-gray-600/40\" />\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<DialogPrimitive.Title>{resources.SeeInside}</DialogPrimitive.Title>\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<DialogPrimitive.Content\n\t\t\t\t\taria-describedby={undefined}\n\t\t\t\t\tclassName=\"fixed left-1/2 top-1/2 z-[100] max-h-screen w-screen max-w-[80vh] -translate-x-1/2 -translate-y-1/2 transform rounded-sm bg-white p-4 pt-0 md:w-[800px]\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"text-right\">\n\t\t\t\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t\t\t\t<button aria-label={resources.Close} className=\"m-5 mr-0 inline-block\" type=\"button\">\n\t\t\t\t\t\t\t\t<X />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t\t</div>\n\t\t\t\t\t<iframe className=\"h-[80vh] w-full\" src={seeInsideIframeUrl} title={resources.SeeInside} />\n\t\t\t\t</DialogPrimitive.Content>\n\t\t\t</DialogPrimitive.Portal>\n\t\t</DialogPrimitive.Root>\n\t);\n};\n","import React, { Fragment } from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../../localization';\nimport { Preorder } from '../../../per-user-data/per-user-data-context';\n\ntype PreorderedProductLabelProps = Preorder;\n\nexport const PreorderedProductLabel = ({ orderDate, routes }: PreorderedProductLabelProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.DisplayTemplates.PricingSidebarViewModel');\n\n\treturn (\n\t\t<Typography tag=\"div\" variant=\"ui2\">\n\t\t\t<CommandSentence template={resources.YouPreorderedOn} Container={Fragment}>\n\t\t\t\t<CommandSentence.Field name=\"PRE_ORDER_DATE\">\n\t\t\t\t\t<a className=\"text-primary\" href={routes.preorderManagementPage}>\n\t\t\t\t\t\t{orderDate}\n\t\t\t\t\t</a>\n\t\t\t\t</CommandSentence.Field>\n\t\t\t</CommandSentence>\n\t\t</Typography>\n\t);\n};\n","import { useCallback, useState } from 'react';\nimport { FormatGroup } from './types';\n\nexport const GLE_MAX_QUANTITY = 1000;\n\ninterface ISku {\n\tid: string;\n\tisSubscription: boolean;\n\tisGroupLicenseEscrow: boolean;\n\tallowsMultipleQuantity: boolean;\n\tformatGroup: FormatGroup;\n}\n\nfunction reconcilePurchaseQuantityWithSku(selectedSku: ISku, currentQuantity: number) {\n\tif (selectedSku.isSubscription) {\n\t\t// For subscription SKUs, purchase quantity is not applicable, so just return the current quantity without modification\n\t\treturn currentQuantity;\n\t}\n\tif (selectedSku.isGroupLicenseEscrow) {\n\t\treturn Math.max(currentQuantity, 2);\n\t}\n\treturn selectedSku.allowsMultipleQuantity ? currentQuantity : 1;\n}\n\nexport function useSelectedSkuAndPurchaseQuantity<Sku extends ISku>(skus: Sku[]) {\n\tconst [selectedSku, setSelectedSku] = useState(skus[0]);\n\tconst [purchaseQuantity, setPurchaseQuantity] = useState(() => reconcilePurchaseQuantityWithSku(skus[0], 1));\n\n\tconst handleSelectedSkuChange = useCallback(\n\t\t(skuId: string, alternateSkuIds?: string[]) => {\n\t\t\tconst allSkuIdsToCheck = [skuId, ...(alternateSkuIds ?? [])];\n\t\t\tconst allSkusToCheck = allSkuIdsToCheck\n\t\t\t\t.map(id => skus.find(sku => sku.id === id))\n\t\t\t\t.filter((sku): sku is Sku => sku !== undefined);\n\n\t\t\t// check if there is a SKU that supports the currently selected purchase quantity\n\t\t\tlet matchingSku: Sku | null = null;\n\t\t\tfor (const sku of allSkusToCheck) {\n\t\t\t\t// skip subscription SKUs as they don't use purchase quantity\n\t\t\t\tif (sku.isSubscription) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (reconcilePurchaseQuantityWithSku(sku, purchaseQuantity) === purchaseQuantity) {\n\t\t\t\t\tmatchingSku = sku;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmatchingSku ??= allSkusToCheck[0];\n\n\t\t\tif (matchingSku) {\n\t\t\t\tconst nextSelectedSku = matchingSku;\n\t\t\t\tsetSelectedSku(nextSelectedSku);\n\t\t\t\tsetPurchaseQuantity(prevQuantity => reconcilePurchaseQuantityWithSku(nextSelectedSku, prevQuantity));\n\t\t\t}\n\t\t},\n\t\t[skus, purchaseQuantity]\n\t);\n\n\tconst handlePurchaseQuantityChange = useCallback(\n\t\t(quantity: number) => {\n\t\t\t// find a SKU that supports the new quantity if possible, otherwise keep the currently selected SKU\n\n\t\t\tconst clampedQuantity = Math.min(Math.max(quantity, 1), GLE_MAX_QUANTITY);\n\n\t\t\tconst eligibleSkus =\n\t\t\t\tselectedSku.formatGroup === 'logosEdition' || selectedSku.formatGroup === 'ebook'\n\t\t\t\t\t? skus.filter(sku => sku.formatGroup === selectedSku.formatGroup)\n\t\t\t\t\t: [selectedSku];\n\n\t\t\tconst matchingSku =\n\t\t\t\teligibleSkus.find(sku => reconcilePurchaseQuantityWithSku(sku, clampedQuantity) === clampedQuantity) ??\n\t\t\t\tselectedSku;\n\n\t\t\tsetSelectedSku(matchingSku);\n\t\t\tsetPurchaseQuantity(reconcilePurchaseQuantityWithSku(matchingSku, clampedQuantity));\n\t\t},\n\t\t[selectedSku, skus]\n\t);\n\n\treturn { selectedSku, purchaseQuantity, handleSelectedSkuChange, handlePurchaseQuantityChange };\n}\n","import React, { useMemo } from 'react';\nimport * as RadioGroup from '@radix-ui/react-radio-group';\nimport * as Tooltip from '@radix-ui/react-tooltip';\nimport cn from 'classnames';\nimport { StepperControl } from '@faithlife/commerce-components';\nimport { Radio } from '../../../../../vendor/styled-ui';\nimport { Select } from '../../../../../vendor/styled-ui/text-input';\nimport { SubscriptionInfo, SubscriptionPeriodType, usePricing } from '../../../per-user-data/per-user-data-context';\nimport { CommerceWebThemeProvider } from '../../../../util/theme';\nimport { FormatGroup, PurchaseOption, PurchaseOptionType } from '../types';\nimport { GLE_MAX_QUANTITY } from '../selected-sku-and-quantity-util';\n\ninterface Sku {\n\tid: string;\n\tformatDisplayName: string;\n\tsubscriptionInfo?: SubscriptionInfo | null;\n\tisSubscription: boolean;\n\tisGroupLicenseEscrow: boolean;\n\tallowsMultipleQuantity: boolean;\n\tformatGroup: FormatGroup;\n}\n\n/**\n * Represents a single chip in the purchase format selector, after combining single and Group License Escrow (GLE) SKUs in one chip\n */\ninterface PurchaseSkuChip {\n\tchipId: string;\n\tformatDisplayName: string;\n\tskuId: string;\n\totherSkuIds: string[];\n\tsupportsQuantitySelection: boolean;\n}\n\nfunction buildPurchaseSkuChips(purchaseSkus: Sku[], isOwned = false): PurchaseSkuChip[] {\n\tconst logosEditionSkus = purchaseSkus.filter(s => s.formatGroup === 'logosEdition');\n\tconst ebookSkus = purchaseSkus.filter(s => s.formatGroup === 'ebook');\n\tconst otherSkus = purchaseSkus.filter(s => s.formatGroup === 'other' || !s.formatGroup);\n\n\tconst logosEditionChips = mapSkuGroupToChips(logosEditionSkus, isOwned);\n\tconst ebookChips = mapSkuGroupToChips(ebookSkus, isOwned);\n\tconst otherChips: PurchaseSkuChip[] = otherSkus.map(sku => ({\n\t\tchipId: sku.id,\n\t\tformatDisplayName: sku.formatDisplayName,\n\t\tskuId: sku.id,\n\t\totherSkuIds: [],\n\t\tsupportsQuantitySelection: sku.allowsMultipleQuantity,\n\t}));\n\n\tconst chips = [...logosEditionChips, ...ebookChips, ...otherChips];\n\n\treturn chips;\n\n\tfunction mapSkuGroupToChips(skus: Sku[], isOwned: boolean): PurchaseSkuChip[] {\n\t\tconst chips: PurchaseSkuChip[] = [];\n\n\t\t// there really shouldn't be more than one single-purchase and one GLE SKU, so we're focusing on that case\n\t\tconst singlePurchaseSkus = skus.filter(s => !s.isGroupLicenseEscrow);\n\t\tconst gleSkus = skus.filter(s => s.isGroupLicenseEscrow);\n\n\t\tconst representativeSku =\n\t\t\tsinglePurchaseSkus.length > 0 ? singlePurchaseSkus[0] : gleSkus.length > 0 ? gleSkus[0] : null;\n\t\tif (representativeSku === null) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst handledSkuIds = new Set<string>();\n\t\t// If the user owns the product, we want to show GLE SKUs as alternatives.\n\t\tconst matchingGroupSkus = !isOwned ? gleSkus.filter(gle => gle.id !== representativeSku.id) : [];\n\n\t\tchips.push({\n\t\t\tchipId: representativeSku.id,\n\t\t\tformatDisplayName: representativeSku.formatDisplayName,\n\t\t\tskuId: representativeSku.id,\n\t\t\totherSkuIds: matchingGroupSkus.map(gle => gle.id),\n\t\t\tsupportsQuantitySelection: representativeSku.allowsMultipleQuantity || gleSkus.length > 0,\n\t\t});\n\n\t\thandledSkuIds.add(representativeSku.id);\n\t\tmatchingGroupSkus.forEach(gle => handledSkuIds.add(gle.id));\n\n\t\t// push remaining single and GLE SKUs as standalone chips (if any)\n\t\tfor (const sku of [...singlePurchaseSkus, ...gleSkus]) {\n\t\t\tif (handledSkuIds.has(sku.id)) {\n\t\t\t\tcontinue; // already processed\n\t\t\t}\n\t\t\tchips.push({\n\t\t\t\tchipId: sku.id,\n\t\t\t\tformatDisplayName: sku.formatDisplayName,\n\t\t\t\tskuId: sku.id,\n\t\t\t\totherSkuIds: [],\n\t\t\t\tsupportsQuantitySelection: sku.isGroupLicenseEscrow || sku.allowsMultipleQuantity,\n\t\t\t});\n\t\t}\n\n\t\treturn chips;\n\t}\n}\n\ninterface SkuSelectorProps {\n\tproductId: string;\n\tskus: Sku[];\n\tpurchaseOptions: PurchaseOption[];\n\tselectedSkuId: string;\n\tisSalePriceVisible: boolean;\n\tpurchaseQuantity: number;\n\tonSelectedSkuChange?: (skuId: string, alternateSkuIds?: string[]) => void;\n\tonPurchaseQuantityChange?: (quantity: number) => void;\n\tisOwned?: boolean;\n}\n\nconst skuItemClassName = cn(\n\t'rounded-sm border border-primary bg-white p-0 text-primary-400 transition-colors',\n\t'focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary/20',\n\t'data-[state=checked]:border-primary',\n\t'lg:p-1'\n);\n\nconst PurchaseSkuItemContent = ({\n\tformatDisplayName,\n\tsalePrice,\n\trestricted,\n}: {\n\tformatDisplayName: string;\n\tsalePrice?: string;\n\trestricted?: boolean;\n}) => (\n\t<div className=\"flex items-center gap-2 rounded-sm bg-gray-200 px-2 py-1\">\n\t\t<span className=\"break-all font-semibold\">{formatDisplayName}</span>\n\t\t{salePrice && <span style={restricted ? { color: 'var(--theme-colors-black-c100)' } : undefined}>{salePrice}</span>}\n\t</div>\n);\n\ninterface PurchaseOptionSectionDetails {\n\tkey: 'purchase' | 'subscription';\n\ttype: PurchaseOptionType;\n\tisSelected: boolean;\n\tonSelect: () => void;\n\tcontent: React.ReactNode;\n}\n\nconst PurchaseOptionSection = ({\n\tisSelected,\n\tshowRadio,\n\ttitle,\n\tcontent,\n\tonSelect,\n}: {\n\tisSelected: boolean;\n\tshowRadio: boolean;\n\ttitle?: React.ReactNode;\n\tcontent: React.ReactNode;\n\tonSelect: () => void;\n}) => {\n\tconst className = cn('flex flex-col gap-2 transition duration-200 ease-out', {\n\t\t'opacity-100 grayscale-0': isSelected || !showRadio,\n\t\t'opacity-70 grayscale hover:opacity-100 hover:grayscale-0': !isSelected && showRadio,\n\t});\n\n\treturn (\n\t\t<div className={className}>\n\t\t\t{showRadio && (\n\t\t\t\t<Radio\n\t\t\t\t\tisChecked={isSelected}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={onSelect}\n\t\t\t\t\ttitle={<span className=\"font-semibold\">{title}</span>}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{content}\n\t\t</div>\n\t);\n};\n\nconst periodTypeOrder: SubscriptionPeriodType[] = [\n\tSubscriptionPeriodType.day,\n\tSubscriptionPeriodType.month,\n\tSubscriptionPeriodType.year,\n];\n\nfunction comparePeriodTypes(a: SubscriptionPeriodType | undefined, b: SubscriptionPeriodType | undefined) {\n\tif (a === b) {\n\t\treturn 0;\n\t}\n\tif (a === undefined) {\n\t\treturn 1;\n\t}\n\tif (b === undefined) {\n\t\treturn -1;\n\t}\n\tconst aIndex = periodTypeOrder.indexOf(a);\n\tconst bIndex = periodTypeOrder.indexOf(b);\n\treturn aIndex - bIndex;\n}\n\n/**\n * Given the currently active SKU ID, find the chip that owns it.\n */\nfunction findChipForSkuId(chips: PurchaseSkuChip[], skuId: string): PurchaseSkuChip | null {\n\treturn (\n\t\tchips.find(c => {\n\t\t\treturn c.skuId === skuId || c.otherSkuIds.includes(skuId);\n\t\t}) ?? null\n\t);\n}\n\nconst QuantitySelector = ({\n\tquantity,\n\tonQuantityChange,\n\tdisabled,\n}: {\n\tquantity: number;\n\tonQuantityChange: (qty: number) => void;\n\tdisabled?: boolean;\n}) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<StepperControl\n\t\t\t\tscale=\"sm\"\n\t\t\t\tmin={1}\n\t\t\t\tmax={GLE_MAX_QUANTITY}\n\t\t\t\tvalue={quantity}\n\t\t\t\tonValueChange={onQuantityChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport const SkuSelector = ({\n\tproductId,\n\tskus,\n\tpurchaseOptions,\n\tselectedSkuId,\n\tisSalePriceVisible,\n\tpurchaseQuantity,\n\tonPurchaseQuantityChange,\n\tonSelectedSkuChange,\n\tisOwned,\n}: SkuSelectorProps) => {\n\tconst { data: pricingData } = usePricing(productId);\n\tconst pricingBySkuId = pricingData?.skus;\n\n\tconst purchaseSkus = useMemo(() => skus.filter(sku => !sku.isSubscription), [skus]);\n\tconst subscriptionSkus = useMemo(() => {\n\t\tconst result = skus\n\t\t\t.filter(sku => sku.isSubscription)\n\t\t\t.map(sku => {\n\t\t\t\tconst userPricingData = pricingBySkuId?.[sku.id];\n\t\t\t\tconst subscriptionInfo = userPricingData?.subscriptionInfo ?? sku.subscriptionInfo ?? null;\n\t\t\t\treturn { ...sku, subscriptionInfo };\n\t\t\t});\n\t\tresult.sort((a, b) => {\n\t\t\tif (!a.subscriptionInfo || !b.subscriptionInfo) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn comparePeriodTypes(a.subscriptionInfo.periodType, b.subscriptionInfo.periodType);\n\t\t});\n\t\treturn result;\n\t}, [skus, pricingBySkuId]);\n\n\tconst purchaseChips = useMemo(() => buildPurchaseSkuChips(purchaseSkus, isOwned), [purchaseSkus, isOwned]);\n\n\t// Chips that share a format display name (e.g. several \"Digital\" gift card amounts) are\n\t// indistinguishable without their price.\n\tconst ambiguousFormatDisplayNames = useMemo(() => {\n\t\tconst counts = new Map<string, number>();\n\t\tfor (const chip of purchaseChips) {\n\t\t\tcounts.set(chip.formatDisplayName, (counts.get(chip.formatDisplayName) ?? 0) + 1);\n\t\t}\n\t\treturn new Set([...counts].filter(([, count]) => count > 1).map(([name]) => name));\n\t}, [purchaseChips]);\n\n\tconst lastSelectedPurchaseSkuIdRef = React.useRef<string | null>(\n\t\tpurchaseChips.length > 0 ? purchaseChips[0].skuId : null\n\t);\n\tif (purchaseSkus.some(sku => sku.id === selectedSkuId)) {\n\t\tlastSelectedPurchaseSkuIdRef.current = selectedSkuId;\n\t}\n\tconst lastSelectedPurchaseSkuId = lastSelectedPurchaseSkuIdRef.current;\n\n\tconst lastSelectedSubscriptionSkuIdRef = React.useRef<string | null>(\n\t\tsubscriptionSkus.length > 0 ? subscriptionSkus[0].id : null\n\t);\n\tif (subscriptionSkus.some(sku => sku.id === selectedSkuId)) {\n\t\tlastSelectedSubscriptionSkuIdRef.current = selectedSkuId;\n\t}\n\tconst lastSelectedSubscriptionSkuId = lastSelectedSubscriptionSkuIdRef.current;\n\n\tconst selectedSkuPurchaseChip = useMemo(() => {\n\t\treturn findChipForSkuId(purchaseChips, selectedSkuId) ?? null;\n\t}, [purchaseChips, selectedSkuId]);\n\n\tconst lastSelectedSkuPurchaseChip = useMemo(() => {\n\t\treturn lastSelectedPurchaseSkuId !== null\n\t\t\t? (findChipForSkuId(purchaseChips, lastSelectedPurchaseSkuId) ?? null)\n\t\t\t: null;\n\t}, [purchaseChips, lastSelectedPurchaseSkuId]);\n\n\tconst shouldShowQuantitySelector = lastSelectedSkuPurchaseChip?.supportsQuantitySelection ?? false;\n\n\tconst handleChipClick = (chipId: string) => {\n\t\tif (!onSelectedSkuChange) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst chip = purchaseChips.find(c => c.chipId === chipId);\n\t\tif (!chip) {\n\t\t\treturn;\n\t\t}\n\n\t\tonSelectedSkuChange(chip.skuId, chip.otherSkuIds);\n\t};\n\n\tconst handleQuantityChange = (newQuantity: number) => {\n\t\tonPurchaseQuantityChange?.(newQuantity);\n\t};\n\n\tconst isPurchaseSkuSelected = purchaseSkus.some(sku => sku.id === selectedSkuId);\n\tconst isSubscriptionSkuSelected = subscriptionSkus.some(sku => sku.id === selectedSkuId);\n\n\tconst handleSubscriptionSkuChange = (skuId: string) => {\n\t\tif (subscriptionSkus.some(sku => sku.id === skuId)) {\n\t\t\tonSelectedSkuChange?.(skuId);\n\t\t}\n\t};\n\n\tconst getPurchaseSkuItemContent = (chip: PurchaseSkuChip): React.ReactNode => {\n\t\tif (!ambiguousFormatDisplayNames.has(chip.formatDisplayName)) {\n\t\t\treturn <PurchaseSkuItemContent formatDisplayName={chip.formatDisplayName} />;\n\t\t}\n\n\t\tconst displaySkuId = chip.otherSkuIds.find(id => id === lastSelectedPurchaseSkuId) ?? chip.skuId;\n\t\tconst salePrice = isSalePriceVisible ? pricingBySkuId?.[displaySkuId]?.prices?.salePrice?.displayAmount : undefined;\n\t\treturn (\n\t\t\t<PurchaseSkuItemContent\n\t\t\t\tformatDisplayName={chip.formatDisplayName}\n\t\t\t\tsalePrice={salePrice}\n\t\t\t\trestricted={pricingData?.isGeographicallyRestricted ?? false}\n\t\t\t/>\n\t\t);\n\t};\n\n\tlet purchaseSkuChipContent: React.ReactNode = null;\n\tif (purchaseChips.length === 1 && subscriptionSkus.length === 0) {\n\t\tconst chip = purchaseChips[0];\n\t\t// Single chip with no alternatives — render as a non-interactive display item\n\t\tpurchaseSkuChipContent = (\n\t\t\t<div className=\"flex flex-wrap gap-2\">\n\t\t\t\t<div className={cn(skuItemClassName, 'cursor-default')}>{getPurchaseSkuItemContent(chip)}</div>\n\t\t\t</div>\n\t\t);\n\t} else if (purchaseChips.length > 0) {\n\t\tpurchaseSkuChipContent = (\n\t\t\t<RadioGroup.Root\n\t\t\t\tclassName=\"flex flex-wrap gap-2\"\n\t\t\t\tvalue={selectedSkuPurchaseChip?.chipId ?? ''}\n\t\t\t\tonValueChange={handleChipClick}\n\t\t\t>\n\t\t\t\t{purchaseChips.map(chip => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<RadioGroup.Item\n\t\t\t\t\t\t\tkey={chip.chipId}\n\t\t\t\t\t\t\tvalue={chip.chipId}\n\t\t\t\t\t\t\tclassName={cn(skuItemClassName, 'cursor-pointer border-transparent hover:border-primary')}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getPurchaseSkuItemContent(chip)}\n\t\t\t\t\t\t</RadioGroup.Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</RadioGroup.Root>\n\t\t);\n\t}\n\tlet purchaseSkuContent: React.ReactNode = null;\n\tif (purchaseSkuChipContent) {\n\t\tpurchaseSkuContent = (\n\t\t\t<Tooltip.Provider>\n\t\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t\t{purchaseSkuChipContent}\n\t\t\t\t\t{shouldShowQuantitySelector && (\n\t\t\t\t\t\t<QuantitySelector\n\t\t\t\t\t\t\tquantity={purchaseQuantity}\n\t\t\t\t\t\t\tonQuantityChange={handleQuantityChange}\n\t\t\t\t\t\t\tdisabled={selectedSkuId !== lastSelectedPurchaseSkuId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Tooltip.Provider>\n\t\t);\n\t}\n\n\tlet subscriptionSkuContent: React.ReactNode = null;\n\tif (subscriptionSkus.length > 0) {\n\t\tconst selectedSubscriptionSku = subscriptionSkus.find(sku => sku.id === lastSelectedSubscriptionSkuId);\n\n\t\tconst pricingForSelectedSubscriptionSku = selectedSubscriptionSku\n\t\t\t? pricingBySkuId?.[selectedSubscriptionSku.id]\n\t\t\t: undefined;\n\t\tconst subscriptionDisplayPrice = isSalePriceVisible\n\t\t\t? pricingForSelectedSubscriptionSku?.prices?.salePrice?.displayAmount && (\n\t\t\t\t\t<>{pricingForSelectedSubscriptionSku.prices.salePrice.displayAmount}</>\n\t\t\t\t)\n\t\t\t: undefined;\n\n\t\tconst selectValue = selectedSubscriptionSku && {\n\t\t\tvalue: lastSelectedSubscriptionSkuId,\n\t\t\tlabel: (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"font-semibold\">{selectedSubscriptionSku.subscriptionInfo?.periodDisplay ?? ''}</span>\n\t\t\t\t\t{!(selectedSubscriptionSku.subscriptionInfo?.shouldHidePrice ?? false) && subscriptionDisplayPrice && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{' • '}\n\t\t\t\t\t\t\t{subscriptionDisplayPrice}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t),\n\t\t};\n\n\t\tconst options = subscriptionSkus.map(sku => {\n\t\t\tconst price = isSalePriceVisible ? pricingBySkuId?.[sku.id]?.prices?.salePrice?.displayAmount : undefined;\n\t\t\tconst name = sku.subscriptionInfo?.periodDisplay ?? '';\n\t\t\tconst shouldHidePrice = sku.subscriptionInfo?.shouldHidePrice ?? false;\n\t\t\treturn {\n\t\t\t\tvalue: sku.id,\n\t\t\t\tlabel: (\n\t\t\t\t\t<span className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<span className=\"font-semibold mr-auto\">{name}</span>\n\t\t\t\t\t\t{!shouldHidePrice && price && <span>{price}</span>}\n\t\t\t\t\t</span>\n\t\t\t\t),\n\t\t\t};\n\t\t});\n\n\t\tsubscriptionSkuContent = (\n\t\t\t<div className=\"max-w-sm\">\n\t\t\t\t<Select\n\t\t\t\t\toptions={options}\n\t\t\t\t\tvalue={selectValue}\n\t\t\t\t\tonChange={(option: { value: string }) => handleSubscriptionSkuChange(option.value)}\n\t\t\t\t\tisSearchable={false}\n\t\t\t\t\tonFocus={() => {\n\t\t\t\t\t\thandleSubscriptionSkuChange(lastSelectedSubscriptionSkuId ?? subscriptionSkus[0].id);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst purchaseOptionSections: PurchaseOptionSectionDetails[] = [];\n\tif (purchaseSkuContent) {\n\t\tconst firstChip = purchaseChips[0];\n\t\tpurchaseOptionSections.push({\n\t\t\tkey: 'purchase',\n\t\t\ttype: 'payInFull',\n\t\t\tisSelected: isPurchaseSkuSelected,\n\t\t\tonSelect: () => firstChip && handleChipClick(firstChip.chipId),\n\t\t\tcontent: purchaseSkuContent,\n\t\t});\n\t}\n\tif (subscriptionSkuContent) {\n\t\tpurchaseOptionSections.push({\n\t\t\tkey: 'subscription',\n\t\t\ttype: 'subscription',\n\t\t\tisSelected: isSubscriptionSkuSelected,\n\t\t\tonSelect: () => handleSubscriptionSkuChange(lastSelectedSubscriptionSkuId ?? subscriptionSkus[0].id),\n\t\t\tcontent: subscriptionSkuContent,\n\t\t});\n\t}\n\n\tconst showRadioOptions = purchaseOptionSections.length > 1;\n\n\treturn (\n\t\t<CommerceWebThemeProvider>\n\t\t\t{purchaseOptionSections.map(purchaseOptionSection => {\n\t\t\t\tconst purchaseOption = purchaseOptions.find(option => option.type === purchaseOptionSection.type);\n\n\t\t\t\treturn (\n\t\t\t\t\t<PurchaseOptionSection\n\t\t\t\t\t\tkey={purchaseOptionSection.key}\n\t\t\t\t\t\tisSelected={purchaseOptionSection.isSelected}\n\t\t\t\t\t\tshowRadio={showRadioOptions}\n\t\t\t\t\t\ttitle={purchaseOption?.title}\n\t\t\t\t\t\tcontent={purchaseOptionSection.content}\n\t\t\t\t\t\tonSelect={purchaseOptionSection.onSelect}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</CommerceWebThemeProvider>\n\t);\n};\n","import React from 'react';\nimport { useLocalization } from '../../../../localization';\nimport { AuthorsAndPublishers } from './authors-and-publishers';\n\ninterface Chip {\n\tname: string;\n\turl: string | null | undefined;\n}\n\ninterface MetadataRowProps {\n\tauthors: readonly Chip[];\n\tpublishers: readonly Chip[];\n\tpublicationPeriod: string | null | undefined;\n\tisbn: string | null | undefined;\n}\n\nexport const MetadataRow = ({ authors, publishers, publicationPeriod, isbn }: MetadataRowProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst publisherMetadata =\n\t\tpublicationPeriod || isbn ? (\n\t\t\t<>\n\t\t\t\t{publicationPeriod ? (\n\t\t\t\t\t<span aria-label={resources.PublicationPeriod} className=\"text-sm leading-5 text-black-200\">\n\t\t\t\t\t\t{publishers.length ? `, ${publicationPeriod}` : publicationPeriod}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\t\t\t\t{isbn ? (\n\t\t\t\t\t<span className=\"text-sm leading-5 text-black-200\">\n\t\t\t\t\t\t<span className=\"font-semibold\">{resources.IsbnLabel}</span>\n\t\t\t\t\t\t{isbn}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\t\t\t</>\n\t\t) : null;\n\n\treturn <AuthorsAndPublishers authors={authors} publishers={publishers} publisherMetadata={publisherMetadata} />;\n};\n","import React, { useEffect, useState } from 'react';\nimport { LinkButton, StarRating } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../../localization';\nimport { REVIEWS_ANCHOR_ID } from '../../reviews/reviews-anchor';\nimport { hasValidReviewData } from '../../../shared/ratings/review-data';\n\ntype ReviewSummaryVariant = 'default' | 'stickyAddToCart';\n\ninterface RatingSummary {\n\taverageRating: number | null | undefined;\n\tnumberOfReviews: number;\n}\n\ninterface ReviewSummaryProps {\n\tratingSummary: RatingSummary | null | undefined;\n\tvariant?: ReviewSummaryVariant;\n}\n\nexport const ReviewSummary = ({ ratingSummary, variant = 'default' }: ReviewSummaryProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst [headerHeight, setHeaderHeight] = useState(0);\n\n\tconst numberOfReviews = ratingSummary?.numberOfReviews ?? 0;\n\tconst averageRating = ratingSummary?.averageRating ?? 0;\n\tconst hasReviews = hasValidReviewData(averageRating, numberOfReviews);\n\n\tuseEffect(() => {\n\t\tconst getHeaderHeight = () => {\n\t\t\tconst header = document.querySelector('header');\n\n\t\t\treturn header ? header.getBoundingClientRect().height : 0;\n\t\t};\n\n\t\tsetHeaderHeight(getHeaderHeight());\n\n\t\tconst handleResize = () => setHeaderHeight(getHeaderHeight());\n\t\tconst handleLogosBannerClosed = () => setTimeout(() => setHeaderHeight(getHeaderHeight()), 0);\n\n\t\twindow.addEventListener('resize', handleResize);\n\t\twindow.addEventListener('logosBannerClosed', handleLogosBannerClosed);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('resize', handleResize);\n\t\t\twindow.removeEventListener('logosBannerClosed', handleLogosBannerClosed);\n\t\t};\n\t}, []);\n\n\tconst reviewsHref = `#${REVIEWS_ANCHOR_ID}`;\n\n\tconst handleScrollToReviews = (event: React.MouseEvent<HTMLAnchorElement>) => {\n\t\tconst reviewsElement = document.getElementById(REVIEWS_ANCHOR_ID);\n\n\t\tif (reviewsElement) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst rect = reviewsElement.getBoundingClientRect();\n\n\t\t\twindow.scrollTo({ top: rect.top + window.scrollY - headerHeight, behavior: 'smooth' });\n\n\t\t\thistory.pushState(null, '', reviewsHref);\n\t\t}\n\t};\n\n\tconst shouldDisplayLinkToReviews = variant !== 'stickyAddToCart';\n\n\tif (!hasReviews && !shouldDisplayLinkToReviews) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1\">\n\t\t\t{hasReviews ? (\n\t\t\t\t<a\n\t\t\t\t\tclassName=\"inline-flex items-center transition-opacity hover:opacity-80 focus-visible:opacity-80 active:opacity-60 motion-reduce:transition-none\"\n\t\t\t\t\thref={reviewsHref}\n\t\t\t\t\tonClick={handleScrollToReviews}\n\t\t\t\t>\n\t\t\t\t\t<StarRating scale=\"md\" rating={averageRating} reviewCount={numberOfReviews} />\n\t\t\t\t</a>\n\t\t\t) : null}\n\t\t\t{shouldDisplayLinkToReviews && !hasReviews && (\n\t\t\t\t<LinkButton href={reviewsHref} onClick={handleScrollToReviews} scale=\"sm\">\n\t\t\t\t\t{resources.BeTheFirstToRateThis}\n\t\t\t\t</LinkButton>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { ChevronDown, ChevronUp } from 'lucide-react';\nimport { LinkButton } from '@faithlife/commerce-components';\nimport { cn } from '../../../../util/cn';\nimport { useLocalization } from '../../../../localization';\nimport '../product-details.css';\n\ninterface ProductDescriptionProps {\n\tdescriptionHtml: string | null | undefined;\n}\n\nexport const ProductDescription = ({ descriptionHtml }: ProductDescriptionProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst [showFullDescription, setShowFullDescription] = useState(false);\n\tconst [isTruncatable, setIsTruncatable] = useState(false);\n\tconst contentRef = useRef<HTMLElement>(null);\n\n\tuseEffect(() => {\n\t\tif (contentRef.current && !showFullDescription) {\n\t\t\tsetIsTruncatable(contentRef.current.scrollHeight > contentRef.current.clientHeight);\n\t\t}\n\t}, [descriptionHtml, showFullDescription]);\n\n\tuseEffect(() => {\n\t\ttry {\n\t\t\tif (typeof window?.refTagger?.tag === 'function') {\n\t\t\t\twindow.refTagger.tag();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error('Failed to run RefTagger tag():', error);\n\t\t}\n\t}, [descriptionHtml]);\n\n\tif (!descriptionHtml) {\n\t\treturn null;\n\t}\n\n\tconst toggleDescription = () => setShowFullDescription(prev => !prev);\n\tconst buttonLabel = showFullDescription ? resources.ReadLess : resources.ReadMore;\n\n\treturn (\n\t\t<section className=\"product-description\">\n\t\t\t<div className=\"bd-product-display-content\">\n\t\t\t\t<article\n\t\t\t\t\tref={contentRef}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'builder-text mt-4 transition-all duration-500 ease-in-out lg:mt-6 [&>p:first-child]:mt-0',\n\t\t\t\t\t\t!showFullDescription && 'line-clamp-5'\n\t\t\t\t\t)}\n\t\t\t\t\tdangerouslySetInnerHTML={{ __html: descriptionHtml }}\n\t\t\t\t\tid=\"product-description-content\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{(isTruncatable || showFullDescription) && (\n\t\t\t\t<LinkButton\n\t\t\t\t\tas=\"button\"\n\t\t\t\t\taria-controls=\"product-description-content\"\n\t\t\t\t\taria-expanded={showFullDescription}\n\t\t\t\t\taria-label={resources.ProductDescriptionToggle.replace('%ACTION%', buttonLabel)}\n\t\t\t\t\tclassName=\"inline-flex items-center gap-sp4\"\n\t\t\t\t\tintent=\"none\"\n\t\t\t\t\tscale=\"sm\"\n\t\t\t\t\tonClick={toggleDescription}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"inline-flex shrink-0 items-center gap-sp4 whitespace-nowrap\">\n\t\t\t\t\t\t{buttonLabel}\n\t\t\t\t\t\t{showFullDescription ? (\n\t\t\t\t\t\t\t<ChevronUp aria-hidden=\"true\" className=\"h-3 w-3 shrink-0\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ChevronDown aria-hidden=\"true\" className=\"h-3 w-3 shrink-0\" />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</LinkButton>\n\t\t\t)}\n\t\t</section>\n\t);\n};\n","import React from 'react';\nimport { CommandSentence } from '@faithlife/command-sentence-control';\nimport { Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../../localization';\nimport { usePricing } from '../../../per-user-data/per-user-data-context';\nimport { AddToWishListWithForm } from '../../../add-to-wish-list';\nimport { Prices } from '../prices';\nimport { PurchaseActions, getPurchaseActionState } from '../purchase-actions';\nimport { Gallery } from '../gallery';\nimport { LogosEditionCallout, hasResourceFormatCallout } from '../logos-edition-callout';\nimport { SeeInside } from '../see-inside';\nimport { PurchaseOption, StaticProduct, StaticSku } from '../types';\nimport { useProductInWishList } from '../../../add-to-wish-list/hooks';\nimport { PrepubProductStatusSummary } from './prepub-product-status-summary';\nimport { PreorderedProductLabel } from './preordered-product-label';\nimport { SkuSelector } from './sku-selector';\nimport { MetadataRow } from './metadata-row';\nimport { ReviewSummary } from './review-summary';\nimport { ProductDescription } from './product-description';\n\nexport interface DetailsProps {\n\tproduct: StaticProduct;\n\tselectedSku: StaticSku;\n\tskus: StaticSku[];\n\tpurchaseOptions: PurchaseOption[];\n\tpurchaseQuantity: number;\n\tonSelectedSkuChange?: (skuId: string, alternateSkuIds?: string[]) => void;\n\tonPurchaseQuantityChange?: (quantity: number) => void;\n\tlogosOrVerbum?: string;\n\tlogosEditionLearnMoreVideoUrl?: string | null;\n\tseeInsideIframeUrl?: string | null;\n\taddToCartButtonRef?: React.Ref<HTMLDivElement>;\n}\n\nexport const Details = ({\n\tproduct,\n\tselectedSku,\n\tskus,\n\tpurchaseOptions,\n\tpurchaseQuantity,\n\tonSelectedSkuChange,\n\tonPurchaseQuantityChange,\n\tlogosOrVerbum = 'Logos',\n\tlogosEditionLearnMoreVideoUrl,\n\tseeInsideIframeUrl,\n\taddToCartButtonRef,\n}: DetailsProps) => {\n\tconst detailsResources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst pricingSidebarResources = useLocalization(\n\t\t'CommerceWeb.Resources.Product.DisplayTemplates.PricingSidebarViewModel'\n\t);\n\n\tconst { isLoading, data: pricingData } = usePricing(product.id);\n\n\tconst { hasTemporaryAccess, hasPermanentAccess, canShowOpenInLogos } = getPurchaseActionState({\n\t\tproduct,\n\t\tselectedSku,\n\t\tpricingData,\n\t});\n\tconst isGroupLicenseEscrow = selectedSku.isGroupLicenseEscrow ?? false;\n\tconst isOwned = hasPermanentAccess || hasTemporaryAccess;\n\n\tconst perUserSkuData = pricingData?.skus?.[selectedSku.id];\n\tconst hasPerUserSkuData = !isLoading && perUserSkuData !== null && perUserSkuData !== undefined;\n\tconst isSkuSellable = hasPerUserSkuData\n\t\t? (perUserSkuData.isSellable ?? selectedSku.isSellable)\n\t\t: selectedSku.isSellable;\n\tconst isSkuPurchasable = perUserSkuData?.isPurchasable ?? false;\n\n\tconst productWishlistData = useProductInWishList(\n\t\tproduct.id,\n\t\tselectedSku.id,\n\t\tisSkuPurchasable && !pricingData?.isPrepubProduct\n\t);\n\n\tlet explanation: React.ReactNode = null;\n\tlet isBlockedFromPurchase = false;\n\tif (!isLoading) {\n\t\tif (pricingData?.preorder) {\n\t\t\texplanation = <PreorderedProductLabel {...pricingData.preorder} />;\n\t\t} else if (isOwned && isSkuSellable) {\n\t\t\texplanation = hasPermanentAccess\n\t\t\t\t? isGroupLicenseEscrow\n\t\t\t\t\t? detailsResources.YouCanDistribute\n\t\t\t\t\t: detailsResources.YouAlreadyOwnThisProduct\n\t\t\t\t: detailsResources.YouHaveTemporaryAccess;\n\t\t} else if (pricingData?.isGeographicallyRestricted) {\n\t\t\texplanation = pricingSidebarResources.ProductNotAvailableInYourRegion;\n\t\t\tisBlockedFromPurchase = true;\n\t\t} else if (pricingData?.userCountryOrRegionIsTradeSanctioned) {\n\t\t\texplanation = (\n\t\t\t\t<CommandSentence template={pricingSidebarResources.UserCountryOfacSanctioned}>\n\t\t\t\t\t<CommandSentence.Field name=\"CURRENT_PRODUCT\">{product.name}</CommandSentence.Field>\n\t\t\t\t</CommandSentence>\n\t\t\t);\n\t\t\tisBlockedFromPurchase = true;\n\t\t} else if (pricingData?.isAcademicallyRestricted && !isSkuPurchasable) {\n\t\t\texplanation = (\n\t\t\t\t<span\n\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t__html: pricingSidebarResources.ProductOnlyAvailableForAcademicProgramMembers,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t);\n\t\t\tisBlockedFromPurchase = true;\n\t\t} else if (!isSkuSellable) {\n\t\t\texplanation = pricingSidebarResources.UnavailableToPurchase;\n\t\t}\n\t}\n\treturn (\n\t\t<div className=\"flex flex-col lg:mb-0 lg:ml-0 gap-6\">\n\t\t\t<Typography className=\"text-primary-400\" tag=\"h1\" variant=\"headingH4\">\n\t\t\t\t{product.name}\n\t\t\t</Typography>\n\t\t\t<MetadataRow\n\t\t\t\tauthors={product.authors ?? []}\n\t\t\t\tpublishers={product.publishers ?? []}\n\t\t\t\tpublicationPeriod={product.publicationPeriod}\n\t\t\t\tisbn={product.isbn}\n\t\t\t/>\n\t\t\t<ReviewSummary ratingSummary={product.ratingSummary} />\n\t\t\t<div className=\"lg:hidden md:max-w-[343px]\">\n\t\t\t\t<Gallery imageUri={product.imageUri} productName={product.name} />\n\t\t\t\t{seeInsideIframeUrl && <SeeInside seeInsideIframeUrl={seeInsideIframeUrl} />}\n\t\t\t</div>\n\n\t\t\t{hasResourceFormatCallout(selectedSku.resourceFormat) && (\n\t\t\t\t<div className=\"md:hidden\">\n\t\t\t\t\t<LogosEditionCallout\n\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum}\n\t\t\t\t\t\tlogosEditionLearnMoreVideoUrl={logosEditionLearnMoreVideoUrl}\n\t\t\t\t\t\tresourceFormat={selectedSku.resourceFormat}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{!pricingData?.hasPreorder && (\n\t\t\t\t<Prices\n\t\t\t\t\tprices={pricingData?.skus?.[selectedSku.id]?.prices}\n\t\t\t\t\tisRestricted={pricingData?.isGeographicallyRestricted ?? false}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{pricingData?.prepubProductStatusSummary && (\n\t\t\t\t<PrepubProductStatusSummary {...pricingData.prepubProductStatusSummary} variant=\"pdp\" />\n\t\t\t)}\n\t\t\t<SkuSelector\n\t\t\t\tproductId={product.id}\n\t\t\t\tskus={skus}\n\t\t\t\tpurchaseOptions={purchaseOptions}\n\t\t\t\tselectedSkuId={selectedSku.id}\n\t\t\t\tisSalePriceVisible={!pricingData?.hasPreorder}\n\t\t\t\tpurchaseQuantity={purchaseQuantity}\n\t\t\t\tonSelectedSkuChange={onSelectedSkuChange}\n\t\t\t\tonPurchaseQuantityChange={onPurchaseQuantityChange}\n\t\t\t\tisOwned={isOwned}\n\t\t\t/>\n\t\t\t{explanation && (\n\t\t\t\t<Typography className=\"text-black-100\" tag=\"div\" variant=\"bodySmall\">\n\t\t\t\t\t{explanation}\n\t\t\t\t</Typography>\n\t\t\t)}\n\n\t\t\t{!isLoading && ((isSkuPurchasable && !isBlockedFromPurchase) || canShowOpenInLogos) ? (\n\t\t\t\t<PurchaseActions\n\t\t\t\t\tproduct={product}\n\t\t\t\t\tselectedSku={selectedSku}\n\t\t\t\t\tpricingData={pricingData}\n\t\t\t\t\tshowSubscriptionPromotion\n\t\t\t\t\tclassName=\"flex gap-2 items-center\"\n\t\t\t\t\tquantity={purchaseQuantity}\n\t\t\t\t\taddToCartButtonRef={addToCartButtonRef}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t\t{productWishlistData !== null && (\n\t\t\t\t<AddToWishListWithForm {...productWishlistData} variant=\"link\" isOwned={isOwned} />\n\t\t\t)}\n\t\t\t<ProductDescription descriptionHtml={product.descriptionHtml} />\n\t\t</div>\n\t);\n};\n","import React, { ReactNode } from 'react';\nimport cn from 'classnames';\n\ninterface StickyAddToCartBarProps {\n\tid?: string;\n\tchildren: ReactNode;\n\tisVisible: boolean;\n}\n\nconst StickyAddToCartBar = ({ id, children, isVisible }: StickyAddToCartBarProps) => {\n\treturn (\n\t\t<div\n\t\t\tid={id}\n\t\t\taria-hidden={!isVisible}\n\t\t\tinert={!isVisible}\n\t\t\tclassName={cn(\n\t\t\t\t'fixed bottom-0 left-0 right-0 z-5 border-y border-gray bg-white p-sp16 lg:p-sp24 transition-transform duration-300 ease-in-out',\n\t\t\t\tisVisible ? 'translate-y-0' : 'translate-y-full'\n\t\t\t)}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n\nexport default StickyAddToCartBar;\n","import React from 'react';\nimport { Typography } from '@faithlife/commerce-components';\nimport { ProductPricingData } from '../../../per-user-data/per-user-data-context';\nimport { Prices } from '../prices';\nimport { PurchaseActions } from '../purchase-actions';\nimport { ReviewSummary } from '../right-column/review-summary';\n\nexport interface StickyAddToCartProduct {\n\tid: string;\n\tname: string;\n\tresourceId?: string;\n\tisCollection: boolean;\n\tratingSummary?: { averageRating: number | null | undefined; numberOfReviews: number } | null;\n}\n\nexport interface StickyAddToCartSelectedSku {\n\tid: string;\n\tisGroupLicenseEscrow?: boolean;\n\tisSubscription?: boolean;\n\tallowsMultipleQuantity?: boolean;\n}\n\ninterface StickyAddToCartContentProps {\n\tproduct: StickyAddToCartProduct;\n\tselectedSku: StickyAddToCartSelectedSku;\n\tpurchaseQuantity: number;\n\tisLoading: boolean;\n\tpricingData?: ProductPricingData | null;\n\tcanShowAddToCart: boolean;\n\tshouldRenderButtons: boolean;\n}\n\n/**\n * Inner content for the sticky add-to-cart bar.\n *  - Left (hidden on mobile): product title + star rating summary\n *  - Right: pricing + action buttons\n */\nexport const StickyAddToCartContent = ({\n\tproduct,\n\tselectedSku,\n\tpurchaseQuantity,\n\tisLoading,\n\tpricingData,\n\tcanShowAddToCart,\n\tshouldRenderButtons,\n}: StickyAddToCartContentProps) => {\n\tconst shouldRenderActionSection = !isLoading && shouldRenderButtons;\n\n\treturn (\n\t\t<div className=\"mx-auto flex max-w-[1440px] flex-row items-center justify-between gap-sp30\">\n\t\t\t{/* Left section — hidden on mobile, title + rating */}\n\t\t\t<div className=\"hidden min-w-0 items-center gap-sp16 md:flex\">\n\t\t\t\t<Typography className=\"min-w-0 truncate text-primary-400\" tag=\"h5\" variant=\"headingH5\">\n\t\t\t\t\t{product.name}\n\t\t\t\t</Typography>\n\t\t\t\t<ReviewSummary ratingSummary={product.ratingSummary} variant=\"stickyAddToCart\" />\n\t\t\t</div>\n\n\t\t\t{/* Right section — pricing + action buttons */}\n\t\t\t{shouldRenderActionSection && (\n\t\t\t\t<div className=\"flex w-full min-w-0 items-center gap-sp8 md:w-auto md:shrink-0\">\n\t\t\t\t\t<div className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t<PurchaseActions\n\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\tselectedSku={selectedSku}\n\t\t\t\t\t\t\tpricingData={pricingData}\n\t\t\t\t\t\t\tclassName=\"flex items-center gap-sp8 [&>button]:min-w-0 [&>button]:flex-1 [&>button]:overflow-hidden [&>button]:whitespace-nowrap md:[&>button]:flex-none max-[374px]:[&>button:nth-child(2)]:hidden\"\n\t\t\t\t\t\t\tquantity={purchaseQuantity}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t{canShowAddToCart ? (\n\t\t\t\t\t\t<span className=\"shrink-0\">\n\t\t\t\t\t\t\t<Prices\n\t\t\t\t\t\t\t\tprices={pricingData?.skus?.[selectedSku.id]?.prices}\n\t\t\t\t\t\t\t\tisRestricted={false}\n\t\t\t\t\t\t\t\tvariant=\"salePriceOnly\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { usePricing } from '../../../per-user-data/per-user-data-context';\nimport { getPurchaseActionState } from '../purchase-actions';\nimport StickyAddToCartBar from './sticky-add-to-cart-bar';\nimport {\n\tStickyAddToCartContent,\n\tStickyAddToCartProduct,\n\tStickyAddToCartSelectedSku,\n} from './sticky-add-to-cart-content';\n\ninterface StickyAddToCartProps {\n\tid?: string;\n\tisVisible: boolean;\n\tproduct: StickyAddToCartProduct;\n\tselectedSku: StickyAddToCartSelectedSku;\n\tpurchaseQuantity: number;\n}\n\nconst StickyAddToCart = ({ id, isVisible, product, selectedSku, purchaseQuantity }: StickyAddToCartProps) => {\n\tconst { isLoading, data: pricingData } = usePricing(product.id);\n\tconst { canShowAddToCart, shouldRenderButtons } = getPurchaseActionState({\n\t\tproduct,\n\t\tselectedSku,\n\t\tpricingData,\n\t});\n\n\tconst shouldRenderActionSection = !isLoading && isVisible && shouldRenderButtons;\n\n\treturn (\n\t\t<StickyAddToCartBar id={id} isVisible={shouldRenderActionSection}>\n\t\t\t<StickyAddToCartContent\n\t\t\t\tproduct={product}\n\t\t\t\tselectedSku={selectedSku}\n\t\t\t\tpurchaseQuantity={purchaseQuantity}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tpricingData={pricingData}\n\t\t\t\tcanShowAddToCart={canShowAddToCart}\n\t\t\t\tshouldRenderButtons={shouldRenderButtons}\n\t\t\t/>\n\t\t</StickyAddToCartBar>\n\t);\n};\n\nexport default StickyAddToCart;\n","import React from 'react';\nimport { registerAdzone } from '@faithlife/commerce-components';\n\nimport RenderBuilderContent from '../../builder/render-builder-content';\nimport { SectionContentViewModel } from '../../../builder';\n\nregisterAdzone();\n\ninterface AdzoneBlockProps {\n\tadzone: SectionContentViewModel;\n}\n\nconst AdzoneBlock = ({ adzone }: AdzoneBlockProps) => (\n\t<>{adzone.contentSourceKind === 'builderIo' && <RenderBuilderContent {...adzone.builderIo} />}</>\n);\n\nexport default AdzoneBlock;\n","import React from 'react';\nimport { TimeSensitiveCallout } from '@faithlife/commerce-components';\n\ninterface TimeSensitiveCalloutBlockProps {\n\thtml?: string | null;\n}\n\nexport const TimeSensitiveCalloutBlock = ({ html }: TimeSensitiveCalloutBlockProps) => {\n\tif (!html) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"mx-auto my-4 w-full max-w-[1440px]\">\n\t\t\t<TimeSensitiveCallout>\n\t\t\t\t<div dangerouslySetInnerHTML={{ __html: html }} />\n\t\t\t</TimeSensitiveCallout>\n\t\t</div>\n\t);\n};\n","import React, { useEffect, useState } from 'react';\nimport Cookies from 'js-cookie';\nimport { CloseButton } from '@faithlife/commerce-components';\nimport type { SectionContentViewModel } from '../../../builder';\nimport { BuilderSection } from '../../builder';\n\ninterface PdpBannerProps {\n\tcontent?: SectionContentViewModel | null;\n}\n\nexport const PdpBanner = ({ content }: PdpBannerProps) => {\n\tconst [hasCheckedDismissedCookie, setHasCheckedDismissedCookie] = useState(false);\n\tconst [isDismissed, setIsDismissed] = useState(true);\n\n\tuseEffect(() => {\n\t\tsetIsDismissed(Cookies.get('isPlatformExplainerDismissed') !== undefined);\n\t\tsetHasCheckedDismissedCookie(true);\n\t}, []);\n\n\tconst closeComponent = () => {\n\t\tCookies.set('isPlatformExplainerDismissed', 'true', { secure: true, path: '/product', expires: 7 });\n\t\tsetIsDismissed(true);\n\t};\n\n\tif (!hasCheckedDismissedCookie || isDismissed || content?.contentSourceKind !== 'builderIo') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"relative mb-4 w-full\">\n\t\t\t<BuilderSection builderIo={content.builderIo} restrictOverflow={false} />\n\t\t\t<div className=\"absolute right-4 top-4 z-10\">\n\t\t\t\t<CloseButton variant=\"tertiary\" onClick={closeComponent} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { useCurrentUser, usePricing } from '../../../per-user-data/per-user-data-context';\nimport Pencil from './svgs/edit_pencil_white.svg';\n\ninterface BusinessDeskEditLinkProps {\n\tproductId: string;\n}\n\nconst c_title = 'Edit Product';\n\nexport const BusinessDeskEditLink = ({ productId }: BusinessDeskEditLinkProps) => {\n\tconst { data: currentUser } = useCurrentUser();\n\tconst { isEmployee } = currentUser;\n\tconst { data } = usePricing(productId);\n\n\tconst businessDeskEditUri = data?.businessDeskEditUri;\n\n\tif (!businessDeskEditUri || !isEmployee) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tclassName=\"absolute right-[15px] top-0 z-10 hidden sm:inline-block\"\n\t\t\thref={businessDeskEditUri}\n\t\t\ttitle={c_title}\n\t\t\ttarget=\"_blank\"\n\t\t\trel=\"noopener noreferrer\"\n\t\t>\n\t\t\t<img\n\t\t\t\tclassName=\"size-5 rounded-[3px] bg-[#c1c1c1cc] p-1 [background-origin:content-box]\"\n\t\t\t\tsrc={Pencil}\n\t\t\t\talt={c_title}\n\t\t\t/>\n\t\t</a>\n\t);\n};\n","import React, { useState } from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden';\nimport { X } from 'lucide-react';\nimport { Keyboard, Scrollbar } from 'swiper/modules';\nimport { Swiper, SwiperSlide } from 'swiper/react';\nimport { useLocalization } from '../../../../localization';\nimport { Image } from '../../../shared/enhanced-image-tag/image';\n\ninterface SamplePagesProps {\n\timageUrls: readonly string[];\n}\n\nexport const SamplePages = ({ imageUrls }: SamplePagesProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst [initialSlide, setInitialSlide] = useState(0);\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tif (imageUrls.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div>\n\t\t\t<div>\n\t\t\t\t<Swiper\n\t\t\t\t\tkeyboard\n\t\t\t\t\tmodules={[Scrollbar, Keyboard]}\n\t\t\t\t\tscrollbar={{\n\t\t\t\t\t\tel: '.swiper-scrollbar',\n\t\t\t\t\t\tdraggable: true,\n\t\t\t\t\t\tdragClass: 'scrollbar-sample-pages',\n\t\t\t\t\t\tdragSize: 50,\n\t\t\t\t\t}}\n\t\t\t\t\tslidesPerView=\"auto\"\n\t\t\t\t\tspaceBetween={8}\n\t\t\t\t>\n\t\t\t\t\t{imageUrls.map((imageSrc, index) => (\n\t\t\t\t\t\t<SwiperSlide className=\"!w-[68px] border border-tailwind-gray-300\" key={imageSrc}>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclassName=\"block h-full w-full\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetIsOpen(true);\n\t\t\t\t\t\t\t\t\tsetInitialSlide(index);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\t\t\talt={resources.SamplePagesThumbnailAlt}\n\t\t\t\t\t\t\t\t\tclassName=\"object-cover\"\n\t\t\t\t\t\t\t\t\theight={91}\n\t\t\t\t\t\t\t\t\tbelowTheFold\n\t\t\t\t\t\t\t\t\tfetchPriority=\"low\"\n\t\t\t\t\t\t\t\t\tsrc={imageSrc}\n\t\t\t\t\t\t\t\t\twidth={68}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</SwiperSlide>\n\t\t\t\t\t))}\n\t\t\t\t\t<div className=\"swiper-scrollbar mt-2 h-[11px] w-full bg-primary-100 p-[3px]\" />\n\t\t\t\t</Swiper>\n\t\t\t</div>\n\t\t\t<DialogPrimitive.Root onOpenChange={setIsOpen} open={isOpen}>\n\t\t\t\t<DialogPrimitive.Portal>\n\t\t\t\t\t<DialogPrimitive.Overlay className=\"fixed inset-0 z-[50] bg-gray-900/60\" onClick={() => setIsOpen(false)} />\n\t\t\t\t\t<DialogPrimitive.Content\n\t\t\t\t\t\taria-describedby={undefined}\n\t\t\t\t\t\tclassName=\"fixed left-1/2 top-1/2 z-[100] flex h-dvh w-screen -translate-x-1/2 -translate-y-1/2 transform flex-col overflow-hidden bg-white sm:h-[92dvh] sm:w-[92vw] sm:max-w-[720px] sm:rounded-sm sm:shadow-xl\"\n\t\t\t\t\t\tonPointerDownOutside={e => e.preventDefault()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t<DialogPrimitive.Title>{resources.SamplePagesViewer}</DialogPrimitive.Title>\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<div className=\"flex shrink-0 justify-end border-b border-tailwind-gray-200 p-2\">\n\t\t\t\t\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\taria-label={resources.Close}\n\t\t\t\t\t\t\t\t\tclassName=\"rounded-full p-2 text-gray-600 hover:bg-tailwind-gray-100\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<X />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Swiper\n\t\t\t\t\t\t\tclassName=\"min-h-0 w-full flex-1 bg-gray-50\"\n\t\t\t\t\t\t\tinitialSlide={initialSlide}\n\t\t\t\t\t\t\tkeyboard\n\t\t\t\t\t\t\tmodules={[Keyboard]}\n\t\t\t\t\t\t\tonSlideChange={swiper => setInitialSlide(swiper.activeIndex)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{imageUrls.map(imageSrc => (\n\t\t\t\t\t\t\t\t<SwiperSlide className=\"flex h-full items-center justify-center p-4\" key={imageSrc}>\n\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\talt={resources.SamplePagesSlideImage}\n\t\t\t\t\t\t\t\t\t\tclassName=\"max-h-full max-w-full object-contain shadow-md\"\n\t\t\t\t\t\t\t\t\t\tsrc={imageSrc}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</SwiperSlide>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</Swiper>\n\t\t\t\t\t</DialogPrimitive.Content>\n\t\t\t\t</DialogPrimitive.Portal>\n\t\t\t</DialogPrimitive.Root>\n\t\t</div>\n\t);\n};\n","import React from 'react';\nimport { useLocalization } from '../../../../localization';\nimport { Gallery } from '../gallery';\nimport { LogosEditionCallout, hasResourceFormatCallout } from '../logos-edition-callout';\nimport { SeeInside } from '../see-inside';\nimport { SamplePages } from './sample-pages';\n\ninterface LeftColumnProduct {\n\tid: string;\n\tname: string;\n\timageUri?: string | null;\n\tsamplePageImageUrls?: readonly string[] | null;\n\tallowsSeeInside?: boolean;\n}\n\ninterface LeftColumnSelectedSku {\n\tresourceFormat?: string | null;\n}\n\ninterface LeftColumnProps {\n\tproduct: LeftColumnProduct;\n\tselectedSku?: LeftColumnSelectedSku | null;\n\tlogosOrVerbum?: string;\n\tlogosEditionLearnMoreVideoUrl?: string | null;\n\tseeInsideIframeUrl?: string | null;\n}\n\nexport const LeftColumn = ({\n\tproduct,\n\tselectedSku,\n\tlogosOrVerbum = 'Logos',\n\tlogosEditionLearnMoreVideoUrl,\n\tseeInsideIframeUrl,\n}: LeftColumnProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"hidden lg:block\">\n\t\t\t\t<Gallery imageUri={product.imageUri} productName={product.name} />\n\t\t\t</div>\n\t\t\t{seeInsideIframeUrl && (\n\t\t\t\t<div className=\"hidden lg:block\">\n\t\t\t\t\t<SeeInside seeInsideIframeUrl={seeInsideIframeUrl} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{selectedSku && hasResourceFormatCallout(selectedSku.resourceFormat) && (\n\t\t\t\t<div className=\"mt-sp24 hidden md:block\">\n\t\t\t\t\t<LogosEditionCallout\n\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum}\n\t\t\t\t\t\tlogosEditionLearnMoreVideoUrl={logosEditionLearnMoreVideoUrl}\n\t\t\t\t\t\tresourceFormat={selectedSku.resourceFormat}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{product.samplePageImageUrls && product.samplePageImageUrls.length > 0 ? (\n\t\t\t\t<div className=\"md:mt-6\">\n\t\t\t\t\t<p className=\"mb-2 text-sm capitalize text-black-100\">{resources.SamplePages}</p>\n\t\t\t\t\t<SamplePages imageUrls={product.samplePageImageUrls} />\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</>\n\t);\n};\n","import React from 'react';\nimport { Typography } from '@faithlife/commerce-components';\nimport { useLocalization } from '../../../localization';\nimport { usePricing } from '../../per-user-data/per-user-data-context';\nimport { useUnownedResources } from './hooks/use-unowned-resources';\n\ninterface LibraryGreetingProps {\n\tproductId: string;\n\tproductName: string;\n\tuserName: string;\n}\n\nconst ShimmerInline = ({ width }: { width: string }) => (\n\t<span className={`inline-block ${width} h-[1em] animate-pulse rounded bg-primary-200 align-middle`} />\n);\n\nexport const LibraryGreeting = ({ productId, productName, userName }: LibraryGreetingProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\tconst { isLoading: isPricingLoading, data: pricingData } = usePricing(productId);\n\tconst { isLoading: isUnownedLoading, data: unownedData } = useUnownedResources(productId);\n\n\tif (isUnownedLoading) {\n\t\treturn null;\n\t}\n\tif (!unownedData || unownedData.count === 0) {\n\t\treturn null;\n\t}\n\n\tconst greetingText = resources.LibraryGreeting.replace('%USER_NAME%', userName);\n\n\tconst primarySkuPrices = pricingData?.primarySku?.prices;\n\tconst priceDisplay = primarySkuPrices?.salePrice?.displayAmount;\n\n\treturn (\n\t\t<>\n\t\t\t<hr className=\"hidden lg:block border-gray lg:mx-sp24\" />\n\t\t\t<section className=\"mx-4 border border-black-20 rounded-b border-t-[6px] border-t-primary-400 px-6 py-5 text-center md:mx-6 lg:mx-6 max-lg:mt-sp24 lg:mt-sp32\">\n\t\t\t\t<Typography tag=\"h2\" variant=\"headingH5\" className=\"mb-3\">\n\t\t\t\t\t{greetingText}\n\t\t\t\t</Typography>\n\t\t\t\t<Typography variant=\"bodySmall\" className=\"text-black-70\">\n\t\t\t\t\t{resources.LibraryResourcesYouDontOwn?.replace('%LIBRARY_NAME%', productName).replace(\n\t\t\t\t\t\t'%UNOWNED_RESOURCE_COUNT%',\n\t\t\t\t\t\tString(unownedData.count)\n\t\t\t\t\t)}{' '}\n\t\t\t\t\t{isPricingLoading\n\t\t\t\t\t\t? resources.LibraryAddByGetting.replace('%LIBRARY_NAME%', productName)\n\t\t\t\t\t\t\t\t.split('%PRICE%')\n\t\t\t\t\t\t\t\t.map((part, i, arr) => (\n\t\t\t\t\t\t\t\t\t<React.Fragment key={i}>\n\t\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t\t\t{i < arr.length - 1 && <ShimmerInline width=\"w-16\" />}\n\t\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t: priceDisplay &&\n\t\t\t\t\t\t\tresources.LibraryAddByGetting.replace('%LIBRARY_NAME%', productName)\n\t\t\t\t\t\t\t\t.split('%PRICE%')\n\t\t\t\t\t\t\t\t.map((part, i, arr) => (\n\t\t\t\t\t\t\t\t\t<React.Fragment key={i}>\n\t\t\t\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t\t\t\t\t{i < arr.length - 1 && <strong>{priceDisplay}</strong>}\n\t\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t</Typography>\n\t\t\t</section>\n\t\t</>\n\t);\n};\n","import { useEffect, useState } from 'react';\n\ninterface UnownedResourcesInfo {\n\tcount: number;\n\tvalueIfPurchasedSeparately: string;\n\tvalueIfPurchasedSeparatelyLocalized: string | null;\n}\n\ninterface UnownedResourcesResponse {\n\tinfos: Record<string, UnownedResourcesInfo>;\n}\n\nexport function useUnownedResources(productId: string) {\n\tconst [data, setData] = useState<UnownedResourcesInfo | null>(null);\n\tconst [isLoading, setIsLoading] = useState(true);\n\n\tuseEffect(() => {\n\t\tlet cancelled = false;\n\n\t\tfetch(`/product/unownedresourcesinfos?productIds=${encodeURIComponent(productId)}`, {\n\t\t\theaders: { 'X-Requested-With': 'XMLHttpRequest' },\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new Error(`Failed to fetch unowned resources: ${response.status}`);\n\t\t\t\t}\n\t\t\t\treturn response.json() as Promise<UnownedResourcesResponse>;\n\t\t\t})\n\t\t\t.then(result => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetData(result.infos[productId] ?? null);\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t};\n\t}, [productId]);\n\n\treturn { data, isLoading };\n}\n","import React, { useMemo } from 'react';\nimport {\n\tEventsTrackingContextProvider,\n\tEventsTrackingContextProviderProps,\n} from '../../events-tracking/events-tracking-context';\nimport BuilderComponentsContextProvider from '../../builder/provider';\nimport {\n\tAnchorPriceLine,\n\tPerUserDataContextProvider,\n\tProductPriceAmount,\n\tProductPriceBreakdownLine,\n\tProductPricingData,\n\tProductPricingSkuData,\n} from '../../per-user-data/per-user-data-context';\nimport { useCurrentUser } from '../../per-user-data/per-user-data-context';\nimport { SectionContentViewModel } from '../../../builder';\nimport { useLocalization } from '../../../localization/use-localization';\nimport { BuyInCollection } from '../recommendations/buy-in-collection';\nimport { ContainingSubscriptions } from '../recommendations/containing-subscriptions';\nimport { CustomersAlsoBought } from '../recommendations/customers-also-bought';\nimport { FeaturedProductsSection } from '../featured-products';\nimport Reviews from '../reviews';\nimport type { ReviewsViewModel } from '../reviews/types';\nimport ProductContentSections from '../product-content-sections';\nimport { DisplayTemplate, ProductDetailsMetadata, AuthorBio } from '../product-content-sections/types';\nimport { Breadcrumbs } from '../../shared/breadcrumbs';\nimport { useSeeInsideUrl } from './hooks/use-see-inside-url';\nimport { Details } from './right-column';\nimport { StickyAddToCart } from './sticky-add-to-cart';\nimport AdzoneBlock from './adzone-block';\nimport { TimeSensitiveCalloutBlock } from './time-sensitive-callout-block';\nimport { PdpBanner } from './pdp-banner';\nimport { BusinessDeskEditLink } from './businessdesk-edit-link';\nimport { LeftColumn } from './left-column';\nimport { LibraryGreeting } from './library-greeting';\nimport { PurchaseOption, StaticProduct, User, StaticSku, SkuPriceAmount, SkuPriceBreakdownLine } from './types';\nimport { useSelectedSkuAndPurchaseQuantity } from './selected-sku-and-quantity-util';\nimport { useStickyAddToCartHandler } from './sticky-add-to-cart/use-sticky-add-to-cart-handler';\n\nfunction mapSkuData(sku: StaticSku, localizedCurrencyCode: string | undefined): ProductPricingSkuData {\n\tconst { salePrice, anchorPrice, anchorSavings, discountSavings } = sku.price ?? {};\n\n\treturn {\n\t\tskuId: sku.id,\n\t\tisSellable: sku.isSellable ?? false,\n\t\tisPurchasable: sku.isPurchasable ?? sku.isSellable ?? false,\n\t\tisPreorder: sku.isPreorder ?? false,\n\t\taddToCartSkuId: sku.addToCartSkuId ?? undefined,\n\t\tisOwned: false,\n\t\tisInCart: false,\n\t\thasBeenPreordered: false,\n\t\tprices: salePrice\n\t\t\t? {\n\t\t\t\t\tsalePrice: mapLocalizedPrice(salePrice, localizedCurrencyCode),\n\t\t\t\t\tanchorPrice: anchorPrice ? mapLocalizedPrice(anchorPrice, localizedCurrencyCode) : undefined,\n\t\t\t\t\tanchorSavings: anchorSavings ? mapLocalizedPrice(anchorSavings, localizedCurrencyCode) : undefined,\n\t\t\t\t\tdiscountSavings: discountSavings ? mapLocalizedPrice(discountSavings, localizedCurrencyCode) : undefined,\n\t\t\t\t\tdiscounts: sku.price?.discounts ?? undefined,\n\t\t\t\t\tbreakdownTriggerLabel: sku.price?.breakdownTriggerLabel ?? undefined,\n\t\t\t\t\tbreakdownLines: mapBreakdownLines(sku.price?.breakdownLines, localizedCurrencyCode),\n\t\t\t\t\tanchorPriceLines: mapAnchorPriceLines(sku.price?.anchorPriceLines, localizedCurrencyCode),\n\t\t\t\t\tsavingsDescription: sku.price?.savingsDescription ?? undefined,\n\t\t\t\t}\n\t\t\t: undefined,\n\t\tsubscriptionInfo: sku.subscriptionInfo ?? undefined,\n\t\troutes: {},\n\t};\n}\n\nfunction mapBreakdownLines(\n\tbreakdownLines: SkuPriceBreakdownLine[] | null | undefined,\n\tlocalizedCurrencyCode: string | undefined\n): ProductPriceBreakdownLine[] | undefined {\n\tif (!breakdownLines || breakdownLines.length === 0) {\n\t\treturn undefined;\n\t}\n\n\treturn breakdownLines.map(line => ({\n\t\tlabel: line.label,\n\t\tamount: mapLocalizedPrice(line.amount, localizedCurrencyCode),\n\t\tisDeduction: line.isDeduction,\n\t\tdisplayInUsd: line.displayInUsd,\n\t\thref: line.href ?? undefined,\n\t}));\n}\n\nfunction mapLocalizedPrice(price: SkuPriceAmount, localizedCurrencyCode: string | undefined): ProductPriceAmount {\n\treturn {\n\t\tamount: price.amount,\n\t\tdisplayAmount: localizedCurrencyCode\n\t\t\t? (price.displayAmountByCurrency?.['USD'] ?? price.displayAmount)\n\t\t\t: price.displayAmount,\n\t\tdisplayAmountCurrencyCode: price.displayAmountCurrencyCode ?? undefined,\n\t\tlocalizedDisplayAmount: localizedCurrencyCode\n\t\t\t? price.displayAmountByCurrency?.[localizedCurrencyCode]\n\t\t\t: (price.localizedDisplayAmount ?? undefined),\n\t\tcurrencyCode: price.currencyCode,\n\t\tdisplayAmountByCurrency: price.displayAmountByCurrency ?? undefined,\n\t};\n}\n\nfunction mapAnchorPriceLines(\n\tanchorPriceLines:\n\t\t| { label: string; displayAmount?: string | null; displayAmountByCurrency?: Record<string, string> | null }[]\n\t\t| null\n\t\t| undefined,\n\tlocalizedCurrencyCode: string | undefined\n): AnchorPriceLine[] | undefined {\n\tif (!anchorPriceLines || anchorPriceLines.length === 0) {\n\t\treturn undefined;\n\t}\n\n\treturn anchorPriceLines.map(line => ({\n\t\tlabel: line.label,\n\t\tdisplayAmount:\n\t\t\t(localizedCurrencyCode ? (line.displayAmountByCurrency?.['USD'] ?? line.displayAmount) : line.displayAmount) ??\n\t\t\tundefined,\n\t\tlocalizedDisplayAmount: localizedCurrencyCode ? line.displayAmountByCurrency?.[localizedCurrencyCode] : undefined,\n\t}));\n}\n\nfunction mapSkuPricesToProductPricingData(\n\tproductId: string,\n\tskus: StaticSku[],\n\tlocalizedCurrencyCode: string | undefined,\n\tisPrepubProduct = false\n): ProductPricingData {\n\tconst skusRecord: Record<string, ProductPricingSkuData> = {};\n\tfor (const sku of skus) {\n\t\tskusRecord[sku.id] = mapSkuData(sku, localizedCurrencyCode);\n\t}\n\n\tconst primarySku = skus.length > 0 ? skusRecord[skus[0].id] : undefined;\n\n\treturn {\n\t\tproductId,\n\t\tisOwned: false,\n\t\thasPreorder: false,\n\t\tisPrepubProduct,\n\t\tisGeographicallyRestricted: false,\n\t\tisAcademicallyRestricted: false,\n\t\tuserCountryOrRegionIsTradeSanctioned: false,\n\t\tprimarySku,\n\t\tskus: skusRecord,\n\t};\n}\n\nexport interface ProductDetailsPageCoreProps {\n\tproduct: StaticProduct;\n\tskus: StaticSku[];\n\tpurchaseOptions: PurchaseOption[];\n\tdisplayTemplate?: DisplayTemplate | null;\n\tproductDetailsMetadata?: ProductDetailsMetadata | null;\n\tauthorBio?: AuthorBio | null;\n\tadzone?: SectionContentViewModel | null;\n\tpdpBanner?: SectionContentViewModel | null;\n\tuser: User;\n\tshowUserGreeting?: boolean;\n\tcontainingProductsUrl?: string | null;\n\tcontainingSubscriptionsUrl?: string | null;\n\tcustomersAlsoBoughtUrl?: string | null;\n\treviews?: ReviewsViewModel | null;\n\tfeaturedProductsUrl?: string | null;\n\tlogosOrVerbum?: string | null;\n\tlogosEditionLearnMoreVideoUrl?: string | null;\n}\n\nexport const ProductDetailsPageCore = ({\n\tproduct,\n\tskus,\n\tpurchaseOptions,\n\tdisplayTemplate,\n\tproductDetailsMetadata,\n\tauthorBio,\n\tadzone,\n\tuser,\n\tshowUserGreeting,\n\tcontainingProductsUrl,\n\tcontainingSubscriptionsUrl,\n\tcustomersAlsoBoughtUrl,\n\treviews,\n\tfeaturedProductsUrl,\n\tlogosOrVerbum,\n\tlogosEditionLearnMoreVideoUrl,\n\tpdpBanner,\n}: ProductDetailsPageCoreProps) => {\n\tconst resources = useLocalization('CommerceWeb.Resources.Product.Details');\n\n\tconst { selectedSku, purchaseQuantity, handleSelectedSkuChange, handlePurchaseQuantityChange } =\n\t\tuseSelectedSkuAndPurchaseQuantity(skus);\n\n\tconst skuIds = useMemo(() => skus.map(s => s.id), [skus]);\n\n\tconst { seeInsideIframeUrl } = useSeeInsideUrl(product.id, product.allowsSeeInside);\n\n\tconst { intersectionTargetRef: addToCartButtonRef, isStickyAddToCartVisible } = useStickyAddToCartHandler();\n\tconst pdpBannerSourceSystem = pdpBanner?.sourceSystem;\n\tconst shouldShowPdpBanner =\n\t\tpdpBannerSourceSystem === undefined ||\n\t\tpdpBannerSourceSystem === 'all' ||\n\t\tpdpBannerSourceSystem === product.sourceToken;\n\n\treturn (\n\t\t<>\n\t\t\t{shouldShowPdpBanner && <PdpBanner content={pdpBanner} />}\n\t\t\t<Breadcrumbs crumbs={[{ url: '/search', text: resources.Products }, { text: product.name }]} />\n\t\t\t<TimeSensitiveCalloutBlock html={displayTemplate?.content?.TimeSensitiveCallOut?.content} />\n\t\t\t<div className=\"tw-preflight relative mx-auto mb-11 flex w-full max-w-[1440px] flex-col lg:grid lg:grid-cols-2 lg:gap-8 xl:gap-15\">\n\t\t\t\t<BusinessDeskEditLink productId={product.id} />\n\t\t\t\t<div className=\"order-2 mx-4 mt-4 md:mt-0 md:mb-4 lg:order-1 lg:mb-0 lg:ml-6 lg:mr-0\">\n\t\t\t\t\t<LeftColumn\n\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum ?? 'Logos'}\n\t\t\t\t\t\tlogosEditionLearnMoreVideoUrl={logosEditionLearnMoreVideoUrl}\n\t\t\t\t\t\tselectedSku={selectedSku}\n\t\t\t\t\t\tseeInsideIframeUrl={seeInsideIframeUrl}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"order-1 mx-4 mb-4 md:mb-6 lg:order-2 lg:mb-0 lg:ml-0 lg:mr-sp24\">\n\t\t\t\t\t<Details\n\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\tskus={skus}\n\t\t\t\t\t\tpurchaseOptions={purchaseOptions}\n\t\t\t\t\t\tselectedSku={selectedSku}\n\t\t\t\t\t\tpurchaseQuantity={purchaseQuantity}\n\t\t\t\t\t\tonSelectedSkuChange={handleSelectedSkuChange}\n\t\t\t\t\t\tonPurchaseQuantityChange={handlePurchaseQuantityChange}\n\t\t\t\t\t\tlogosOrVerbum={logosOrVerbum ?? 'Logos'}\n\t\t\t\t\t\tlogosEditionLearnMoreVideoUrl={logosEditionLearnMoreVideoUrl}\n\t\t\t\t\t\tseeInsideIframeUrl={seeInsideIframeUrl}\n\t\t\t\t\t\taddToCartButtonRef={addToCartButtonRef}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{showUserGreeting && user.displayName && (\n\t\t\t\t\t<div className=\"lg:col-span-2 order-3 empty:hidden\">\n\t\t\t\t\t\t<LibraryGreeting productId={product.id} productName={product.name} userName={user.displayName} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{containingProductsUrl && (\n\t\t\t\t\t<div className=\"lg:col-span-2 order-3 empty:hidden\">\n\t\t\t\t\t\t<BuyInCollection containingProductsUrl={containingProductsUrl} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{containingSubscriptionsUrl && (\n\t\t\t\t\t<div className=\"lg:col-span-2 order-3 empty:hidden\">\n\t\t\t\t\t\t<ContainingSubscriptions containingSubscriptionsUrl={containingSubscriptionsUrl} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{featuredProductsUrl && (\n\t\t\t\t\t<div className=\"lg:col-span-2 order-3 empty:hidden\">\n\t\t\t\t\t\t<FeaturedProductsSection featuredProductsUrl={featuredProductsUrl} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<section className=\"order-4 flex flex-col gap-sp16 lg:gap-sp32 lg:col-span-2 lg:flex-col-reverse max-lg:mt-sp24 empty:hidden\">\n\t\t\t\t\t{adzone && (\n\t\t\t\t\t\t<div className=\"min-[990px]:max-lg:mx-sp16 lg:mx-sp24\">\n\t\t\t\t\t\t\t<AdzoneBlock adzone={adzone} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{displayTemplate && (\n\t\t\t\t\t\t<ProductContentSections\n\t\t\t\t\t\t\tdisplayTemplate={displayTemplate}\n\t\t\t\t\t\t\tproductId={product.id}\n\t\t\t\t\t\t\tproductDetailsMetadata={productDetailsMetadata}\n\t\t\t\t\t\t\tauthorBio={authorBio}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{(!!adzone || !!displayTemplate) && <hr className=\"hidden lg:block border-gray lg:mx-sp24\" />}\n\t\t\t\t</section>\n\t\t\t\t{customersAlsoBoughtUrl && skus.length > 0 && (\n\t\t\t\t\t<div className=\"lg:col-span-2 order-5 empty:hidden\">\n\t\t\t\t\t\t<CustomersAlsoBought customersAlsoBoughtUrl={customersAlsoBoughtUrl} skuIds={skuIds} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{/* Reviews section: loaded entirely client-side after page render */}\n\t\t\t<div className=\"mx-auto max-w-[1440px] p-sp16 lg:p-sp24\">{reviews && <Reviews reviews={reviews} />}</div>\n\n\t\t\t<StickyAddToCart\n\t\t\t\tid=\"pdp-sticky-add-to-cart-banner\"\n\t\t\t\tisVisible={isStickyAddToCartVisible}\n\t\t\t\tproduct={product}\n\t\t\t\tselectedSku={selectedSku}\n\t\t\t\tpurchaseQuantity={purchaseQuantity}\n\t\t\t/>\n\t\t</>\n\t);\n};\n\ninterface ProductDetailsPageProps {\n\tproduct: StaticProduct;\n\tskus: StaticSku[];\n\tpurchaseOptions: PurchaseOption[];\n\talgoliaEventsTrackingSettings: Omit<EventsTrackingContextProviderProps, 'children' | 'queryId'>;\n\tqueryId?: string | null;\n\tdisplayTemplate?: DisplayTemplate | null;\n\tproductDetailsMetadata?: ProductDetailsMetadata | null;\n\tauthorBio?: AuthorBio | null;\n\tadzone?: SectionContentViewModel | null;\n\tpdpBanner?: SectionContentViewModel | null;\n\tuser: User;\n\tshowUserGreeting?: boolean;\n\tcontainingProductsUrl?: string | null;\n\tcontainingSubscriptionsUrl?: string | null;\n\tcustomersAlsoBoughtUrl?: string | null;\n\treviews?: ReviewsViewModel | null;\n\tfeaturedProductsUrl?: string | null;\n\tlogosOrVerbum?: string | null;\n\tlogosEditionLearnMoreVideoUrl?: string | null;\n}\n\nconst ProductDetailsPage = (props: ProductDetailsPageProps) => {\n\tconst { data: currentUser } = useCurrentUser();\n\tconst { preferredCurrency } = currentUser;\n\n\t// On SSR, preferredCurrency defaults to 'USD' (no localized prices yet).\n\t// Once the client mounts and useCurrentUser resolves, the localized currency\n\t// code is used to populate localizedDisplayAmount from pricesByCurrency.\n\tconst localizedCurrencyCode = preferredCurrency !== 'USD' ? preferredCurrency : undefined;\n\n\tconst initialPricingData = useMemo(\n\t\t() => [\n\t\t\tmapSkuPricesToProductPricingData(\n\t\t\t\tprops.product.id,\n\t\t\t\tprops.skus,\n\t\t\t\tlocalizedCurrencyCode,\n\t\t\t\tprops.product.isPrepubProduct\n\t\t\t),\n\t\t],\n\t\t[props.product.id, props.product.isPrepubProduct, props.skus, localizedCurrencyCode]\n\t);\n\n\treturn (\n\t\t<EventsTrackingContextProvider {...props.algoliaEventsTrackingSettings} queryId={props.queryId}>\n\t\t\t<PerUserDataContextProvider initialPricingData={initialPricingData} requestAnonymousPricing>\n\t\t\t\t<BuilderComponentsContextProvider staticProductData={[]}>\n\t\t\t\t\t<ProductDetailsPageCore {...props} />\n\t\t\t\t</BuilderComponentsContextProvider>\n\t\t\t</PerUserDataContextProvider>\n\t\t</EventsTrackingContextProvider>\n\t);\n};\n\nexport default ProductDetailsPage;\n","import { useEffect, useState } from 'react';\n\ninterface SeeInsideResponse {\n\tseeInsideIframeUrl: string | null;\n}\n\nasync function fetchSeeInsideUrl(productId: string): Promise<string | null> {\n\ttry {\n\t\tconst response = await fetch(`/api/product/${encodeURIComponent(productId)}/seeinside`);\n\t\tif (!response.ok) {\n\t\t\treturn null;\n\t\t}\n\t\tconst data: SeeInsideResponse = await response.json();\n\t\treturn data.seeInsideIframeUrl ?? null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function useSeeInsideUrl(\n\tproductId?: string,\n\tenabled = true\n): {\n\tseeInsideIframeUrl: string | null;\n\tisLoading: boolean;\n} {\n\tconst [seeInsideIframeUrl, setSeeInsideIframeUrl] = useState<string | null>(null);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!productId || !enabled) {\n\t\t\tsetSeeInsideIframeUrl(null);\n\t\t\tsetIsLoading(false);\n\t\t\treturn;\n\t\t}\n\n\t\tlet cancelled = false;\n\t\tsetIsLoading(true);\n\n\t\tfetchSeeInsideUrl(productId).then(url => {\n\t\t\tif (!cancelled) {\n\t\t\t\tsetSeeInsideIframeUrl(url);\n\t\t\t\tsetIsLoading(false);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t};\n\t}, [productId, enabled]);\n\n\treturn { seeInsideIframeUrl, isLoading };\n}\n","import { useCallback, useEffect, useState } from 'react';\n\n/**\n * Sticky bottom bar behavior:\n * - Show the sticky add-to-cart bar when the main add-to-cart button is not visible in the viewport.\n */\nexport const useStickyAddToCartHandler = () => {\n\tconst [isStickyAddToCartVisible, setIsStickyAddToCartVisible] = useState(false);\n\tconst [intersectionTarget, setIntersectionTarget] = useState<HTMLElement | null>(null);\n\n\tconst intersectionTargetRef: React.Ref<HTMLElement> = useCallback((element: HTMLElement | null) => {\n\t\tsetIntersectionTarget(element);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!intersectionTarget) {\n\t\t\tsetIsStickyAddToCartVisible(false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst intersectionObserverCallback = (entries: IntersectionObserverEntry[]) => {\n\t\t\tconst entry = entries[0];\n\t\t\tif (entry.isIntersecting) {\n\t\t\t\tsetIsStickyAddToCartVisible(false);\n\t\t\t} else {\n\t\t\t\tsetIsStickyAddToCartVisible(true);\n\t\t\t}\n\t\t};\n\n\t\tconst observerOptions = {\n\t\t\troot: null,\n\t\t\trootMargin: '0px',\n\t\t\tthreshold: 0.33,\n\t\t};\n\t\tconst observer = new IntersectionObserver(intersectionObserverCallback, observerOptions);\n\t\tobserver.observe(intersectionTarget);\n\t\treturn () => observer.disconnect();\n\t}, [intersectionTarget]);\n\n\treturn { intersectionTargetRef, isStickyAddToCartVisible };\n};\n","import { useLocalization } from '../../localization';\n\nconst priceFormatGettersByBillingMode = {\n\tMonthly: {\n\t\tgetLocalizedPriceFormat: resources => `(${resources.MonthlyPriceFormat})`,\n\t\tgetPriceFormat: resources => resources.MonthlyPriceFormat,\n\t},\n\tAnnually: {\n\t\tgetLocalizedPriceFormat: resources => `(${resources.AnnualPriceFormat})`,\n\t\tgetPriceFormat: resources => resources.MonthlyPriceFormat,\n\t},\n};\n\nconst freeTrialPeriodUnitTextGettersByUnit = {\n\tday: (freeTrialPeriodLength, resources) =>\n\t\tfreeTrialPeriodLength === 1 ? resources.DayPeriodUnit : resources.DaysPeriodUnit,\n\tmonth: (freeTrialPeriodLength, resources) =>\n\t\tfreeTrialPeriodLength === 1 ? resources.MonthPeriodUnit : resources.MonthsPeriodUnit,\n\tyear: (freeTrialPeriodLength, resources) =>\n\t\tfreeTrialPeriodLength === 1 ? resources.YearPeriodUnit : resources.YearsPeriodUnit,\n};\n\nconst useResourceFormatsAndTexts = ({\n\tlocale,\n\tbillingMode,\n\tfreeTrialPeriodUnit,\n\tfreeTrialPeriodLength,\n\tavailableLogosTieredSubscriptionLevels,\n\tsubscriptionResources: customSubscriptionResources,\n}) => {\n\tconst defaultSubscriptionResources = useLocalization('CommerceWeb.Resources.Product.ContainingSubscriptions');\n\tconst subscriptionResources = customSubscriptionResources ?? {\n\t\tDayPeriodUnit: defaultSubscriptionResources.DayPeriodUnit,\n\t\tDaysPeriodUnit: defaultSubscriptionResources.DaysPeriodUnit,\n\t\tMonthPeriodUnit: defaultSubscriptionResources.MonthPeriodUnit,\n\t\tMonthsPeriodUnit: defaultSubscriptionResources.MonthsPeriodUnit,\n\t\tYearPeriodUnit: defaultSubscriptionResources.YearPeriodUnit,\n\t\tYearsPeriodUnit: defaultSubscriptionResources.YearsPeriodUnit,\n\t\tPremiumLevel: defaultSubscriptionResources.PremiumLevel,\n\t\tProLevel: defaultSubscriptionResources.ProLevel,\n\t\tMaxLevel: defaultSubscriptionResources.MaxLevel,\n\t\tSubscription: defaultSubscriptionResources.Subscription,\n\t\tSubscriptions: defaultSubscriptionResources.Subscriptions,\n\t};\n\tconst { AnnualPriceFormat, MonthlyPriceFormat } = useLocalization(\n\t\t'CommerceWeb.Resources.Configure.SubscriptionPlans'\n\t);\n\tconst subscriptionPlansResources = { AnnualPriceFormat, MonthlyPriceFormat };\n\n\tif (!subscriptionResources || !subscriptionPlansResources) {\n\t\treturn null;\n\t}\n\n\tconst { getLocalizedPriceFormat, getPriceFormat } = priceFormatGettersByBillingMode[billingMode];\n\tconst getFreeTrialPeriodUnitText = freeTrialPeriodUnitTextGettersByUnit[freeTrialPeriodUnit?.toLowerCase()];\n\n\tconst availableSubscriptionLevelsFormatter = new Intl.ListFormat(locale, { style: 'long', type: 'conjunction' });\n\n\treturn {\n\t\tlocalizedPriceFormat: getLocalizedPriceFormat(subscriptionPlansResources),\n\t\tpriceFormat: getPriceFormat(subscriptionPlansResources),\n\t\tfreeTrialPeriodUnitText: getFreeTrialPeriodUnitText?.(freeTrialPeriodLength, subscriptionResources),\n\t\tlocalizedAvailableSubscriptionLevelListText: availableSubscriptionLevelsFormatter.format(\n\t\t\tavailableLogosTieredSubscriptionLevels?.map(level => subscriptionResources[`${level}Level`])\n\t\t),\n\t\tsubscriptionsText:\n\t\t\tavailableLogosTieredSubscriptionLevels?.length > 1\n\t\t\t\t? subscriptionResources.Subscriptions\n\t\t\t\t: subscriptionResources.Subscription,\n\t};\n};\n\nexport default useResourceFormatsAndTexts;\n","import React, { useEffect, useMemo, useRef } from 'react';\nimport Async from 'react-select/async';\nimport AsyncCreatable from 'react-select/async-creatable';\nimport debounce from 'lodash.debounce';\n\nfunction createDebouncedLoadOptions(optionsRef, debounceInterval) {\n\tlet pendingRequest;\n\tlet generation = 0;\n\tlet hasInputChanged = false;\n\n\tconst invokeLoadOptions = request => {\n\t\tif (pendingRequest !== request) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet hasCalledBack = false;\n\t\tconst handleOptions = options => {\n\t\t\t// Late default options are still needed when the user clears a newer query.\n\t\t\tif (\n\t\t\t\trequest.generation !== generation ||\n\t\t\t\thasCalledBack ||\n\t\t\t\t(pendingRequest !== request && !request.isDefault)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\thasCalledBack = true;\n\t\t\tif (pendingRequest === request) {\n\t\t\t\tpendingRequest = undefined;\n\t\t\t}\n\t\t\trequest.callback(options);\n\t\t};\n\t\tconst handleError = error => {\n\t\t\tif (request.generation !== generation || pendingRequest !== request || hasCalledBack) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tif (optionsRef.current.onLoadError) {\n\t\t\t\t\toptionsRef.current.onLoadError(error, request.inputValue);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(error);\n\t\t\t\t}\n\t\t\t} catch (reportingError) {\n\t\t\t\tconsole.error(error);\n\t\t\t\tconsole.error(reportingError);\n\t\t\t} finally {\n\t\t\t\thandleOptions();\n\t\t\t}\n\t\t};\n\n\t\ttry {\n\t\t\tconst result = optionsRef.current.loadOptions(request.inputValue, handleOptions);\n\t\t\tif (result && typeof result.then === 'function') {\n\t\t\t\tresult.then(handleOptions, handleError);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\thandleError(error);\n\t\t}\n\t};\n\n\tconst debouncedInvokeLoadOptions = debounce(invokeLoadOptions, debounceInterval);\n\tconst debouncedLoadOptions = (inputValue, callback) => {\n\t\tpendingRequest = {\n\t\t\tinputValue,\n\t\t\tcallback,\n\t\t\tgeneration,\n\t\t\tisDefault: !hasInputChanged && optionsRef.current.defaultOptions === true,\n\t\t};\n\t\tif (debounceInterval) {\n\t\t\tdebouncedInvokeLoadOptions(pendingRequest);\n\t\t} else {\n\t\t\tinvokeLoadOptions(pendingRequest);\n\t\t}\n\t};\n\n\tdebouncedLoadOptions.cancel = settlePending => {\n\t\tgeneration++;\n\t\tdebouncedInvokeLoadOptions.cancel();\n\t\tconst request = pendingRequest;\n\t\tpendingRequest = undefined;\n\t\tif (settlePending && request) {\n\t\t\trequest.callback();\n\t\t}\n\t};\n\tdebouncedLoadOptions.invalidate = () => {\n\t\thasInputChanged = true;\n\t\tdebouncedInvokeLoadOptions.cancel();\n\t\tpendingRequest = undefined;\n\t};\n\n\treturn debouncedLoadOptions;\n}\n\nfunction makeDebouncedSelect(Component) {\n\treturn React.forwardRef(\n\t\t({ debounceInterval, loadOptions, onLoadError, onInputChange, ...props }, ref) => {\n\t\t\tconst optionsRef = useRef();\n\t\t\toptionsRef.current = { loadOptions, onLoadError, defaultOptions: props.defaultOptions };\n\t\t\tconst hasLoadOptions = Boolean(loadOptions);\n\t\t\tconst debouncedLoadOptions = useMemo(\n\t\t\t\t() =>\n\t\t\t\t\thasLoadOptions ? createDebouncedLoadOptions(optionsRef, debounceInterval) : undefined,\n\t\t\t\t[debounceInterval, hasLoadOptions],\n\t\t\t);\n\t\t\tconst isMounted = useRef(false);\n\n\t\t\tuseEffect(() => {\n\t\t\t\tisMounted.current = true;\n\t\t\t\treturn () => {\n\t\t\t\t\tisMounted.current = false;\n\t\t\t\t};\n\t\t\t}, []);\n\n\t\t\tuseEffect(\n\t\t\t\t() => () => {\n\t\t\t\t\tif (debouncedLoadOptions) {\n\t\t\t\t\t\tdebouncedLoadOptions.cancel(isMounted.current);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t[debouncedLoadOptions],\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<Component\n\t\t\t\t\t{...props}\n\t\t\t\t\tonInputChange={(inputValue, meta) => {\n\t\t\t\t\t\tif (debouncedLoadOptions) {\n\t\t\t\t\t\t\tdebouncedLoadOptions.invalidate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn onInputChange && onInputChange(inputValue, meta);\n\t\t\t\t\t}}\n\t\t\t\t\tloadOptions={debouncedLoadOptions}\n\t\t\t\t\tref={ref}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t);\n}\n\nexport const DebouncedSelectAsync = makeDebouncedSelect(Async);\nexport const DebouncedSelectAsyncCreatable = makeDebouncedSelect(AsyncCreatable);\n","import { useState } from 'react';\n\nconst EMPTY_FUNCTION = () => {};\n\n/**\n * For situations when a value can be controlled externally via props, but if it isn't controlled\n * you'd like to control it internally via state.\n * @param {any} controlledValue - The prop that can externally control the value when defined.\n * @param {any} defaultValue - An optional default value to initialize the state with when the value\n * is not externally controlled.\n * @returns {[value: any, trySetValue: (newValue?: any) => void]} An array of the state value and\n * either a setter function or (if the value is externally controlled) an empty function.\n */\nexport function useOptionallyControlledState(controlledValue, defaultValue) {\n\tconst [value, setValue] = useState(defaultValue);\n\n\tif (controlledValue !== undefined) {\n\t\treturn [controlledValue, EMPTY_FUNCTION];\n\t} else {\n\t\treturn [value, setValue];\n\t}\n}\n","import styled from 'styled-components';\nimport { components as reactSelectComponents } from 'react-select';\n\nexport const AvatarOption = styled(reactSelectComponents.Option)`\n\t&& {\n\t\talign-items: center;\n\t\tdisplay: flex;\n\t\tpadding: ${props => props.styled.space[3]};\n\t}\n`;\n\nexport const AvatarOptionImage = styled.img`\n\tborder-radius: 10%;\n\theight: 40px;\n\twidth: 40px;\n\tmax-width: 40px;\n\tobject-fit: cover;\n`;\n\nexport const AvatarOptionCheckbox = styled.div`\n\tpadding-right: ${props => props.theme.space[3]};\n`;\n\nexport const AvatarOptionText = styled.div`\n\tpadding: ${props => props.theme.space[3]};\n`;\n\nexport const AvatarOptionName = styled.div`\n\tcolor: ${props => props.theme.colors.gray66};\n\tfont-size: ${props => props.theme.fontSizes[3]};\n\tfont-weight: ${props => props.theme.fontWeights.bold};\n`;\n\nexport const AvatarOptionSecondaryLabel = styled.div`\n\tcolor: ${props => props.theme.colors.gray52};\n\tfont-size: ${props => props.theme.fontSizes[2]};\n`;\n\nexport const AvatarMultiValue = styled(reactSelectComponents.MultiValue)`\n\talign-items: center;\n\tdisplay: flex;\n\tmin-height: 26px;\n`;\n\nexport const AvatarMultiValueImage = styled.img`\n\tborder-radius: 10%;\n\theight: 18px;\n\twidth: 18px;\n\tmax-width: 18px;\n\tobject-fit: cover;\n`;\n\nexport const AvatarMultiValueName = styled.span`\n\tpadding-left: ${props => props.theme.fontSizes[2]};\n`;\n","import React, { useState, useEffect } from 'react';\nimport * as reactSelect from 'react-select';\nimport ReactSelectCreatable from 'react-select/creatable';\nimport { colors } from '../shared-styles';\nimport { ChevronDown } from '../icons/12px';\nimport { Checkbox } from '../../components/check-box';\nimport { DebouncedSelectAsync, DebouncedSelectAsyncCreatable } from './debounced-async';\nimport { useClearableSelectValue } from './use-clearable-select-value';\nimport * as Styled from './styled';\nimport { ThemedBox } from '../ThemedBox';\nimport { useTheme } from '../../theme';\n\nconst {\n\tdefault: ReactSelect,\n\tcomponents: reactSelectComponents,\n\t...reactSelectFunctions\n} = reactSelect;\n\nconst selectStyles = (props, theme) => {\n\tconst ourStyles = {\n\t\tcontrol: (styles, state) => ({\n\t\t\t...styles,\n\t\t\tminHeight: '32px',\n\t\t\tfontSize: '16px',\n\t\t\tbackgroundColor: state.isDisabled\n\t\t\t\t? theme.colors.input.backgroundDisabled\n\t\t\t\t: theme.colors.input.background,\n\t\t\tcolor: theme.colors.input.foreground,\n\t\t\tborder: state.isFocused\n\t\t\t\t? `1px solid ${theme.colors.input.borderFocused}`\n\t\t\t\t: `1px solid ${theme.colors.input.border}`,\n\t\t\tborderRadius: theme.radii[1],\n\t\t\tboxShadow: state.isFocused ? `0 0 0 2px ${theme.colors.input.shadowFocused}` : 'none',\n\t\t\t'&:hover': {\n\t\t\t\tborderColor: state.isFocused ? theme.colors.input.borderFocused : theme.colors.input.border,\n\t\t\t},\n\t\t}),\n\t\tvalueContainer: styles => ({\n\t\t\t...styles,\n\t\t\tpadding: '0 6px',\n\t\t\tinput: {\n\t\t\t\tfontFamily: 'inherit',\n\t\t\t},\n\t\t}),\n\t\tinput: styles => ({\n\t\t\t...styles,\n\t\t\tlineHeight: 1,\n\t\t\tinput: {\n\t\t\t\t'&,&:focus': {\n\t\t\t\t\tboxShadow: 'none',\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t\tindicatorSeparator: () => ({\n\t\t\tdisplay: 'none',\n\t\t}),\n\t\tclearIndicator: () => ({\n\t\t\tdisplay: 'none',\n\t\t}),\n\t\tdropdownIndicator: styles => ({\n\t\t\t...styles,\n\t\t\tcolor: theme.colors.input.icon,\n\t\t\tpadding: '5px 8px',\n\t\t}),\n\t\tplaceholder: styles => ({\n\t\t\t...styles,\n\t\t\tlineHeight: 1,\n\t\t\twhiteSpace: 'nowrap',\n\t\t\tcolor: theme.colors.input.placeholderForeground,\n\t\t}),\n\t\tsingleValue: (styles, state) => ({\n\t\t\t...styles,\n\t\t\tcolor: state.isDisabled\n\t\t\t\t? theme.colors.input.foregroundDisabled\n\t\t\t\t: props.inferred\n\t\t\t\t? '#006099'\n\t\t\t\t: theme.colors.input.foreground,\n\t\t}),\n\t\tmultiValue: styles => ({\n\t\t\t...styles,\n\t\t\tbackgroundColor: colors.gray4,\n\t\t}),\n\t\tmultiValueLabel: styles => ({\n\t\t\t...styles,\n\t\t\tcolor: theme.colors.input.foreground,\n\t\t}),\n\t\tmultiValueRemove: styles => ({\n\t\t\t...styles,\n\t\t\tcolor: colors.gray52,\n\t\t\t':hover': {\n\t\t\t\tbackgroundColor: '',\n\t\t\t\tcolor: colors.blueDark,\n\t\t\t},\n\t\t}),\n\t\tmenuPortal: styles => ({\n\t\t\t...styles,\n\t\t\tzIndex: 1100,\n\t\t}),\n\t\tmenu: styles => ({\n\t\t\t...styles,\n\t\t\tmarginTop: 0,\n\t\t\tboxShadow: theme.shadows[1],\n\t\t\tbackgroundColor: theme.colors.select.menuBackground,\n\t\t\tcolor: theme.colors.select.menuForeground,\n\t\t}),\n\t\toption: (styles, state) => ({\n\t\t\t...styles,\n\t\t\tbackgroundColor: state.isFocused\n\t\t\t\t? theme.colors.select.menuItemFocusedBackground\n\t\t\t\t: theme.colors.select.menuBackground,\n\t\t\tcolor: theme.colors.select.menuForeground,\n\t\t}),\n\t};\n\n\tconst customStyles = props.styles;\n\tif (!customStyles) {\n\t\treturn ourStyles;\n\t}\n\n\tconst ourWrappedStyles = Object.entries(ourStyles).reduce(\n\t\t(acc, [key, value]) => ({\n\t\t\t...acc,\n\t\t\t[key]: (styles, state) => {\n\t\t\t\tconst ourStyle = value(styles, state);\n\t\t\t\tif (props.styles[key]) {\n\t\t\t\t\t// pass the resulting style object from our style functions to the custom style functions\n\t\t\t\t\treturn props.styles[key](ourStyle, state);\n\t\t\t\t}\n\n\t\t\t\treturn ourStyle;\n\t\t\t},\n\t\t}),\n\t\t{},\n\t);\n\n\treturn { ...customStyles, ...ourWrappedStyles };\n};\n\nconst selectTheme = theme => ({\n\t...theme,\n\tcolors: {\n\t\t...theme.colors,\n\t\tprimary: colors.blueBase,\n\t\tprimary25: colors.gray8,\n\t\tprimary50: colors.gray8,\n\t\tprimary75: colors.gray8,\n\t\tdanger: colors.redBase,\n\t\tdangerLight: colors.redLight,\n\t},\n});\n\nconst defaultComponents = {\n\t// eslint-disable-next-line react/prop-types\n\tOption: ({ children, ...props }) => (\n\t\t<reactSelectComponents.Option {...props}>{children || '\\u200B'}</reactSelectComponents.Option>\n\t),\n\n\tDropdownIndicator: props => (\n\t\t<reactSelectComponents.DropdownIndicator {...props}>\n\t\t\t<ChevronDown color=\"currentColor\" />\n\t\t</reactSelectComponents.DropdownIndicator>\n\t),\n\n\tMenu: props => (\n\t\t<ThemedBox>\n\t\t\t<reactSelectComponents.Menu {...props} />\n\t\t</ThemedBox>\n\t),\n};\n\nconst AvatarOption = ({ data, selectProps: { showCheckboxes, getIsOptionChecked }, ...props }) => {\n\tconst theme = useTheme();\n\tconst { avatar, label, secondaryLabel } = data;\n\n\t// Using styled instead of theme for theme prop since react-select already uses a prop named theme and there is a collision.\n\treturn (\n\t\t<Styled.AvatarOption {...props} styled={theme}>\n\t\t\t{avatar ? (\n\t\t\t\t<>\n\t\t\t\t\t{!showCheckboxes ? null : (\n\t\t\t\t\t\t<Styled.AvatarOptionCheckbox theme={theme}>\n\t\t\t\t\t\t\t<Checkbox onClick={() => {}} isChecked={getIsOptionChecked(data)} disableAutoBlur />\n\t\t\t\t\t\t</Styled.AvatarOptionCheckbox>\n\t\t\t\t\t)}\n\t\t\t\t\t<Styled.AvatarOptionImage src={avatar} alt={label} />\n\t\t\t\t\t<Styled.AvatarOptionText theme={theme}>\n\t\t\t\t\t\t<Styled.AvatarOptionName theme={theme}>{label}</Styled.AvatarOptionName>\n\t\t\t\t\t\t{secondaryLabel && (\n\t\t\t\t\t\t\t<Styled.AvatarOptionSecondaryLabel theme={theme}>\n\t\t\t\t\t\t\t\t{secondaryLabel}\n\t\t\t\t\t\t\t</Styled.AvatarOptionSecondaryLabel>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Styled.AvatarOptionText>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t)}\n\t\t</Styled.AvatarOption>\n\t);\n};\n\nconst AvatarMultiValue = ({ data: { avatar, label }, ...props }) => {\n\tconst theme = useTheme();\n\n\treturn (\n\t\t<Styled.AvatarMultiValue {...props}>\n\t\t\t{avatar ? (\n\t\t\t\t<>\n\t\t\t\t\t<Styled.AvatarMultiValueImage src={avatar} alt={label} />\n\t\t\t\t\t<Styled.AvatarMultiValueName theme={theme}>{label}</Styled.AvatarMultiValueName>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t)}\n\t\t</Styled.AvatarMultiValue>\n\t);\n};\n\nexport const avatarComponents = {\n\t...defaultComponents,\n\tOption: AvatarOption,\n\tMultiValue: AvatarMultiValue,\n};\n\nfunction noOptionsMessage({ inputValue }) {\n\treturn inputValue ? 'No options' : null;\n}\n\nfunction handleKeyDown(e, onConsumerKeyDown) {\n\tconst { nodeName, type, value } = e.target;\n\tif (onConsumerKeyDown) {\n\t\tonConsumerKeyDown(e);\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (nodeName.toLowerCase() === 'input' && type.toLowerCase() === 'text') {\n\t\tconst selectionIndex = e.key === 'Home' ? 0 : e.key === 'End' ? value.length : null;\n\n\t\tif (selectionIndex !== null) {\n\t\t\tif (e.shiftKey) {\n\t\t\t\tif (e.key === 'Home') {\n\t\t\t\t\te.target.selectionStart = selectionIndex;\n\t\t\t\t} else {\n\t\t\t\t\te.target.selectionEnd = selectionIndex;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\te.target.setSelectionRange(selectionIndex, selectionIndex);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { reactSelectFunctions, reactSelectComponents };\n\n/** Autocomplete control based on react-select */\nexport const Select = React.forwardRef((props, ref) => {\n\tconst transformedProps = useCommonSelectProps(props, ref);\n\treturn <ReactSelect {...transformedProps} />;\n});\n\n/** The same as `Select`, but allows new entries. */\nexport const CreatableSelect = React.forwardRef((props, ref) => {\n\tconst transformedProps = useCommonSelectProps(props, ref);\n\treturn (\n\t\t<ReactSelectCreatable\n\t\t\tformatCreateLabel={node => <span>New entry: {node}</span>}\n\t\t\t{...transformedProps}\n\t\t/>\n\t);\n});\n\n/** The same as `Select`, but allows new entries and fetches data asynchronously. */\nexport const AsyncCreatableSelect = React.forwardRef((props, ref) => {\n\tconst transformedProps = useCommonSelectProps(props, ref);\n\treturn (\n\t\t<DebouncedSelectAsyncCreatable\n\t\t\tallowCreateWhileLoading={false}\n\t\t\tformatCreateLabel={node => <span>New entry: {node}</span>}\n\t\t\t{...transformedProps}\n\t\t/>\n\t);\n});\n\n/** The same as `Select`, but fetches options asynchronously. */\nexport const AsyncSelect = React.forwardRef((props, ref) => {\n\tconst transformedProps = useCommonSelectProps(props, ref);\n\treturn <DebouncedSelectAsync {...transformedProps} />;\n});\n\nexport function useCommonSelectProps(props, ref) {\n\tconst {\n\t\tcomponents,\n\t\tdisabled,\n\t\tisDisabled,\n\t\tstyles,\n\t\tonKeyDown,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonChange,\n\t\tinputValue,\n\t\tdefaultInputValue,\n\t\tonInputChange,\n\t\tisClearable,\n\t\tisMulti,\n\t\t...otherProps\n\t} = props;\n\n\tconst body = useBody();\n\tconst theme = useTheme();\n\tconst {\n\t\tinnerValue,\n\t\tinnerOnChange,\n\t\tinnerInputValue,\n\t\tinnerOnInputChange,\n\t} = useClearableSelectValue({\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonChange,\n\t\tinputValue,\n\t\tdefaultInputValue,\n\t\tonInputChange,\n\t\tisClearable,\n\t\tisMulti,\n\t});\n\n\treturn {\n\t\tref: ref,\n\t\tclassNamePrefix: 'fl-select',\n\t\ttheme: selectTheme,\n\t\tcomponents: { ...defaultComponents, ...components },\n\t\tnoOptionsMessage: noOptionsMessage,\n\t\tmenuPortalTarget: body,\n\t\tisDisabled: disabled || isDisabled,\n\t\tstyles: selectStyles(props, theme),\n\t\tonKeyDown: e => handleKeyDown(e, onKeyDown),\n\t\tvalue: innerValue,\n\t\tonChange: innerOnChange,\n\t\tinputValue: innerInputValue,\n\t\tonInputChange: innerOnInputChange,\n\t\tisClearable: isClearable,\n\t\tisMulti: isMulti,\n\t\t...otherProps,\n\t};\n}\n\nfunction useBody() {\n\tconst [body, setBody] = useState(null);\n\tuseEffect(() => {\n\t\tsetBody((window && window.document.body) || null);\n\t}, []);\n\n\treturn body;\n}\n","import { useCallback } from 'react';\nimport { useOptionallyControlledState } from '../utils/use-optionally-controlled-state';\n\n/**\n * A React Select workaround to clear the `Select` value when the user is typing into the `Select`'s\n * input (as long as the `Select` is only for a single value and is clearable).\n */\nexport function useClearableSelectValue({\n\tvalue: controlledSelectValue,\n\tdefaultValue: defaultSelectValue,\n\tonChange: onSelectChange,\n\tinputValue: controlledInputValue,\n\tdefaultInputValue,\n\tonInputChange,\n\tisClearable,\n\tisMulti,\n}) {\n\tconst [selectValue, trySetSelectValue] = useOptionallyControlledState(\n\t\tcontrolledSelectValue,\n\t\tdefaultSelectValue,\n\t);\n\tconst [inputValue, trySetInputValue] = useOptionallyControlledState(\n\t\tcontrolledInputValue,\n\t\tdefaultInputValue,\n\t);\n\n\tconst innerOnSelectChange = useCallback(\n\t\t(newSelectValue, meta) => {\n\t\t\tconst nextSelectValue =\n\t\t\t\tisMulti && Array.isArray(newSelectValue) && newSelectValue.length === 0\n\t\t\t\t\t? null\n\t\t\t\t\t: newSelectValue;\n\t\t\ttrySetSelectValue(nextSelectValue);\n\t\t\tif (onSelectChange) {\n\t\t\t\tonSelectChange(nextSelectValue, meta);\n\t\t\t}\n\t\t},\n\t\t[isMulti, onSelectChange, trySetSelectValue],\n\t);\n\tconst innerOnInputChange = useCallback(\n\t\t(newInputValue, meta) => {\n\t\t\tconst userIsTyping = meta.action === 'input-change';\n\t\t\tif (isClearable && !isMulti && userIsTyping) {\n\t\t\t\tinnerOnSelectChange(null, { action: 'set-value' });\n\t\t\t}\n\n\t\t\ttrySetInputValue(newInputValue);\n\t\t\tif (onInputChange) {\n\t\t\t\tonInputChange(newInputValue, meta);\n\t\t\t}\n\t\t},\n\t\t[innerOnSelectChange, isClearable, isMulti, onInputChange, trySetInputValue],\n\t);\n\n\treturn {\n\t\tinnerValue: selectValue,\n\t\tinnerOnChange: innerOnSelectChange,\n\t\tinnerInputValue: inputValue,\n\t\tinnerOnInputChange,\n\t};\n}\n"],"names":["module","exports","ProductsClient","getContainingProductsAsync","containingProductsUrl","response","fetch","get","url","json","getHasContainingProductsAsync","hasContainingProductsUrl","getContainingSubscriptionsAsync","containingSubscriptionsUrl","getProductsCustomersAlsoBoughtAsync","customersAlsoBoughtUrl","skuIds","params","getTooltipAsync","getProductDownloadsAsync","downloadsUrl","getFeaturedProducts","featuredProductIdsUrl","error","status","featuredProducts","getQuickCompare","quickCompareUrl","getUnownedResourcesInfos","unownedResourcesInfosBaseUrl","productIds","join","infos","getShortBlurbsForProductIds","getShortBlurbsUrl","postWithBody","body","getSubscriptionPromotionsForSkuIds","getSubscriptionPromotionsUrl","useInView","threshold","rootMargin","ref","useRef","isInView","setIsInView","useState","useEffect","element","current","observer","IntersectionObserver","entry","isIntersecting","disconnect","observe","RecommendationsProductIdsContext","React","RecommendationsContext","products","children","resources","useLocalization","staticProductData","initialOwnership","useMemo","dataMap","ids","ownership","forEach","product","catalogData","averageRating","ratings","reviewCount","numberOfRatings","shouldDisplayRatings","shouldDisplayStars","hasValidReviewData","id","productId","name","primarySkuId","undefined","imageUri","imageUrl","productPageUri","productPageUrl","author","skus","mapPricingToUserProductData","pricing","rating","mapToProductData","addedToCart","addedToCartTooltip","youAlreadyOwnThisProduct","youAlreadyPreorderedThisProduct","preorder","push","isOwned","isInCart","Provider","value","RecommendationsResourcesProvider","RecommendationsCartProvider","StaticProductDataProvider","InitialSkuOwnershipProvider","RecommendationsProductProvider","StaticWishlistDataProvider","errorContext","StaticWishlistProvider","ProductCardSkeleton","className","SkeletonCarousel","CarouselContent","CarouselProduct","showArrows","scale","RecommendationsCarousel","data","isLoading","heading","subHeading","length","ContentSection","sectionHeadline","headlineBody","headlineClassName","BuyInCollection","setData","setIsLoading","fetchData","useCallback","async","containingProducts","BuyInCollectionTitle","YouCanSave","ContainingSubscriptions","containingSubscriptions","ContainingSubscriptionsCard","AccessThisTitleWithAFreeTrialToLogosOrVerbum","AccessThisTitleWithASubscriptionToLogosOrVerbum","AvailableInSubscriptions","StartingAt","Subscribe","formatsAndTexts","useResourceFormatsAndTexts","locale","billingMode","freeTrialPeriodUnit","freeTrialPeriodLength","availableLogosTieredSubscriptionLevels","subscriptionResources","title","replace","logosOrVerbum","priceText","priceFormat","startingAtMonthlyPrice","availableInText","localizedAvailableSubscriptionLevelListText","subscriptionsText","subscribeUrl","routes","ConfigurationWizardSubscriptions","href","fill","height","viewBox","width","xmlns","d","stroke","CustomersAlsoBought","CustomersAlsoBoughtTitle","FeaturedProducts","primaryProduct","secondaryProducts","src","alt","role","authorDisplayString","blurb","regularPrice","RegularPrice","map","key","FeaturedProductsSkeleton","FeaturedProductsSection","featuredProductsUrl","result","ResourceHighlights","ReviewsClient","getReviews","requestUrl","reviews","getAdditionalReviews","offset","getRatings","getReview","deleteReview","delete","createReview","userId","reviewText","addReactionToReview","post","removeReactionFromReview","flagReview","followPage","unfollowPage","RatingSelector","selectedRating","onSelectedRatingChange","previewRating","setPreviewRating","ratingDescriptions","HatedIt","DidntLikeIt","ItsOkay","LikedIt","LovedIt","activeRating","handleMouseEnter","point","handleMouseLeave","handleClick","_desc","index","isFilled","starClassName","type","onMouseEnter","onMouseLeave","onClick","StarFilledIcon","size","StarIcon","TextArea","forwardRef","props","_extends","cn","displayName","ReviewEditor","user","isUserLoggedIn","currentUserReview","onReviewSubmit","onDeleteReview","navigate","useLocation","setSelectedRating","setReviewText","textareaRef","trimmedReviewText","trim","focus","handleSubmitReview","CreateReviewUrl","handleDeleteClick","handleSignInClick","SignInUrl","Typography","variant","CommandSentence","Container","template","AlreadyReviewed","Field","localeDate","LoadingSpinner","small","Button","Delete","ReviewThisProduct","StarRating","onChange","e","target","placeholder","ShareYourThoughtsHere","rows","PleaseFollowOur","ReviewGuidelinesLink","rel","ReviewGuidelines","AllPostedReviews","TermsOfServiceLink","TermsOfService","CanSeeThis","Everyone","disabled","SubmitReview","SignIn","ReviewHeader","reviewsTemplate","BasedOnSingleReview","BasedOnReviews","CustomerReviews","RatingOutOfMax","toFixed","String","classesByScale","sm","lg","LinkButton","ReviewItem","review","text","reviewRoutes","canDelete","DeleteReviewUrl","canFlag","FlagReviewUrl","handleFlagClick","SingleRating","Flag","ReviewsList","sortModes","SortModeSelector","sortMode","onSortModeChanged","sortModeLabels","latest","LatestFirst","earliest","EarliestFirst","ByRating","DropdownMenu","DropdownMenuTrigger","asChild","DropdownButton","DropdownMenuContent","DropdownMenuRadioGroup","onValueChange","mode","DropdownMenuRadioItem","Divider","REVIEWS_ANCHOR_ID","REVIEW_LIMIT_INCREMENT","product_reviews","Reviews","reviewsProps","setSortMode","reviewLimit","setReviewLimit","allReviews","setAllReviews","serverMayHaveMoreReviews","setServerMayHaveMoreReviews","setRatings","sortedReviews","sort","a","b","sortReviews","da","createdDate","db","slice","find","r","cancelled","loadedReviews","GetReviewsUrl","loadInitialReviews","refreshRatings","newRatings","GetRatingsUrl","refreshReviews","newReviews","handleDeleteReview","prev","filter","canReadMore","canReadLess","isLoadingMore","setIsLoadingMore","handleReadMoreClick","additionalReviews","concat","handleReadLessClick","LoadingReviews","WriteAReview","loading","ReadMore","ReadLess","c_amberVideoEmbedRegex","DisplayContent","html","rewritten","breakpointQuery","container","runContentScripts","scripts","Array","from","querySelectorAll","oldScript","newScript","document","createElement","attribute","attributes","setAttribute","hasAttribute","parentNode","replaceChild","executeScriptTagsInContainer","window","refTagger","tag","console","matchMedia","mediaQuery","handleChange","addEventListener","removeEventListener","addListener","removeListener","useExecuteContentScripts","dangerouslySetInnerHTML","__html","c_wistiaPlaylistScriptSrc","c_wistiaSingleScriptSrc","scriptAlreadyPresent","Boolean","querySelector","EmbeddedVideo","videoUrl","allowAutoplay","isWistiaUrl","includes","playlistMatch","match","wistiaPlaylistId","allowAttributeEntries","allowAttribute","wistiaPlaylistsScript","onload","playlistDetailsScript","appendChild","script","style","frameBorder","scrolling","allowFullScreen","allow","EmbeddedVideoSection","joinNodes","nodes","separator","flatMap","node","renderNamedLinks","items","item","searchUrl","formatSubject","subject","ProductDetailsMetadata","productDetailsMetadata","label","Title","authors","Authors","Author","edition","Edition","series","Series","volume","Volume","publishers","Publishers","Publisher","printPublicationYear","PrintPublicationDate","electronicPublicationYear","LogosReleaseDate","pageCount","Pages","era","Era","languages","Languages","Language","resourceCount","Resources","format","Format","formatType","subjects","Subjects","Subject","isbns","Isbns","Isbn","isbn","resourceId","ResourceId","resourceType","ResourceType","version","MetadataLastUpdated","row","AuthorBioSection","authorBio","SharedAuthorBio","bio","showMore","showLess","c_default","kind","c_singleVolume","c_collection","containedResourcesTitleKey","c_library","c_mobileEdSingleResource","c_mobileEdBundle","getSectionsForTemplate","AccordionHtmlTitle","c_noProductComponents","isRefetching","useNoProductComponents","product_content_sections","ProductContentSections","displayTemplate","useProductComponents","useContainedResourcesContext","currentUser","useCurrentUser","isLoggedIn","detailsResources","authorBioResources","templateKind","templateFetchesContainedResources","some","descriptor","productComponents","hasContainedResources","sections","isProductOwned","isOwnedByUser","descriptors","groups","containedResourcesTitle","pendingAccordion","accordionGroupIndex","c_innerSpacing","flushNodes","flushAccordion","Accordion","defaultValue","section","sectionIndex","AccordionItem","AccordionTrigger","AccordionContent","CoursesIncluded","ResourcesIncluded","productDetailsSection","content","ProductDetails","productDetailsContent","aboutName","authorSection","authorContent","TrustedGuideIcon","hasContainedSection","ContainedResources","defaultHideOwned","formatName","lastName","firstName","split","linkClassName","AttributeChips","chips","labelClassName","trailingContent","isMobile","useScreensize","open","setOpen","visibleChipCount","visibleChips","overflowChips","chip","i","intent","touchTarget","AndMoreTooltip","Popover","onOpenChange","MoreTooltipText","ChevronDown","AuthorsAndPublishers","publisherMetadata","By","SalePricePopover","prices","triggerLabel","breakdownTriggerLabel","lines","breakdownLines","finalAmount","salePrice","displayAmount","localizedDisplayAmount","SeePricingBreakdown","sideOffset","align","line","amount","displayInUsd","resolveAmount","isDeduction","Prices","isRestricted","discounts","discount","description","nonStackingDiscounts","shouldStack","stackingDiscounts","localizedSalePrice","salePriceTemplate","renderDiscountPills","anchorPriceLines","savingsDescription","discountSavings","singularPeriodUnitResourceKey","day","month","year","pluralPeriodUnitResourceKey","SubscriptionPromotion","promotion","checked","freeTrialInfo","percentOff","subscribableProductTitle","TitleFormat","ProLevel","checkboxLabel","Fragment","AddFreeTrial","periodLength","periodUnit","getPeriodUnitText","DayPeriodUnit","DaysPeriodUnit","MonthPeriodUnit","MonthsPeriodUnit","YearPeriodUnit","YearsPeriodUnit","SubscribeNow","savingsTemplate","StartFreeTrialForSavings","SubscribeForSavings","Checkbox","typography","learnMore","as","LearnMore","QuantityUpdateButton","cartItemId","cartUpdateUrl","quantity","addToCartButtonResources","errorResources","isUpdating","setIsUpdating","isUpdatingRef","handleUpdate","eventAggregator","newCart","CartClient","updateCartAsync","quantityByCartItemId","order","analyticsTelemetry","dataLayer","dispatchEvent","CustomEvent","detail","cart","NotificationUtility","notify","errorOccurredDuringCartUpdate","updatingQuantity","updateQuantity","getPurchaseActionState","selectedSku","pricingData","hasTemporaryAccess","accessKind","hasPermanentAccess","isGeographicallyRestricted","isSellable","isPurchasable","canShowAddToCart","isGroupLicenseEscrow","openInLogosUrl","openInLogosBaseUrl","encodeURIComponent","canShowOpenInLogos","shouldRenderButtons","PurchaseActions","showGeoRestrictionMessage","showSubscriptionPromotion","addToCartButtonRef","openInLogosResources","subscriptionPromotion","useSubscriptionPromotion","isSubscriptionPromotionChecked","setIsSubscriptionPromotionChecked","subscribableProductOptionId","shouldAddSubscriptionToCart","supportsMultipleQuantity","isSubscription","allowsMultipleQuantity","selectedSkuPricingData","effectiveQuantity","cartQuantityUpdate","cartItems","identifier","IdentifierTypes","SKU","SPOID","showPromotion","AddToCartButton","buttonTextOverride","isPrepubProduct","OpenInLogosLinkText","Gallery","productName","Image","fetchPriority","targetAspectRatio","sizes","mobile","desktop","largeDesktop","ComingSoon","ResourceFormats","CollapsibleCallout","collapsedContent","expandText","collapseText","isExpanded","setIsExpanded","panelClass","X","VideoPopover","isModalOpen","onClose","Modal","isOpen","background","Header","padding","actions","UtilityButton","color","resourceGroupKey","calloutResourceFormats","hasResourceFormatCallout","resourceFormat","CalloutSummary","isEbook","isVerbum","EbooksCalloutSummary","Ebooks","LogosEditionsCalloutSummary","VerbumEditions","LogosEditions","EditionBadge","isReaderEdition","Ebook","VerbumEdition","LogosEdition","ReaderEdition","ResearchEdition","CalloutHeader","isLogosEditionCollection","ThisCollectionContainsLogosEditions","ThisResource","TwoTypesOfLogosEditionsHeading","TwoTypesOfLogosEditions","CalloutBody","EbooksCallout","LogosEditionsCallout","ResearchEditionsCallout","ResearchEditions","ReaderEditionsCallout","ReaderEditions","LearnMoreVideoButton","isVideoShown","setIsVideoShown","PlayIcon","LogosEditionCallout","logosEditionLearnMoreVideoUrl","isLogosEdition","toLowerCase","Close","SeeInside","seeInsideIframeUrl","DialogPrimitive","Eye","VisuallyHidden","PreorderedProductLabel","orderDate","YouPreorderedOn","preorderManagementPage","reconcilePurchaseQuantityWithSku","currentQuantity","Math","max","skuItemClassName","PurchaseSkuItemContent","formatDisplayName","restricted","PurchaseOptionSection","isSelected","showRadio","onSelect","Radio","isChecked","periodTypeOrder","SubscriptionPeriodType","findChipForSkuId","skuId","c","otherSkuIds","QuantitySelector","onQuantityChange","StepperControl","min","GLE_MAX_QUANTITY","SkuSelector","purchaseOptions","selectedSkuId","isSalePriceVisible","purchaseQuantity","onPurchaseQuantityChange","onSelectedSkuChange","usePricing","pricingBySkuId","purchaseSkus","sku","subscriptionSkus","userPricingData","subscriptionInfo","indexOf","comparePeriodTypes","periodType","purchaseChips","logosEditionSkus","s","formatGroup","ebookSkus","otherSkus","mapSkuGroupToChips","chipId","supportsQuantitySelection","singlePurchaseSkus","gleSkus","representativeSku","handledSkuIds","Set","matchingGroupSkus","gle","add","has","buildPurchaseSkuChips","ambiguousFormatDisplayNames","counts","Map","set","count","lastSelectedPurchaseSkuIdRef","lastSelectedPurchaseSkuId","lastSelectedSubscriptionSkuIdRef","lastSelectedSubscriptionSkuId","selectedSkuPurchaseChip","lastSelectedSkuPurchaseChip","shouldShowQuantitySelector","handleChipClick","isPurchaseSkuSelected","isSubscriptionSkuSelected","handleSubscriptionSkuChange","getPurchaseSkuItemContent","displaySkuId","purchaseSkuChipContent","RadioGroup","purchaseSkuContent","Tooltip","newQuantity","subscriptionSkuContent","selectedSubscriptionSku","pricingForSelectedSubscriptionSku","subscriptionDisplayPrice","selectValue","periodDisplay","shouldHidePrice","options","price","Select","option","isSearchable","onFocus","purchaseOptionSections","firstChip","showRadioOptions","CommerceWebThemeProvider","purchaseOptionSection","purchaseOption","MetadataRow","publicationPeriod","PublicationPeriod","IsbnLabel","ReviewSummary","ratingSummary","headerHeight","setHeaderHeight","numberOfReviews","hasReviews","getHeaderHeight","header","getBoundingClientRect","handleResize","handleLogosBannerClosed","setTimeout","reviewsHref","handleScrollToReviews","event","reviewsElement","getElementById","preventDefault","rect","scrollTo","top","scrollY","behavior","history","pushState","shouldDisplayLinkToReviews","BeTheFirstToRateThis","ProductDescription","descriptionHtml","showFullDescription","setShowFullDescription","isTruncatable","setIsTruncatable","contentRef","scrollHeight","clientHeight","buttonLabel","ProductDescriptionToggle","toggleDescription","ChevronUp","Details","pricingSidebarResources","perUserSkuData","isSkuSellable","isSkuPurchasable","productWishlistData","useProductInWishList","explanation","isBlockedFromPurchase","YouCanDistribute","YouAlreadyOwnThisProduct","YouHaveTemporaryAccess","ProductNotAvailableInYourRegion","userCountryOrRegionIsTradeSanctioned","UserCountryOfacSanctioned","isAcademicallyRestricted","ProductOnlyAvailableForAcademicProgramMembers","UnavailableToPurchase","hasPreorder","prepubProductStatusSummary","PrepubProductStatusSummary","AddToWishListWithForm","sticky_add_to_cart_bar","StickyAddToCartBar","isVisible","inert","StickyAddToCartContent","shouldRenderActionSection","sticky_add_to_cart","StickyAddToCart","registerAdzone","adzone_block","AdzoneBlock","adzone","contentSourceKind","RenderBuilderContent","builderIo","TimeSensitiveCalloutBlock","TimeSensitiveCallout","PdpBanner","hasCheckedDismissedCookie","setHasCheckedDismissedCookie","isDismissed","setIsDismissed","Cookies","BuilderSection","restrictOverflow","CloseButton","closeComponent","secure","path","expires","c_title","BusinessDeskEditLink","isEmployee","businessDeskEditUri","Pencil","SamplePages","imageUrls","initialSlide","setInitialSlide","setIsOpen","Swiper","keyboard","modules","Scrollbar","Keyboard","scrollbar","el","draggable","dragClass","dragSize","slidesPerView","spaceBetween","imageSrc","SwiperSlide","SamplePagesThumbnailAlt","belowTheFold","onPointerDownOutside","SamplePagesViewer","onSlideChange","swiper","activeIndex","SamplePagesSlideImage","LeftColumn","samplePageImageUrls","ShimmerInline","LibraryGreeting","userName","isPricingLoading","isUnownedLoading","unownedData","headers","then","ok","Error","catch","useUnownedResources","greetingText","primarySkuPrices","primarySku","priceDisplay","LibraryResourcesYouDontOwn","LibraryAddByGetting","part","arr","mapSkuData","localizedCurrencyCode","anchorPrice","anchorSavings","isPreorder","addToCartSkuId","hasBeenPreordered","mapLocalizedPrice","mapBreakdownLines","mapAnchorPriceLines","displayAmountByCurrency","displayAmountCurrencyCode","currencyCode","mapSkuPricesToProductPricingData","skusRecord","ProductDetailsPageCore","showUserGreeting","pdpBanner","handleSelectedSkuChange","handlePurchaseQuantityChange","setSelectedSku","setPurchaseQuantity","alternateSkuIds","allSkusToCheck","matchingSku","nextSelectedSku","prevQuantity","clampedQuantity","useSelectedSkuAndPurchaseQuantity","enabled","setSeeInsideIframeUrl","fetchSeeInsideUrl","useSeeInsideUrl","allowsSeeInside","intersectionTargetRef","isStickyAddToCartVisible","useStickyAddToCartHandler","setIsStickyAddToCartVisible","intersectionTarget","setIntersectionTarget","entries","root","pdpBannerSourceSystem","sourceSystem","shouldShowPdpBanner","sourceToken","Breadcrumbs","crumbs","Products","TimeSensitiveCallOut","product_details_page","preferredCurrency","initialPricingData","EventsTrackingContextProvider","algoliaEventsTrackingSettings","queryId","PerUserDataContextProvider","requestAnonymousPricing","BuilderComponentsContextProvider","priceFormatGettersByBillingMode","Monthly","getLocalizedPriceFormat","MonthlyPriceFormat","getPriceFormat","Annually","AnnualPriceFormat","freeTrialPeriodUnitTextGettersByUnit","customSubscriptionResources","defaultSubscriptionResources","PremiumLevel","MaxLevel","Subscription","Subscriptions","subscriptionPlansResources","getFreeTrialPeriodUnitText","availableSubscriptionLevelsFormatter","Intl","ListFormat","localizedPriceFormat","freeTrialPeriodUnitText","level","makeDebouncedSelect","Component","debounceInterval","loadOptions","onLoadError","onInputChange","optionsRef","defaultOptions","hasLoadOptions","debouncedLoadOptions","pendingRequest","generation","hasInputChanged","invokeLoadOptions","request","hasCalledBack","handleOptions","isDefault","callback","handleError","inputValue","reportingError","debouncedInvokeLoadOptions","debounce","cancel","settlePending","invalidate","createDebouncedLoadOptions","isMounted","meta","DebouncedSelectAsync","Async","EMPTY_FUNCTION","AsyncCreatable","useOptionallyControlledState","controlledValue","setValue","styled","reactSelectComponents","Option","withConfig","componentId","space","img","div","theme","colors","gray66","fontSizes","fontWeights","bold","gray52","MultiValue","span","default","ReactSelect","components","reactSelectFunctions","reactSelect","selectStyles","ourStyles","control","styles","state","minHeight","fontSize","backgroundColor","isDisabled","input","backgroundDisabled","foreground","border","isFocused","borderFocused","borderRadius","radii","boxShadow","shadowFocused","borderColor","valueContainer","fontFamily","lineHeight","indicatorSeparator","display","clearIndicator","dropdownIndicator","icon","whiteSpace","placeholderForeground","singleValue","foregroundDisabled","inferred","multiValue","gray4","multiValueLabel","multiValueRemove","blueDark","menuPortal","zIndex","menu","marginTop","shadows","select","menuBackground","menuForeground","menuItemFocusedBackground","customStyles","ourWrappedStyles","Object","reduce","acc","ourStyle","selectTheme","primary","blueBase","primary25","gray8","primary50","primary75","danger","redBase","dangerLight","redLight","defaultComponents","DropdownIndicator","Menu","ThemedBox","noOptionsMessage","transformedProps","useCommonSelectProps","CreatableSelect","ReactSelectCreatable","formatCreateLabel","AsyncSelect","onKeyDown","defaultInputValue","isClearable","isMulti","otherProps","setBody","useBody","useTheme","innerValue","innerOnChange","innerInputValue","innerOnInputChange","controlledSelectValue","defaultSelectValue","onSelectChange","controlledInputValue","trySetSelectValue","trySetInputValue","innerOnSelectChange","newSelectValue","nextSelectValue","isArray","newInputValue","userIsTyping","action","useClearableSelectValue","classNamePrefix","menuPortalTarget","onConsumerKeyDown","nodeName","defaultPrevented","selectionIndex","shiftKey","selectionStart","selectionEnd","setSelectionRange","handleKeyDown"],"sourceRoot":""}