@propeller-commerce/propeller-v2-react-ui 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/context/PropellerContext.tsx","../src/context/ProductGridContext.tsx","../src/composables/react/useAddress.ts","../src/composables/react/useAuth.ts","../src/composables/shared/utils/cartInit.ts","../src/composables/react/useCart.ts","../src/composables/react/useCheckout.ts","../src/composables/react/useClusterConfigurator.ts","../src/composables/react/useCompany.ts","../src/composables/react/useFavorites.ts","../src/composables/react/useInfraProps.ts","../src/composables/react/useMenu.ts","../src/composables/react/shared/usePagination.ts","../src/composables/react/useOrders.ts","../src/composables/react/useProductBundles.ts","../src/composables/react/useProductInfo.ts","../src/composables/react/useProductSearch.ts","../src/composables/react/useProductSlider.ts","../src/composables/react/useProductSpecs.ts","../src/composables/react/usePurchaseAuthorization.ts","../src/composables/react/useResolvedProps.ts","../src/composables/react/useServices.ts","../src/composables/shared/utils/fetchActiveCart.ts","../src/composables/shared/utils/mergeAnonymousCart.ts","../src/components/LoginForm.tsx","../src/components/AccountIconAndMenu.tsx","../src/components/ActionCode.tsx","../src/components/AddToCart.tsx","../src/components/AddToFavorite.tsx","../src/components/AddressCard.tsx","../src/components/AddressSelector.tsx","../src/components/Breadcrumbs.tsx","../src/components/BreadcrumbsWithProvider.tsx","../src/components/CartBonusItems.tsx","../src/components/CartCarriers.tsx","../src/components/ItemStock.tsx","../src/components/CartItem.tsx","../src/components/CartIconAndSidebar.tsx","../src/components/CartOverview.tsx","../src/components/CartPaymethods.tsx","../src/components/CartSummary.tsx","../src/components/CategoryDescription.tsx","../src/components/CategoryShortDescription.tsx","../src/components/CategoryShortDescriptionWithProvider.tsx","../src/components/ClusterCard.tsx","../src/components/ClusterConfigurator.tsx","../src/components/ClusterInfo.tsx","../src/components/ClusterOptions.tsx","../src/components/CompanySwitcher.tsx","../src/components/DeliveryDate.tsx","../src/components/FavoriteListItem.tsx","../src/components/GridPagination.tsx","../src/components/FavoriteListDetails.tsx","../src/components/FavoriteLists.tsx","../src/components/ForgotPassword.tsx","../src/components/GridFilters.tsx","../src/components/GridTitle.tsx","../src/components/GridTitleWithProvider.tsx","../src/components/GridToolbar.tsx","../src/components/ItemsOverview.tsx","../src/components/Menu.tsx","../src/components/OrderActions.tsx","../src/components/OrderItemCard.tsx","../src/components/OrderBonusItems.tsx","../src/components/OrderList.tsx","../src/components/OrderShipments.tsx","../src/components/OrderSummary.tsx","../src/components/OrderTotals.tsx","../src/components/PriceToggle.tsx","../src/components/ProductBulkPrices.tsx","../src/components/ProductBulkPricesWithProvider.tsx","../src/components/ProductBundles.tsx","../src/components/ProductPrice.tsx","../src/components/ProductCard.tsx","../src/components/ProductDescription.tsx","../src/components/ProductDownloads.tsx","../src/components/ProductGallery.tsx","../src/components/ProductGrid.tsx","../src/components/defaults/DefaultProductImage.tsx","../src/components/defaults/DefaultProductBadges.tsx","../src/components/defaults/DefaultProductSurcharges.tsx","../src/components/ProductInfo.tsx","../src/components/ProductPriceWithProvider.tsx","../src/components/ProductShortDescription.tsx","../src/components/ProductShortDescriptionWithProvider.tsx","../src/components/ProductSlider.tsx","../src/components/ProductSpecifications.tsx","../src/components/ProductVideos.tsx","../src/components/ProductTabs.tsx","../src/components/PurchaseAuthorizationConfigurator.tsx","../src/components/PurchaseAuthorizationRequests.tsx","../src/components/QuoteActions.tsx","../src/components/RegisterForm.tsx","../src/components/SearchBar.tsx","../src/components/UserDetails.tsx"],"names":["createContext","jsx","useContext","useMemo","deriveUserMode","useState","isContact","isCustomer","useCallback","createServices","AddressType","YesNo","user","ok","err","CartStatus","cart","getAddresses","Gender","CartAddressType","useRef","PurchaseRole","resultCart","addedItem","CrossupsellType","PaymentStatuses","collectAttributeValues","filterProductsBySelections","attributeNameMatches","getAttributeDisplayName","extractAttributeValues","useEffect","OrderSearchFields","OrderItemClass","inflightFetches","ProductSortField","ProductSearchableField","ProductStatus","SortOrder","attributes","React","getLabel","jsxs","Fragment","getProductUrl","getProductImageUrl","getLocalizedValue","formatPrice","getProductSku","formatSurcharge","React2","React3","_getCountryName","React4","React5","getProductName","getBundlePrice","getBundleNonLeaders","React6","getClusterSku","getClusterImageUrl","getClusterName","formatPriceHelper","React7","items","DEFAULT_LABELS","isContentHidden","React8","OrderSortField","OrderType","OrderDiscountType","isHidden","BundleCondition","resolveAttributeValues","RESOLVE_SPEC","MemoizedRoot","React9","React10","getLanguageString","React11","AttributeType","_formatPrice"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,IAAM,oBAAA,GAAuBA,qBAAoC,IAAI,CAAA;AACrE,IAAM,qBAAA,GAAwBA,qBAAqC,IAAI,CAAA;AA+BhE,SAAS,qBAAA,CAAsB,EAAE,KAAA,EAAO,QAAA,EAAS,EAA+B;AACrF,EAAA,uBACEC,cAAA,CAAC,oBAAA,CAAqB,QAAA,EAArB,EAA8B,OAC5B,QAAA,EACH,CAAA;AAEJ;AAcO,SAAS,iBAAA,CAAkB,EAAE,KAAA,EAAO,QAAA,EAAS,EAA2B;AAC7E,EAAA,uBACEA,cAAA,CAAC,qBAAA,CAAsB,QAAA,EAAtB,EAA+B,OAC7B,QAAA,EACH,CAAA;AAEJ;AAMO,SAAS,gBAAA,GAAyC;AACvD,EAAA,OAAOC,kBAAW,oBAAoB,CAAA;AACxC;AAGO,SAAS,wBAAA,GAA0C;AACxD,EAAA,MAAM,IAAA,GAAOA,kBAAW,oBAAoB,CAAA;AAC5C,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KAGF;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT;AAMO,SAAS,iBAAA,GAA2C;AACzD,EAAA,OAAOA,kBAAW,qBAAqB,CAAA;AACzC;AAQO,SAAS,mBAAA,GAA6C;AAC3D,EAAA,MAAM,IAAA,GAAOA,kBAAW,oBAAoB,CAAA;AAC5C,EAAA,MAAM,K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AA,GAAA,EACV,CAAA;AAEJ;AAEA,IAAO,mBAAA,GAAQ","file":"index.cjs","sourcesContent":["'use client';\n\nimport { createContext, useContext, useMemo, ReactNode } from 'react';\nimport { GraphQLClient, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n Services,\n ShopMode,\n UserMode,\n} from '@propeller-commerce/propeller-v2-core-ui';\nimport { deriveUserMode } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Tier 1 — application-wide infrastructure. Bound by `<PropellerDepsProvider>`\n * once at the root of the app. These values are app-singletons: the GraphQL\n * client, the SDK Services bundle wired to it, and the cosmetic / branding\n * defaults (currency, configuration). They do not change per subtree — for\n * per-scope state (user, companyId, language) use `<PropellerProvider>`.\n *\n * Why split: per-scope state belongs to a routed section (impersonation,\n * multi-cart, language widgets); deps don't. Splitting lets a deeper\n * `<PropellerProvider>` replace the scope without recreating the GraphQL\n * client or invalidating service references.\n */\nexport interface PropellerDeps {\n /**\n * The GraphQL client the consumer constructed. Exposed for code that needs\n * to pass it back into SDK helpers (rare — most code should use `services`).\n */\n graphqlClient: GraphQLClient;\n /**\n * The Services bundle (`{ product, cart, user, ... }`) wired to\n * `graphqlClient`. Build it via `createServices(graphqlClient)`.\n */\n services: Services;\n /** Currency symbol used by display components. Default: `'€'`. */\n currency: string;\n /** Free-form configuration bag forwarded to components. */\n configuration: unknown;\n}\n\n/**\n * Tier 2 — per-scope state. Bound by `<PropellerProvider>` and replaceable\n * by nesting a second provider deeper in the tree.\n */\nexport interface PropellerScope {\n /** The authenticated user, or `null` when browsing anonymously. */\n user: Contact | Customer | null;\n /** Active company ID for the current session; `undefined` for non-company users. */\n companyId: number | undefined;\n /** Active language code (e.g. `'NL'`). */\n language: string;\n /** When `true`, display components show tax-inclusive prices. */\n includeTax: boolean;\n /** Portal access mode (e.g. `'open'`, `'semi-closed'`). */\n portalMode: string;\n /**\n * Shop mode declared in `propeller.json`. Combined with `user` to derive\n * `userMode` on the composite context. Defaults to `'hybrid'` when omitted\n * so existing call sites keep their current branching semantics (any\n * logged-in Contact → b2b surface).\n */\n shopMode?: ShopMode;\n}\n\n/**\n * Composite of Tier 1 deps + Tier 2 scope. Preserved as the public\n * `PropellerInfra` shape so existing consumers (`useInfraProps`,\n * `useResolvedProps`, card components) keep working unchanged.\n *\n * `userMode` is derived from `user` + `shopMode`; B2B-gated UI should\n * read this rather than re-deriving from `isContact(user)`.\n */\nexport interface PropellerInfra extends PropellerDeps, PropellerScope {\n userMode: UserMode;\n}\n\nconst PropellerDepsContext = createContext<PropellerDeps | null>(null);\nconst PropellerScopeContext = createContext<PropellerScope | null>(null);\n\nexport interface PropellerDepsProviderProps {\n /** The Tier 1 deps. Wire once at app root. */\n value: PropellerDeps;\n /** The subtree that gains access to the deps. */\n children: ReactNode;\n}\n\n/**\n * Provider for Tier 1 infrastructure (graphqlClient, services, currency,\n * configuration). Mount once at the root of the app, above any routed tree.\n *\n * @example\n * // app/providers.tsx\n * import { GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\n * import { createServices, PropellerDepsProvider } from 'propeller-v2-react-ui';\n *\n * const graphqlClient = new GraphQLClient({ endpoint: '/api/graphql' });\n * const services = createServices(graphqlClient);\n *\n * export function Providers({ children }) {\n * return (\n * <PropellerDepsProvider value={{ graphqlClient, services, currency: '€', configuration }}>\n * <PropellerProvider value={scopeFromHostStores}>\n * {children}\n * </PropellerProvider>\n * </PropellerDepsProvider>\n * );\n * }\n */\nexport function PropellerDepsProvider({ value, children }: PropellerDepsProviderProps) {\n return (\n <PropellerDepsContext.Provider value={value}>\n {children}\n </PropellerDepsContext.Provider>\n );\n}\n\nexport interface PropellerProviderProps {\n /** The Tier 2 scope. */\n value: PropellerScope;\n /** The subtree that gains access to the scope. */\n children: ReactNode;\n}\n\n/**\n * Provider for Tier 2 per-scope state (user, companyId, language,\n * includeTax, portalMode). Wrap the routed tree; nest deeper to override\n * scope for a subtree (impersonation, multi-cart, …).\n */\nexport function PropellerProvider({ value, children }: PropellerProviderProps) {\n return (\n <PropellerScopeContext.Provider value={value}>\n {children}\n </PropellerScopeContext.Provider>\n );\n}\n\n/**\n * Read the installed Tier 1 deps. Returns `null` outside the provider so\n * components stay usable standalone / in tests.\n */\nexport function usePropellerDeps(): PropellerDeps | null {\n return useContext(PropellerDepsContext);\n}\n\n/** Throwing variant — call when deps are required. */\nexport function useRequiredPropellerDeps(): PropellerDeps {\n const deps = useContext(PropellerDepsContext);\n if (!deps) {\n throw new Error(\n '[propeller-v2-react-ui] useRequiredPropellerDeps() called outside ' +\n '<PropellerDepsProvider>. Wrap your app root with ' +\n '<PropellerDepsProvider value={{ graphqlClient, services, currency, configuration }}>.'\n );\n }\n return deps;\n}\n\n/**\n * Read the Tier 2 scope. Returns `null` outside the provider so components\n * stay usable standalone / in tests.\n */\nexport function usePropellerScope(): PropellerScope | null {\n return useContext(PropellerScopeContext);\n}\n\n/**\n * Composite read of Tier 1 deps + Tier 2 scope. Mirrors the previous\n * `PropellerInfra` shape so existing consumers keep working unchanged.\n *\n * Returns `null` when either tier is missing.\n */\nexport function usePropellerContext(): PropellerInfra | null {\n const deps = useContext(PropellerDepsContext);\n const scope = useContext(PropellerScopeContext);\n return useMemo(() => {\n if (!deps || !scope) return null;\n const userMode = deriveUserMode(scope.user, scope.shopMode ?? 'hybrid');\n return { ...deps, ...scope, userMode };\n }, [deps, scope]);\n}\n\n/**\n * Read the active `userMode` directly. Returns `'anonymous'` outside the\n * provider so components stay usable standalone / in tests.\n */\nexport function useUserMode(): UserMode {\n const scope = useContext(PropellerScopeContext);\n if (!scope) return 'anonymous';\n return deriveUserMode(scope.user, scope.shopMode ?? 'hybrid');\n}\n","'use client';\n\nimport { createContext, useContext, ReactNode, ComponentType } from 'react';\nimport { Cart, CartMainItem, Product, Cluster } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n PriceComponentProps,\n StockComponentProps,\n AddToCartComponentProps,\n ImageComponentProps,\n BadgesComponentProps,\n FavoriteComponentProps,\n ProductBundlesComponentProps,\n ProductBulkPricesComponentProps,\n ProductSurchargesComponentProps,\n} from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Tier 2 grid config context. Collapses the feature-flag/display and callback\n * props that ProductGrid otherwise cascades through ProductCard/ClusterCard\n * down to AddToCart/ItemStock. ProductGrid is the provider; the card subtree\n * consumes via useProductGridConfig() instead of receiving ~20 threaded props.\n *\n * Prop-name aliases are resolved here to a single canonical name:\n * - ProductGrid `stockValidation` -> `enableStockValidation`\n * (ProductGrid `addToCartLabels` stays as-is; ProductCard already maps it to\n * AddToCart's `labels` prop at its existing render site.)\n */\nexport interface ProductGridConfig {\n // Feature / display\n /** Number of columns the grid renders cards in. */\n columns: number;\n /** When `true`, cards display the product price. */\n showPrice?: boolean;\n /** When `true`, cards display the stock level / status. */\n showStock?: boolean;\n /** When `true`, cards display the availability indicator. */\n showAvailability?: boolean;\n /** When `true`, cards show the add-to-favorites control. */\n enableAddFavorite?: boolean;\n /** When `true`, cards render the add-to-cart control. */\n allowAddToCart?: boolean;\n /** When `true`, adding an item creates a cart if none exists yet. */\n createCart?: boolean;\n /** When `true`, the add-to-cart flow opens a confirmation modal. */\n showModal?: boolean;\n /** When `true`, cards show quantity increment/decrement steppers. */\n allowIncrDecr?: boolean;\n /** When `true`, add-to-cart validates the requested quantity against stock. Aliased from ProductGrid's `stockValidation` prop. */\n enableStockValidation?: boolean;\n /** Target cart ID that add-to-cart actions operate on. */\n cartId?: string;\n /** Child product IDs to add alongside the main product (bundle/cluster children). */\n childItems?: number[];\n /** Free-text note attached to items added to the cart. */\n notes?: string;\n /** Explicit unit price override passed to add-to-cart. */\n price?: number;\n /** Localised label overrides for stock-status text rendered on cards. */\n stockLabels?: Record<string, string>;\n /** Localised label overrides forwarded to each card's `AddToCart` component. */\n addToCartLabels?: Record<string, string>;\n /** Localised label overrides forwarded to the embedded `<ProductPrice>` display inside each card. */\n priceLabels?: Record<string, string>;\n\n // Callbacks\n /** Called when a new cart is created during an add-to-cart action. */\n onCartCreated?: (cart: Cart) => void;\n /** Called after an item is successfully added to the cart. */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n /** Called when the user chooses to proceed to checkout. */\n onProceedToCheckout?: () => void;\n /** Called when the user clicks the request-a-quote action. */\n onRequestQuoteClick?: (cart: Cart) => void;\n /** Called when a product/cluster favorite is toggled; `isFavorite` is the new state. */\n onToggleFavorite?: (item: Product | Cluster, isFavorite: boolean) => void;\n /** Called when a product card is clicked. */\n onProductClick?: (product: Product) => void;\n /** Called when a cluster card is clicked. */\n onClusterClick?: (cluster: Cluster) => void;\n\n // ───── Component-slot injection (extension API) ─────\n // When set on the resolver context, cards/grids/sliders inside render the\n // injected component in place of the default. Explicit per-card\n // props still override; precedence is explicit > grid context > infra > default.\n /** Replaces the default price block in cards / PDP / cart row / order row. */\n priceComponent?: ComponentType<PriceComponentProps>;\n /** Replaces the default stock / availability block. */\n stockComponent?: ComponentType<StockComponentProps>;\n /** Replaces the default add-to-cart control. */\n addToCartComponent?: ComponentType<AddToCartComponentProps>;\n /** Replaces the default product / cluster image block. */\n imageComponent?: ComponentType<ImageComponentProps>;\n /** Replaces the default product / cluster badges block. */\n badgesComponent?: ComponentType<BadgesComponentProps>;\n /** Replaces the default add-to-favorite control. */\n favoriteComponent?: ComponentType<FavoriteComponentProps>;\n /** Replaces the default product-bundles block on a PDP. */\n bundlesComponent?: ComponentType<ProductBundlesComponentProps>;\n /** Replaces the default product-bulk-prices block on a PDP. */\n bulkPricesComponent?: ComponentType<ProductBulkPricesComponentProps>;\n /** Replaces the default surcharges block on a PDP / cart row. */\n surchargesComponent?: ComponentType<ProductSurchargesComponentProps>;\n\n // Iteration-level: swap the whole ProductCard / ClusterCard rendered by\n // ProductGrid and ProductSlider. The custom component receives the same\n // props that the default would have received.\n /** Replaces the whole ProductCard rendered inside ProductGrid / ProductSlider. */\n productCardComponent?: ComponentType<{ product: Product } & Record<string, unknown>>;\n /** Replaces the whole ClusterCard rendered inside ProductGrid / ProductSlider. */\n clusterCardComponent?: ComponentType<{ cluster: Cluster } & Record<string, unknown>>;\n}\n\nconst ProductGridContext = createContext<ProductGridConfig | null>(null);\n\n/**\n * Provider — ProductGrid wraps its card subtree with this so descendant\n * cards read display flags and callbacks via {@link useProductGridConfig}\n * instead of receiving them as threaded props.\n *\n * @param value - The grid config object shared with the card subtree.\n * @param children - The card subtree (ProductCard / ClusterCard and below).\n * @returns The provider element wrapping `children`.\n */\nexport function ProductGridConfigProvider({\n value,\n children,\n}: {\n value: ProductGridConfig;\n children: ReactNode;\n}) {\n return (\n <ProductGridContext.Provider value={value}>\n {children}\n </ProductGridContext.Provider>\n );\n}\n\n/**\n * Reads the {@link ProductGridConfig} from context.\n *\n * Non-throwing: ProductCard/ClusterCard used outside a grid (ProductSlider,\n * standalone, tests) get null and fall back to explicit props / defaults.\n *\n * @returns The grid config, or `null` when rendered outside a provider.\n */\nexport function useProductGridConfig(): ProductGridConfig | null {\n return useContext(ProductGridContext);\n}\n","/**\n * useAddress (React) — Address display and CRUD.\n *\n * Uses proper SDK types for all address service calls.\n * CompanyAddressUpdateInput / CustomerAddressUpdateInput do not have a `type` field —\n * the address type is only set on creation.\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { AddressType, Gender, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Address,\n Customer,\n CompanyAddressCreateInput,\n CustomerAddressCreateInput,\n CompanyAddressUpdateInput,\n CustomerAddressUpdateInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport type { AnyUser } from '@propeller-commerce/propeller-v2-core-ui';\nimport { isContact, isCustomer } from '@propeller-commerce/propeller-v2-core-ui';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Flat, framework-agnostic address payload accepted by the CRUD methods. */\nexport interface AddressInput {\n /** Address type (invoice/delivery). Only honoured on create — defaults to `invoice` for companies, `delivery` for customers. */\n type?: AddressType;\n /** Recipient's first name. */\n firstName?: string;\n /** Recipient's last name. */\n lastName?: string;\n /** Recipient's middle name / tussenvoegsel. */\n middleName?: string;\n /** Company name printed on the address. */\n company?: string;\n /** Street name. Required. */\n street: string;\n /** House number. */\n number?: string;\n /** House-number suffix / addition. */\n numberExtension?: string;\n /** Postal / ZIP code. Required. */\n postalCode: string;\n /** City. Required. */\n city: string;\n /** ISO country code. Required. */\n country: string;\n /** Contact email for this address. */\n email?: string;\n /** Landline phone number. */\n phone?: string;\n /** Mobile phone number. */\n mobile?: string;\n /** Recipient gender. */\n gender?: Gender;\n /** When `Y`, marks this address as the default for its type. */\n isDefault?: YesNo;\n /** Free-text notes attached to the address. */\n notes?: string;\n}\n\nexport interface UseAddressOptions {\n /**\n * GraphQL client. Nullable so callers can invoke the hook unconditionally\n * (Rules of Hooks) even when the client isn't ready yet — the CRUD methods\n * bail with `{ success: false, error: 'No client' }` until it is.\n */\n graphqlClient: GraphQLClient | null | undefined;\n /** Authenticated user. Nullable for the same reason as `graphqlClient`. */\n user: AnyUser | null | undefined;\n /** Explicit company id; overrides the contact's `company.companyId` when resolving the address owner. */\n companyId?: number;\n}\n\n/** State and CRUD actions returned by {@link useAddress}. */\nexport interface UseAddressReturn {\n /** `true` while any CRUD call is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Creates a company- or customer-scoped address depending on the user kind. */\n createAddress: (input: AddressInput) => Promise<{ success: boolean; address?: Address; error?: string }>;\n /** Updates an existing address by id; address `type` cannot be changed. */\n updateAddress: (addressId: number, input: Partial<AddressInput>) => Promise<{ success: boolean; address?: Address; error?: string }>;\n /** Deletes an address by id. */\n deleteAddress: (addressId: number) => Promise<{ success: boolean; error?: string }>;\n /** Marks an address as default by issuing an update with `isDefault: Y`. */\n setDefaultAddress: (addressId: number) => Promise<{ success: boolean; error?: string }>;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useAddress — display and CRUD for company / customer addresses.\n *\n * @param options - see {@link UseAddressOptions}.\n * @returns loading/error state plus async CRUD actions — see {@link UseAddressReturn}.\n *\n * @remarks\n * GraphQL integration: every call goes through `services.address` (`AddressService`),\n * built per-call via `createServices(graphqlClient)`. The user kind decides which\n * mutation runs — contacts use `createCompanyAddress` / `updateCompanyAddress` /\n * `deleteCompanyAddress` (companyId from `options.companyId` or `user.company`),\n * customers use `createCustomerAddress` / `updateCustomerAddress` /\n * `deleteCustomerAddress` (customerId from the user). All mutations require an\n * authenticated session; methods short-circuit with `{ success: false }` when the\n * client or user context is missing. `setDefaultAddress` delegates to `updateAddress`.\n */\nexport function useAddress(options: UseAddressOptions): UseAddressReturn {\n const { graphqlClient, user, companyId } = options;\n\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n function resolveIds(): { companyId?: number; customerId?: number } {\n if (!user) return {};\n if (isContact(user)) return { companyId: companyId ?? user.company?.companyId };\n if (isCustomer(user)) return { customerId: (user as Customer).customerId };\n return {};\n }\n\n // ── Create address ────────────────────────────────────────────────────────\n\n const createAddress = useCallback(\n async (input: AddressInput): Promise<{ success: boolean; address?: Address; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).address;\n const ids = resolveIds();\n let address: Address;\n\n if (ids.companyId) {\n const createInput: CompanyAddressCreateInput = {\n street: input.street,\n postalCode: input.postalCode,\n city: input.city,\n country: input.country,\n type: input.type ?? AddressType.invoice,\n companyId: ids.companyId,\n ...(input.firstName && { firstName: input.firstName }),\n ...(input.lastName && { lastName: input.lastName }),\n ...(input.middleName && { middleName: input.middleName }),\n ...(input.company && { company: input.company }),\n ...(input.number && { number: input.number }),\n ...(input.numberExtension && { numberExtension: input.numberExtension }),\n ...(input.email && { email: input.email }),\n ...(input.phone && { phone: input.phone }),\n ...(input.mobile && { mobile: input.mobile }),\n ...(input.gender && { gender: input.gender }),\n ...(input.isDefault && { isDefault: input.isDefault }),\n ...(input.notes && { notes: input.notes }),\n };\n address = await service.createCompanyAddress(createInput);\n } else if (ids.customerId) {\n const createInput: CustomerAddressCreateInput = {\n street: input.street,\n postalCode: input.postalCode,\n city: input.city,\n country: input.country,\n type: input.type ?? AddressType.delivery,\n customerId: ids.customerId,\n ...(input.firstName && { firstName: input.firstName }),\n ...(input.lastName && { lastName: input.lastName }),\n ...(input.middleName && { middleName: input.middleName }),\n ...(input.number && { number: input.number }),\n ...(input.numberExtension && { numberExtension: input.numberExtension }),\n ...(input.email && { email: input.email }),\n ...(input.phone && { phone: input.phone }),\n ...(input.mobile && { mobile: input.mobile }),\n ...(input.gender && { gender: input.gender }),\n ...(input.isDefault && { isDefault: input.isDefault }),\n ...(input.notes && { notes: input.notes }),\n };\n address = await service.createCustomerAddress(createInput);\n } else {\n return { success: false, error: 'No user context' };\n }\n\n return { success: true, address };\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to create address';\n setError(msg);\n return { success: false, error: msg };\n } finally {\n setLoading(false);\n }\n },\n [graphqlClient, user, companyId]\n );\n\n // ── Update address ────────────────────────────────────────────────────────\n // Note: SDK update inputs do not have an `type` field; type is fixed at creation.\n\n const updateAddress = useCallback(\n async (addressId: number, input: Partial<AddressInput>): Promise<{ success: boolean; address?: Address; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).address;\n const ids = resolveIds();\n let address: Address;\n\n if (ids.companyId) {\n const updateInput: CompanyAddressUpdateInput = {\n id: addressId,\n companyId: ids.companyId,\n ...(input.firstName && { firstName: input.firstName }),\n ...(input.lastName && { lastName: input.lastName }),\n ...(input.middleName && { middleName: input.middleName }),\n ...(input.company && { company: input.company }),\n ...(input.street && { street: input.street }),\n ...(input.number !== undefined && { number: input.number }),\n ...(input.numberExtension && { numberExtension: input.numberExtension }),\n ...(input.postalCode && { postalCode: input.postalCode }),\n ...(input.city && { city: input.city }),\n ...(input.country && { country: input.country }),\n ...(input.email && { email: input.email }),\n ...(input.phone && { phone: input.phone }),\n ...(input.mobile && { mobile: input.mobile }),\n ...(input.gender && { gender: input.gender }),\n ...(input.isDefault && { isDefault: input.isDefault }),\n ...(input.notes && { notes: input.notes }),\n };\n address = await service.updateCompanyAddress(updateInput);\n } else if (ids.customerId) {\n const updateInput: CustomerAddressUpdateInput = {\n id: addressId,\n customerId: ids.customerId,\n ...(input.firstName && { firstName: input.firstName }),\n ...(input.lastName && { lastName: input.lastName }),\n ...(input.middleName && { middleName: input.middleName }),\n ...(input.street && { street: input.street }),\n ...(input.number !== undefined && { number: input.number }),\n ...(input.numberExtension && { numberExtension: input.numberExtension }),\n ...(input.postalCode && { postalCode: input.postalCode }),\n ...(input.city && { city: input.city }),\n ...(input.country && { country: input.country }),\n ...(input.email && { email: input.email }),\n ...(input.phone && { phone: input.phone }),\n ...(input.mobile && { mobile: input.mobile }),\n ...(input.gender && { gender: input.gender }),\n ...(input.isDefault && { isDefault: input.isDefault }),\n ...(input.notes && { notes: input.notes }),\n };\n address = await service.updateCustomerAddress(updateInput);\n } else {\n return { success: false, error: 'No user context' };\n }\n\n return { success: true, address };\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to update address';\n setError(msg);\n return { success: false, error: msg };\n } finally {\n setLoading(false);\n }\n },\n [graphqlClient, user, companyId]\n );\n\n // ── Delete address ────────────────────────────────────────────────────────\n\n const deleteAddress = useCallback(\n async (addressId: number): Promise<{ success: boolean; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).address;\n const ids = resolveIds();\n if (ids.companyId) {\n await service.deleteCompanyAddress({ id: addressId, companyId: ids.companyId });\n } else if (ids.customerId) {\n await service.deleteCustomerAddress({ id: addressId, customerId: ids.customerId });\n } else {\n return { success: false, error: 'No user context' };\n }\n return { success: true };\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to delete address';\n setError(msg);\n return { success: false, error: msg };\n } finally {\n setLoading(false);\n }\n },\n [graphqlClient, user, companyId]\n );\n\n const setDefaultAddress = useCallback(\n async (addressId: number): Promise<{ success: boolean; error?: string }> =>\n updateAddress(addressId, { isDefault: YesNo.Y }),\n [updateAddress]\n );\n\n return { loading, error, createAddress, updateAddress, deleteAddress, setDefaultAddress };\n}\n","/**\n * useAuth (React) — Login, registration, and forgot-password flows.\n *\n * Responsibilities:\n * - login: LoginService + getViewer for session token + user\n * - registerContact: createCompany → registerContact (ContactRegisterInput wrapper) → createCompanyAddress\n * - registerCustomer: registerCustomer (CustomerRegisterInput wrapper) → login → createCustomerAddress\n * - forgotPassword: UserService.sendPasswordResetEmail\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices, isCustomer, ok, err, type Result } from '@propeller-commerce/propeller-v2-core-ui';\nimport { AddressType, Gender, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Contact,\n Customer,\n CreateCompanyInput,\n CompanyAddressCreateInput,\n CustomerAddressCreateInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n ViewerInput,\n ContactRegisterInput,\n CustomerRegisterInput,\n PasswordResetInput,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/**\n * Success payload for login / registerContact / registerCustomer.\n *\n * `user` + tokens are optional: the `autoLogin: false` branches of the\n * register flows complete server-side but deliberately drop the session,\n * yielding an `ok({})`.\n */\nexport interface AuthSuccess {\n /** The authenticated viewer (Contact or Customer) when resolved. */\n user?: Contact | Customer;\n /** Session JWT bearer token, when issued. */\n accessToken?: string;\n /** Refresh token, when issued. */\n refreshToken?: string;\n /** ISO timestamp at which `accessToken` expires. */\n expiresAt?: string;\n}\n\n/** Backwards-friendly alias kept for the public `UseAuth*` type re-exports. */\nexport type LoginResult = Result<AuthSuccess, string>;\n\n/** Form payload for B2B (company contact) registration. */\nexport interface RegisterContactInput {\n /** Login email for the new contact. */\n email: string;\n /** Initial account password. */\n password: string;\n /** Contact's first name. */\n firstName: string;\n /** Contact's middle name / tussenvoegsel. */\n middleName?: string;\n /** Contact's last name. */\n lastName: string;\n /** Contact phone number. */\n phone?: string;\n /** Contact gender. */\n gender?: Gender;\n /** Company name — when present a company is created and the contact attached to it. */\n companyName?: string;\n /** Company VAT / tax number. */\n vatNumber?: string;\n /** Company Chamber-of-Commerce number. */\n cocNumber?: string;\n /** Billing address street. */\n street?: string;\n /** Billing address house number. */\n number?: string;\n /** Billing address house-number suffix. */\n numberExtension?: string;\n /** Billing address postal code. */\n postalCode?: string;\n /** Billing address city. */\n city?: string;\n /** Billing address ISO country code. */\n country?: string;\n /** Delivery address street. */\n deliveryStreet?: string;\n /** Delivery address house number. */\n deliveryNumber?: string;\n /** Delivery address house-number suffix. */\n deliveryNumberExtension?: string;\n /** Delivery address postal code. */\n deliveryPostalCode?: string;\n /** Delivery address city. */\n deliveryCity?: string;\n /** Delivery address ISO country code. */\n deliveryCountry?: string;\n /** When `true`, the billing address is copied into a delivery-typed record. */\n sameDeliveryAsBilling?: boolean;\n}\n\n/** Form payload for B2C (customer) registration. */\nexport interface RegisterCustomerInput {\n /** Login email for the new customer. */\n email: string;\n /** Initial account password. */\n password: string;\n /** Customer's first name. */\n firstName: string;\n /** Customer's middle name / tussenvoegsel. */\n middleName?: string;\n /** Customer's last name. */\n lastName: string;\n /** Customer phone number. */\n phone?: string;\n /** Customer gender. */\n gender?: Gender;\n /** Billing address street. */\n street?: string;\n /** Billing address house number. */\n number?: string;\n /** Billing address house-number suffix. */\n numberExtension?: string;\n /** Billing address postal code. */\n postalCode?: string;\n /** Billing address city. */\n city?: string;\n /** Billing address ISO country code. */\n country?: string;\n /** Delivery address street. */\n deliveryStreet?: string;\n /** Delivery address house number. */\n deliveryNumber?: string;\n /** Delivery address house-number suffix. */\n deliveryNumberExtension?: string;\n /** Delivery address postal code. */\n deliveryPostalCode?: string;\n /** Delivery address city. */\n deliveryCity?: string;\n /** Delivery address ISO country code. */\n deliveryCountry?: string;\n /** When `true`, the billing address is copied into a delivery-typed record. */\n sameDeliveryAsBilling?: boolean;\n}\n\n/** Options for {@link useAuth}. */\nexport interface UseAuthOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** Default primary language for registration / reset emails. Defaults to `'NL'`. */\n language?: string;\n /** Fires whenever the in-memory Bearer header changes — receives the token, or `''` when cleared. */\n onAuthHeaderUpdate?: (token: string) => void;\n /** Portal configuration: track-attribute names, PA config input, channelId, etc. */\n configuration?: any;\n}\n\n/** State and auth actions returned by {@link useAuth}. */\nexport interface UseAuthReturn {\n /** `true` while a login or registration call is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Authenticates by email/password; pass `onLoginSubmit` to fully override the SDK login. */\n login: (\n email: string,\n password: string,\n onLoginSubmit?: (email: string, password: string) => Promise<Contact | Customer>,\n ) => Promise<Result<AuthSuccess, string>>;\n /** Registers a B2B contact (and optionally a company + addresses); `autoLogin` keeps the session. */\n registerContact: (\n input: RegisterContactInput,\n preferredLanguage?: string,\n autoLogin?: boolean,\n ) => Promise<Result<AuthSuccess, string>>;\n /** Registers a B2C customer (and optionally addresses); `autoLogin` keeps the session. */\n registerCustomer: (\n input: RegisterCustomerInput,\n preferredLanguage?: string,\n autoLogin?: boolean,\n ) => Promise<Result<AuthSuccess, string>>;\n /** Triggers a password-reset email for the given address. */\n forgotPassword: (email: string) => Promise<Result<void, string>>;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useAuth — login, registration, and forgot-password flows.\n *\n * @param options - see {@link UseAuthOptions}.\n * @returns loading/error state plus async auth actions — see {@link UseAuthReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `login` calls `services.login.login()` (`LoginService`) then `services.user.getViewer()`\n * (`UserService`) to fetch the Contact/Customer; the JWT is set as an in-memory Bearer\n * header via `graphqlClient.updateConfig()` only — never persisted (cross-reload auth\n * relies on an httpOnly cookie). `registerContact` runs `company.createCompany` →\n * `user.registerContact` → implicit `login` → `address.createCompanyAddress` →\n * `user.triggerContactSendWelcomeEmailEvent`. `registerCustomer` runs\n * `user.registerCustomer` → `login` → `address.createCustomerAddress` →\n * `user.triggerCustomerSendWelcomeEmailEvent`, re-fetching the viewer afterward.\n * When `autoLogin` is `false` the session is dropped via `clearAccessToken()`.\n * `forgotPassword` calls `user.sendPasswordResetEmail()`.\n */\nexport function useAuth(options: UseAuthOptions): UseAuthReturn {\n const { graphqlClient, language = 'NL', onAuthHeaderUpdate, configuration } = options;\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // ── Login ─────────────────────────────────────────────────────────────────\n\n const login = useCallback(async (\n email: string,\n password: string,\n onLoginSubmit?: (email: string, password: string) => Promise<Contact | Customer>,\n ): Promise<Result<AuthSuccess, string>> => {\n setLoading(true);\n setError(null);\n try {\n if (onLoginSubmit) {\n const user = await onLoginSubmit(email, password);\n return ok({ user });\n }\n const loginService = createServices(graphqlClient).login;\n const loginResult = await loginService.login({ email, password });\n const session = loginResult?.session;\n const accessToken = session?.accessToken;\n const refreshToken = session?.refreshToken;\n const expiresAt = session?.expirationTime;\n if (accessToken) {\n // Set the Bearer header IN MEMORY only for the rest of this page\n // session — do NOT call graphqlClient.setAccessToken(), whose SDK\n // default resolver persists the JWT to localStorage['access_token']\n // (the XSS hole Phase 5 closed). Cross-reload auth is handled by the\n // httpOnly cookie: the caller's afterLogin POSTs the token to\n // /api/auth/session and the /api/graphql proxy injects Bearer\n // server-side from that cookie.\n const cfg = graphqlClient.getConfig();\n graphqlClient.updateConfig({\n headers: { ...cfg.headers, Authorization: `Bearer ${accessToken}` },\n });\n onAuthHeaderUpdate?.(accessToken);\n }\n const userService = createServices(graphqlClient).user;\n const viewerInput: ViewerInput = {\n ...(configuration?.contactTrackAttributes?.length && {\n contactAttributesInput: { attributeDescription: { names: configuration.contactTrackAttributes } },\n }),\n ...(configuration?.customerTrackAttributes?.length && {\n customerAttributesInput: { attributeDescription: { names: configuration.customerTrackAttributes } },\n }),\n ...(configuration?.companyTrackAttributes?.length && {\n companyAttributesInput: { attributeDescription: { names: configuration.companyTrackAttributes } },\n }),\n ...(configuration?.contactPAConfigInput && {\n contactPAConfigInput: configuration.contactPAConfigInput,\n }),\n };\n const viewer = await userService.getViewer(viewerInput);\n const user = viewer as Contact | Customer;\n // Phase D.3: no longer dispatches `userLoggedIn` to coordinate\n // host-side state. The caller receives `user` in the return value and\n // is responsible for updating its own auth store.\n return ok({ user, accessToken, refreshToken, expiresAt });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Login failed';\n setError(msg);\n return err(msg);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, onAuthHeaderUpdate, configuration]);\n\n // ── Register contact ──────────────────────────────────────────────────────\n // Contact registration path:\n // createCompany → registerContact (ContactRegisterInput) → createCompanyAddress(es)\n\n const registerContact = useCallback(async (\n input: RegisterContactInput,\n preferredLanguage = language,\n autoLogin = true,\n ): Promise<Result<AuthSuccess, string>> => {\n setLoading(true);\n setError(null);\n try {\n const userService = createServices(graphqlClient).user;\n const companyService = createServices(graphqlClient).company;\n const addressService = createServices(graphqlClient).address;\n\n let companyId: number | undefined;\n if (input.companyName) {\n const companyInput: CreateCompanyInput = {\n name: input.companyName,\n ...(input.vatNumber && { taxNumber: input.vatNumber }),\n ...(input.cocNumber && { cocNumber: input.cocNumber }),\n email: input.email,\n ...(input.phone && { phone: input.phone }),\n };\n const company = await companyService.createCompany({\n input: companyInput,\n contactPAConfigInput: { page: 1, offset: 10 },\n companyAttributesInput: {},\n contactSearchArguments: { page: 1, offset: 10 },\n });\n companyId = company.companyId;\n }\n\n const contactInput: ContactRegisterInput = {\n contactRegisterInput: {\n email: input.email,\n password: input.password,\n firstName: input.firstName,\n ...(input.middleName && { middleName: input.middleName }),\n lastName: input.lastName,\n ...(input.phone && { phone: input.phone }),\n ...(input.gender && { gender: input.gender }),\n primaryLanguage: preferredLanguage,\n parentId: companyId as number,\n },\n companyAttributesInput: {},\n contactAttributesInput: {},\n contactPAConfigInput: { page: 1, offset: 10 },\n };\n // The contact-register response carries the new contact's id AND a freshly\n // issued `session` (accessToken/refreshToken/expirationTime) — the backend\n // logs the contact in as part of registration. We capture both here.\n //\n // The response also includes a `favoriteLists` sub-selection that the\n // FavoriteListsV2 service rejects with FORBIDDEN for newly-created contacts.\n // That's a *partial* error: the SDK's executeMutation returns `data`\n // alongside the error (it only throws when `data` is null), so\n // `registerResult` — including `session` — is still returned. The try/catch\n // is defensive in case a future SDK change starts throwing on partials.\n let registeredContactId: number | undefined;\n let registerAccessToken: string | undefined;\n try {\n const registerResult = await userService.registerContact(contactInput);\n registeredContactId = (registerResult?.contact as unknown as Contact | undefined)?.contactId;\n registerAccessToken = registerResult?.session?.accessToken;\n } catch {\n // Swallow: contact creation succeeded server-side; the only failing\n // sub-selection is the favoriteLists field, which is empty for new users.\n }\n\n // Authenticate company-address creation with the token from the register\n // response — NOT with a separate login(). `companyAddressCreate` is a\n // company-scoped mutation the backend authorizes against the logged-in\n // contact; called anonymously (API key only) it returns FORBIDDEN. Set the\n // register-session token as the in-memory Bearer header (the same channel\n // login() uses); we deliberately do NOT call graphqlClient.setAccessToken(),\n // whose SDK default resolver would persist the JWT to\n // localStorage['access_token'] (the XSS hole Phase 5 closed). login() below\n // is a separate concern, run only to establish the real user session.\n if (registerAccessToken) {\n const cfg = graphqlClient.getConfig();\n graphqlClient.updateConfig({\n headers: { ...cfg.headers, Authorization: `Bearer ${registerAccessToken}` },\n });\n }\n\n if (input.street && companyId) {\n const invoiceAddress: CompanyAddressCreateInput = {\n firstName: input.firstName,\n lastName: input.lastName,\n ...(input.gender && { gender: input.gender }),\n street: input.street,\n number: input.number,\n numberExtension: input.numberExtension,\n postalCode: input.postalCode ?? '',\n city: input.city ?? '',\n country: input.country ?? 'NL',\n type: AddressType.invoice,\n isDefault: YesNo.Y,\n companyId,\n };\n await addressService.createCompanyAddress(invoiceAddress);\n\n // Determine the delivery-address payload:\n // - If \"same as billing\" is checked, copy the billing fields and only\n // change `type` to `delivery` so Propeller has a dedicated delivery\n // record for the contact.\n // - Otherwise, use the separately-entered delivery fields (skip if the\n // user left them empty).\n if (input.sameDeliveryAsBilling) {\n const deliveryAddress: CompanyAddressCreateInput = {\n ...invoiceAddress,\n type: AddressType.delivery,\n };\n await addressService.createCompanyAddress(deliveryAddress);\n } else if (input.deliveryStreet) {\n const deliveryAddress: CompanyAddressCreateInput = {\n firstName: input.firstName,\n lastName: input.lastName,\n ...(input.gender && { gender: input.gender }),\n street: input.deliveryStreet,\n number: input.deliveryNumber,\n numberExtension: input.deliveryNumberExtension,\n postalCode: input.deliveryPostalCode ?? '',\n city: input.deliveryCity ?? '',\n country: input.deliveryCountry ?? 'NL',\n type: AddressType.delivery,\n isDefault: YesNo.Y,\n companyId,\n };\n await addressService.createCompanyAddress(deliveryAddress);\n }\n }\n\n if (registeredContactId) {\n try {\n await userService.triggerContactSendWelcomeEmailEvent({\n contactId: registeredContactId,\n language: preferredLanguage,\n ...(configuration?.channelId && { channelId: configuration.channelId }),\n });\n } catch (e) {\n console.error('Failed to send welcome email to contact', e);\n }\n }\n\n if (!autoLogin) {\n // Address creation used the register-session token (set as the in-memory\n // Bearer header above). The caller asked not to stay logged in, so strip\n // that header and notify the host. Nothing was persisted to localStorage,\n // so there's no setAccessToken/localStorage cleanup to do.\n const cfg = graphqlClient.getConfig();\n const headers = { ...cfg.headers };\n delete headers['Authorization'];\n graphqlClient.updateConfig({ headers });\n onAuthHeaderUpdate?.('');\n return ok({});\n }\n\n // Separate concern: establish the real user session. login() re-issues a\n // session (overwriting the in-memory register-session header) and returns\n // the viewer + token for the host to persist via its afterLogin/afterRegistration.\n return await login(input.email, input.password);\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Registration failed';\n setError(msg);\n return err(msg);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, login, onAuthHeaderUpdate, configuration]);\n\n // ── Register customer ──────────────────────────────────────────────────\n // Customer registration path:\n // registerCustomer (CustomerRegisterInput) → login → createCustomerAddress\n\n const registerCustomer = useCallback(async (\n input: RegisterCustomerInput,\n preferredLanguage = language,\n autoLogin = true,\n ): Promise<Result<AuthSuccess, string>> => {\n setLoading(true);\n setError(null);\n try {\n const userService = createServices(graphqlClient).user;\n const addressService = createServices(graphqlClient).address;\n\n const customerInput: CustomerRegisterInput = {\n customerRegisterInput: {\n email: input.email,\n password: input.password,\n firstName: input.firstName,\n ...(input.middleName && { middleName: input.middleName }),\n lastName: input.lastName,\n ...(input.phone && { phone: input.phone }),\n ...(input.gender && { gender: input.gender }),\n primaryLanguage: preferredLanguage,\n },\n customerAttributesInput: {},\n };\n await userService.registerCustomer(customerInput);\n\n const loginResult = await login(input.email, input.password);\n if (!loginResult.ok) return loginResult;\n const loggedInUser = loginResult.data.user;\n\n let addressesCreated = false;\n if (input.street && isCustomer(loggedInUser ?? null)) {\n const customer = loggedInUser as Customer;\n const invoiceAddress: CustomerAddressCreateInput = {\n firstName: input.firstName,\n lastName: input.lastName,\n ...(input.gender && { gender: input.gender }),\n street: input.street,\n number: input.number,\n numberExtension: input.numberExtension,\n postalCode: input.postalCode ?? '',\n city: input.city ?? '',\n country: input.country ?? 'NL',\n type: AddressType.invoice,\n isDefault: YesNo.Y,\n customerId: customer.customerId,\n };\n await addressService.createCustomerAddress(invoiceAddress);\n addressesCreated = true;\n\n // Match the contact flow: when \"same as billing\" is checked, copy the\n // billing fields into a delivery-typed record so Propeller has a\n // dedicated default delivery address. Otherwise, use the separately\n // entered delivery fields (skip if the user left them empty).\n if (input.sameDeliveryAsBilling) {\n const deliveryAddress: CustomerAddressCreateInput = {\n ...invoiceAddress,\n type: AddressType.delivery,\n };\n await addressService.createCustomerAddress(deliveryAddress);\n } else if (input.deliveryStreet) {\n const deliveryAddress: CustomerAddressCreateInput = {\n firstName: input.firstName,\n lastName: input.lastName,\n ...(input.gender && { gender: input.gender }),\n street: input.deliveryStreet,\n number: input.deliveryNumber,\n numberExtension: input.deliveryNumberExtension,\n postalCode: input.deliveryPostalCode ?? '',\n city: input.deliveryCity ?? '',\n country: input.deliveryCountry ?? 'NL',\n type: AddressType.delivery,\n isDefault: YesNo.Y,\n customerId: customer.customerId,\n };\n await addressService.createCustomerAddress(deliveryAddress);\n }\n }\n\n if (isCustomer(loggedInUser ?? null)) {\n try {\n await userService.triggerCustomerSendWelcomeEmailEvent({\n customerId: (loggedInUser as Customer).customerId,\n language: preferredLanguage,\n ...(configuration?.channelId && { channelId: configuration.channelId }),\n });\n } catch (e) {\n console.error('Failed to send welcome email to customer', e);\n }\n }\n\n if (!autoLogin) {\n // Address creation needed the customerId from login(); now drop the\n // session so the caller doesn't see this as a logged-in flow.\n // clearAccessToken() removes localStorage['access_token']; also strip\n // the in-memory Bearer header set during the implicit login above.\n graphqlClient.clearAccessToken();\n const cfg = graphqlClient.getConfig();\n const headers = { ...cfg.headers };\n delete headers['Authorization'];\n graphqlClient.updateConfig({ headers });\n onAuthHeaderUpdate?.('');\n return ok({});\n }\n\n // Re-fetch the viewer so the returned user includes the just-created\n // addresses. The user object captured by login() above is a snapshot\n // taken before the addresses existed, and consumers that store it\n // (auth context, dashboard, /account/addresses) would otherwise see no\n // addresses until the next page load.\n if (addressesCreated) {\n try {\n const viewerInput: ViewerInput = {\n ...(configuration?.customerTrackAttributes?.length && {\n customerAttributesInput: { attributeDescription: { names: configuration.customerTrackAttributes } },\n }),\n };\n const refreshedViewer = await userService.getViewer(viewerInput);\n const refreshedUser = refreshedViewer as Contact | Customer;\n return ok({ ...loginResult.data, user: refreshedUser });\n } catch {\n // Fall through to original loginResult — addresses still exist\n // server-side; only the local snapshot is stale.\n }\n }\n return loginResult;\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Registration failed';\n setError(msg);\n return err(msg);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, login, onAuthHeaderUpdate, configuration]);\n\n // ── Forgot password ─────────────────────────────────────────────────────\n\n const forgotPassword = useCallback(async (email: string): Promise<Result<void, string>> => {\n setLoading(true);\n setError(null);\n try {\n const userService = createServices(graphqlClient).user;\n const resetInput: PasswordResetInput = { email };\n await userService.sendPasswordResetEmail(resetInput);\n return ok(undefined);\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to send reset email';\n setError(msg);\n return err(msg);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient]);\n\n return { loading, error, login, registerContact, registerCustomer, forgotPassword };\n}\n","/**\n * cartInit — 3-step cart initialisation shared by useCart and useProductBundles.\n *\n * Step 1: Search for an existing OPEN cart for this user.\n * Step 2: If none found, create a new cart via startCart.\n * Step 3: Assign default invoice and delivery addresses to the new cart.\n *\n * Framework-agnostic async function.\n */\n\nimport { CartAddressType, CartStatus, Gender } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n Cart,\n CartSearchInput,\n CartStartInput,\n CartStartVariables,\n CartUpdateAddressInput,\n Address,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport {\n isContact,\n isCustomer,\n getAddresses,\n type AnyUser,\n type Services,\n} from '@propeller-commerce/propeller-v2-core-ui';\n\n/** Configuration object for {@link initCart}. */\nexport interface CartInitConfig {\n /**\n * The Services bundle — pass `services` from `usePropellerContext()` / the\n * provider's value object. Replaces the previous `graphqlClient` field\n * which forced this util to know how to construct services.\n */\n services: Services;\n /** The current user (Contact or Customer); `null` for anonymous carts. */\n user: AnyUser;\n /** Active company ID — overrides user's default company for cart lookup and creation */\n companyId?: number;\n /** Language code for localised cart queries. Defaults to `'NL'`. */\n language?: string;\n /** Image search filters forwarded to cart queries that hydrate item media. */\n imageSearchFilters?: MediaImageProductSearchInput;\n /** Image transformation filters forwarded to cart queries that hydrate item media. */\n imageVariantFilters?: TransformationsInput;\n /** Callback invoked with the resolved cart once it is fetched or created. */\n onCartCreated?: (cart: Cart) => void;\n}\n\n/**\n * Resolves the active cart for the current user.\n * Returns an existing OPEN cart if one exists, otherwise creates and\n * initialises a new cart with default addresses.\n *\n * @param config - The cart initialisation configuration.\n * @returns The resolved (existing or newly created) cart.\n *\n * @remarks\n * Uses the {@link Services.cart} SDK service exclusively:\n * - `cart.getCarts` searches for an existing `OPEN` cart by contact/customer/company.\n * - `cart.getCart` hydrates the matched cart by `cartId`.\n * - `cart.startCart` creates a new cart when no open cart is found.\n * - `cart.updateCartAddress` assigns the user's default invoice and delivery\n * addresses to the new cart (best-effort; failures are swallowed).\n */\nexport async function initCart(config: CartInitConfig): Promise<Cart> {\n const {\n services,\n user,\n companyId,\n language = 'NL',\n imageSearchFilters,\n imageVariantFilters,\n onCartCreated,\n } = config;\n\n const cartService = services.cart;\n\n // ── Step 1: Look for an existing open cart ────────────────────────────────\n if (user) {\n try {\n const searchInput: CartSearchInput = {\n offset: 100,\n statuses: [CartStatus.OPEN],\n };\n\n if (isContact(user) && user.contactId) {\n searchInput.contactIds = [user.contactId];\n const resolvedCompanyId = companyId ?? user.company?.companyId;\n if (resolvedCompanyId) {\n searchInput.companyIds = [resolvedCompanyId];\n }\n } else if (isCustomer(user) && user.customerId) {\n searchInput.customerIds = [user.customerId];\n }\n\n const carts = await cartService.getCarts(searchInput);\n\n if (carts?.items && carts.items.length > 0) {\n const existingCartId = carts.items[carts.items.length - 1].cartId;\n const cart = await cartService.getCart({\n cartId: existingCartId,\n imageSearchFilters: imageSearchFilters as MediaImageProductSearchInput,\n imageVariantFilters: imageVariantFilters as TransformationsInput,\n language,\n });\n onCartCreated?.(cart);\n return cart;\n }\n } catch (e) {\n console.error('[cartInit] Failed to fetch existing carts:', e);\n }\n }\n\n // ── Step 2: Create a new cart ─────────────────────────────────────────────\n const startInput: CartStartInput = { language };\n\n if (user) {\n if (isContact(user) && user.contactId) {\n startInput.contactId = user.contactId;\n const resolvedCompanyId = companyId ?? user.company?.companyId;\n if (resolvedCompanyId) {\n startInput.companyId = resolvedCompanyId;\n }\n } else if (isCustomer(user) && user.customerId) {\n startInput.customerId = user.customerId;\n }\n }\n\n const startVars: CartStartVariables = {\n input: startInput,\n imageSearchFilters: imageSearchFilters as MediaImageProductSearchInput,\n imageVariantFilters: imageVariantFilters as TransformationsInput,\n language,\n };\n\n let cart = await cartService.startCart(startVars);\n\n // ── Step 3: Assign default addresses ─────────────────────────────────────\n if (cart && user) {\n const addresses = getAddresses(user);\n\n const defaultInvoice = addresses.find(\n (addr: Address) => addr.isDefault === 'Y' && addr.type === 'invoice'\n );\n const defaultDelivery = addresses.find(\n (addr: Address) => addr.isDefault === 'Y' && addr.type === 'delivery'\n );\n\n const addressBase = (addr: Address): Omit<CartUpdateAddressInput, 'type'> => {\n const base: Omit<CartUpdateAddressInput, 'type'> = {\n firstName: addr.firstName || '',\n lastName: addr.lastName || '',\n street: addr.street || '',\n postalCode: addr.postalCode || '',\n city: addr.city || '',\n country: addr.country || 'NL',\n gender: addr.gender || Gender.U,\n };\n if (addr.middleName) base.middleName = addr.middleName;\n if (addr.number) base.number = String(addr.number);\n if (addr.numberExtension) base.numberExtension = String(addr.numberExtension);\n if (addr.company) base.company = addr.company;\n if (addr.email) base.email = addr.email;\n if (addr.mobile) base.mobile = addr.mobile;\n if (addr.phone) base.phone = addr.phone;\n if (addr.notes) base.notes = addr.notes;\n return base;\n };\n\n if (defaultInvoice) {\n try {\n cart = await cartService.updateCartAddress({\n id: cart.cartId,\n input: { type: CartAddressType.INVOICE, ...addressBase(defaultInvoice) },\n imageSearchFilters: imageSearchFilters as MediaImageProductSearchInput,\n imageVariantFilters: imageVariantFilters as TransformationsInput,\n language,\n });\n } catch {\n // Address update is best-effort; cart still works without it\n // and the user can set the address at checkout.\n }\n }\n\n if (defaultDelivery) {\n try {\n cart = await cartService.updateCartAddress({\n id: cart.cartId,\n input: { type: CartAddressType.DELIVERY, ...addressBase(defaultDelivery) },\n imageSearchFilters: imageSearchFilters as MediaImageProductSearchInput,\n imageVariantFilters: imageVariantFilters as TransformationsInput,\n language,\n });\n } catch {\n // Address update is best-effort; cart still works without it\n // and the user can set the address at checkout.\n }\n }\n }\n\n onCartCreated?.(cart);\n return cart;\n}\n","/**\n * useCart (React) — Cart management hook.\n */\n\nimport { useState, useCallback, useMemo, useRef } from 'react';\nimport { createServices, ok, err, type AnyUser, type Result } from '@propeller-commerce/propeller-v2-core-ui';\nimport { CrossupsellType, PurchaseRole } from '@propeller-commerce/propeller-sdk-v2';\nimport type { GraphQLClient, Cart, CartMainItem, Product, Cluster, Contact, Customer, MediaImageProductSearchInput, TransformationsInput, PurchaseAuthorizationConfig, Crossupsell, CrossupsellsQueryVariables, CrossupsellSearchInput, CartProcessResponse } from '@propeller-commerce/propeller-sdk-v2';\nimport { initCart, type CartInitConfig } from '../shared/utils/cartInit';\n\n/** Options for {@link useCart}. */\nexport interface UseCartOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user (Contact or Customer); scopes cart lookup and pricing. */\n user: AnyUser;\n /** Existing cart id to seed the hook with, skipping `resolveCart`. */\n cartId?: string;\n /** Active company id for B2B carts and purchase-authorization checks. */\n companyId?: number;\n /** Cart language. Falls back to `configuration.language`, then `'NL'`. */\n language?: string;\n /** Portal configuration: language plus image search/variant filters. */\n configuration?: { language?: string; imageSearchFiltersGrid?: MediaImageProductSearchInput; imageVariantFiltersSmall?: TransformationsInput };\n /** Fires once whenever a cart is resolved or created — use it to persist `cart.cartId`. */\n onCartCreated?: (cart: Cart) => void;\n}\n\n/** Arguments for {@link UseCartReturn.addItem}. */\nexport interface AddItemOptions {\n /** Product to add. */\n product: Product;\n /** Cluster the product belongs to, when adding a configured cluster item. */\n cluster?: Cluster;\n /** Child product ids for bundle/cluster composite items. */\n childItems?: number[];\n /** Quantity to add. */\n quantity: number;\n /** Free-text line-item notes. */\n notes?: string;\n /** Explicit unit price override. */\n price?: number;\n /** Override: when provided, replaces the SDK call and returns the cart synchronously. */\n onAddToCart?: (product: Product, clusterId?: number, quantity?: number, childItems?: { productId: number; quantity: number }[], notes?: string, price?: number) => Cart;\n /** Fires after the item is added — receives the updated cart and the matched line item. */\n afterAddToCart?: (cart: Cart, item: CartMainItem | null) => void;\n /** When `true`, rejects the add if `product.inventory.totalQuantity` is below `quantity`. */\n enableStockValidation?: boolean;\n /** Explicit cart id to add into; defaults to the hook's resolved cart. */\n cartId?: string;\n /** When `true` and no cart exists, resolves/creates one before adding. */\n createCart?: boolean;\n}\n\n/** Arguments for {@link UseCartReturn.getCrossupsells}. */\nexport interface GetCrossupsellsOptions {\n /** Source product id to fetch crossupsells for. */\n productId?: number;\n /** Source cluster id to fetch crossupsells for. */\n clusterId?: number;\n /** Crossupsell types; defaults to `[ACCESSORIES]`. */\n types?: string[];\n /** Tax zone for price calculation. Defaults to `'NL'`. */\n taxZone?: string;\n /** Image transformation filters for the returned items. */\n imageVariantFilters?: TransformationsInput;\n}\n\n/** Cart state and actions returned by {@link useCart}. */\nexport interface UseCartReturn {\n /** The resolved cart, or `null` before `resolveCart` runs. */\n cart: Cart | null;\n /** Id of the resolved cart, or `''`. */\n cartId: string;\n /** `true` while a mutating cart call is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** `false` when a B2B purchaser's authorization limit is exceeded by the cart total. */\n checkoutAllowed: boolean;\n /** Resolves an existing cart or creates one via the shared `initCart` flow. */\n resolveCart: () => Promise<Cart>;\n /** Adds a product (optionally a cluster/bundle) to the cart. */\n addItem: (\n options: AddItemOptions,\n ) => Promise<Result<{ cart: Cart; item: CartMainItem | null }, string>>;\n /** Updates a line item's quantity. */\n updateItemQuantity: (cartItemId: string, quantity: number) => Promise<Cart | undefined>;\n /** Debounced update of a line item's notes (`debounceMs` defaults to 500). */\n updateItemNotes: (cartItemId: string, notes: string, debounceMs?: number) => void;\n /** Removes a line item from the cart. */\n deleteItem: (cartItemId: string) => Promise<Cart | undefined>;\n /** Applies a promotional action code to the cart. */\n addActionCode: (code: string) => Promise<Cart | undefined>;\n /** Removes a previously-applied action code. */\n removeActionCode: (code: string) => Promise<Cart | undefined>;\n /** Submits the cart for purchase authorization (B2B). */\n requestAuthorization: () => Promise<Result<void, string>>;\n /** Converts the cart into an order (`orderStatus` defaults to `'COMPLETE'`). */\n processCart: (orderStatus?: string) => Promise<Result<CartProcessResponse, string>>;\n /** Fetches crossupsell / accessory products for a product or cluster. */\n getCrossupsells: (options: GetCrossupsellsOptions) => Promise<Crossupsell[]>;\n /** Returns the minimum orderable quantity for a product (>= 1). */\n getMinQuantity: (product: Product | null | undefined) => number;\n /** Returns the quantity step / unit increment for a product (>= 1). */\n getStep: (product: Product | null | undefined) => number;\n}\n\n/**\n * useCart — cart resolution and line-item management.\n *\n * @param options - see {@link UseCartOptions}.\n * @returns cart state plus async actions — see {@link UseCartReturn}.\n *\n * @remarks\n * GraphQL integration: all backend calls go through `services.cart` (`CartService`)\n * and `services.crossupsell` (`CrossupsellService`), derived from\n * `options.graphqlClient` via `createServices`. `resolveCart()` runs the shared\n * `initCart` flow (`getCarts` → `startCart` → `updateCartAddress`). `addItem` calls\n * `addItemToCart`; `updateItemQuantity` / `updateItemNotes` call `updateCartItem`\n * (the notes update is debounced); `deleteItem` calls `deleteCartItem`;\n * `addActionCode` / `removeActionCode` call `addActionCodeToCart` /\n * `removeActionCodeFromCart`; `requestAuthorization` calls\n * `requestPurchaseAuthorization`; `processCart` calls `processCart` to convert the\n * cart to an order; `getCrossupsells` calls `crossupsell.getCrossupsells`. Cart\n * mutations require a cart id; `addItem` can create one on demand via `createCart`.\n */\nexport function useCart(options: UseCartOptions): UseCartReturn {\n const { graphqlClient, user, companyId, configuration, onCartCreated } = options;\n const language = options.language || configuration?.language || 'NL';\n\n const [cart, setCart] = useState<Cart | null>(null);\n const [cartId, setCartId] = useState(options.cartId || '');\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const notesTimers = useRef<Record<string, ReturnType<typeof setTimeout>>>({});\n\n const checkoutAllowed = useMemo<boolean>(() => {\n if (!user || !('contactId' in user)) return true;\n if (!companyId) return true;\n if (!cart) return true;\n const pacData = (user as Contact).purchaseAuthorizationConfigs;\n const items: PurchaseAuthorizationConfig[] = pacData?.items ?? [];\n const purchaserPac = items.find((pac: PurchaseAuthorizationConfig) =>\n pac.purchaseRole === PurchaseRole.PURCHASER && pac.company?.companyId === companyId\n );\n if (!purchaserPac) return true;\n const limit = purchaserPac.authorizationLimit ?? 0;\n const totalGross = cart.total?.totalGross ?? 0;\n return totalGross <= limit;\n }, [user, companyId, cart]);\n\n function getMinQuantity(product: Product | null | undefined): number { const min = product?.minimumQuantity; return min && min > 0 ? min : 1; }\n function getStep(product: Product | null | undefined): number { const unit = product?.unit; return unit && unit > 0 ? unit : 1; }\n\n const resolveCart = useCallback(async (): Promise<Cart> => {\n const config: CartInitConfig = {\n services: createServices(graphqlClient),\n user, companyId, language,\n imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput,\n imageVariantFilters: configuration?.imageVariantFiltersSmall as TransformationsInput,\n onCartCreated: (c) => { setCart(c); setCartId(c.cartId); onCartCreated?.(c); },\n };\n const resolved = await initCart(config);\n setCart(resolved); setCartId(resolved.cartId);\n return resolved;\n }, [graphqlClient, user, companyId, language, configuration, onCartCreated]);\n\n const addItem = useCallback(async (\n opts: AddItemOptions,\n ): Promise<Result<{ cart: Cart; item: CartMainItem | null }, string>> => {\n setLoading(true); setError(null);\n try {\n if (opts.enableStockValidation) {\n const available = opts.product.inventory?.totalQuantity ?? 0;\n if (available < opts.quantity) return err('Insufficient stock available');\n }\n const childItemInputs = opts.childItems?.map((id) => ({ productId: id, quantity: opts.quantity }));\n if (opts.onAddToCart) {\n const resultCart = opts.onAddToCart(opts.product, opts.cluster?.clusterId, opts.quantity, childItemInputs, opts.notes, opts.price);\n setCart(resultCart); setCartId(resultCart.cartId);\n const addedItem = resultCart.items?.find((i: CartMainItem) => i.productId === opts.product.productId) ?? null;\n opts.afterAddToCart?.(resultCart, addedItem);\n return ok({ cart: resultCart, item: addedItem });\n }\n let resolvedCartId = opts.cartId || cartId;\n if (!resolvedCartId) {\n if (opts.createCart) { const c = await resolveCart(); resolvedCartId = c.cartId; }\n else return err('No cart ID provided');\n }\n const service = createServices(graphqlClient).cart;\n const resultCart = await service.addItemToCart({\n id: resolvedCartId,\n input: { productId: opts.product.productId, quantity: opts.quantity, ...(opts.cluster?.clusterId !== undefined && { clusterId: opts.cluster.clusterId }), ...(childItemInputs && { childItems: childItemInputs }), ...(opts.notes && { notes: opts.notes }), ...(opts.price !== undefined && { price: opts.price }) },\n language, imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput, imageVariantFilters: configuration?.imageVariantFiltersSmall as TransformationsInput,\n });\n setCart(resultCart); setCartId(resultCart.cartId);\n const addedItem = resultCart.items?.find((i: CartMainItem) => i.productId === opts.product.productId) ?? null;\n opts.afterAddToCart?.(resultCart, addedItem);\n return ok({ cart: resultCart, item: addedItem });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to add item to cart';\n setError(msg);\n return err(msg);\n } finally { setLoading(false); }\n }, [graphqlClient, cartId, language, configuration, resolveCart]);\n\n const updateItemQuantity = useCallback(async (cartItemId: string, quantity: number): Promise<Cart | undefined> => {\n if (!cartId) return undefined; setLoading(true);\n try {\n const service = createServices(graphqlClient).cart;\n const updated = await service.updateCartItem({ id: cartId, itemId: cartItemId, input: { quantity }, language, imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput, imageVariantFilters: configuration?.imageVariantFiltersSmall });\n setCart(updated);\n return updated;\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to update quantity'); }\n finally { setLoading(false); }\n }, [graphqlClient, cartId, language, configuration]);\n\n const updateItemNotes = useCallback((cartItemId: string, notes: string, debounceMs = 500): void => {\n if (notesTimers.current[cartItemId]) clearTimeout(notesTimers.current[cartItemId]);\n notesTimers.current[cartItemId] = setTimeout(async () => {\n delete notesTimers.current[cartItemId];\n if (!cartId) return;\n try {\n const service = createServices(graphqlClient).cart;\n const updated = await service.updateCartItem({ id: cartId, itemId: cartItemId, input: { notes }, language, imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput, imageVariantFilters: configuration?.imageVariantFiltersSmall });\n setCart(updated);\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to update notes'); }\n }, debounceMs);\n }, [graphqlClient, cartId, language, configuration]);\n\n const deleteItem = useCallback(async (cartItemId: string): Promise<Cart | undefined> => {\n if (!cartId) return undefined; setLoading(true);\n try {\n const service = createServices(graphqlClient).cart;\n const updated = await service.deleteCartItem({\n id: cartId,\n input: { itemId: cartItemId },\n language,\n imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput,\n imageVariantFilters: configuration?.imageVariantFiltersSmall as TransformationsInput\n });\n setCart(updated);\n return updated;\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to delete item'); }\n finally { setLoading(false); }\n }, [graphqlClient, cartId, language, configuration]);\n\n const addActionCode = useCallback(async (code: string): Promise<Cart | undefined> => {\n if (!cartId) return undefined;\n try {\n const service = createServices(graphqlClient).cart;\n const updated = await service.addActionCodeToCart({ id: cartId, input: { actionCode: code }, language, imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput, imageVariantFilters: configuration?.imageVariantFiltersSmall });\n setCart(updated);\n return updated;\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to add action code'); }\n }, [graphqlClient, cartId, language, configuration]);\n\n const removeActionCode = useCallback(async (code: string): Promise<Cart | undefined> => {\n if (!cartId) return undefined;\n try {\n const service = createServices(graphqlClient).cart;\n const updated = await service.removeActionCodeFromCart({ id: cartId, input: { actionCode: code }, language, imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput, imageVariantFilters: configuration?.imageVariantFiltersSmall });\n setCart(updated);\n return updated;\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to remove action code'); }\n }, [graphqlClient, cartId, language, configuration]);\n\n const requestAuthorization = useCallback(async (): Promise<Result<void, string>> => {\n if (!cartId) return err('No cart');\n try {\n const service = createServices(graphqlClient).cart;\n await service.requestPurchaseAuthorization({ id: cartId });\n return ok(undefined);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : 'Failed to request authorization');\n }\n }, [graphqlClient, cartId]);\n\n const processCart = useCallback(async (orderStatus = 'COMPLETE'): Promise<Result<CartProcessResponse, string>> => {\n if (!cartId) return err('No cart');\n try {\n const service = createServices(graphqlClient).cart;\n const response = await service.processCart({ id: cartId, input: { orderStatus, language } });\n return ok(response);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : 'Failed to process cart');\n }\n }, [graphqlClient, cartId, language]);\n\n const getCrossupsells = useCallback(async (opts: GetCrossupsellsOptions): Promise<Crossupsell[]> => {\n const { productId, clusterId, types, taxZone, imageVariantFilters } = opts;\n if (!productId && !clusterId) return [];\n try {\n const service = createServices(graphqlClient).crossupsell;\n const variables: CrossupsellsQueryVariables = {\n input: {\n types: (types ?? [CrossupsellType.ACCESSORIES]) as CrossupsellSearchInput['types'],\n page: 1,\n offset: 50,\n ...(productId && !clusterId && { productIdsFrom: [productId] }),\n ...(clusterId && { clusterIdsFrom: [clusterId] }),\n },\n language,\n imageSearchFilters: configuration?.imageSearchFiltersGrid as MediaImageProductSearchInput,\n imageVariantFilters: imageVariantFilters ?? configuration?.imageVariantFiltersSmall as TransformationsInput,\n priceCalculateProductInput: {\n taxZone: taxZone || 'NL',\n ...(user && 'company' in user && { companyId: (user as Contact)?.company?.companyId }),\n ...(user && 'contactId' in user && { contactId: (user as Contact)?.contactId }),\n ...(user && 'customerId' in user && { customerId: (user as Customer)?.customerId }),\n },\n };\n const result = await service.getCrossupsells(variables);\n return result?.items ?? [];\n } catch { return []; }\n }, [graphqlClient, language, configuration, user]);\n\n return { cart, cartId, loading, error, checkoutAllowed, resolveCart, addItem, updateItemQuantity, updateItemNotes, deleteItem, addActionCode, removeActionCode, requestAuthorization, processCart, getCrossupsells, getMinQuantity, getStep };\n}\n","/**\n * useCheckout (React) — Multi-step checkout SDK logic.\n *\n * Encapsulates all SDK service calls for the checkout flow:\n * - Pre-populating cart addresses from user's saved default addresses\n * - Updating cart invoice/delivery addresses\n * - Updating cart shipping + payment data\n * - Placing an order or quote request (processCart → setOrderStatus → optional triggerQuoteSendRequest)\n * - Syncing a user's stored account address after in-checkout edits\n */\n\nimport { useState, useCallback } from 'react';\nimport {\n createServices,\n isContact,\n isCustomer,\n ok,\n err,\n type AnyUser,\n type Result,\n} from '@propeller-commerce/propeller-v2-core-ui';\nimport { AddressType, CartAddressType, Gender, PaymentStatuses } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Cart,\n CartUpdateAddressInput,\n CartUpdateInput,\n MediaImageProductSearchInput,\n TransformationsInput,\n Address,\n Company,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Options for {@link useCheckout}. */\nexport interface UseCheckoutOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; supplies the saved default addresses pre-populated into the cart. */\n user: AnyUser;\n /** Active company id used to resolve the contact's company addresses. */\n companyId?: number;\n /** Checkout language. Defaults to `'NL'`. */\n language?: string;\n /** Portal configuration: image search/variant filters passed to cart mutations. */\n configuration?: {\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n };\n}\n\n/** Arguments for {@link UseCheckoutReturn.placeOrder}. */\nexport interface PlaceOrderOptions {\n /** Id of the cart to convert. */\n cartId: string;\n /** Order status to set — `'NEW'` for an order, `'REQUEST'` for a quote request. */\n orderStatus: 'NEW' | 'REQUEST';\n /** Customer reference printed on the order. */\n reference?: string;\n /** Free-text order notes. */\n notes?: string;\n /** When `true`, treats this as a quote: suppresses confirmation email/PDF and triggers a quote-send request. */\n isQuoteMode?: boolean;\n}\n\n/** State and checkout actions returned by {@link useCheckout}. */\nexport interface UseCheckoutReturn {\n /** `true` while a checkout call is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Pre-populate cart addresses from user's default saved addresses. Returns updated cart. */\n populateCartAddresses: (cart: Cart) => Promise<Cart>;\n /** Update a single cart address (invoice or delivery). Returns updated cart. */\n updateCartAddress: (cartId: string, input: CartUpdateAddressInput) => Promise<Cart>;\n /** Update cart shipping carrier + payment method. Returns updated cart. */\n updateCartShipping: (cartId: string, input: CartUpdateInput) => Promise<Cart>;\n /** Process cart to order/quote, set status, optionally trigger quote send. Returns orderId on success. */\n placeOrder: (options: PlaceOrderOptions) => Promise<Result<{ orderId: number }, string>>;\n /** Sync a user's stored account address with data entered during checkout. */\n updateUserAccountAddress: (addressData: Record<string, unknown>, type: CartAddressType) => Promise<void>;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useCheckout — multi-step checkout SDK logic.\n *\n * @param options - see {@link UseCheckoutOptions}.\n * @returns loading/error state plus async checkout actions — see {@link UseCheckoutReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * Cart steps go through `services.cart` (`CartService`) — `populateCartAddresses` and\n * `updateCartAddress` call `updateCartAddress`, `updateCartShipping` calls `updateCart`.\n * `placeOrder` calls `cart.updateCart` (when reference/notes are set), `cart.processCart`\n * to obtain the order id, then `services.order` (`OrderService`) `setOrderStatus` and,\n * in quote mode, `triggerQuoteSendRequest`. `updateUserAccountAddress` writes the\n * user's stored address back via `services.address` (`AddressService`) —\n * `updateCompanyAddress` for contacts, `updateCustomerAddress` for customers.\n * All calls require an authenticated session.\n */\nexport function useCheckout(options: UseCheckoutOptions): UseCheckoutReturn {\n const { graphqlClient, user, companyId } = options;\n const language = options.language ?? 'NL';\n const configuration = options.configuration ?? {};\n\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // ── Helpers ───────────────────────────────────────────────────────────────\n\n function getActiveCompany(): Company | null {\n if (!user || !isContact(user)) return null;\n if (companyId) {\n const items = user.companies?.items;\n if (Array.isArray(items)) {\n const found = items.find((c) => c.companyId === companyId);\n if (found) return found;\n }\n }\n return user.company ?? null;\n }\n\n function getUserDefaultAddress(type: 'invoice' | 'delivery'): Address | null {\n if (!user) return null;\n let addresses: Address[] = [];\n if (isContact(user)) {\n const company = getActiveCompany();\n if (company) addresses = (company.addresses ?? []) as Address[];\n } else if (isCustomer(user)) {\n addresses = (user.addresses ?? []) as Address[];\n }\n const addressType = type === 'invoice' ? AddressType.invoice : AddressType.delivery;\n return addresses.find((a) => a.type === addressType && a.isDefault === 'Y')\n || addresses.find((a) => a.type === addressType)\n || null;\n }\n\n // ── Populate cart addresses ───────────────────────────────────────────────\n\n const populateCartAddresses = useCallback(\n async (cart: Cart): Promise<Cart> => {\n const cartService = createServices(graphqlClient).cart;\n const imageSearchFilters = configuration.imageSearchFiltersGrid;\n const imageVariantFilters = configuration.imageVariantFiltersSmall;\n const hasInvoice = !!cart.invoiceAddress?.street;\n const hasDelivery = !!cart.deliveryAddress?.street;\n\n let updatedCart = cart;\n\n if (!hasInvoice) {\n const defaultInvoice = getUserDefaultAddress('invoice');\n if (defaultInvoice) {\n const input: CartUpdateAddressInput = {\n type: CartAddressType.INVOICE,\n firstName: defaultInvoice.firstName || '',\n lastName: defaultInvoice.lastName || '',\n street: defaultInvoice.street || '',\n postalCode: defaultInvoice.postalCode || '',\n city: defaultInvoice.city || '',\n company: defaultInvoice.company,\n gender: defaultInvoice.gender,\n middleName: defaultInvoice.middleName,\n number: defaultInvoice.number,\n numberExtension: defaultInvoice.numberExtension,\n country: defaultInvoice.country,\n email: defaultInvoice.email,\n mobile: defaultInvoice.mobile,\n phone: defaultInvoice.phone,\n };\n updatedCart = await cartService.updateCartAddress({\n id: updatedCart.cartId,\n input,\n imageVariantFilters,\n imageSearchFilters,\n language,\n });\n }\n }\n\n if (!hasDelivery) {\n const defaultDelivery = getUserDefaultAddress('delivery');\n if (defaultDelivery) {\n const input: CartUpdateAddressInput = {\n type: CartAddressType.DELIVERY,\n firstName: defaultDelivery.firstName || '',\n lastName: defaultDelivery.lastName || '',\n street: defaultDelivery.street || '',\n postalCode: defaultDelivery.postalCode || '',\n city: defaultDelivery.city || '',\n company: defaultDelivery.company,\n gender: defaultDelivery.gender,\n middleName: defaultDelivery.middleName,\n number: defaultDelivery.number,\n numberExtension: defaultDelivery.numberExtension,\n country: defaultDelivery.country,\n email: defaultDelivery.email,\n mobile: defaultDelivery.mobile,\n phone: defaultDelivery.phone,\n };\n updatedCart = await cartService.updateCartAddress({\n id: updatedCart.cartId,\n input,\n imageVariantFilters,\n imageSearchFilters,\n language,\n });\n }\n }\n\n return updatedCart;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [graphqlClient, user, companyId, language, configuration]\n );\n\n // ── Update cart address ───────────────────────────────────────────────────\n\n const updateCartAddress = useCallback(\n async (cartId: string, input: CartUpdateAddressInput): Promise<Cart> => {\n const cartService = createServices(graphqlClient).cart;\n return cartService.updateCartAddress({\n id: cartId,\n input,\n imageVariantFilters: configuration.imageVariantFiltersSmall,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n language,\n });\n },\n [graphqlClient, language, configuration]\n );\n\n // ── Update cart shipping ──────────────────────────────────────────────────\n\n const updateCartShipping = useCallback(\n async (cartId: string, input: CartUpdateInput): Promise<Cart> => {\n const cartService = createServices(graphqlClient).cart;\n return cartService.updateCart({\n id: cartId,\n input,\n imageVariantFilters: configuration.imageVariantFiltersSmall,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n language,\n });\n },\n [graphqlClient, language, configuration]\n );\n\n // ── Place order ───────────────────────────────────────────────────────────\n\n const placeOrder = useCallback(\n async (opts: PlaceOrderOptions): Promise<Result<{ orderId: number }, string>> => {\n setLoading(true);\n setError(null);\n try {\n const cartService = createServices(graphqlClient).cart;\n const orderService = createServices(graphqlClient).order;\n const { cartId, orderStatus, reference, notes, isQuoteMode } = opts;\n\n if (reference || notes) {\n await cartService.updateCart({\n id: cartId,\n input: { reference: reference || undefined, notes: notes || undefined },\n imageVariantFilters: configuration.imageVariantFiltersSmall,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n language,\n });\n }\n\n const response = await cartService.processCart({\n id: cartId,\n input: { orderStatus: orderStatus as string, language },\n });\n\n if (!response?.cartOrderId) {\n throw new Error('No order ID returned from processCart');\n }\n\n const orderId = response.cartOrderId;\n\n await orderService.setOrderStatus({\n orderId,\n status: orderStatus as string,\n payStatus: PaymentStatuses.OPEN,\n sendOrderConfirmationEmail: !isQuoteMode,\n addPDFAttachment: !isQuoteMode,\n triggerOrderSendConfirmEvent: !isQuoteMode,\n deleteCart: true,\n });\n\n if (isQuoteMode) {\n await orderService.triggerQuoteSendRequest({ orderId, language });\n }\n\n return ok({ orderId });\n } catch (e: unknown) {\n const msg = e instanceof Error ? e.message : 'Failed to place order';\n setError(msg);\n return err(msg);\n } finally {\n setLoading(false);\n }\n },\n [graphqlClient, language, configuration]\n );\n\n // ── Update user account address ───────────────────────────────────────────\n\n const updateUserAccountAddress = useCallback(\n async (addressData: Record<string, unknown>, type: CartAddressType): Promise<void> => {\n if (!user) return;\n\n const addressService = createServices(graphqlClient).address;\n const addressType = type === CartAddressType.INVOICE\n ? AddressType.invoice\n : AddressType.delivery;\n\n let addresses: Address[] = [];\n const company = isContact(user) ? getActiveCompany() : null;\n if (isContact(user)) {\n if (!company) return;\n addresses = (company.addresses ?? []) as Address[];\n } else if (isCustomer(user)) {\n addresses = (user.addresses ?? []) as Address[];\n }\n\n const matchedAddr = addresses.find((a) => a.type === addressType && a.isDefault === 'Y')\n || addresses.find((a) => a.type === addressType);\n\n if (!matchedAddr?.id) return;\n\n try {\n const commonFields = {\n id: Number(matchedAddr.id),\n company: addressData.company as string | undefined,\n gender: addressData.gender as Gender | undefined,\n firstName: addressData.firstName as string | undefined,\n middleName: addressData.middleName as string | undefined,\n lastName: addressData.lastName as string | undefined,\n email: addressData.email as string | undefined,\n street: addressData.street as string | undefined,\n number: addressData.number as string | undefined,\n numberExtension: addressData.numberExtension as string | undefined,\n postalCode: addressData.postalCode as string | undefined,\n city: addressData.city as string | undefined,\n country: addressData.country as string | undefined,\n isDefault: matchedAddr.isDefault,\n };\n\n if (isContact(user) && company) {\n await addressService.updateCompanyAddress({\n ...commonFields,\n companyId: (company as { companyId: number }).companyId,\n });\n } else if (isCustomer(user)) {\n await addressService.updateCustomerAddress({\n ...commonFields,\n customerId: user.customerId,\n });\n }\n } catch (e: unknown) {\n console.error('Error updating user account address:', e);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [graphqlClient, user, companyId]\n );\n\n return {\n loading,\n error,\n populateCartAddresses,\n updateCartAddress,\n updateCartShipping,\n placeOrder,\n updateUserAccountAddress,\n };\n}\n","/**\n * useClusterConfigurator (React) — Cascading attribute selection state machine.\n */\n\nimport { useState, useMemo, useCallback } from 'react';\nimport type { Product, AttributeResult, ClusterConfig, ClusterConfigSetting } from '@propeller-commerce/propeller-sdk-v2';\nimport {\n attributeNameMatches,\n extractAttributeValues,\n filterProductsBySelections,\n collectAttributeValues,\n getAttributeDisplayName,\n} from '@propeller-commerce/propeller-v2-core-ui';\n\n/** A cluster-config setting resolved against the current product set and selections. */\nexport interface ConfiguredSetting {\n /** Setting id from the cluster config. */\n id: number;\n /** Raw attribute name this setting selects on. */\n name: string;\n /** Display widget hint (e.g. dropdown, swatch). */\n displayType: string;\n /**\n * Source-of-truth attribute type from the underlying\n * `attributeDescription.type` (e.g. `COLOR`, `TEXT`, `INT`). PIMs sometimes\n * configure a setting with `displayType: 'COLOR'` even though the attribute\n * holds plain text — the configurator uses this field to decide whether a\n * value is actually a colour (render swatch) or just a label (render chip).\n * `undefined` when no product carries the attribute yet.\n */\n attributeType?: string;\n /** Sort priority — settings render in ascending order. */\n priority: string;\n /** Localized, human-readable label for the setting. */\n displayName: string;\n /** Attribute values still selectable given prior selections. */\n availableValues: string[];\n /** Currently selected value, or `''`. */\n selectedValue: string;\n /** `true` when no values are available or a preceding setting is unselected. */\n disabled: boolean;\n}\n\n/** Options for {@link useClusterConfigurator}. */\nexport interface UseClusterConfiguratorOptions {\n /** All product variants in the cluster being configured. */\n products: Product[];\n /** Cluster configuration describing the selectable attribute settings. */\n config: ClusterConfig;\n /** Language used to resolve attribute display names. Defaults to `'NL'`. */\n language?: string;\n /** Fires when a complete selection narrows to a single product variant. */\n onConfigurationChange?: (product: Product) => void;\n}\n\n/** Selection state and actions returned by {@link useClusterConfigurator}. */\nexport interface UseClusterConfiguratorReturn {\n /** Map of setting name to currently selected value. */\n selectedAttributes: Record<string, string>;\n /** The cluster settings resolved with available values and disabled state. */\n settingsWithValues: ConfiguredSetting[];\n /** Selects a value for a setting and cascades defaults onto later settings. */\n handleAttributeSelect: (settingName: string, value: string) => void;\n /** Seeds the selection from an existing product's attribute values. */\n initFromProduct: (product: Product) => void;\n /** Clears all selections. */\n reset: () => void;\n}\n\n/**\n * useClusterConfigurator — cascading attribute selection state machine.\n *\n * Drives a cluster variant picker: each setting's available values are filtered\n * by the selections made on higher-priority settings, and once every setting has\n * a value the matching product is surfaced via `onConfigurationChange`.\n *\n * @param options - see {@link UseClusterConfiguratorOptions}.\n * @returns selection state plus selection actions — see {@link UseClusterConfiguratorReturn}.\n */\nexport function useClusterConfigurator(\n options: UseClusterConfiguratorOptions\n): UseClusterConfiguratorReturn {\n const { products, config, language = 'NL', onConfigurationChange } = options;\n\n const [selectedAttributes, setSelectedAttributes] = useState<Record<string, string>>({});\n\n function getSortedSettings(): ClusterConfigSetting[] {\n const settings = config?.settings;\n if (!settings?.length) return [];\n return settings.slice().sort((a, b) => parseInt(a.priority) - parseInt(b.priority));\n }\n\n function getAvailableValuesForIndexWithSelections(\n attributeName: string,\n settingIndex: number,\n selections: Record<string, string>\n ): string[] {\n if (settingIndex === 0) return collectAttributeValues(products, attributeName);\n const sortedSettings = getSortedSettings();\n const previousSelections: Record<string, string> = {};\n for (let i = 0; i < settingIndex; i++) {\n const prev = sortedSettings[i];\n if (selections[prev.name]) previousSelections[prev.name] = selections[prev.name];\n }\n const matching = filterProductsBySelections(products, previousSelections);\n return collectAttributeValues(matching, attributeName);\n }\n\n const settingsWithValues = useMemo<ConfiguredSetting[]>(() => {\n const sortedSettings = getSortedSettings();\n const sel = selectedAttributes;\n return sortedSettings.map((setting, index) => {\n const availableValues = getAvailableValuesForIndexWithSelections(setting.name, index, sel);\n const selectedValue = sel[setting.name] || '';\n const isPreviousMissing = index > 0 && sortedSettings.slice(0, index).some((prev) => !sel[prev.name]);\n const isDisabled = availableValues.length === 0 || isPreviousMissing;\n let displayName = setting.name;\n let attributeType: string | undefined;\n // Look across all products, not just the first — different variants\n // may omit an attribute, and the first product happens not to carry\n // the type/description we need.\n for (const product of products) {\n const items = product.attributes?.items as AttributeResult[] | undefined;\n if (!items) continue;\n const match = items.find((a) => attributeNameMatches(a, setting.name));\n if (!match) continue;\n displayName = getAttributeDisplayName(match, language) || setting.name;\n attributeType = (match.attributeDescription?.type ?? undefined) as string | undefined;\n break;\n }\n return { id: setting.id, name: setting.name, displayType: setting.displayType as string, attributeType, priority: setting.priority, displayName, availableValues, selectedValue, disabled: isDisabled };\n });\n }, [products, config, selectedAttributes, language]);\n\n const handleAttributeSelect = useCallback(\n (settingName: string, value: string): void => {\n const sortedSettings = getSortedSettings();\n const changedIndex = sortedSettings.findIndex((s) => s.name === settingName);\n if (changedIndex < 0) return;\n const newSelections: Record<string, string> = { ...selectedAttributes };\n newSelections[settingName] = value;\n for (let i = changedIndex + 1; i < sortedSettings.length; i++) delete newSelections[sortedSettings[i].name];\n for (let i = changedIndex + 1; i < sortedSettings.length; i++) {\n const next = sortedSettings[i];\n const available = getAvailableValuesForIndexWithSelections(next.name, i, newSelections);\n if (available.length > 0) { newSelections[next.name] = available[0]; } else { break; }\n }\n setSelectedAttributes(newSelections);\n const allSelected = sortedSettings.every((s) => !!newSelections[s.name]);\n if (allSelected) {\n const matching = filterProductsBySelections(products, newSelections);\n if (matching.length > 0 && onConfigurationChange) onConfigurationChange(matching[0]);\n }\n },\n [products, config, selectedAttributes, onConfigurationChange]\n );\n\n const initFromProduct = useCallback(\n (product: Product): void => {\n const sortedSettings = getSortedSettings();\n if (!sortedSettings.length) return;\n const attrItems = product.attributes?.items as AttributeResult[] | undefined;\n if (!attrItems) return;\n const initial: Record<string, string> = {};\n for (const setting of sortedSettings) {\n const match = attrItems.find((a) => attributeNameMatches(a, setting.name));\n if (match) { const values = extractAttributeValues(match); if (values.length) initial[setting.name] = values[0]; }\n }\n if (!Object.keys(initial).length) return;\n setSelectedAttributes(initial);\n const allSelected = sortedSettings.every((s) => !!initial[s.name]);\n if (allSelected && onConfigurationChange) {\n const matching = filterProductsBySelections(products, initial);\n if (matching.length > 0) onConfigurationChange(matching[0]);\n }\n },\n [products, config, onConfigurationChange]\n );\n\n const reset = useCallback(() => setSelectedAttributes({}), []);\n\n return { selectedAttributes, settingsWithValues, handleAttributeSelect, initFromProduct, reset };\n}\n","/**\n * useCompany (React) — Company switcher and Purchase Authorization Configurator.\n *\n * Responsibilities:\n * - fetchCompany: CompanyService.getCompany() with correctly-typed CompanyVariables\n * - fetchPendingCarts: CartService.getCarts() with CartStatus.PENDING_PURCHASE_AUTHORIZATION\n * - createPac / updatePac / deletePac: PurchaseAuthorizationConfigService with proper input types\n * - acceptCartRequest: CartService.acceptPurchaseAuthorizationRequest()\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { CartStatus } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Company,\n Cart,\n CompanyVariables,\n ContactSearchArguments,\n ContactPurchaseAuthorizationConfigSearchInput,\n AttributeResultSearchInput,\n PurchaseAuthorizationConfigCreateInput,\n PurchaseAuthorizationConfigUpdateInput,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface UseCompanyOptions {\n /** GraphQL client. Nullable so the hook can be called unconditionally even\n * when CompanySwitcher renders before the client is ready (see CompanySwitcher). */\n graphqlClient: GraphQLClient | null | undefined;\n /** Language used for company-scoped queries. */\n language?: string;\n}\n\n/** State and company actions returned by {@link useCompany}. */\nexport interface UseCompanyReturn {\n /** The fetched company, or `null`. */\n company: Company | null;\n /** Carts awaiting purchase authorization for the company. */\n pendingCarts: Cart[];\n /** `true` while a fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Fetches a company by id, optionally overriding the default search/PA-config inputs. */\n fetchCompany: (companyId: number, overrides?: Partial<Omit<CompanyVariables, 'id'>>) => Promise<void>;\n /** Loads carts pending purchase authorization for the company. */\n fetchPendingCarts: (companyId: number) => Promise<void>;\n /** Creates a Purchase Authorization Config (PAC). */\n createPac: (input: PurchaseAuthorizationConfigCreateInput) => Promise<{ success: boolean; error?: string }>;\n /** Updates an existing PAC by id. */\n updatePac: (pacId: string, input: PurchaseAuthorizationConfigUpdateInput) => Promise<{ success: boolean; error?: string }>;\n /** Deletes a PAC by id. */\n deletePac: (pacId: string) => Promise<{ success: boolean; error?: string }>;\n /** Accepts a cart's pending purchase-authorization request. */\n acceptCartRequest: (cartId: string) => Promise<{ success: boolean; error?: string }>;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useCompany — company switcher and Purchase Authorization configurator.\n *\n * @param options - see {@link UseCompanyOptions}.\n * @returns company state plus async actions — see {@link UseCompanyReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `fetchCompany` calls `services.company.getCompany()` (`CompanyService`) with\n * `contactSearchArguments`, `contactPAConfigInput` and `companyAttributesInput`.\n * `fetchPendingCarts` and `acceptCartRequest` go through `services.cart` (`CartService`)\n * — `getCarts` filtered by `CartStatus.PENDING_PURCHASE_AUTHORIZATION`, and\n * `acceptPurchaseAuthorizationRequest`. PAC CRUD goes through\n * `services.purchaseAuthConfig` (`PurchaseAuthorizationConfigService`) —\n * `createPurchaseAuthorizationConfig` / `updatePurchaseAuthorizationConfig` /\n * `deletePurchaseAuthorizationConfig`. All calls require an authenticated session;\n * each method no-ops or returns `{ success: false }` when `graphqlClient` is null.\n */\nexport function useCompany(options: UseCompanyOptions): UseCompanyReturn {\n const { graphqlClient } = options;\n\n const [company, setCompany] = useState<Company | null>(null);\n const [pendingCarts, setPendingCarts] = useState<Cart[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // ── Fetch company ─────────────────────────────────────────────────────────\n // - contactSearchArguments: { page: 1, offset: 50 }\n // - contactPAConfigInput: { companyIds: [companyId], page: 1, offset: 100 }\n // - companyAttributesInput: {}\n\n const fetchCompany = useCallback(async (companyId: number, overrides?: Partial<Omit<CompanyVariables, 'id'>>): Promise<void> => {\n if (!graphqlClient) return;\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).company;\n const contactSearchArguments: ContactSearchArguments = { page: 1, offset: 50 };\n const contactPAConfigInput: ContactPurchaseAuthorizationConfigSearchInput = {\n companyIds: [companyId],\n page: 1,\n offset: 100,\n };\n const companyAttributesInput: AttributeResultSearchInput = {};\n const variables: CompanyVariables = {\n id: companyId,\n contactSearchArguments: overrides?.contactSearchArguments ?? contactSearchArguments,\n contactPAConfigInput: overrides?.contactPAConfigInput ?? contactPAConfigInput,\n companyAttributesInput: overrides?.companyAttributesInput ?? companyAttributesInput,\n };\n const result = await service.getCompany(variables);\n setCompany(result);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch company');\n } finally {\n setLoading(false);\n }\n }, [graphqlClient]);\n\n // ── Fetch pending carts ───────────────────────────────────────────────────\n // - statuses: [CartStatus.PENDING_PURCHASE_AUTHORIZATION]\n\n const fetchPendingCarts = useCallback(async (companyId: number): Promise<void> => {\n if (!graphqlClient) return;\n setLoading(true);\n try {\n const service = createServices(graphqlClient).cart;\n const result = await service.getCarts({\n companyIds: [companyId],\n statuses: [CartStatus.PENDING_PURCHASE_AUTHORIZATION],\n offset: 50,\n });\n setPendingCarts(result.items ?? []);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch pending carts');\n } finally {\n setLoading(false);\n }\n }, [graphqlClient]);\n\n // ── PAC CRUD ──────────────────────────────────────────────────────────────\n\n const createPac = useCallback(async (\n input: PurchaseAuthorizationConfigCreateInput,\n ): Promise<{ success: boolean; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n try {\n const service = createServices(graphqlClient).purchaseAuthConfig;\n await service.createPurchaseAuthorizationConfig(input);\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to create PAC' };\n }\n }, [graphqlClient]);\n\n const updatePac = useCallback(async (\n pacId: string,\n input: PurchaseAuthorizationConfigUpdateInput,\n ): Promise<{ success: boolean; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n try {\n const service = createServices(graphqlClient).purchaseAuthConfig;\n await service.updatePurchaseAuthorizationConfig(pacId, input);\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to update PAC' };\n }\n }, [graphqlClient]);\n\n const deletePac = useCallback(async (pacId: string): Promise<{ success: boolean; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n try {\n const service = createServices(graphqlClient).purchaseAuthConfig;\n await service.deletePurchaseAuthorizationConfig(pacId);\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to delete PAC' };\n }\n }, [graphqlClient]);\n\n const acceptCartRequest = useCallback(async (cartId: string): Promise<{ success: boolean; error?: string }> => {\n if (!graphqlClient) return { success: false, error: 'No client' };\n try {\n const service = createServices(graphqlClient).cart;\n await service.acceptPurchaseAuthorizationRequest({ id: cartId });\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to accept request' };\n }\n }, [graphqlClient]);\n\n return {\n company,\n pendingCarts,\n loading,\n error,\n fetchCompany,\n fetchPendingCarts,\n createPac,\n updatePac,\n deletePac,\n acceptCartRequest,\n };\n}\n","/**\n * useFavorites (React) — Favorite list CRUD with optimistic updates.\n *\n * Responsibilities:\n * - fetchLists: read favoriteLists from Contact/Customer (no separate SDK call needed)\n * - createList: FavoriteListService.createFavoriteList with contactId/customerId from user\n * - updateList / deleteList: FavoriteListService CRUD\n * - addToList / removeFromList: FavoriteListService item management\n * - isProductInList: check products.items for a given productId\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { GraphQLClient, FavoriteList, FavoriteListsCreateInput, Product } from '@propeller-commerce/propeller-sdk-v2';\nimport type { AnyUser } from '@propeller-commerce/propeller-v2-core-ui';\nimport { isContact, isCustomer } from '@propeller-commerce/propeller-v2-core-ui';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Editable fields of a favorite list. */\nexport interface FavoriteListFormData {\n /** List display name. */\n name: string;\n /** Whether the list is the user's default. */\n isDefault: boolean;\n}\n\n/** Options for {@link useFavorites}. */\nexport interface UseFavoritesOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; favorite lists are read off this object. */\n user: AnyUser;\n /** Language for list operations. */\n language?: string;\n /** Override: fires instead of the default `createFavoriteList` call. */\n onCreate?: (data: FavoriteListFormData) => void;\n /** Override: fires instead of the default `updateFavoriteList` call. */\n onEdit?: (id: string, data: FavoriteListFormData) => void;\n /** Override: fires instead of the default `deleteFavoriteList` call. */\n onDelete?: (id: string) => void;\n /** Fires after any list create / update / delete completes. */\n onListChanged?: () => void;\n}\n\n/** State and favorite-list actions returned by {@link useFavorites}. */\nexport interface UseFavoritesReturn {\n /** The user's favorite lists. */\n lists: FavoriteList[];\n /** Always `false` — lists are read synchronously from the user object. */\n loading: boolean;\n /** `true` while a create / update / delete call is in flight. */\n saving: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Id of the list currently being edited, or `null`. */\n editingListId: string | null;\n /** Working copy of the edited list's name. */\n editListName: string;\n /** Working copy of the edited list's default flag. */\n editSetAsDefault: boolean;\n /** Draft name for a new list. */\n newListName: string;\n /** Draft default flag for a new list. */\n newSetAsDefault: boolean;\n /** List staged for deletion confirmation, or `null`. */\n listToDelete: FavoriteList | null;\n /** Re-reads the lists from the current user object. */\n fetchLists: () => void;\n /** Enters edit mode for a list, seeding the edit fields. */\n startEdit: (list: FavoriteList) => void;\n /** Exits edit mode and clears the edit fields. */\n cancelEdit: () => void;\n /** Sets the working edit name. */\n setEditListName: (name: string) => void;\n /** Sets the working edit default flag. */\n setEditSetAsDefault: (v: boolean) => void;\n /** Sets the draft name for a new list. */\n setNewListName: (name: string) => void;\n /** Sets the draft default flag for a new list. */\n setNewSetAsDefault: (v: boolean) => void;\n /** Persists the in-progress edit to the given list id. */\n updateList: (listId: string) => Promise<void>;\n /** Stages a list for delete confirmation. */\n confirmDelete: (list: FavoriteList) => void;\n /** Deletes the staged list, with optimistic removal and rollback on failure. */\n deleteList: () => Promise<void>;\n /** Creates a new favorite list. */\n createList: (name: string, isDefault: boolean) => Promise<void>;\n /** Adds a product and/or cluster to a list. */\n addToList: (listId: string, productId?: number, clusterId?: number) => Promise<void>;\n /** Removes one or more products/clusters from a list. */\n removeFromList: (\n listId: string,\n productId?: number | number[],\n clusterId?: number | number[],\n ) => Promise<void>;\n /** `true` when the list already contains the given product id. */\n isProductInList: (listId: string, productId: number) => boolean;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useFavorites — favorite-list CRUD with optimistic updates.\n *\n * @param options - see {@link UseFavoritesOptions}.\n * @returns list state, edit-form state and async actions — see {@link UseFavoritesReturn}.\n *\n * @remarks\n * GraphQL integration: all mutations go through `services.favoriteList`\n * (`FavoriteListService`), built per-call via `createServices(graphqlClient)`.\n * `fetchLists` is local-only — it reads `user.favoriteLists.items` and makes no API\n * call. `createList` calls `createFavoriteList` (with `contactId`/`customerId` from\n * the user); `updateList` calls `updateFavoriteList`; `deleteList` calls\n * `deleteFavoriteList` (optimistically removing the list and re-adding it on error);\n * `addToList` / `removeFromList` call `addFavoriteListItems` / `removeFavoriteListItems`.\n * Setting a list as default first clears the previous default via `updateFavoriteList`.\n * All mutations require an authenticated session; any `on*` callback fully overrides\n * its default API call.\n */\nexport function useFavorites(options: UseFavoritesOptions): UseFavoritesReturn {\n const { graphqlClient, user, onCreate, onEdit, onDelete, onListChanged } = options;\n\n const [lists, setLists] = useState<FavoriteList[]>([]);\n // fetchLists reads synchronously from the user object — no async loading needed.\n const loading = false;\n const [saving, setSaving] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [editingListId, setEditingListId] = useState<string | null>(null);\n const [editListName, setEditListName] = useState('');\n const [editSetAsDefault, setEditSetAsDefault] = useState(false);\n const [newListName, setNewListName] = useState('');\n const [newSetAsDefault, setNewSetAsDefault] = useState(false);\n const [listToDelete, setListToDelete] = useState<FavoriteList | null>(null);\n\n // ── Fetch lists ───────────────────────────────────────────────────────────\n // Reads favoriteLists from the user object directly.\n\n const fetchLists = useCallback(() => {\n if (!user) { setLists([]); return; }\n const items = user.favoriteLists?.items ?? [];\n setLists(items);\n }, [user]);\n\n // Auto-sync lists from user whenever user changes (covers initial mount).\n useEffect(() => {\n fetchLists();\n }, [fetchLists]);\n\n // ── Edit state helpers ────────────────────────────────────────────────────\n\n const startEdit = useCallback((list: FavoriteList) => {\n setEditingListId(String(list.id));\n setEditListName(list.name);\n setEditSetAsDefault(list.isDefault || false);\n }, []);\n\n const cancelEdit = useCallback(() => {\n setEditingListId(null);\n setEditListName('');\n setEditSetAsDefault(false);\n }, []);\n\n // ── Update list ───────────────────────────────────────────────────────────\n\n const updateList = useCallback(\n async (listId: string): Promise<void> => {\n const data: FavoriteListFormData = { name: editListName, isDefault: editSetAsDefault };\n if (onEdit) { onEdit(listId, data); cancelEdit(); onListChanged?.(); return; }\n setSaving(true);\n try {\n const service = createServices(graphqlClient).favoriteList;\n if (data.isDefault) {\n const currentDefault = lists.find((l) => l.isDefault && String(l.id) !== listId);\n if (currentDefault) {\n await service.updateFavoriteList(String(currentDefault.id), { name: currentDefault.name, isDefault: false });\n }\n }\n const updated = await service.updateFavoriteList(listId, { name: data.name, isDefault: data.isDefault });\n setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));\n cancelEdit();\n onListChanged?.();\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to update list');\n } finally {\n setSaving(false);\n }\n },\n [graphqlClient, editListName, editSetAsDefault, lists, onEdit, onListChanged, cancelEdit]\n );\n\n // ── Delete list ───────────────────────────────────────────────────────────\n\n const confirmDelete = useCallback((list: FavoriteList) => setListToDelete(list), []);\n\n const deleteList = useCallback(async (): Promise<void> => {\n if (!listToDelete) return;\n const list = listToDelete;\n const listId = String(list.id);\n if (onDelete) { onDelete(listId); setListToDelete(null); onListChanged?.(); return; }\n setSaving(true);\n setLists((prev) => prev.filter((l) => String(l.id) !== listId));\n setListToDelete(null);\n try {\n const service = createServices(graphqlClient).favoriteList;\n await service.deleteFavoriteList(listId);\n onListChanged?.();\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to delete list');\n setLists((prev) => [...prev, list]);\n } finally {\n setSaving(false);\n }\n }, [graphqlClient, listToDelete, onDelete, onListChanged]);\n\n // ── Create list ───────────────────────────────────────────────────────────\n // Passes contactId/customerId from the user.\n\n const createList = useCallback(\n async (name: string, isDefault: boolean): Promise<void> => {\n const data: FavoriteListFormData = { name, isDefault };\n if (onCreate) { onCreate(data); onListChanged?.(); return; }\n setSaving(true);\n try {\n const service = createServices(graphqlClient).favoriteList;\n if (isDefault) {\n const currentDefault = lists.find((l) => l.isDefault);\n if (currentDefault) {\n await service.updateFavoriteList(String(currentDefault.id), { name: currentDefault.name, isDefault: false });\n }\n }\n const createInput: FavoriteListsCreateInput = { name, isDefault };\n if (isContact(user)) createInput.contactId = user.contactId;\n if (isCustomer(user)) createInput.customerId = user.customerId;\n const created = await service.createFavoriteList(createInput);\n setLists((prev) => [...prev, created]);\n onListChanged?.();\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to create list');\n } finally {\n setSaving(false);\n }\n },\n [graphqlClient, user, lists, onCreate, onListChanged]\n );\n\n // ── Add / remove items ────────────────────────────────────────────────────\n\n const addToList = useCallback(\n async (listId: string, productId?: number, clusterId?: number): Promise<void> => {\n try {\n const service = createServices(graphqlClient).favoriteList;\n const updated = await service.addFavoriteListItems(listId, {\n ...(productId && { productIds: [productId] }),\n ...(clusterId && { clusterIds: [clusterId] }),\n });\n setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to add to list');\n }\n },\n [graphqlClient]\n );\n\n const removeFromList = useCallback(\n async (\n listId: string,\n productId?: number | number[],\n clusterId?: number | number[],\n ): Promise<void> => {\n const productIds = productId === undefined ? [] : Array.isArray(productId) ? productId : [productId];\n const clusterIds = clusterId === undefined ? [] : Array.isArray(clusterId) ? clusterId : [clusterId];\n if (productIds.length === 0 && clusterIds.length === 0) return;\n try {\n const service = createServices(graphqlClient).favoriteList;\n const updated = await service.removeFavoriteListItems(listId, {\n ...(productIds.length && { productIds }),\n ...(clusterIds.length && { clusterIds }),\n });\n setLists((prev) => prev.map((l) => String(l.id) === listId ? updated : l));\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to remove from list');\n }\n },\n [graphqlClient]\n );\n\n // ── Check product in list ─────────────────────────────────────────────────\n // list.products is ProductsResponse; items are IBaseProduct but runtime Product.\n\n const isProductInList = useCallback(\n (listId: string, productId: number): boolean => {\n const list = lists.find((l) => String(l.id) === listId);\n if (!list) return false;\n return (list.products?.items ?? []).some((p) => (p as Product).productId === productId);\n },\n [lists]\n );\n\n return {\n lists, loading, saving, error,\n editingListId, editListName, editSetAsDefault,\n newListName, newSetAsDefault, listToDelete,\n fetchLists, startEdit, cancelEdit,\n setEditListName, setEditSetAsDefault, setNewListName, setNewSetAsDefault,\n updateList, confirmDelete, deleteList, createList,\n addToList, removeFromList, isProductInList,\n };\n}\n","'use client';\n\nimport { usePropellerContext, PropellerInfra } from '../../context/PropellerContext';\n\ntype InfraKey = keyof PropellerInfra;\n\nconst INFRA_KEYS: InfraKey[] = [\n 'graphqlClient',\n 'user',\n 'companyId',\n 'language',\n 'includeTax',\n 'currency',\n 'configuration',\n 'portalMode',\n];\n\n/**\n * useInfraProps — resolves the Tier 1 infrastructure props for a component.\n *\n * - An explicit prop value (defined and non-null) always wins — existing call\n * sites keep working unchanged (additive / opt-in, no breaking change).\n * - Otherwise the value is taken from `<PropellerProvider>`.\n * - Non-infra props pass through untouched.\n * - Null-context safe: with no provider the props are returned as-is, so\n * components still work standalone / in tests.\n *\n * @param props - the component's raw props, possibly carrying infra keys.\n * @returns the same props with any unset infra keys filled in from the provider.\n */\nexport function useInfraProps<P extends Partial<Record<InfraKey, unknown>>>(\n props: P,\n): P & Partial<PropellerInfra> {\n const ctx = usePropellerContext();\n const resolved = { ...props } as P & Partial<PropellerInfra>;\n for (const key of INFRA_KEYS) {\n const explicit = (props as Record<string, unknown>)[key];\n if (explicit !== undefined && explicit !== null) continue;\n if (ctx && ctx[key] !== undefined) {\n (resolved as Record<string, unknown>)[key] = ctx[key];\n }\n }\n return resolved;\n}\n","/**\n * useMenu (React) — Category tree fetch with depth-configurable recursive GraphQL query.\n *\n * Responsibilities:\n * - Dynamic recursive GraphQL category query (depth-configurable, default 3)\n * - localStorage cache with 12h TTL, user-specific cache key\n * - Maps LocalizedString arrays to flat name/slug strings per language\n */\n\nimport { useState, useCallback } from 'react';\nimport type { GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Raw category shape returned by the recursive GraphQL query */\ninterface MenuCategoryRaw {\n categoryId: number;\n hidden?: boolean | 'Y' | 'N' | string | null;\n name: Array<{ value: string; language: string }>;\n slug: Array<{ value: string }>;\n categories?: MenuCategoryRaw[];\n}\n\nfunction isHidden(raw: MenuCategoryRaw): boolean {\n return raw.hidden === true || raw.hidden === 'Y';\n}\n\n/** A flattened category node in the menu tree. */\nexport interface MenuCategory {\n /** Category id. */\n categoryId: number;\n /** Category name resolved for the active language. */\n name: string;\n /** Category URL slug. */\n slug: string;\n /** Nested child categories (hidden ones filtered out). */\n children: MenuCategory[];\n}\n\n/** Options for {@link useMenu}. */\nexport interface UseMenuOptions {\n /** GraphQL client used to run the recursive category query. */\n graphqlClient: GraphQLClient;\n /** Language used to resolve category names/slugs. Defaults to `'NL'`. */\n language?: string;\n /** Nesting depth for the category tree. Default: 3. */\n depth?: number;\n /** Cache TTL in milliseconds. Default: 12h. */\n cacheTtlMs?: number;\n}\n\n/** State and actions returned by {@link useMenu}. */\nexport interface UseMenuReturn {\n /** The fetched top-level category tree. */\n categories: MenuCategory[];\n /** `true` while a menu fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Fetches the category tree for a root category id; `userKey` scopes the cache. */\n fetchMenu: (rootCategoryId: number, userKey?: string) => Promise<void>;\n /** Removes the cached menu entry for the given root category / language / user. */\n clearCache: (rootCategoryId: number, language: string, userKey?: string) => void;\n}\n\n// ── Constants ─────────────────────────────────────────────────────────────────\n\nconst CACHE_TTL_DEFAULT = 12 * 60 * 60 * 1000; // 12h\n\n// Module-level inflight dedup map — prevents two concurrent fetchMenu calls for\n// the same key (e.g. Menu + HomeFallback both mounting at the same time) from\n// both hitting the API. The second caller awaits the promise and reads from cache.\nconst inflightFetches = new Map<string, Promise<void>>();\n\n// ── Pure helpers (module-level, no reactive deps) ─────────────────────────────\n\n/**\n * Builds recursive `categories { ... }` fragment string for the GraphQL query.\n */\nfunction buildCategoriesQuery(depth: number): string {\n if (depth === 0) return '';\n return `\n categories {\n categoryId\n hidden\n name(language: $language) { value language }\n slug(language: $language) { value }\n ${buildCategoriesQuery(depth - 1)}\n }\n `;\n}\n\n/**\n * Maps a raw SDK category (LocalizedString arrays) to a flat MenuCategory.\n * Picks the entry matching `language`, falls back to first entry.\n */\nfunction mapCategory(raw: MenuCategoryRaw, language: string): MenuCategory {\n const nameEntry = raw.name?.find(n => n.language === language) ?? raw.name?.[0];\n const slugEntry = raw.slug?.[0];\n return {\n categoryId: raw.categoryId,\n name: nameEntry?.value ?? '',\n slug: slugEntry?.value ?? '',\n children: (raw.categories ?? [])\n .filter(child => !isHidden(child))\n .map(child => mapCategory(child, language)),\n };\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useMenu — category-tree fetch with a depth-configurable recursive GraphQL query.\n *\n * @param options - see {@link UseMenuOptions}.\n * @returns the category tree, loading/error state and fetch/cache actions — see {@link UseMenuReturn}.\n *\n * @remarks\n * GraphQL integration: unlike the SDK-service hooks, `fetchMenu` runs a raw query\n * directly via `graphqlClient.query()` — it builds a recursive `categories { ... }`\n * fragment to the configured `depth` and reads the root category's children.\n * Results are cached in `localStorage` with a 12h TTL under a key scoped by root\n * category, language and `userKey`. A module-level `inflightFetches` map dedups\n * concurrent fetches for the same key so a second caller awaits the first and reads\n * from cache. The category query is public and needs no authenticated session.\n */\nexport function useMenu(options: UseMenuOptions): UseMenuReturn {\n const { graphqlClient } = options;\n const language = options.language ?? 'NL';\n const depth = options.depth ?? 3;\n const cacheTtlMs = options.cacheTtlMs ?? CACHE_TTL_DEFAULT;\n\n const [categories, setCategories] = useState<MenuCategory[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // ── Cache helpers ──────────────────────────────────────────────────────────\n\n function cacheKey(categoryId: number, lang: string, userKey = ''): string {\n return `propeller_menu_${categoryId}_${lang}${userKey ? `_${userKey}` : ''}`;\n }\n\n function getFromCache(key: string): MenuCategory[] | null {\n if (typeof window === 'undefined') return null;\n try {\n const raw = localStorage.getItem(key);\n if (!raw) return null;\n const parsed: { data: MenuCategory[]; expiresAt: number } = JSON.parse(raw);\n // Reject stale format (old Menu.tsx stored { data: Category, expires: ... })\n if (!Array.isArray(parsed.data)) { localStorage.removeItem(key); return null; }\n if (Date.now() > parsed.expiresAt) { localStorage.removeItem(key); return null; }\n return parsed.data;\n } catch { return null; }\n }\n\n function saveToCache(key: string, data: MenuCategory[]): void {\n if (typeof window === 'undefined') return;\n try {\n localStorage.setItem(key, JSON.stringify({ data, expiresAt: Date.now() + cacheTtlMs }));\n } catch { /* localStorage quota exceeded — silently ignore */ }\n }\n\n const clearCache = useCallback((rootCategoryId: number, lang: string, userKey = ''): void => {\n if (typeof window === 'undefined') return;\n try { localStorage.removeItem(cacheKey(rootCategoryId, lang, userKey)); } catch {}\n }, []);\n\n // ── Fetch ──────────────────────────────────────────────────────────────────\n\n const fetchMenu = useCallback(async (rootCategoryId: number, userKey = ''): Promise<void> => {\n const key = cacheKey(rootCategoryId, language, userKey);\n const cached = getFromCache(key);\n if (cached) { setCategories(cached); return; }\n\n // Piggyback on an in-flight fetch for the same key instead of firing a\n // duplicate request (e.g. Menu + HomeFallback both mounting simultaneously).\n if (inflightFetches.has(key)) {\n setLoading(true);\n await inflightFetches.get(key);\n setLoading(false);\n const fresh = getFromCache(key);\n if (fresh) setCategories(fresh);\n return;\n }\n\n setLoading(true);\n setError(null);\n\n let resolve!: () => void;\n const promise = new Promise<void>(res => { resolve = res; });\n inflightFetches.set(key, promise);\n\n try {\n // Build recursive query — buildCategoriesQuery() fragment + query string\n const gql = `\n query Menu($categoryId: Float, $language: String) {\n category(categoryId: $categoryId) {\n categoryId\n hidden\n name(language: $language) { value language }\n slug(language: $language) { value }\n ${buildCategoriesQuery(depth)}\n }\n }\n `;\n const variables: Record<string, unknown> = { categoryId: rootCategoryId, language };\n\n // graphqlClient.query() extracts .data and throws on GraphQL errors\n const data = await graphqlClient.query<{ category: MenuCategoryRaw }>(gql, variables);\n const root = data?.category ?? null;\n\n // Return subcategories of root (L1 items) — same as Menu.tsx getSubCategories(rootCategory)\n const items: MenuCategory[] = root\n ? (root.categories ?? [])\n .filter(cat => !isHidden(cat))\n .map(cat => mapCategory(cat, language))\n : [];\n\n setCategories(items);\n if (items.length > 0) saveToCache(key, items);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch menu');\n } finally {\n inflightFetches.delete(key);\n resolve();\n setLoading(false);\n }\n }, [graphqlClient, language, depth, cacheTtlMs]);\n\n return { categories, loading, error, fetchMenu, clearCache };\n}\n","/**\n * usePagination (React) — Shared pagination logic.\n */\n\nimport { useState, useCallback } from 'react';\n\n/** Pagination state and navigation actions returned by {@link usePagination}. */\nexport interface PaginationState {\n /** Current page number (1-based). */\n currentPage: number;\n /** Total number of pages. */\n totalPages: number;\n /** Total number of items across all pages. */\n totalItems: number;\n /** Items shown per page. */\n itemsPerPage: number;\n /** `true` when a next page exists. */\n hasNextPage: boolean;\n /** `true` when a previous page exists. */\n hasPreviousPage: boolean;\n /** Navigates to a page; ignored when out of the `1..totalPages` range. */\n goToPage: (page: number) => void;\n /** Advances to the next page if one exists. */\n nextPage: () => void;\n /** Goes back to the previous page if one exists. */\n previousPage: () => void;\n /** Updates totals/page count from a paged API response. */\n setFromResponse: (response: { itemsFound?: number; pages?: number; offset?: number }) => void;\n /** Resets to page 1 with cleared totals. */\n reset: () => void;\n}\n\n/**\n * usePagination — shared pagination state and navigation logic.\n *\n * @param initialItemsPerPage - starting page size. Defaults to 10.\n * @returns pagination state plus navigation actions — see {@link PaginationState}.\n */\nexport function usePagination(initialItemsPerPage = 10): PaginationState {\n const [currentPage, setCurrentPage] = useState(1);\n const [totalPages, setTotalPages] = useState(1);\n const [totalItems, setTotalItems] = useState(0);\n const [itemsPerPage, setItemsPerPage] = useState(initialItemsPerPage);\n\n const hasNextPage = currentPage < totalPages;\n const hasPreviousPage = currentPage > 1;\n\n const goToPage = useCallback((page: number) => {\n setCurrentPage((prev) => {\n // `totalPages <= 1` means the count isn't known yet — the grid hasn't\n // fetched (e.g. it's still rendering an SSR-seeded first page, so\n // `setFromResponse` hasn't run). Don't reject navigation in that state,\n // or the FIRST pagination click is silently dropped and never triggers a\n // fetch. Once a real `totalPages` (> 1) is known we enforce the upper\n // bound; an out-of-range page otherwise just yields an empty fetch,\n // which self-corrects on the next `setFromResponse`.\n if (page >= 1 && (totalPages <= 1 || page <= totalPages)) return page;\n return prev;\n });\n }, [totalPages]);\n\n const nextPage = useCallback(() => {\n setCurrentPage((prev) => (prev < totalPages ? prev + 1 : prev));\n }, [totalPages]);\n\n const previousPage = useCallback(() => {\n setCurrentPage((prev) => (prev > 1 ? prev - 1 : prev));\n }, []);\n\n const setFromResponse = useCallback(\n (response: { itemsFound?: number; pages?: number; offset?: number }) => {\n const items = response.itemsFound ?? 0;\n const perPage = response.offset ?? itemsPerPage;\n setTotalItems(items);\n setTotalPages(response.pages ?? Math.ceil(items / perPage));\n if (response.offset) setItemsPerPage(response.offset);\n },\n [itemsPerPage]\n );\n\n const reset = useCallback(() => {\n setCurrentPage(1);\n setTotalPages(1);\n setTotalItems(0);\n }, []);\n\n return {\n currentPage,\n totalPages,\n totalItems,\n itemsPerPage,\n hasNextPage,\n hasPreviousPage,\n goToPage,\n nextPage,\n previousPage,\n setFromResponse,\n reset,\n };\n}\n","/**\n * useOrders (React) — Order list, search, PDF download and reorder flow.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { OrderItemClass, OrderSearchFields, OrderType, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Order,\n OrderItem,\n Cart,\n OrderSearchArguments,\n DateSearchInput,\n DecimalSearchInput,\n OrderSortInput,\n Base64File,\n CartAddItemVariables,\n MediaImageProductSearchInput,\n TransformationsInput,\n OrderQueryVariables,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { usePagination } from './shared/usePagination';\nimport { initCart } from '../shared/utils/cartInit';\nimport type { AnyUser } from '@propeller-commerce/propeller-v2-core-ui';\nimport { isContact, isCustomer } from '@propeller-commerce/propeller-v2-core-ui';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Search/filter criteria for the order list. */\nexport interface OrderSearchForm {\n /** Free-text search term matched against `termFields`. */\n term?: string;\n /** Filter on order creation date. */\n createdAt?: DateSearchInput;\n /** Filter on last-modified date. */\n lastModifiedAt?: DateSearchInput;\n /** Filter on order total price. */\n price?: DecimalSearchInput;\n /** Sort field/direction for the results. */\n sortInput?: Partial<OrderSortInput>;\n /** Restrict to a single order type. */\n type?: OrderType;\n}\n\n/** Options for {@link useOrders}. */\nexport interface UseOrdersOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; supplies the userId the order query is scoped to. */\n user: AnyUser;\n /** Active company id; scopes orders to a company for B2B users. */\n companyId?: number;\n /** Language for order/PDF queries. Defaults to `'NL'`. */\n language?: string;\n /** Page size for the order list. Defaults to 10. */\n itemsPerPage?: number;\n /** Order statuses to include. Defaults to `['NEW','CONFIRMED','VALIDATED','ORDER']`. */\n orderStatuses?: string[];\n /** Fields the free-text `term` is matched against. */\n termFields?: OrderSearchFields[];\n /** Portal configuration: image search/variant filters. */\n configuration?: {\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n };\n /** Restrict orders to specific sales channels. */\n channelIds?: number[];\n /** Fires when `reorder` creates a fresh cart — use it to persist the cart id. */\n onCartCreated?: (cart: Cart) => void;\n /** Fires after a reorder completes — receives the cart all items were added to. */\n afterReorder?: (cart: Cart) => void;\n}\n\n/** State and order actions returned by {@link useOrders}. */\nexport interface UseOrdersReturn {\n /** The current page of orders. */\n orders: Order[];\n /** `true` while a fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** The active search/filter criteria. */\n searchForm: OrderSearchForm;\n /** Replaces the search criteria (does not trigger a fetch on its own). */\n setSearchForm: (form: OrderSearchForm) => void;\n /** Current page number (1-based). */\n currentPage: number;\n /** Total number of pages. */\n totalPages: number;\n /** Total matching orders across all pages. */\n totalItems: number;\n /** Page size. */\n itemsPerPage: number;\n /** Fetches a page of orders using the current search form. */\n fetchOrders: (page?: number) => Promise<void>;\n /** Navigates to a page. */\n goToPage: (page: number) => void;\n /** Clears the search form and refetches page 1. */\n resetSearch: () => void;\n /** Downloads an order's confirmation PDF to the browser. */\n downloadPdf: (order: Order) => Promise<{ success: boolean; error?: string }>;\n /** Re-adds an order's items to a (new or existing) cart. */\n reorder: (order: Order, cartId?: string) => Promise<{ success: boolean; cart?: Cart; error?: string }>;\n /** Updates a quote/order status by id. */\n setQuoteStatus: (\n orderId: number,\n flags: { status?: string }\n ) => Promise<{ success: boolean; error?: string }>;\n /** Fetches a single order by id. */\n getOrderById: (orderId: number) => Promise<{ success: boolean; order?: Order; error?: string }>;\n /** Downloads a quote PDF for the given order id. */\n downloadQuotePdf: (orderId: number) => Promise<{ success: boolean; error?: string }>;\n}\n\n/**\n * useOrders — order list, search, PDF download and reorder flow.\n *\n * @param options - see {@link UseOrdersOptions}.\n * @returns order list, pagination state and async actions — see {@link UseOrdersReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * Most calls go through `services.order` (`OrderService`) — `fetchOrders` calls\n * `getOrders` (scoped by `userId`, optional `companyIds` and statuses), `getOrderById`\n * calls `getOrder`, `downloadPdf` / `downloadQuotePdf` call `getOrderPDF` / `getQuotePDF`\n * (decoding the base64 result client-side into a download), and `setQuoteStatus` calls\n * `setOrderStatus`. `reorder` resolves a cart via the shared `initCart` flow then calls\n * `services.cart.addItemToCart` (`CartService`) once per parent order item. Pagination\n * is delegated to `usePagination`. All calls require an authenticated session.\n */\nexport function useOrders(options: UseOrdersOptions): UseOrdersReturn {\n const {\n graphqlClient,\n user,\n companyId,\n orderStatuses = ['NEW', 'CONFIRMED', 'VALIDATED', 'ORDER'],\n configuration = {},\n onCartCreated,\n afterReorder,\n } = options;\n\n const language = options.language || 'NL';\n const termFields = options.termFields ?? [\n OrderSearchFields.REFERENCE,\n OrderSearchFields.ITEM_SKU,\n OrderSearchFields.ID,\n OrderSearchFields.ITEM_NAME,\n OrderSearchFields.REMARKS,\n ];\n\n const [orders, setOrders] = useState<Order[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [searchForm, setSearchForm] = useState<OrderSearchForm>({});\n const pagination = usePagination(options.itemsPerPage ?? 10);\n\n // ── Fetch orders ──────────────────────────────────────────────────────────\n\n const fetchOrders = useCallback(\n async (page = 1): Promise<void> => {\n if (!user) return;\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).order;\n const userId: number = isContact(user) ? user.contactId : isCustomer(user) ? user.customerId : 0;\n const resolvedCompanyId = companyId ?? (isContact(user) ? user.company?.companyId : null);\n\n const searchArgs: OrderSearchArguments = {\n status: orderStatuses,\n userId: [userId!],\n ...(resolvedCompanyId && { companyIds: [resolvedCompanyId] }),\n page,\n offset: pagination.itemsPerPage,\n term: searchForm.term || '',\n termFields,\n ...(searchForm.createdAt && { createdAt: searchForm.createdAt }),\n ...(searchForm.lastModifiedAt && { lastModifiedAt: searchForm.lastModifiedAt }),\n ...(searchForm.price && { price: searchForm.price }),\n ...(searchForm.sortInput && { sortInputs: [searchForm.sortInput as OrderSortInput] }),\n ...(searchForm.type && { type: [searchForm.type] }),\n ...(options.channelIds?.length && { channelIds: options.channelIds }),\n };\n\n const response = await service.getOrders(searchArgs);\n setOrders(response.items || []);\n pagination.setFromResponse(response);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch orders');\n setOrders([]);\n } finally {\n setLoading(false);\n }\n },\n [graphqlClient, user, companyId, orderStatuses, searchForm, pagination.itemsPerPage]\n );\n\n useEffect(() => {\n if (user) fetchOrders(pagination.currentPage);\n }, [user, companyId, pagination.currentPage]);\n\n const resetSearch = useCallback(() => {\n setSearchForm({});\n fetchOrders(1);\n }, [fetchOrders]);\n\n // ── PDF download ──────────────────────────────────────────────────────────\n\n const downloadPdf = useCallback(\n async (order: Order): Promise<{ success: boolean; error?: string }> => {\n if (!order?.id) return { success: false, error: 'No order ID' };\n try {\n const service = createServices(graphqlClient).order;\n const pdfResponse = await service.getOrderPDF(order.id);\n if (!pdfResponse) return { success: false, error: 'No PDF response' };\n\n let byteArray: Uint8Array;\n let contentType = 'application/pdf';\n let fileName = `order-${order.id}-confirmation.pdf`;\n\n if (typeof pdfResponse === 'object' && (pdfResponse as Base64File).base64) {\n const r = pdfResponse as Base64File;\n const chars = atob(r.base64);\n byteArray = new Uint8Array(chars.length);\n for (let i = 0; i < chars.length; i++) byteArray[i] = chars.charCodeAt(i);\n contentType = r.contentType || contentType;\n fileName = r.fileName || fileName;\n } else if (typeof pdfResponse === 'string') {\n const chars = atob(pdfResponse);\n byteArray = new Uint8Array(chars.length);\n for (let i = 0; i < chars.length; i++) byteArray[i] = chars.charCodeAt(i);\n } else {\n return { success: false, error: 'Unrecognised PDF format' };\n }\n\n const blob = new Blob([byteArray.buffer as ArrayBuffer], { type: contentType });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to download PDF' };\n }\n },\n [graphqlClient]\n );\n\n // ── Reorder ───────────────────────────────────────────────────────────────\n\n const reorder = useCallback(\n async (order: Order, existingCartId?: string): Promise<{ success: boolean; cart?: Cart; error?: string }> => {\n if (!order?.items) return { success: false, error: 'No order items' };\n try {\n let resolvedCartId = existingCartId;\n if (!resolvedCartId) {\n const c = await initCart({\n services: createServices(graphqlClient),\n user,\n companyId,\n language,\n imageSearchFilters: configuration.imageSearchFiltersGrid!,\n imageVariantFilters: configuration.imageVariantFiltersSmall!,\n onCartCreated,\n });\n resolvedCartId = c.cartId;\n }\n\n const cartService = createServices(graphqlClient).cart;\n const allProducts = order.items.filter(\n (item: OrderItem) => item.class === OrderItemClass.product && item.isBonus === YesNo.N\n );\n const parentItems = allProducts.filter((item: OrderItem) => !item.parentOrderItemId);\n const childMap = new Map<number, OrderItem[]>();\n allProducts\n .filter((item: OrderItem) => item.parentOrderItemId)\n .forEach((item: OrderItem) => {\n const arr = childMap.get(item.parentOrderItemId!) || [];\n arr.push(item);\n childMap.set(item.parentOrderItemId!, arr);\n });\n\n let lastCart: Cart | null = null;\n for (const item of parentItems) {\n if (!item.productId) continue;\n const isCluster = item.product?.cluster && typeof item.product.cluster === 'object';\n const children = childMap.get(item.id) || [];\n let clusterId: number | undefined;\n let childItems: { productId: number; quantity: number }[] | undefined;\n\n if (isCluster && item.product!.cluster) {\n clusterId = item.product!.cluster.clusterId;\n if (children.length > 0) {\n childItems = children\n .filter((c) => c.productId)\n .map((c) => ({ productId: c.productId!, quantity: c.quantity || item.quantity || 1 }));\n }\n }\n\n const addVars: CartAddItemVariables = {\n id: resolvedCartId,\n input: {\n productId: item.productId,\n quantity: item.quantity || 1,\n ...(clusterId !== undefined && { clusterId }),\n ...(childItems && { childItems }),\n },\n language,\n imageSearchFilters: configuration.imageSearchFiltersGrid!,\n imageVariantFilters: configuration.imageVariantFiltersSmall!,\n };\n\n lastCart = await cartService.addItemToCart(addVars);\n }\n\n if (lastCart) {\n afterReorder?.(lastCart);\n return { success: true, cart: lastCart };\n }\n return { success: false, error: 'No items were added' };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Reorder failed' };\n }\n },\n [graphqlClient, user, companyId, language, configuration, onCartCreated, afterReorder]\n );\n\n // ── Quote status ──────────────────────────────────────────────────────────\n\n const setQuoteStatus = useCallback(\n async (\n orderId: number,\n flags: { status?: string }\n ): Promise<{ success: boolean; error?: string }> => {\n try {\n const service = createServices(graphqlClient).order;\n await service.setOrderStatus({ orderId, ...flags });\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to update status' };\n }\n },\n [graphqlClient]\n );\n\n // ── Get single order by ID ────────────────────────────────────────────────\n\n const getOrderById = useCallback(\n async (orderId: number): Promise<{ success: boolean; order?: Order; error?: string }> => {\n try {\n const service = createServices(graphqlClient).order;\n const variables: OrderQueryVariables = {\n orderId,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n imageVariantFilters: configuration.imageVariantFiltersSmall,\n language,\n };\n const order = await service.getOrder(variables);\n if (!order) return { success: false, error: 'Order not found' };\n return { success: true, order };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to fetch order' };\n }\n },\n [graphqlClient, language, configuration]\n );\n\n // ── Download quote PDF ────────────────────────────────────────────────────\n\n const downloadQuotePdf = useCallback(\n async (orderId: number): Promise<{ success: boolean; error?: string }> => {\n try {\n const service = createServices(graphqlClient).order;\n const pdfResponse = await service.getQuotePDF(orderId);\n if (!pdfResponse) return { success: false, error: 'No PDF response' };\n\n let byteArray: Uint8Array;\n let contentType = 'application/pdf';\n let fileName = `quote-${orderId}.pdf`;\n\n if (typeof pdfResponse === 'object' && (pdfResponse as Base64File).base64) {\n const r = pdfResponse as Base64File;\n const chars = atob(r.base64);\n byteArray = new Uint8Array(chars.length);\n for (let i = 0; i < chars.length; i++) byteArray[i] = chars.charCodeAt(i);\n contentType = r.contentType || contentType;\n fileName = r.fileName || fileName;\n } else if (typeof pdfResponse === 'string') {\n const chars = atob(pdfResponse);\n byteArray = new Uint8Array(chars.length);\n for (let i = 0; i < chars.length; i++) byteArray[i] = chars.charCodeAt(i);\n } else {\n return { success: false, error: 'Unrecognised PDF format' };\n }\n\n const blob = new Blob([byteArray.buffer as ArrayBuffer], { type: contentType });\n const url = window.URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(url);\n return { success: true };\n } catch (e: unknown) {\n return { success: false, error: e instanceof Error ? e.message : 'Failed to download quote PDF' };\n }\n },\n [graphqlClient]\n );\n\n return {\n orders,\n loading,\n error,\n searchForm,\n setSearchForm,\n currentPage: pagination.currentPage,\n totalPages: pagination.totalPages,\n totalItems: pagination.totalItems,\n itemsPerPage: pagination.itemsPerPage,\n fetchOrders,\n goToPage: pagination.goToPage,\n resetSearch,\n downloadPdf,\n reorder,\n setQuoteStatus,\n getOrderById,\n downloadQuotePdf,\n };\n}\n","/**\n * useProductBundles (React) — Bundle fetching and add-to-cart flow.\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { GraphQLClient, Cart, MediaImageProductSearchInput, TransformationsInput, Product } from '@propeller-commerce/propeller-sdk-v2';\nimport { initCart } from '../shared/utils/cartInit';\nimport type { AnyUser } from '@propeller-commerce/propeller-v2-core-ui';\n\n/** A product bundle with its constituent products and pricing. */\nexport interface BundleItem {\n /** Bundle id. */\n id: number;\n /** Bundle display name. */\n name: string;\n /** Products that make up the bundle. */\n products: Product[];\n /** Discount applied to the bundle. */\n discount?: number;\n /** Sum of the products' individual prices. */\n originalTotal?: number;\n /** Discounted total price of the bundle. */\n bundleTotal?: number;\n}\n\n/** Options for {@link useProductBundles}. */\nexport interface UseProductBundlesOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; scopes cart resolution and pricing. */\n user: AnyUser;\n /** Active company id for B2B cart resolution. */\n companyId?: number;\n /** Language for bundle queries. Falls back to `configuration.language`, then `'NL'`. */\n language?: string;\n /** Portal configuration: language plus required image search/variant filters. */\n configuration: {\n language?: string;\n imageSearchFiltersGrid: MediaImageProductSearchInput;\n imageVariantFiltersSmall: TransformationsInput;\n };\n /** Fires when a fresh cart is created — use it to persist the cart id. */\n onCartCreated?: (cart: Cart) => void;\n}\n\n/** State and bundle actions returned by {@link useProductBundles}. */\nexport interface UseProductBundlesReturn {\n /** The fetched bundles. */\n bundles: BundleItem[];\n /** `true` while a bundle fetch is in flight. */\n loading: boolean;\n /** `true` while a bundle is being added to the cart. */\n adding: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Id of the cart bundles are added to. */\n cartId: string;\n /** Fetches bundles that contain the given product. */\n fetchBundles: (productId: number) => Promise<void>;\n /** Adds a bundle to a (new or existing) cart. */\n addBundleToCart: (bundleId: number, existingCartId?: string) => Promise<{ success: boolean; cart?: Cart; error?: string }>;\n /** Computes the rounded discount percentage between an original and discounted price. */\n calcDiscountPercent: (original: number, discounted: number) => number;\n}\n\n/**\n * useProductBundles — bundle fetching and add-to-cart flow.\n *\n * @param options - see {@link UseProductBundlesOptions}.\n * @returns bundle state plus async actions — see {@link UseProductBundlesReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `fetchBundles` calls `services.bundle.getBundles()` (`BundleService`) filtered by\n * product id. `addBundleToCart` resolves a cart via the shared `initCart` flow when\n * none exists, then calls `services.cart.addBundleToCart()` (`CartService`).\n * `calcDiscountPercent` is pure and makes no API call. Cart mutations require an\n * authenticated session.\n */\nexport function useProductBundles(options: UseProductBundlesOptions): UseProductBundlesReturn {\n const { graphqlClient, user, companyId, configuration, onCartCreated } = options;\n const language = options.language || configuration.language || 'NL';\n\n const [bundles, setBundles] = useState<BundleItem[]>([]);\n const [loading, setLoading] = useState(false);\n const [adding, setAdding] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [cartId, setCartId] = useState('');\n\n const fetchBundles = useCallback(async (productId: number): Promise<void> => {\n setLoading(true); setError(null);\n try {\n const service = createServices(graphqlClient).bundle;\n const result = await service.getBundles({ input: { productIds: [productId], page: 1, offset: 100 }, language, imageSearchFilters: configuration.imageSearchFiltersGrid, imageVariantFilters: configuration.imageVariantFiltersSmall });\n setBundles(((result as any)?.items || []) as BundleItem[]);\n } catch (e: any) { setError(e?.message || 'Failed to fetch bundles'); }\n finally { setLoading(false); }\n }, [graphqlClient, language, configuration]);\n\n const addBundleToCart = useCallback(\n async (bundleId: number, existingCartId?: string): Promise<{ success: boolean; cart?: Cart; error?: string }> => {\n setAdding(true); setError(null);\n try {\n let resolvedCartId = existingCartId || cartId;\n if (!resolvedCartId) {\n const cart = await initCart({ services: createServices(graphqlClient), user, companyId, language, imageSearchFilters: configuration.imageSearchFiltersGrid, imageVariantFilters: configuration.imageVariantFiltersSmall, onCartCreated: (c) => { setCartId(c.cartId); onCartCreated?.(c); } });\n resolvedCartId = cart.cartId;\n setCartId(resolvedCartId);\n }\n const cartService = createServices(graphqlClient).cart;\n const cart = await cartService.addBundleToCart({ id: resolvedCartId, input: { bundleId: String(bundleId) }, language, imageSearchFilters: configuration.imageSearchFiltersGrid, imageVariantFilters: configuration.imageVariantFiltersSmall });\n return { success: true, cart };\n } catch (e: any) {\n const msg = e?.message || 'Failed to add bundle to cart';\n setError(msg); return { success: false, error: msg };\n } finally { setAdding(false); }\n },\n [graphqlClient, user, companyId, language, configuration, cartId, onCartCreated]\n );\n\n const calcDiscountPercent = useCallback((original: number, discounted: number): number => {\n if (!original || original === 0) return 0;\n return Math.round(((original - discounted) / original) * 100);\n }, []);\n\n return { bundles, loading, adding, error, cartId, fetchBundles, addBundleToCart, calcDiscountPercent };\n}\n","/**\n * useProductInfo (React) — Sequential product/cluster data fetching.\n *\n * Responsibilities:\n * - ProductInfo: getOrderlists → getProduct (sequential; orderlists needed for price tier)\n * - ClusterInfo: getClusterConfig → getCluster (sequential; config drives attribute names)\n * - priceCalculateProductInput + userBulkPriceProductInput for correct per-user pricing\n * - Cluster fallback chain: cluster → defaultProduct for name/sku/price/image\n */\n\nimport { useState, useCallback, useMemo } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport type {\n GraphQLClient,\n Product,\n Cluster,\n Contact,\n Customer,\n LocalizedString,\n ClusterConfigSetting,\n ProductQueryVariables,\n ClusterVariables,\n PriceCalculateProductInput,\n UserBulkPriceProductInput,\n AttributeResultSearchInput,\n MediaImageProductSearchInput,\n TransformationsInput,\n OrderlistSearchInput,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Options for {@link useProductInfo}. */\nexport interface UseProductInfoOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** Language for product/cluster queries. Defaults to `'NL'`. */\n language?: string;\n /** Tax zone used for price calculation. Defaults to `'NL'`. */\n taxZone?: string;\n /** The signed-in user; supplies contactId/customerId for per-user pricing. */\n user?: Contact | Customer | null;\n /** Active company id for company-scoped pricing and orderlist resolution. */\n companyId?: number;\n /** Attribute names to include in attributeResultSearchInput (productTrackAttributes). */\n productTrackAttributes?: string[];\n /** Portal configuration: image search/variant filters per size. */\n configuration?: {\n /** Image search filters applied to product/cluster media. */\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n /** Used for products (ProductInfo). */\n imageVariantFiltersLarge?: TransformationsInput;\n /** Used for clusters (ClusterInfo). */\n imageVariantFiltersMedium?: TransformationsInput;\n /** Alias: some configs use imageVariantFiltersSmall for product images. */\n imageVariantFiltersSmall?: TransformationsInput;\n };\n}\n\n/** State and fetch actions returned by {@link useProductInfo}. */\nexport interface UseProductInfoReturn {\n /** The fetched product, or `null`. */\n product: Product | null;\n /** The fetched cluster, or `null`. */\n cluster: Cluster | null;\n /** `true` while a product/cluster fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Fetches a product by id, optionally overriding the image filters. */\n fetchProduct: (productId: number, imageSearchFilters?: MediaImageProductSearchInput, imageVariantFilters?: TransformationsInput) => Promise<void>;\n /** Fetches a cluster by id, optionally overriding the image filters. */\n fetchCluster: (clusterId: number, imageSearchFilters?: MediaImageProductSearchInput, imageVariantFilters?: TransformationsInput) => Promise<void>;\n // Cluster display helpers (fallback chain: cluster → defaultProduct)\n /** Cluster name, falling back to the default product's name. */\n clusterName: string;\n /** Cluster SKU, falling back to the default product's SKU. */\n clusterSku: string;\n /** Cluster gross price taken from the default product, or `null`. */\n clusterPrice: number | null;\n /** First image URL of the cluster's default product, or `''`. */\n clusterImageUrl: string;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useProductInfo — sequential product / cluster data fetching.\n *\n * @param options - see {@link UseProductInfoOptions}.\n * @returns product/cluster state, fetch actions and cluster display helpers — see {@link UseProductInfoReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `fetchProduct` runs two sequential calls — first `services.orderlist.getOrderlists()`\n * (`OrderlistService`, only when a user + company are present, to resolve price-tier\n * orderlist ids), then `services.product.getProduct()` (`ProductService`) with\n * `priceCalculateProductInput` / `userBulkPriceProductInput` for per-user pricing.\n * `fetchCluster` runs `services.cluster.getClusterConfig()` then\n * `services.cluster.getCluster()` (`ClusterService`), passing the config-derived\n * attribute names. The cluster display helpers are pure derivations of `cluster`.\n */\nexport function useProductInfo(options: UseProductInfoOptions): UseProductInfoReturn {\n const { graphqlClient, configuration = {} } = options;\n const language = options.language ?? 'NL';\n const taxZone = options.taxZone ?? 'NL';\n\n const [product, setProduct] = useState<Product | null>(null);\n const [cluster, setCluster] = useState<Cluster | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // ── Shared price input builders ───────────────────────────────────────────\n\n function buildPriceInput(): PriceCalculateProductInput {\n const input: PriceCalculateProductInput = { taxZone };\n if (options.companyId) input.companyId = options.companyId;\n if (options.user && 'contactId' in options.user) input.contactId = (options.user as Contact).contactId;\n if (options.user && 'customerId' in options.user) input.customerId = (options.user as Customer).customerId;\n return input;\n }\n\n function buildBulkPriceInput(): UserBulkPriceProductInput {\n const input: UserBulkPriceProductInput = { taxZone };\n if (options.companyId) input.companyId = options.companyId;\n if (options.user && 'contactId' in options.user) input.contactId = (options.user as Contact).contactId;\n if (options.user && 'customerId' in options.user) input.customerId = (options.user as Customer).customerId;\n return input;\n }\n\n function buildAttributeInput(): AttributeResultSearchInput | undefined {\n const names = options.productTrackAttributes;\n if (!names || names.length === 0) return undefined;\n return { attributeDescription: { names } };\n }\n\n // ── Fetch product ─────────────────────────────────────────────────────────\n // getOrderlists first (if user+companyId), then getProduct.\n\n const fetchProduct = useCallback(async (\n productId: number,\n imageSearchFilters?: MediaImageProductSearchInput,\n imageVariantFilters?: TransformationsInput,\n ): Promise<void> => {\n setLoading(true);\n setError(null);\n try {\n // Step 1: resolve orderlist IDs\n let orderlistIds: number[] = [];\n if (options.user && options.companyId) {\n const orderlistService = createServices(graphqlClient).orderlist;\n const searchInput: OrderlistSearchInput = { companyIds: [options.companyId] };\n const orderlists = await orderlistService.getOrderlists(searchInput);\n orderlistIds = (orderlists?.items ?? []).map((ol) => ol.id);\n }\n\n // Step 2: fetch product with full inputs\n const service = createServices(graphqlClient).product;\n const attributeInput = buildAttributeInput();\n\n const variables: ProductQueryVariables = {\n productId,\n language,\n applyOrderlists: true,\n orderlistIds,\n imageSearchFilters: imageSearchFilters ?? configuration.imageSearchFiltersGrid,\n imageVariantFilters: (imageVariantFilters ?? configuration.imageVariantFiltersLarge ?? configuration.imageVariantFiltersSmall) as TransformationsInput,\n priceCalculateProductInput: buildPriceInput(),\n userBulkPriceProductInput: buildBulkPriceInput(),\n ...(attributeInput && { attributeResultSearchInput: attributeInput }),\n };\n\n const result = await service.getProduct(variables);\n setProduct(result);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch product');\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, taxZone, options.user, options.companyId, options.productTrackAttributes, configuration]);\n\n // ── Fetch cluster ─────────────────────────────────────────────────────────\n // getClusterConfig first, then getCluster with attributeNames.\n\n const fetchCluster = useCallback(async (\n clusterId: number,\n imageSearchFilters?: MediaImageProductSearchInput,\n imageVariantFilters?: TransformationsInput,\n ): Promise<void> => {\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).cluster;\n\n // Step 1: get cluster config to extract attribute names\n const clusterConfig = await service.getClusterConfig(clusterId);\n const attributeNames: string[] =\n (clusterConfig?.config?.settings ?? []).map(\n (setting: ClusterConfigSetting) => setting.name\n );\n\n // Step 2: fetch cluster with full inputs\n const variables: ClusterVariables = {\n clusterId,\n language,\n imageSearchFilters: imageSearchFilters ?? configuration.imageSearchFiltersGrid,\n imageVariantFilters: (imageVariantFilters ?? configuration.imageVariantFiltersMedium) as TransformationsInput,\n priceCalculateProductInput: buildPriceInput(),\n ...(attributeNames.length > 0 && {\n attributeResultSearchInput: {\n attributeDescription: { names: attributeNames },\n } as AttributeResultSearchInput,\n }),\n };\n\n const result = await service.getCluster(variables);\n setCluster(result);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch cluster');\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, taxZone, options.user, options.companyId, configuration]);\n\n // ── Cluster display helpers (fallback chain: cluster → defaultProduct) ────\n\n const clusterName = useMemo<string>(() => {\n if (!cluster) return '';\n const lang = language;\n const names: LocalizedString[] = cluster.names ?? [];\n if (names.length) {\n const match = names.find(n => n.language === lang);\n return match?.value ?? names[0]?.value ?? '';\n }\n const dp = cluster.defaultProduct;\n const dpNames: LocalizedString[] = dp?.names ?? [];\n const dpMatch = dpNames.find(n => n.language === lang);\n return dpMatch?.value ?? dpNames[0]?.value ?? '';\n }, [cluster, language]);\n\n const clusterSku = useMemo<string>(() => {\n if (!cluster) return '';\n return cluster.sku || cluster.defaultProduct?.sku || '';\n }, [cluster]);\n\n const clusterPrice = useMemo<number | null>(() => {\n if (!cluster) return null;\n const dp = cluster.defaultProduct;\n return dp?.price?.gross ?? null;\n }, [cluster]);\n\n const clusterImageUrl = useMemo<string>(() => {\n if (!cluster) return '';\n const dp = cluster.defaultProduct;\n return dp?.media?.images?.items?.[0]?.imageVariants?.[0]?.url ?? '';\n }, [cluster]);\n\n return {\n product,\n cluster,\n loading,\n error,\n fetchProduct,\n fetchCluster,\n clusterName,\n clusterSku,\n clusterPrice,\n clusterImageUrl,\n };\n}\n","/**\n * useProductSearch (React) — Product fetching, filtering, race condition prevention.\n */\n\nimport { useState, useCallback, useEffect, useRef, useMemo } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { ProductSearchableField, ProductSortField, ProductStatus, SortOrder } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Product,\n Cluster,\n Contact,\n Customer,\n ProductsResponse,\n AttributeFilter,\n ProductTextFilterInput,\n Category,\n CategoryQueryVariables,\n CategoryProductSearchInput,\n ProductSortInput,\n SearchFieldsInput,\n ProductPriceFilterInput,\n PriceCalculateProductInput,\n FilterAvailableAttributeInput,\n MediaImageProductSearchInput,\n TransformationsInput,\n ProductsQueryVariables,\n ProductSearchInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { usePagination } from './shared/usePagination';\n\n// Module-level dedup set — prevents two concurrent identical fetches from both\n// hitting the API (React Strict Mode runs every effect twice in development).\nconst inflightFetches = new Set<string>();\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Options for {@link useProductSearch}. */\nexport interface UseProductSearchOptions {\n /** GraphQL client; omit it together with a `products` array for controlled mode. */\n graphqlClient?: GraphQLClient;\n /** When provided, the hook is controlled — it renders these products and skips fetching. */\n products?: (Product | Cluster)[];\n /** Category id to list products from. */\n categoryId?: number;\n /** Free-text search term — triggers a wide search across the base category. */\n term?: string;\n /** Manufacturer/brand to filter by — also triggers a wide search. */\n brand?: string;\n /** Language for product queries. Defaults to `'NL'`. */\n language?: string;\n /** Tax zone for price calculation. Defaults to `'NL'`. */\n taxZone?: string;\n /** The signed-in user; supplies userId/contactId/customerId for pricing. */\n user?: Contact | Customer | null;\n /** Active company id for company-scoped pricing/visibility. */\n companyId?: number;\n /** Attribute text filters applied to the category search. */\n textFilters?: ProductTextFilterInput[];\n /** Lower price bound filter. */\n priceFilterMin?: number;\n /** Upper price bound filter. */\n priceFilterMax?: number;\n /** Sort field; overrides the internal sort state when set. */\n sortField?: string;\n /** Sort direction (`'ASC'` / `'DESC'`); overrides internal state when set. */\n sortOrder?: string;\n /** Page size. Defaults to 12. */\n pageSize?: number;\n /** Portal configuration: base category fallback plus image filters. */\n configuration: {\n baseCategoryId?: number;\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersMedium?: TransformationsInput;\n };\n /** Fires with the available attribute filters from the category response. */\n onFiltersChange?: (filters: AttributeFilter[]) => void;\n /** Fires with the min/max price bounds from the category response. */\n onPriceBoundsChange?: (min: number, max: number) => void;\n /** Fires with the total matching item count whenever it changes. */\n onItemsFoundChange?: (count: number) => void;\n /** Fires when the current page changes. */\n onPageChange?: (page: number) => void;\n /** Fires with the raw `ProductsResponse` after each category fetch. */\n onProductsResponse?: (products: ProductsResponse) => void;\n /** Fires with the resolved category object after each category fetch. */\n onCategoryChange?: (category: Category) => void;\n}\n\n/** State and search actions returned by {@link useProductSearch}. */\nexport interface UseProductSearchReturn {\n /** Products to render — controlled `products` or the internally fetched list. */\n displayProducts: (Product | Cluster)[];\n /** Total matching products across all pages. */\n itemsFound: number;\n /** `true` while the main category fetch is in flight (uncontrolled mode only). */\n isLoading: boolean;\n /** Active sort field. */\n currentSortField: string;\n /** Active sort direction. */\n currentSortOrder: string;\n /** Current page number (1-based). */\n currentPage: number;\n /** Total number of pages. */\n totalPages: number;\n /** The current search-bar term. */\n searchTerm: string;\n /** Results of the debounced search-bar query. */\n searchResults: (Product | Cluster)[];\n /** Total items found by the search-bar query. */\n searchItemsFound: number;\n /** `true` while the debounced search-bar query is in flight. */\n searchLoading: boolean;\n /** Runs the main category product fetch. */\n fetchProducts: () => Promise<void>;\n /** Sets the search-bar term and triggers a debounced product search. */\n search: (term: string) => void;\n /** Navigates the main product list to a page. */\n goToPage: (page: number) => void;\n}\n\n/**\n * useProductSearch — product fetching, filtering and race-condition prevention.\n *\n * @param options - see {@link UseProductSearchOptions}.\n * @returns product list, sort/pagination state and search actions — see {@link UseProductSearchReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `fetchProducts` calls `services.category.getCategory()` (`CategoryService`) with a\n * `categoryProductSearchInput` (statuses, term, manufacturers, text/price filters,\n * sort) plus `priceCalculateProductInput` for per-user pricing. The debounced\n * `search` calls `services.product.getProducts()` (`ProductService`) 300 ms after the\n * last keystroke. Two race guards are in place: a per-instance `fetchIdRef` so only\n * the latest fetch commits, and a module-level `inflightFetches` set that dedups\n * identical concurrent fetches (e.g. React Strict Mode's double effect). In\n * controlled mode (a `products` array supplied) no API calls are made.\n */\nexport function useProductSearch(options: UseProductSearchOptions): UseProductSearchReturn {\n const { graphqlClient, configuration } = options;\n\n const isControlled = options.products !== undefined;\n const language = options.language || 'NL';\n const taxZone = options.taxZone || 'NL';\n const pageSize = options.pageSize ?? 12;\n\n const [internalProducts, setInternalProducts] = useState<(Product | Cluster)[]>([]);\n const [itemsFound, setItemsFound] = useState(0);\n const [internalLoading, setInternalLoading] = useState(false);\n const [currentSortField, setCurrentSortField] = useState(\n options.sortField ?? ProductSortField.RELEVANCE\n );\n const [currentSortOrder, setCurrentSortOrder] = useState(options.sortOrder ?? 'DESC');\n const [searchTerm, setSearchTerm] = useState('');\n const [searchResults, setSearchResults] = useState<(Product | Cluster)[]>([]);\n const [searchItemsFound, setSearchItemsFound] = useState(0);\n const [searchLoading, setSearchLoading] = useState(false);\n\n const fetchIdRef = useRef(0);\n const searchTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const pagination = usePagination(pageSize);\n\n // Stable string key from the user's ID — prevents re-fetches when the user\n // object reference changes but the underlying identity hasn't (common with\n // useReducer-based auth contexts that return a new state object on every\n // dispatch, even if the user data is unchanged).\n const userKey = options.user\n ? ('contactId' in options.user\n ? String((options.user as Contact).contactId)\n : String((options.user as Customer).customerId))\n : '';\n\n const displayProducts = useMemo<(Product | Cluster)[]>(\n () => (isControlled ? options.products! : internalProducts),\n [isControlled, options.products, internalProducts]\n );\n\n const isLoading = !isControlled && internalLoading;\n\n // ── Language filter ───────────────────────────────────────────────────────\n\n function filterByLanguage(products: (Product | Cluster)[], lang: string): (Product | Cluster)[] {\n if (!lang) return products;\n return products.filter((p) => {\n const names = (p as Product).names || (p as Cluster).names || [];\n if (!names || names.length === 0) return true;\n return names.some((n: { language?: string }) => n.language === lang);\n });\n }\n\n // ── Fetch products ────────────────────────────────────────────────────────\n\n const fetchProducts = useCallback(async (): Promise<void> => {\n if (!graphqlClient || isControlled) return;\n\n const thisId = ++fetchIdRef.current;\n\n // ── Inflight dedup (guards against React Strict Mode double-effect) ───────\n // Bail out when nothing to fetch: no categoryId, term, or brand.\n // This prevents components like SearchBar (which only use `search()`) from\n // triggering a spurious category fetch on mount via the baseCategoryId fallback.\n if (!options.categoryId && !options.term && !options.brand) return;\n\n const isWideSearch = !!options.term || !!options.brand;\n const catId = isWideSearch\n ? (configuration?.baseCategoryId ?? 0)\n : (options.categoryId ?? configuration?.baseCategoryId ?? 0);\n\n if (!catId) return;\n\n const inflightKey = [\n catId, language, pagination.currentPage, pageSize,\n options.term ?? '', options.brand ?? '',\n options.sortField ?? '', options.sortOrder ?? '',\n options.companyId ?? '', userKey,\n JSON.stringify(options.textFilters ?? []),\n options.priceFilterMin ?? '', options.priceFilterMax ?? '',\n ].join('|');\n\n if (inflightFetches.has(inflightKey)) {\n // Identical fetch already in flight — undo the ID increment so the\n // in-flight request can still commit its result via the thisId check.\n fetchIdRef.current--;\n return;\n }\n inflightFetches.add(inflightKey);\n\n setInternalLoading(true);\n\n try {\n const service = createServices(graphqlClient).category;\n\n const lang = language;\n const activeSortField = (options.sortField ?? currentSortField) as ProductSortField;\n const activeSortOrder = (options.sortOrder ?? currentSortOrder) as SortOrder;\n\n // Build sort inputs\n const sortInputs: ProductSortInput[] = (activeSortField)\n ? [{ field: activeSortField, order: activeSortOrder }]\n : [];\n\n // Build search fields with boost when searching by term\n const searchFields: SearchFieldsInput[] = options.term\n ? [\n {\n fieldNames: [\n ProductSearchableField.NAME,\n ProductSearchableField.KEYWORDS,\n ProductSearchableField.SKU,\n ProductSearchableField.CUSTOM_KEYWORDS,\n ],\n boost: 5,\n },\n {\n fieldNames: [\n ProductSearchableField.DESCRIPTION,\n ProductSearchableField.MANUFACTURER,\n ProductSearchableField.MANUFACTURER_CODE,\n ProductSearchableField.EAN_CODE,\n ProductSearchableField.BAR_CODE,\n ProductSearchableField.CLUSTER_ID,\n ProductSearchableField.CUSTOM_KEYWORDS,\n ProductSearchableField.PRODUCT_ID,\n ProductSearchableField.SHORT_DESCRIPTION,\n ProductSearchableField.SUPPLIER,\n ProductSearchableField.SUPPLIER_CODE,\n ],\n boost: 1,\n },\n ]\n : [];\n\n // Build price filter\n const priceFilter: ProductPriceFilterInput | undefined =\n options.priceFilterMin !== undefined || options.priceFilterMax !== undefined\n ? { from: options.priceFilterMin ?? 0, to: options.priceFilterMax ?? 999999 }\n : undefined;\n\n // Resolve user IDs\n const userId: number | undefined =\n options.user && 'contactId' in options.user\n ? (options.user as Contact).contactId\n : options.user && 'customerId' in options.user\n ? (options.user as Customer).customerId\n : undefined;\n\n const contactId: number | undefined =\n options.user && 'contactId' in options.user\n ? (options.user as Contact).contactId\n : undefined;\n\n const customerId: number | undefined =\n options.user && 'customerId' in options.user\n ? (options.user as Customer).customerId\n : undefined;\n\n const categoryProductSearchInput: CategoryProductSearchInput = {\n language: lang,\n page: pagination.currentPage,\n offset: pageSize,\n statuses: [\n ProductStatus.A,\n ProductStatus.P,\n ProductStatus.T,\n ProductStatus.S,\n ],\n hidden: false,\n ...(options.term && { term: options.term, searchFields }),\n ...(options.brand && { manufacturers: [options.brand] }),\n ...(options.textFilters?.length && { textFilters: options.textFilters }),\n ...(priceFilter && { price: priceFilter }),\n ...(sortInputs.length && { sortInputs }),\n ...(options.companyId && { companyId: options.companyId }),\n ...(userId !== undefined && { userId }),\n };\n\n const priceCalculateProductInput: PriceCalculateProductInput = {\n taxZone,\n ...(options.companyId && { companyId: options.companyId }),\n ...(contactId !== undefined && { contactId }),\n ...(customerId !== undefined && { customerId }),\n };\n\n const filterAvailableAttributeInput: FilterAvailableAttributeInput = {\n isSearchable: true,\n };\n\n const variables: CategoryQueryVariables = {\n categoryId: catId,\n language: lang,\n categoryProductSearchInput,\n priceCalculateProductInput,\n filterAvailableAttributeInput,\n imageSearchFilters: configuration?.imageSearchFiltersGrid,\n imageVariantFilters: configuration?.imageVariantFiltersMedium,\n };\n\n const response = await service.getCategory(variables);\n\n if (thisId !== fetchIdRef.current) return;\n\n const productsResponse = response?.products as ProductsResponse | undefined;\n const rawProducts = (productsResponse?.items ?? []) as (Product | Cluster)[];\n const filtered = filterByLanguage(rawProducts, lang);\n\n setInternalProducts(filtered);\n\n const untranslatedCount = rawProducts.length - filtered.length;\n const apiTotal = productsResponse?.itemsFound ?? rawProducts.length;\n const found = Math.max(0, apiTotal - untranslatedCount);\n\n setItemsFound(found);\n options.onItemsFoundChange?.(found);\n\n if (productsResponse) {\n pagination.setFromResponse({\n itemsFound: found,\n pages: productsResponse.pages ?? 1,\n offset: productsResponse.offset ?? pageSize,\n });\n options.onProductsResponse?.(productsResponse);\n }\n\n if (productsResponse?.filters) {\n options.onFiltersChange?.(productsResponse.filters);\n }\n\n // Price-slider bounds. The API's aggregated `minPrice`/`maxPrice` are\n // populated for anonymous catalog reads, but come back as 0 for a\n // logged-in (contact/company-priced) request — which would make the slider\n // fall back to a bogus 9999 cap. When the aggregate max is missing or 0,\n // derive the bounds from the resolved per-item prices in THIS result set\n // instead (the items carry the contact price). Uses `gross` (the catalog\n // filter scale; same field the API aggregate reflects), falling back to\n // `net`. Note: derived bounds reflect the current result page, not the\n // whole catalog — but that is strictly better than no/9999 bound, and the\n // anonymous path still uses the true catalog aggregate.\n const aggMin = productsResponse?.minPrice;\n const aggMax = productsResponse?.maxPrice;\n if (aggMax !== undefined && aggMax > 0) {\n options.onPriceBoundsChange?.(aggMin ?? 0, aggMax);\n } else {\n const prices = ((productsResponse?.items ?? []) as Product[])\n .map((p) => p?.price?.gross ?? p?.price?.net)\n .filter((n): n is number => typeof n === 'number' && n > 0);\n if (prices.length) {\n options.onPriceBoundsChange?.(Math.floor(Math.min(...prices)), Math.ceil(Math.max(...prices)));\n }\n }\n\n if (response) {\n options.onCategoryChange?.(response as Category);\n }\n } catch (e) {\n console.error('[useProductSearch] fetchProducts error:', e);\n if (thisId === fetchIdRef.current) setInternalProducts([]);\n } finally {\n inflightFetches.delete(inflightKey);\n if (thisId === fetchIdRef.current) setInternalLoading(false);\n }\n }, [\n graphqlClient,\n isControlled,\n options.categoryId,\n options.term,\n options.brand,\n options.textFilters,\n options.priceFilterMin,\n options.priceFilterMax,\n options.sortField,\n options.sortOrder,\n options.companyId,\n userKey,\n language,\n taxZone,\n pageSize,\n pagination.currentPage,\n configuration,\n ]);\n\n // ── Search bar (debounced) ────────────────────────────────────────────────\n\n const search = useCallback(\n (term: string): void => {\n setSearchTerm(term);\n if (searchTimerRef.current) clearTimeout(searchTimerRef.current);\n if (!term.trim()) {\n setSearchResults([]);\n setSearchItemsFound(0);\n return;\n }\n searchTimerRef.current = setTimeout(async () => {\n if (!graphqlClient) return;\n setSearchLoading(true);\n try {\n const service = createServices(graphqlClient).product;\n const input: ProductSearchInput = {\n term,\n language,\n page: 1,\n offset: 10,\n statuses: [\n ProductStatus.A,\n ProductStatus.P,\n ProductStatus.T,\n ProductStatus.S,\n ],\n sortInputs: [{ field: ProductSortField.RELEVANCE, order: SortOrder.DESC }],\n searchFields: [\n {\n fieldNames: [\n ProductSearchableField.NAME,\n ProductSearchableField.KEYWORDS,\n ProductSearchableField.SKU,\n ProductSearchableField.CUSTOM_KEYWORDS,\n ],\n boost: 5,\n },\n {\n fieldNames: [\n ProductSearchableField.DESCRIPTION,\n ProductSearchableField.MANUFACTURER,\n ProductSearchableField.MANUFACTURER_CODE,\n ProductSearchableField.EAN_CODE,\n ProductSearchableField.BAR_CODE,\n ProductSearchableField.CLUSTER_ID,\n ProductSearchableField.CUSTOM_KEYWORDS,\n ProductSearchableField.PRODUCT_ID,\n ProductSearchableField.SHORT_DESCRIPTION,\n ProductSearchableField.SUPPLIER,\n ProductSearchableField.SUPPLIER_CODE,\n ],\n boost: 1,\n },\n ],\n };\n const variables: ProductsQueryVariables = {\n input,\n language,\n imageVariantFilters: configuration?.imageVariantFiltersMedium as TransformationsInput,\n };\n const result = await service.getProducts(variables);\n const items = (result?.items ?? []) as (Product | Cluster)[];\n setSearchResults(items);\n setSearchItemsFound((result as ProductsResponse)?.itemsFound ?? items.length);\n } catch {\n setSearchResults([]);\n setSearchItemsFound(0);\n } finally {\n setSearchLoading(false);\n }\n }, 300);\n },\n [graphqlClient, language, configuration, userKey]\n );\n\n // ── Effects ───────────────────────────────────────────────────────────────\n\n useEffect(() => {\n if (!isControlled) fetchProducts();\n }, [\n options.categoryId,\n options.term,\n options.brand,\n language,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(options.textFilters),\n options.priceFilterMin,\n options.priceFilterMax,\n options.sortField,\n options.sortOrder,\n pageSize,\n options.companyId,\n userKey,\n pagination.currentPage,\n ]);\n\n return {\n displayProducts,\n itemsFound,\n isLoading,\n currentSortField,\n currentSortOrder,\n currentPage: pagination.currentPage,\n totalPages: pagination.totalPages,\n searchTerm,\n searchResults,\n searchItemsFound,\n searchLoading,\n fetchProducts,\n search,\n goToPage: pagination.goToPage,\n };\n}\n","/**\n * useProductSlider (React) — Crossupsell/product fetch + scroll tracking.\n *\n * Responsibilities:\n * - fetchCrossupsells: CrossupsellService with priceCalculateProductInput + extract productTo/clusterTo\n * - fetchProducts: ProductService.getProducts() batch call (NOT per-item getProduct())\n * with statuses filter and filterAvailableAttributeInput\n * - Scroll position tracking for responsive sliding\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { CrossupsellType, ProductStatus } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Product,\n Cluster,\n Contact,\n Customer,\n Crossupsell,\n CrossupsellsQueryVariables,\n ProductsQueryVariables,\n ProductSearchInput,\n PriceCalculateProductInput,\n FilterAvailableAttributeInput,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\n/** Arguments for {@link UseProductSliderReturn.fetchCrossupsells}. */\nexport interface FetchCrossupsellsInput {\n /** Source product id to fetch crossupsells for. */\n productId?: number;\n /** Source cluster id to fetch crossupsells for. */\n clusterId?: number;\n /** Crossupsell types to include. */\n types?: CrossupsellType[];\n}\n\n/** Options for {@link useProductSlider}. */\nexport interface UseProductSliderOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** Language for product/crossupsell queries. Defaults to `'NL'`. */\n language?: string;\n /** Tax zone for price calculation. Defaults to `'NL'`. */\n taxZone?: string;\n /** The signed-in user; supplies contactId/customerId for per-user pricing. */\n user?: Contact | Customer | null;\n /** Active company id for company-scoped pricing. */\n companyId?: number;\n /** Portal configuration: image search/variant filters. */\n configuration?: {\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersMedium?: TransformationsInput;\n };\n}\n\n/** State and slider actions returned by {@link useProductSlider}. */\nexport interface UseProductSliderReturn {\n /** The products/clusters currently shown in the slider. */\n products: (Product | Cluster)[];\n /** `true` while a fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** `true` when the slider can scroll further left. */\n canScrollLeft: boolean;\n /** `true` when the slider can scroll further right. */\n canScrollRight: boolean;\n /** Fetches crossupsell products for a product/cluster and extracts their targets. */\n fetchCrossupsells: (input: FetchCrossupsellsInput) => Promise<void>;\n /** Batch-fetches products/clusters by id. */\n fetchProducts: (productIds: number[], clusterIds?: number[]) => Promise<void>;\n /** Scrolls the container left by one item width (default 280px). */\n scrollLeft: (containerEl: HTMLElement, itemWidth?: number) => void;\n /** Scrolls the container right by one item width (default 280px). */\n scrollRight: (containerEl: HTMLElement, itemWidth?: number) => void;\n /** Recomputes `canScrollLeft` / `canScrollRight` from the container's scroll position. */\n onScroll: (containerEl: HTMLElement) => void;\n}\n\n// ── Composable ────────────────────────────────────────────────────────────────\n\n/**\n * useProductSlider — crossupsell / product fetch plus scroll tracking.\n *\n * @param options - see {@link UseProductSliderOptions}.\n * @returns slider product state and fetch/scroll actions — see {@link UseProductSliderReturn}.\n *\n * @remarks\n * GraphQL integration: services are built per-call via `createServices(graphqlClient)`.\n * `fetchCrossupsells` calls `services.crossupsell.getCrossupsells()`\n * (`CrossupsellService`) with `priceCalculateProductInput`, then unwraps each\n * `Crossupsell`'s `productTo` / `clusterTo` target. `fetchProducts` calls\n * `services.product.getProducts()` (`ProductService`) as a single batch query (never\n * a per-id `getProduct`), with a status filter and `filterAvailableAttributeInput`.\n * The `scrollLeft` / `scrollRight` / `onScroll` helpers are pure DOM operations and\n * make no API calls.\n */\nexport function useProductSlider(options: UseProductSliderOptions): UseProductSliderReturn {\n const { graphqlClient, configuration = {} } = options;\n const language = options.language ?? 'NL';\n const taxZone = options.taxZone ?? 'NL';\n\n const [products, setProducts] = useState<(Product | Cluster)[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [canScrollLeft, setCanScrollLeft] = useState(false);\n const [canScrollRight, setCanScrollRight] = useState(false);\n\n // ── Price input builder ───────────────────────────────────────────────────\n\n function buildPriceInput(): PriceCalculateProductInput {\n const input: PriceCalculateProductInput = { taxZone };\n if (options.companyId) input.companyId = options.companyId;\n if (options.user && 'contactId' in options.user) input.contactId = (options.user as Contact).contactId;\n if (options.user && 'customerId' in options.user) input.customerId = (options.user as Customer).customerId;\n return input;\n }\n\n // ── Assortment filter ───────────────────────────────────────────────────\n // Resolves crossupsell items against the user's assortment via the same\n // `getProducts` query the listings use, and returns only the items that come\n // back (preserving the input order). Products outside the contact's\n // assortment are dropped — the backend simply omits them, exactly as it does\n // on the catalog/search pages (which scope by userId/companyId). On a query\n // failure we return the input unchanged so the slider isn't blanked.\n\n const resolveCompanyId = (): number | undefined => {\n if (options.companyId) return options.companyId;\n if (options.user && 'contactId' in options.user) return (options.user as Contact).company?.companyId;\n return undefined;\n };\n\n async function filterToAssortment(items: (Product | Cluster)[]): Promise<(Product | Cluster)[]> {\n if (!items.length) return items;\n\n const productIds: number[] = [];\n const clusterIds: number[] = [];\n for (const item of items) {\n if ('productId' in item && (item as Product).productId !== undefined) {\n productIds.push((item as Product).productId);\n } else if ('clusterId' in item && (item as Cluster).clusterId !== undefined) {\n clusterIds.push((item as Cluster).clusterId);\n }\n }\n if (!productIds.length && !clusterIds.length) return items;\n\n const userId = resolveUserId();\n const companyId = resolveCompanyId();\n const searchInput: ProductSearchInput = {\n ...(productIds.length && { productIds }),\n ...(clusterIds.length && { clusterIds }),\n language,\n page: 1,\n offset: 50,\n statuses: [ProductStatus.A, ProductStatus.P, ProductStatus.T, ProductStatus.S],\n ...(userId !== undefined && { userId }),\n ...(companyId !== undefined && { companyId }),\n };\n const filterAvailableAttributeInput: FilterAvailableAttributeInput = { isSearchable: true };\n const variables: ProductsQueryVariables = {\n input: searchInput,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n imageVariantFilters: configuration.imageVariantFiltersMedium as TransformationsInput,\n filterAvailableAttributeInput,\n };\n\n try {\n const response = await createServices(graphqlClient).product.getProducts(variables);\n const resolved = (response?.items ?? []) as (Product | Cluster)[];\n const allowed = new Set<number>();\n for (const r of resolved) {\n const id = (r as Product).productId ?? (r as Cluster).clusterId;\n if (id !== undefined) allowed.add(id);\n }\n return items.filter((item) => {\n const id = (item as Product).productId ?? (item as Cluster).clusterId;\n return id !== undefined && allowed.has(id);\n });\n } catch {\n // Verification failed — don't blank the slider; show the raw crossupsells.\n return items;\n }\n }\n\n function resolveUserId(): number | undefined {\n if (options.user && 'contactId' in options.user) return (options.user as Contact).contactId;\n if (options.user && 'customerId' in options.user) return (options.user as Customer).customerId;\n return undefined;\n }\n\n // ── Fetch crossupsells ────────────────────────────────────────────────────\n // - includes priceCalculateProductInput\n // - extracts productTo / clusterTo from each Crossupsell\n\n const fetchCrossupsells = useCallback(async (input: FetchCrossupsellsInput): Promise<void> => {\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).crossupsell;\n const variables: CrossupsellsQueryVariables = {\n input: {\n page: 1,\n offset: 50,\n ...(input.types && input.types.length > 0 && { types: input.types }),\n ...(input.productId && { productIdsFrom: [input.productId] }),\n ...(input.clusterId && { clusterIdsFrom: [input.clusterId] }),\n },\n language,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n imageVariantFilters: configuration.imageVariantFiltersMedium as TransformationsInput,\n priceCalculateProductInput: buildPriceInput(),\n };\n\n const result = await service.getCrossupsells(variables);\n const crossupsells: Crossupsell[] = result?.items ?? [];\n\n const items: (Product | Cluster)[] = [];\n for (const cu of crossupsells) {\n if (cu.productTo) items.push(cu.productTo as Product);\n else if (cu.clusterTo) items.push(cu.clusterTo as Cluster);\n }\n\n // Crossupsell relationships are NOT scoped to the user's assortment —\n // they can reference products/clusters the signed-in contact may not\n // order or even open (the PDP returns \"not found\"). Re-resolve the\n // extracted ids through the assortment-aware `getProducts` query (the\n // same one `fetchProducts` uses, scoped by userId/companyId like the\n // catalog/search listings) and keep only the items that come back, in\n // the original crossupsell order. If this verification call fails we\n // fall back to the raw items so a transient error doesn't blank the\n // slider.\n const orderableItems = await filterToAssortment(items);\n setProducts(orderableItems);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch crossupsells');\n setProducts([]);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, taxZone, options.user, options.companyId, configuration]);\n\n // ── Fetch products (batch) ────────────────────────────────────────────────\n // - uses ProductService.getProducts() (batch), NOT per-item getProduct()\n // - includes statuses filter and filterAvailableAttributeInput\n\n const fetchProducts = useCallback(async (productIds: number[], clusterIds: number[] = []): Promise<void> => {\n if (!productIds.length && !clusterIds.length) return;\n setLoading(true);\n setError(null);\n try {\n const service = createServices(graphqlClient).product;\n\n const searchInput: ProductSearchInput = {\n productIds,\n clusterIds,\n language,\n page: 1,\n offset: 50,\n statuses: [\n ProductStatus.A,\n ProductStatus.P,\n ProductStatus.T,\n ProductStatus.S,\n ],\n };\n\n const filterAvailableAttributeInput: FilterAvailableAttributeInput = { isSearchable: true };\n\n const variables: ProductsQueryVariables = {\n input: searchInput,\n imageSearchFilters: configuration.imageSearchFiltersGrid,\n imageVariantFilters: configuration.imageVariantFiltersMedium as TransformationsInput,\n filterAvailableAttributeInput,\n };\n\n const response = await service.getProducts(variables);\n setProducts((response?.items ?? []) as (Product | Cluster)[]);\n } catch (e: unknown) {\n setError(e instanceof Error ? e.message : 'Failed to fetch products');\n setProducts([]);\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, language, configuration]);\n\n // ── Scroll helpers ────────────────────────────────────────────────────────\n\n const onScroll = useCallback((containerEl: HTMLElement): void => {\n setCanScrollLeft(containerEl.scrollLeft > 0);\n setCanScrollRight(containerEl.scrollLeft + containerEl.clientWidth < containerEl.scrollWidth - 1);\n }, []);\n\n const scrollLeft = useCallback((containerEl: HTMLElement, itemWidth = 280): void => {\n containerEl.scrollBy({ left: -itemWidth, behavior: 'smooth' });\n }, []);\n\n const scrollRight = useCallback((containerEl: HTMLElement, itemWidth = 280): void => {\n containerEl.scrollBy({ left: itemWidth, behavior: 'smooth' });\n }, []);\n\n return {\n products,\n loading,\n error,\n canScrollLeft,\n canScrollRight,\n fetchCrossupsells,\n fetchProducts,\n scrollLeft,\n scrollRight,\n onScroll,\n };\n}\n","/**\n * useProductSpecs (React) — Product attribute fetch and grouping.\n */\n\nimport { useState, useCallback } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { GraphQLClient, AttributeResult, AttributeResultSearchInput } from '@propeller-commerce/propeller-sdk-v2';\nimport { extractAttributeValues, getAttributeDisplayName } from '@propeller-commerce/propeller-v2-core-ui';\n\n/** A named group of product attributes for display. */\nexport interface AttributeGroup {\n /** Group name; `''` for ungrouped attributes. */\n name: string;\n /** Attributes belonging to this group. */\n attributes: AttributeDisplayItem[];\n}\n\n/** A single product attribute prepared for display. */\nexport interface AttributeDisplayItem {\n /** Raw attribute name. */\n name: string;\n /** Localized, human-readable attribute label. */\n displayName: string;\n /** The attribute's value(s) as display strings. */\n values: string[];\n /** Attribute value type (e.g. `'TEXT'`). */\n type: string;\n}\n\n/** Options for {@link useProductSpecs}. */\nexport interface UseProductSpecsOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** Language used to resolve attribute display names. Defaults to `'NL'`. */\n language?: string;\n}\n\n/** State and actions returned by {@link useProductSpecs}. */\nexport interface UseProductSpecsReturn {\n /** Raw attribute results for the fetched product. */\n attributes: AttributeResult[];\n /** Attributes organised into display groups. */\n groupedAttributes: AttributeGroup[];\n /** `true` while a specs fetch is in flight. */\n loading: boolean;\n /** Last error message, or `null`. */\n error: string | null;\n /** Fetches and groups the public attributes for a product. */\n fetchSpecs: (productId: number) => Promise<void>;\n}\n\n/**\n * useProductSpecs — product attribute fetch and grouping.\n *\n * @param options - see {@link UseProductSpecsOptions}.\n * @returns attribute state plus the `fetchSpecs` action — see {@link UseProductSpecsReturn}.\n *\n * @remarks\n * GraphQL integration: `fetchSpecs` calls `services.product.getAttributeResultByProductId()`\n * (`ProductService`), built per-call via `createServices(graphqlClient)`, with an\n * `AttributeResultSearchInput` that requests public attributes only\n * (`attributeDescription.isPublic: true`, page 1, offset 2000). The results are then\n * grouped client-side by their `attributeDescription.group`.\n */\nexport function useProductSpecs(options: UseProductSpecsOptions): UseProductSpecsReturn {\n const { graphqlClient } = options;\n const language = options.language || 'NL';\n\n const [attributes, setAttributes] = useState<AttributeResult[]>([]);\n const [groupedAttributes, setGroupedAttributes] = useState<AttributeGroup[]>([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n // Groups attributes by their attribute group. Accepts a language param for\n // group-name resolution.\n function buildGroups(attrs: AttributeResult[], lang: string): AttributeGroup[] {\n const ungrouped: AttributeDisplayItem[] = [];\n const groupMap: Record<string, AttributeDisplayItem[]> = {};\n for (const attr of attrs) {\n const values = extractAttributeValues(attr);\n if (!values.length) continue;\n const displayName = getAttributeDisplayName(attr, lang);\n const item: AttributeDisplayItem = {\n name: attr.attributeDescription?.name || '',\n displayName,\n values,\n type: attr.value?.type || 'TEXT',\n };\n const groupName = attr.attributeDescription?.group || '';\n if (groupName) {\n if (!groupMap[groupName]) groupMap[groupName] = [];\n groupMap[groupName].push(item);\n } else { ungrouped.push(item); }\n }\n const groups: AttributeGroup[] = Object.entries(groupMap).map(([name, attributes]) => ({ name, attributes }));\n if (ungrouped.length) groups.push({ name: '', attributes: ungrouped });\n return groups;\n }\n\n const fetchSpecs = useCallback(async (productId: number): Promise<void> => {\n setLoading(true); setError(null);\n try {\n const service = createServices(graphqlClient).product;\n // Public attributes only, fetched in a single large page: isPublic: true, page: 1, offset: 2000\n const searchInput: AttributeResultSearchInput = {\n attributeDescription: { isPublic: true },\n page: 1,\n offset: 2000,\n };\n const result = await service.getAttributeResultByProductId(productId, searchInput);\n const items: AttributeResult[] = result?.items ?? [];\n setAttributes(items);\n setGroupedAttributes(buildGroups(items, language));\n } catch (e: unknown) { setError(e instanceof Error ? e.message : 'Failed to fetch specifications'); }\n finally { setLoading(false); }\n }, [graphqlClient, language]);\n\n return { attributes, groupedAttributes, loading, error, fetchSpecs };\n}\n","/**\n * usePurchaseAuthorization (React) — Purchase Authorization Configurator + Requests.\n *\n * Covers: PurchaseAuthorizationConfigurator, PurchaseAuthorizationRequests.\n */\n\nimport { useState, useCallback, useMemo, useEffect, useRef } from 'react';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport { CartStatus, Gender, PurchaseRole } from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n GraphQLClient,\n Company,\n Cart,\n CartMainItem,\n Contact,\n Customer,\n PurchaseAuthorizationConfig,\n PurchaseAuthorizationConfigCreateInput,\n RegisterContactInput,\n AttributeResultSearchInput,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useCompany } from './useCompany';\n\n// ── Shared types ──────────────────────────────────────────────────────────────\n\n/** Per-contact editable PAC fields tracked in the configurator table. */\nexport interface RowEdit {\n /** Selected purchase role for the row's contact. */\n role: string;\n /** Authorization spend limit, or `undefined` when unlimited/unset. */\n limit: number | undefined;\n /** `true` when the row has unsaved changes. */\n dirty: boolean;\n}\n\n/** Form state for the \"add contact\" modal. */\nexport interface AddContactFormState {\n /** Selected gender. */\n gender: string;\n /** Contact email. */\n email: string;\n /** Contact first name. */\n firstName: string;\n /** Contact middle name / tussenvoegsel. */\n middleName: string;\n /** Contact last name. */\n lastName: string;\n /** Contact phone number. */\n phone: string;\n}\n\nconst EMPTY_CONTACT_FORM: AddContactFormState = {\n gender: '', email: '', firstName: '', middleName: '', lastName: '', phone: '',\n};\n\n/** Checks if a user is an authorization manager for the given company. Works on plain objects from localStorage. */\nfunction checkIsAuthManager(user: Contact | Customer | null | undefined, companyId: number): boolean {\n if (!user || !('contactId' in user)) return false;\n const pacData = (user as Contact).purchaseAuthorizationConfigs;\n const items: PurchaseAuthorizationConfig[] = pacData?.items ?? [];\n return items.some((pac: PurchaseAuthorizationConfig) => {\n const role = pac.purchaseRole;\n const pacCompanyId = pac.company?.companyId;\n return role === PurchaseRole.AUTHORIZATION_MANAGER && Number(pacCompanyId) === Number(companyId);\n });\n}\n\n// ══════════════════════════════════════════════════════════════════════════════\n// usePurchaseAuthorizationConfigurator\n// ══════════════════════════════════════════════════════════════════════════════\n\n/** Options for {@link usePurchaseAuthorizationConfigurator}. */\nexport interface UsePurchaseAuthorizationConfiguratorOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; used to detect authorization-manager rights. */\n user: Contact | Customer | null;\n /** Company whose contacts and PACs are managed. */\n companyId: number;\n /** Rows per page (default 10) */\n pageOffset?: number;\n /** Fires before a contact is created — receives the register input. */\n beforeContactCreate?: (input: RegisterContactInput) => void;\n /** Override: fires instead of the default `registerContact` call. */\n onContactCreate?: (input: RegisterContactInput) => void;\n /** Fires after a contact is created — receives the new contact. */\n afterContactCreate?: (contact: Contact) => void;\n /** Override: fires instead of the default PAC create call. */\n onPurchaseAuthorizationCreate?: (pac: PurchaseAuthorizationConfigCreateInput) => void;\n /** Fires after a PAC is created. */\n afterPurchaseAuthorizationCreate?: (pac: PurchaseAuthorizationConfig) => void;\n /** Override: fires instead of the default PAC update call. */\n onPurchaseAuthorizationUpdate?: (pac: PurchaseAuthorizationConfig) => void;\n /** Fires after a PAC is updated. */\n afterPurchaseAuthorizationUpdate?: (pac: PurchaseAuthorizationConfig) => void;\n /** Override: fires instead of the default PAC delete call. */\n onPurchaseAuthorizationDelete?: (pac: PurchaseAuthorizationConfig) => void;\n /** Fires after a PAC delete succeeds; receiving it suppresses the default reload. */\n afterPurchaseAuthorizationDelete?: (deleted: boolean) => void;\n}\n\n/** State, per-row helpers and handlers returned by {@link usePurchaseAuthorizationConfigurator}. */\nexport interface UsePurchaseAuthorizationConfiguratorReturn {\n // Data\n /** The loaded company, or `null`. */\n company: Company | null;\n /** `true` while company data is loading. */\n loading: boolean;\n /** Contacts on the current company page. */\n contacts: Contact[];\n /** Total contact pages. */\n totalPages: number;\n /** Current contact page (1-based). */\n currentPage: number;\n // Derived\n /** `true` when the signed-in user is an authorization manager for the company. */\n isAuthManager: boolean;\n // Per-row state\n /** Per-contact unsaved PAC edits, keyed by contact id. */\n rowEdits: Record<number, RowEdit>;\n /** Existing PAC per contact, keyed by contact id. */\n pacMap: Record<number, PurchaseAuthorizationConfig>;\n /** Per-contact in-flight flag for save/create/delete, keyed by contact id. */\n actionLoading: Record<number, boolean>;\n // Add-contact modal state\n /** Whether the add-contact modal is open. */\n showAddContactModal: boolean;\n /** Working form state of the add-contact modal. */\n addContactForm: AddContactFormState;\n /** `true` while a contact is being created. */\n addContactLoading: boolean;\n /** Error message from the add-contact modal, or `''`. */\n addContactError: string;\n // Per-row helpers\n /** `true` when the contact already has a PAC. */\n hasPac: (contactId: number) => boolean;\n /** `true` when the contact id is the signed-in user. */\n isCurrentUser: (contactId: number) => boolean;\n /** `true` when the row has unsaved changes. */\n isRowDirty: (contactId: number) => boolean;\n /** Current (possibly edited) role for the row. */\n getRowRole: (contactId: number) => string;\n /** Current (possibly edited) limit for the row. */\n getRowLimit: (contactId: number) => number | undefined;\n /** `true` while the row has an action in flight. */\n isRowLoading: (contactId: number) => boolean;\n // Handlers\n /** Loads a page of the company's contacts and their PACs. */\n loadCompany: (page: number) => Promise<void>;\n /** Stages a role change for a contact's row. */\n handleRoleChange: (contactId: number, role: string) => void;\n /** Stages a limit change for a contact's row. */\n handleLimitChange: (contactId: number, value: string) => void;\n /** Creates a PAC for the contact from the staged row edit. */\n handleCreate: (contactId: number) => Promise<void>;\n /** Saves the staged row edit to the contact's existing PAC. */\n handleSave: (contactId: number) => Promise<void>;\n /** Deletes the contact's PAC. */\n handleDelete: (contactId: number) => Promise<void>;\n /** Changes the current contact page. */\n handlePageChange: (page: number) => void;\n /** Opens the add-contact modal. */\n openAddContactModal: () => void;\n /** Closes the add-contact modal and resets its form. */\n closeAddContactModal: () => void;\n /** Setter for the add-contact form state. */\n setAddContactForm: React.Dispatch<React.SetStateAction<AddContactFormState>>;\n /** Submits the add-contact form, registering a new company contact. */\n handleAddContactSubmit: () => Promise<void>;\n}\n\n/**\n * usePurchaseAuthorizationConfigurator — manages a company's contacts and their\n * Purchase Authorization Configs (roles + spend limits).\n *\n * @param options - see {@link UsePurchaseAuthorizationConfiguratorOptions}.\n * @returns company data, per-row PAC state and handlers — see {@link UsePurchaseAuthorizationConfiguratorReturn}.\n *\n * @remarks\n * GraphQL integration: company data and PAC CRUD are delegated to the {@link useCompany}\n * hook (`fetchCompany` → `CompanyService.getCompany`; `createPac` / `updatePac` /\n * `deletePac` → `PurchaseAuthorizationConfigService`). `handleAddContactSubmit` calls\n * `services.user.registerContact()` (`UserService`) directly, built per-call via\n * `createServices(graphqlClient)`. After a successful create/update/delete the\n * company page is reloaded. All calls require an authenticated session; each `on*`\n * callback fully overrides its default API call.\n */\nexport function usePurchaseAuthorizationConfigurator(\n options: UsePurchaseAuthorizationConfiguratorOptions,\n): UsePurchaseAuthorizationConfiguratorReturn {\n const { graphqlClient, user, companyId, pageOffset = 10 } = options;\n // Keep callbacks in a ref so handlers don't stale-close over them\n const cbRef = useRef(options);\n cbRef.current = options;\n\n const { company, loading, fetchCompany, createPac, updatePac, deletePac } = useCompany({ graphqlClient });\n\n const [currentPage, setCurrentPage] = useState(1);\n const [rowEdits, setRowEdits] = useState<Record<number, RowEdit>>({});\n const [pacMap, setPacMap] = useState<Record<number, PurchaseAuthorizationConfig>>({});\n const [actionLoading, setActionLoading] = useState<Record<number, boolean>>({});\n const [showAddContactModal, setShowAddContactModal] = useState(false);\n const [addContactForm, setAddContactForm] = useState<AddContactFormState>(EMPTY_CONTACT_FORM);\n const [addContactLoading, setAddContactLoading] = useState(false);\n const [addContactError, setAddContactError] = useState('');\n\n const isAuthManager = useMemo(() => checkIsAuthManager(user, companyId), [user, companyId]);\n\n const contacts = useMemo<Contact[]>(\n () => (company as Company)?.contacts?.items ?? [],\n [company],\n );\n\n const totalPages = useMemo<number>(\n () => (company as Company)?.contacts?.pages ?? 0,\n [company],\n );\n\n function buildMaps(contactList: Contact[]): void {\n const newPacMap: Record<number, PurchaseAuthorizationConfig> = {};\n const newRowEdits: Record<number, RowEdit> = {};\n contactList.forEach((contact: Contact) => {\n const cId = contact.contactId;\n const pacItems: PurchaseAuthorizationConfig[] = contact.purchaseAuthorizationConfigs?.items ?? [];\n if (pacItems.length > 0) newPacMap[cId] = pacItems[0];\n const pac = newPacMap[cId];\n newRowEdits[cId] = {\n role: pac ? pac.purchaseRole : '',\n limit: pac ? pac.authorizationLimit : undefined,\n dirty: false,\n };\n });\n setPacMap(newPacMap);\n setRowEdits(newRowEdits);\n }\n\n const loadCompany = useCallback(async (page: number): Promise<void> => {\n if (!graphqlClient || !companyId) return;\n await fetchCompany(companyId, {\n contactSearchArguments: { page, offset: pageOffset },\n contactPAConfigInput: { companyIds: [companyId], page: 1, offset: 100 },\n companyAttributesInput: {} as AttributeResultSearchInput,\n });\n }, [graphqlClient, companyId, pageOffset, fetchCompany]);\n\n // Rebuild row maps whenever company data refreshes\n useEffect(() => {\n if (company) {\n buildMaps((company as Company).contacts?.items ?? []);\n }\n }, [company]);\n\n // Reload when companyId or currentPage changes\n useEffect(() => {\n if (graphqlClient && companyId) {\n loadCompany(currentPage);\n }\n }, [companyId, currentPage]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const hasPac = useCallback((id: number) => !!pacMap[id], [pacMap]);\n const isCurrentUser = useCallback((id: number) => (user as Contact)?.contactId === id, [user]);\n const isRowDirty = useCallback((id: number) => !!rowEdits[id]?.dirty, [rowEdits]);\n const getRowRole = useCallback((id: number) => rowEdits[id]?.role ?? '', [rowEdits]);\n const getRowLimit = useCallback((id: number) => rowEdits[id]?.limit, [rowEdits]);\n const isRowLoading = useCallback((id: number) => !!actionLoading[id], [actionLoading]);\n\n const handleRoleChange = useCallback((contactId: number, role: string): void => {\n setRowEdits(prev => ({\n ...prev,\n [contactId]: { ...(prev[contactId] ?? { role: '', limit: undefined, dirty: false }), role, dirty: true },\n }));\n }, []);\n\n const handleLimitChange = useCallback((contactId: number, value: string): void => {\n const limit = value === '' ? undefined : Number(value);\n setRowEdits(prev => ({\n ...prev,\n [contactId]: { ...(prev[contactId] ?? { role: '', limit: undefined, dirty: false }), limit, dirty: true },\n }));\n }, []);\n\n const handleCreate = useCallback(async (contactId: number): Promise<void> => {\n setActionLoading(prev => ({ ...prev, [contactId]: true }));\n try {\n const edit = rowEdits[contactId] ?? { role: PurchaseRole.PURCHASER, limit: undefined, dirty: false };\n const input: PurchaseAuthorizationConfigCreateInput = {\n contactId,\n companyId,\n purchaseRole: (edit.role || PurchaseRole.PURCHASER) as PurchaseRole,\n authorizationLimit: edit.limit,\n };\n if (cbRef.current.onPurchaseAuthorizationCreate) {\n cbRef.current.onPurchaseAuthorizationCreate(input);\n } else {\n const result = await createPac(input);\n if (result.success) await loadCompany(currentPage);\n }\n } finally {\n setActionLoading(prev => ({ ...prev, [contactId]: false }));\n }\n }, [rowEdits, companyId, currentPage, createPac, loadCompany]);\n\n const handleSave = useCallback(async (contactId: number): Promise<void> => {\n const pac = pacMap[contactId];\n if (!pac) return;\n setActionLoading(prev => ({ ...prev, [contactId]: true }));\n try {\n const edit = rowEdits[contactId];\n if (cbRef.current.onPurchaseAuthorizationUpdate) {\n cbRef.current.onPurchaseAuthorizationUpdate(pac);\n } else {\n const result = await updatePac(pac.id, {\n purchaseRole: (edit.role || pac.purchaseRole) as PurchaseRole,\n authorizationLimit: edit.limit,\n });\n if (result.success) await loadCompany(currentPage);\n }\n } finally {\n setActionLoading(prev => ({ ...prev, [contactId]: false }));\n }\n }, [pacMap, rowEdits, currentPage, updatePac, loadCompany]);\n\n const handleDelete = useCallback(async (contactId: number): Promise<void> => {\n const pac = pacMap[contactId];\n if (!pac) return;\n setActionLoading(prev => ({ ...prev, [contactId]: true }));\n try {\n if (cbRef.current.onPurchaseAuthorizationDelete) {\n cbRef.current.onPurchaseAuthorizationDelete(pac);\n } else {\n const result = await deletePac(pac.id);\n if (result.success) {\n if (cbRef.current.afterPurchaseAuthorizationDelete) {\n cbRef.current.afterPurchaseAuthorizationDelete(true);\n } else {\n await loadCompany(currentPage);\n }\n }\n }\n } finally {\n setActionLoading(prev => ({ ...prev, [contactId]: false }));\n }\n }, [pacMap, currentPage, deletePac, loadCompany]);\n\n const handlePageChange = useCallback((page: number): void => {\n setCurrentPage(page);\n }, []);\n\n const openAddContactModal = useCallback((): void => {\n setAddContactError('');\n setShowAddContactModal(true);\n }, []);\n\n const closeAddContactModal = useCallback((): void => {\n setShowAddContactModal(false);\n setAddContactError('');\n setAddContactForm(EMPTY_CONTACT_FORM);\n }, []);\n\n const handleAddContactSubmit = useCallback(async (): Promise<void> => {\n setAddContactLoading(true);\n setAddContactError('');\n try {\n const input: RegisterContactInput = {\n parentId: companyId,\n gender: addContactForm.gender as Gender,\n email: addContactForm.email,\n firstName: addContactForm.firstName,\n middleName: addContactForm.middleName,\n lastName: addContactForm.lastName,\n phone: addContactForm.phone,\n };\n if (cbRef.current.beforeContactCreate) cbRef.current.beforeContactCreate(input);\n if (cbRef.current.onContactCreate) {\n cbRef.current.onContactCreate(input);\n } else {\n const userService = createServices(graphqlClient).user;\n const result = await userService.registerContact({ contactRegisterInput: input });\n if (cbRef.current.afterContactCreate) {\n cbRef.current.afterContactCreate(result.contact as unknown as Contact);\n } else {\n await loadCompany(currentPage);\n }\n }\n closeAddContactModal();\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : 'Failed to create contact';\n setAddContactError(msg);\n } finally {\n setAddContactLoading(false);\n }\n }, [graphqlClient, companyId, addContactForm, currentPage, loadCompany, closeAddContactModal]);\n\n return {\n company, loading, contacts, totalPages, currentPage, isAuthManager,\n rowEdits, pacMap, actionLoading,\n showAddContactModal, addContactForm, addContactLoading, addContactError,\n hasPac, isCurrentUser, isRowDirty, getRowRole, getRowLimit, isRowLoading,\n loadCompany, handleRoleChange, handleLimitChange, handleCreate, handleSave, handleDelete,\n handlePageChange, openAddContactModal, closeAddContactModal, setAddContactForm,\n handleAddContactSubmit,\n };\n}\n\n// ══════════════════════════════════════════════════════════════════════════════\n// usePurchaseAuthorizationRequests\n// ══════════════════════════════════════════════════════════════════════════════\n\n/** Options for {@link usePurchaseAuthorizationRequests}. */\nexport interface UsePurchaseAuthorizationRequestsOptions {\n /** GraphQL client the hook derives its Services bundle from. */\n graphqlClient: GraphQLClient;\n /** The signed-in user; the accepting contact and auth-manager check come from here. */\n user: Contact | Customer | null;\n /** Company whose pending authorization requests are listed. */\n companyId: number;\n /** Portal configuration: language plus image search/variant filters. */\n configuration?: {\n language?: string;\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n };\n /** Override: fires instead of the default accept-request call. */\n onAcceptRequest?: (cartId: string) => void;\n /** Fires after a request is accepted — receives the resulting cart. */\n afterAcceptRequest?: (cart: Cart) => void;\n /**\n * Override: fires instead of the default CartService.deleteCart() call.\n * Receives the cartId string.\n */\n onDeleteRequest?: (cartId: string) => void;\n /** Called AFTER a successful delete. Receives the deleted cart's id. */\n afterDeleteRequest?: (cartId: string) => void;\n /** Fires when any request operation throws. */\n onError?: (err: Error) => void;\n}\n\n/** State and request actions returned by {@link usePurchaseAuthorizationRequests}. */\nexport interface UsePurchaseAuthorizationRequestsReturn {\n /** Carts pending purchase authorization for the company. */\n carts: Cart[];\n /** `true` while the request list is loading. */\n loading: boolean;\n /** The cart open in the detail modal, or `null`. */\n selectedCart: Cart | null;\n /** `true` while the selected cart's full detail is loading. */\n modalLoading: boolean;\n /** `true` while an accept call is in flight. */\n acceptLoading: boolean;\n /** `true` while a delete call is in flight. */\n deleteLoading: boolean;\n /** `true` when the signed-in user is an authorization manager for the company. */\n isAuthManager: boolean;\n /** Sums the quantities of all items in a cart. */\n getTotalQuantity: (cart: Cart) => number;\n /** Formats a contact's full name. */\n getContactName: (contact: Contact | null | undefined) => string;\n /** Returns the line items of the currently selected cart. */\n getModalItems: () => CartMainItem[];\n /** Loads the company's pending authorization-request carts. */\n loadCarts: () => Promise<void>;\n /** Opens a cart in the modal and loads its full detail. */\n handleViewCart: (cart: Cart) => Promise<void>;\n /** Accepts the selected cart's authorization request. */\n handleAcceptRequest: () => Promise<void>;\n /** Deletes (rejects) the selected cart's authorization request. */\n handleDeleteRequest: () => Promise<void>;\n /** Closes the detail modal. */\n closeModal: () => void;\n}\n\n/**\n * usePurchaseAuthorizationRequests — review queue for carts awaiting purchase\n * authorization (accept or reject).\n *\n * @param options - see {@link UsePurchaseAuthorizationRequestsOptions}.\n * @returns request list, modal state and handlers — see {@link UsePurchaseAuthorizationRequestsReturn}.\n *\n * @remarks\n * GraphQL integration: all backend calls go through `services.cart` (`CartService`),\n * built per-call via `createServices(graphqlClient)`. `loadCarts` calls `getCarts`\n * filtered by `CartStatus.PENDING_PURCHASE_AUTHORIZATION` and the company id;\n * `handleViewCart` calls `getCart` for the full cart detail; `handleAcceptRequest`\n * calls `acceptPurchaseAuthorizationRequest` (passing the accepting contact id);\n * `handleDeleteRequest` calls `deleteCart`. All calls require an authenticated\n * session; `onAcceptRequest` / `onDeleteRequest` fully override their default calls.\n */\nexport function usePurchaseAuthorizationRequests(\n options: UsePurchaseAuthorizationRequestsOptions,\n): UsePurchaseAuthorizationRequestsReturn {\n const { graphqlClient, user, companyId, configuration } = options;\n const cbRef = useRef(options);\n cbRef.current = options;\n\n const [carts, setCarts] = useState<Cart[]>([]);\n const [loading, setLoading] = useState(true);\n const [selectedCart, setSelectedCart] = useState<Cart | null>(null);\n const [modalLoading, setModalLoading] = useState(false);\n const [acceptLoading, setAcceptLoading] = useState(false);\n const [deleteLoading, setDeleteLoading] = useState(false);\n\n const isAuthManager = useMemo(() => checkIsAuthManager(user, companyId), [user, companyId]);\n\n const getTotalQuantity = useCallback((cart: Cart): number => {\n return (cart?.items || []).reduce((sum: number, item: CartMainItem) => sum + (item.quantity || 0), 0);\n }, []);\n\n const getContactName = useCallback((contact: Contact | null | undefined): string => {\n if (!contact) return '';\n return [contact.firstName ?? '', contact.middleName ?? '', contact.lastName ?? ''].filter(Boolean).join(' ');\n }, []);\n\n const getModalItems = useCallback((): CartMainItem[] => {\n return selectedCart?.items || [];\n }, [selectedCart]);\n\n const loadCarts = useCallback(async (): Promise<void> => {\n if (!graphqlClient || !companyId) return;\n setLoading(true);\n try {\n const service = createServices(graphqlClient).cart;\n const response = await service.getCarts({\n statuses: [CartStatus.PENDING_PURCHASE_AUTHORIZATION],\n companyIds: [companyId],\n });\n setCarts(response?.items || []);\n } catch (err: unknown) {\n cbRef.current.onError?.(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setLoading(false);\n }\n }, [graphqlClient, companyId]);\n\n const handleViewCart = useCallback(async (cart: Cart): Promise<void> => {\n setSelectedCart(cart);\n setModalLoading(true);\n try {\n const service = createServices(graphqlClient).cart;\n const fullCart = await service.getCart({\n cartId: cart.cartId,\n language: configuration?.language || process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE || 'NL',\n imageSearchFilters: configuration?.imageSearchFiltersGrid ?? {},\n imageVariantFilters: configuration?.imageVariantFiltersSmall,\n });\n setSelectedCart(fullCart);\n } catch (err: unknown) {\n cbRef.current.onError?.(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setModalLoading(false);\n }\n }, [graphqlClient, configuration]);\n\n const handleAcceptRequest = useCallback(async (): Promise<void> => {\n if (!selectedCart) return;\n setAcceptLoading(true);\n const cartId = selectedCart.cartId;\n try {\n let cartForCallback: Cart = selectedCart;\n if (cbRef.current.onAcceptRequest) {\n cbRef.current.onAcceptRequest(cartId);\n } else {\n const service = createServices(graphqlClient).cart;\n cartForCallback = await service.acceptPurchaseAuthorizationRequest({\n id: cartId,\n input: { contactId: (user as Contact)?.contactId },\n imageSearchFilters: configuration?.imageSearchFiltersGrid,\n imageVariantFilters: configuration?.imageVariantFiltersSmall,\n language: configuration?.language || 'NL',\n });\n }\n cbRef.current.afterAcceptRequest?.(cartForCallback);\n setSelectedCart(null);\n await loadCarts();\n } catch (err: unknown) {\n cbRef.current.onError?.(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setAcceptLoading(false);\n }\n }, [graphqlClient, user, selectedCart, configuration, loadCarts]);\n\n const handleDeleteRequest = useCallback(async (): Promise<void> => {\n if (!selectedCart) return;\n setDeleteLoading(true);\n const cartId = selectedCart.cartId;\n try {\n if (cbRef.current.onDeleteRequest) {\n cbRef.current.onDeleteRequest(cartId);\n } else {\n const service = createServices(graphqlClient).cart;\n await service.deleteCart({ id: cartId });\n }\n cbRef.current.afterDeleteRequest?.(cartId);\n setSelectedCart(null);\n await loadCarts();\n } catch (err: unknown) {\n cbRef.current.onError?.(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setDeleteLoading(false);\n }\n }, [graphqlClient, selectedCart, loadCarts]);\n\n const closeModal = useCallback((): void => {\n setSelectedCart(null);\n }, []);\n\n // Load on mount and when companyId changes\n useEffect(() => {\n if (graphqlClient && companyId) {\n loadCarts();\n }\n }, [companyId]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return {\n carts, loading, selectedCart, modalLoading, acceptLoading, deleteLoading, isAuthManager,\n getTotalQuantity, getContactName, getModalItems,\n loadCarts, handleViewCart, handleAcceptRequest, handleDeleteRequest, closeModal,\n };\n}\n","'use client';\n\nimport { useInfraProps } from './useInfraProps';\nimport { useProductGridConfig, ProductGridConfig } from '../../context/ProductGridContext';\nimport { PropellerInfra } from '../../context/PropellerContext';\n\n/**\n * Declarative resolver for the two-tier prop precedence used by ProductCard /\n * ClusterCard:\n *\n * explicit prop > ProductGrid context (Tier 2) > Propeller infra (Tier 1) > default\n *\n * Before this, each card hand-wrote a ~25–40 line object literal of\n * `rawProps.x ?? grid?.x ?? infra.x ?? d` lines — easy to get the precedence\n * order wrong per key and impossible to scan. This collapses it to a spec\n * table. It internally calls the same non-throwing `useInfraProps` and\n * `useProductGridConfig` hooks, so callers no longer invoke them directly and\n * standalone usage (no provider) still works.\n *\n * Spec per key:\n * - `infra` : fall back to PropellerInfra[key] (Tier 1)\n * - `grid` : fall back to ProductGridConfig[key] (Tier 2)\n * - `default`: final fallback when nothing else resolved\n * - `transform(gridValue)`: when the grid value needs wrapping before use\n * (e.g. ProductCard's onToggleFavorite adapter)\n *\n * A key absent from the spec is treated as `raw`-only (passes through unchanged).\n */\n\ntype InfraKey = keyof PropellerInfra;\ntype GridKey = keyof ProductGridConfig;\n\ninterface ResolveSpecEntry {\n /** Tier-1 infra key to fall back to (after the explicit prop). */\n infra?: InfraKey;\n /** Tier-2 grid-config key to fall back to (after the explicit prop). */\n grid?: GridKey;\n /** Final fallback when neither explicit prop nor context resolved a value. */\n default?: unknown;\n /**\n * Optional adapter applied to the *grid* value when it is the one chosen.\n * Used by the card `onToggleFavorite` wrappers that re-shape the grid\n * callback signature.\n */\n transform?: (gridValue: NonNullable<ProductGridConfig[GridKey]>) => unknown;\n}\n\n/** Per-prop resolution spec: maps each prop key to its {@link ResolveSpecEntry}. */\nexport type ResolveSpec<P> = Partial<Record<keyof P, ResolveSpecEntry>>;\n\n/**\n * useResolvedProps — resolves props through the two-tier precedence\n * `explicit prop > ProductGrid context > Propeller infra > default`.\n *\n * @param rawProps - the component's raw props.\n * @param spec - per-key resolution rules; keys absent from the spec pass through unchanged.\n * @returns the props with each spec'd key resolved to its highest-precedence value.\n */\nexport function useResolvedProps<P extends object>(rawProps: P, spec: ResolveSpec<P>): P {\n const grid = useProductGridConfig();\n const infra = useInfraProps(\n rawProps as Record<string, unknown>,\n ) as Record<string, unknown> & Partial<PropellerInfra>;\n\n const resolved = { ...rawProps } as Record<string, unknown>;\n\n const rawRecord = rawProps as Record<string, unknown>;\n\n for (const key of Object.keys(spec)) {\n const entry = (spec as Record<string, ResolveSpecEntry>)[key];\n const explicit = rawRecord[key];\n if (explicit !== undefined && explicit !== null) {\n // Explicit prop always wins — keep the spread value.\n continue;\n }\n\n // Tier 2: ProductGrid config.\n if (entry.grid && grid) {\n const gridValue = grid[entry.grid];\n if (gridValue !== undefined && gridValue !== null) {\n resolved[key] = entry.transform\n ? entry.transform(gridValue as NonNullable<ProductGridConfig[GridKey]>)\n : gridValue;\n continue;\n }\n }\n\n // Tier 1: Propeller infra.\n if (entry.infra) {\n const infraValue = (infra as Partial<PropellerInfra>)[entry.infra];\n if (infraValue !== undefined && infraValue !== null) {\n resolved[key] = infraValue;\n continue;\n }\n }\n\n // Final default.\n if (entry.default !== undefined) {\n resolved[key] = entry.default;\n }\n }\n\n return resolved as P;\n}\n","'use client';\n\nimport { useRequiredPropellerDeps } from '../../context/PropellerContext';\nimport type { Services } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Read the SDK services bundle from `<PropellerDepsProvider>`.\n *\n * The package ships no default `graphqlClient` / `services`. The consumer\n * constructs both at app startup and passes them through\n * `<PropellerDepsProvider value={{ graphqlClient, services, ... }}>`. Per-scope\n * state (user, companyId, language) goes through `<PropellerProvider>`\n * separately.\n *\n * Throws when used outside the deps provider — that's an integration error\n * the consumer fixes at the root layout, not something to paper over with a\n * singleton.\n */\nexport function useServices(): Services {\n return useRequiredPropellerDeps().services;\n}\n","/**\n * fetchActiveCart — fetches the user's existing OPEN cart filtered by user/company.\n *\n * Framework-agnostic helper so login/register pages can reuse the same logic\n * without forcing a state-management store dependency.\n */\n\nimport { CartStatus } from '@propeller-commerce/propeller-sdk-v2';\nimport type { Services } from '@propeller-commerce/propeller-v2-core-ui';\nimport type {\n Cart,\n CartSearchInput,\n Contact,\n Customer,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport type { CartQueryVariables } from '@propeller-commerce/propeller-sdk-v2';\n\n/** Configuration object for {@link fetchActiveCart}. */\nexport interface FetchActiveCartConfig {\n /**\n * The Services bundle — pass `services` from `usePropellerContext()` / the\n * provider's value object. Replaces the previous `graphqlClient` field.\n */\n services: Services;\n /** The authenticated user (Contact or Customer) whose cart to look up. */\n user: Contact | Customer;\n /** Active company ID — narrows the cart search for company users. */\n companyId?: number;\n /** Language code for the localised cart query. */\n language: string;\n /** Image search filters forwarded to the cart query that hydrates item media. */\n imageSearchFilters: MediaImageProductSearchInput;\n /** Image transformation filters forwarded to the cart query that hydrates item media. */\n imageVariantFilters: TransformationsInput;\n}\n\n/**\n * Fetches the user's existing OPEN cart, or `null` when none exists.\n *\n * @param cfg - The fetch configuration.\n * @returns The hydrated open cart, or `null` if none is found or the lookup fails.\n *\n * @remarks\n * Uses the {@link Services.cart} SDK service:\n * - `cart.getCarts` searches `OPEN` carts filtered by contact/customer/company.\n * - `cart.getCart` hydrates the most recent matching cart by `cartId`.\n * Errors are caught, logged, and surfaced as a `null` return.\n */\nexport async function fetchActiveCart(\n cfg: FetchActiveCartConfig,\n): Promise<Cart | null> {\n const cartService = cfg.services.cart;\n try {\n const searchInput: CartSearchInput = {\n offset: 100,\n statuses: [CartStatus.OPEN],\n };\n let scopedByCompany = false;\n if ('contactId' in cfg.user && cfg.user.contactId) {\n searchInput.contactIds = [cfg.user.contactId];\n if (cfg.companyId) {\n searchInput.companyIds = [cfg.companyId];\n scopedByCompany = true;\n }\n } else if ('customerId' in cfg.user && cfg.user.customerId) {\n searchInput.customerIds = [cfg.user.customerId];\n }\n\n // The backend authorizes the `companyIds` cart filter against the contact's\n // memberships; a `companyId` the contact doesn't belong to (e.g. a stale\n // selection left from a previous session) makes the whole query fail with\n // \"Unauthorized use of companyIds\". Drop the company narrowing and retry on\n // the contact alone — that returns the same cart and never 403s. The caller\n // is expected to reconcile the bad selection separately.\n let carts;\n try {\n carts = await cartService.getCarts(searchInput);\n } catch (companyScopedErr) {\n if (!scopedByCompany) throw companyScopedErr;\n console.warn(\n '[fetchActiveCart] company-scoped cart lookup failed; retrying without companyIds:',\n companyScopedErr,\n );\n delete searchInput.companyIds;\n carts = await cartService.getCarts(searchInput);\n }\n\n if (carts?.items?.length) {\n const existingCartId = carts.items[carts.items.length - 1].cartId;\n const cartVars: CartQueryVariables = {\n cartId: existingCartId,\n imageSearchFilters: cfg.imageSearchFilters,\n imageVariantFilters: cfg.imageVariantFilters,\n language: cfg.language,\n };\n return (await cartService.getCart(cartVars)) ?? null;\n }\n return null;\n } catch (e) {\n console.error('[fetchActiveCart] Failed to fetch active cart:', e);\n return null;\n }\n}\n","/**\n * mergeAnonymousCart — copies items from an anonymous cart into a target\n * (authenticated) cart by calling CartService.addItemToCart per item.\n *\n * Framework-agnostic.\n */\n\nimport type { Services } from '@propeller-commerce/propeller-v2-core-ui';\nimport type {\n Cart,\n CartMainItem,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\n\n/** Configuration object for {@link mergeAnonymousCart}. */\nexport interface MergeAnonymousCartConfig {\n /**\n * The Services bundle — pass `services` from `usePropellerContext()` / the\n * provider's value object. Replaces the previous `graphqlClient` field.\n */\n services: Services;\n /** The authenticated user's cart that anonymous items will be added to. */\n targetCartId: string;\n /** The anonymous cart from the store/state captured before authentication. */\n anonymousCart: Cart | null;\n /** Language code for the localised cart mutations. */\n language: string;\n /** Image search filters forwarded to each add-item call that hydrates media. */\n imageSearchFilters: MediaImageProductSearchInput;\n /** Image transformation filters forwarded to each add-item call that hydrates media. */\n imageVariantFilters: TransformationsInput;\n}\n\n/**\n * Copies every item from an anonymous cart into a target authenticated cart.\n *\n * @param cfg - The merge configuration.\n * @returns The latest cart returned by the final successful add, or `null` when\n * the anonymous cart is empty, missing, or is itself the target.\n *\n * @remarks\n * Uses the {@link Services.cart} SDK service: each item is copied via a serial\n * `cart.addItemToCart` call (serial because every call returns the full cart,\n * so parallel calls would race). Child items and `notes` are forwarded when\n * present; individual failures are caught and logged without aborting the loop.\n */\nexport async function mergeAnonymousCart(\n cfg: MergeAnonymousCartConfig,\n): Promise<Cart | null> {\n const items = cfg.anonymousCart?.items ?? [];\n if (!items.length) return null;\n // Skip if anonymous cart IS the target — guards against self-merge.\n if (\n cfg.anonymousCart?.cartId &&\n cfg.anonymousCart.cartId === cfg.targetCartId\n ) {\n return null;\n }\n\n const service = cfg.services.cart;\n let result: Cart | null = null;\n\n // Serial iteration: each call returns the full cart, so parallel races.\n for (const item of items as CartMainItem[]) {\n if (!item.productId || !item.quantity) continue;\n\n const childItems = item.childItems\n ?.filter((c: any) => c.productId)\n .map((c: any) => ({\n productId: c.productId,\n quantity: c.quantity ?? item.quantity,\n }));\n\n try {\n result = await service.addItemToCart({\n id: cfg.targetCartId,\n input: {\n productId: item.productId,\n quantity: item.quantity,\n ...(item.clusterId && { clusterId: item.clusterId }),\n ...(childItems && childItems.length > 0 && { childItems }),\n ...(item.notes && { notes: item.notes }),\n },\n language: cfg.language,\n imageSearchFilters: cfg.imageSearchFilters,\n imageVariantFilters: cfg.imageVariantFilters,\n });\n } catch (e) {\n console.error(\n '[mergeAnonymousCart] addItemToCart failed for productId=' +\n item.productId,\n e,\n );\n }\n }\n\n return result;\n}\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport {\n Cart,\n Contact,\n Customer,\n GraphQLClient,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useAuth } from '../composables/react/useAuth';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface LoginFormProps {\n /**\n * GraphQL client for self-contained login.\n * When provided (and onLoginSubmit is not), the component handles\n * authentication internally via LoginService + UserService.\n */\n graphqlClient?: GraphQLClient;\n\n /** Title of the login form\n * @default \"Log in\"\n */\n title?: string;\n\n /** Subtitle of the login form\n * @default \"\"\n */\n subtitle?: string;\n\n /** Show/hide the password reset link\n * @default true\n */\n displayForgotPasswordLink?: boolean;\n\n /** Action for the password reset link click */\n onForgotPasswordClick?: (event?: React.MouseEvent) => void;\n\n /** Show/hide the registration link\n * @default true\n */\n displayRegisterLink?: boolean;\n\n /** Action for the registration link click */\n onRegisterClick?: (event?: React.MouseEvent) => void;\n\n /** Show/hide the guest checkout link\n * @default true\n */\n displayGuestCheckoutLink?: boolean;\n\n /** Action for the guest checkout link click */\n onGuestCheckoutClick?: (event?: React.MouseEvent) => void;\n\n /** Label for the submit button\n * @default \"Login\"\n */\n buttonText?: string;\n\n /**\n * Labels for the login form fields.\n *\n * Available keys:\n * - email: Email field label (default: \"Email\")\n * - password: Password field label (default: \"Password\")\n * - emailPlaceholder: Email input placeholder (default: \"name@example.com\")\n * - passwordPlaceholder: Password input placeholder (default: \"••••••••\")\n * - forgotPassword: Forgot password link text (default: \"Forgot password?\")\n * - registerText: Text before register link (default: \"Don't have an account?\")\n * - registerLink: Register link text (default: \"Create an Account\")\n * - guestCheckoutLink: Guest checkout link text (default: \"Continue as Guest\")\n */\n labels?: Record<string, string>;\n\n /**\n * Fires when login form is submitted (delegation mode).\n * When provided, the component does NOT call the SDK — the parent handles authentication.\n * When absent and graphqlClient is provided, the component handles login internally.\n */\n onLoginSubmit?: (email: string, password: string) => void;\n\n /** Whether login is currently in progress (shows loading state on button).\n * Used in delegation mode. Ignored in self-contained mode.\n * @default false\n */\n loginLoading?: boolean;\n\n /** Error message to display in the form.\n * Used in delegation mode. In self-contained mode the component manages its own error.\n */\n loginError?: string;\n\n /** Callback before the login process starts */\n beforeLogin?: () => void;\n\n /** Callback after successful login with user data.\n * `anonymousCart` is the cart held in the parent's state at the moment of submission,\n * forwarded so the parent can merge it into the authenticated user's cart.\n */\n afterLogin?: (\n user: Contact | Customer,\n accessToken?: string,\n refreshToken?: string,\n expiresAt?: string,\n anonymousCart?: Cart | null\n ) => void;\n\n /** Anonymous cart snapshot from the parent's state — forwarded to `afterLogin`. */\n cart?: Cart | null;\n\n /**\n * Show login form in dropdown for immediate login when user is not logged in.\n * @default true\n */\n accountHeaderLoginForm?: boolean;\n\n /** Config object providing imageSearchFiltersGrid and imageVariantFiltersSmall. */\n configuration?: {\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n };\n\n /** Compound mode opt-in. When provided, LoginForm renders the compound\n * subtree (using <LoginForm.X> subcomponents) instead of the default\n * layout. Subcomponents share form state via context. */\n children?: React.ReactNode;\n}\n\ninterface LoginFormContextValue {\n resolved: LoginFormProps;\n form: {\n email: string;\n password: string;\n isLoading: boolean;\n error: string;\n onEmailChange: (value: string) => void;\n onPasswordChange: (value: string) => void;\n onSubmit: (e: React.FormEvent) => void;\n };\n}\n\nconst LoginFormContext = React.createContext<LoginFormContextValue | null>(null);\n\nfunction useLoginFormContext(): LoginFormContextValue {\n const ctx = React.useContext(LoginFormContext);\n if (!ctx) {\n throw new Error(\n 'LoginForm compound subcomponents must be rendered inside <LoginForm>.',\n );\n }\n return ctx;\n}\n\n/**\n * Renders an email/password login form supporting both self-contained mode\n * (handles authentication internally) and delegation mode (parent handles it).\n *\n * @remarks Uses {@link useAuth} for self-contained authentication.\n */\nfunction LoginForm(rawProps: LoginFormProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const { loading, error: authError, login } = useAuth({\n graphqlClient: props.graphqlClient as GraphQLClient,\n });\n\n // Labels / flags resolved once (previously each was a one-line function\n // redefined every render and called from the JSX).\n const emailLabel = getLabel(props.labels, 'email', 'Email');\n const passwordLabel = getLabel(props.labels, 'password', 'Password');\n const emailPlaceholder = getLabel(props.labels, 'emailPlaceholder', 'name@example.com');\n const passwordPlaceholder = getLabel(props.labels, 'passwordPlaceholder', '••••••••');\n const forgotPasswordText = getLabel(props.labels, 'forgotPassword', 'Forgot password?');\n const registerText = getLabel(props.labels, 'registerText', \"Don't have an account?\");\n const registerLinkText = getLabel(props.labels, 'registerLink', 'Create an Account');\n const guestCheckoutLinkText = getLabel(props.labels, 'guestCheckoutLink', 'Continue as Guest');\n const resolvedTitle = props.title !== undefined ? props.title : 'Log in';\n const resolvedButtonText = props.buttonText || 'Login';\n const showForgotPassword = props.displayForgotPasswordLink !== false;\n const showRegister = props.displayRegisterLink !== false;\n const showGuestCheckout = props.displayGuestCheckoutLink !== false;\n\n const isLoading = props.onLoginSubmit ? props.loginLoading === true : loading;\n\n // Surface a friendly fixed message for any login failure — server-side error\n // strings can be cryptic (\"HTTP 401\", GraphQL \"Unauthorized\", etc.) and\n // aren't safe to show to end users. Override via `labels.invalidCredentials`.\n const rawError = props.onLoginSubmit ? props.loginError : authError;\n const errorMessage = rawError\n ? getLabel(\n props.labels,\n 'invalidCredentials',\n \"The credentials you entered don't match our records. Please try again.\",\n )\n : '';\n\n async function handleSubmit(e: React.FormEvent): Promise<void> {\n e.preventDefault();\n if (props.beforeLogin) {\n props.beforeLogin();\n }\n if (props.onLoginSubmit) {\n // Delegation mode: parent handles authentication\n props.onLoginSubmit(email, password);\n return;\n }\n\n // Self-contained mode: handle login via composable\n if (!props.graphqlClient) {\n return;\n }\n if (loading) return;\n\n const result = await login(email, password);\n if (result.ok && result.data.user) {\n setEmail('');\n setPassword('');\n if (props.afterLogin) {\n props.afterLogin(\n result.data.user as Contact | Customer,\n result.data.accessToken,\n result.data.refreshToken,\n result.data.expiresAt,\n props.cart ?? null,\n );\n }\n }\n }\n\n const contextValue: LoginFormContextValue = {\n resolved: props,\n form: {\n email,\n password,\n isLoading,\n error: errorMessage,\n onEmailChange: (value) => setEmail(value),\n onPasswordChange: (value) => setPassword(value),\n onSubmit: handleSubmit,\n },\n };\n\n // Compound mode: consumer composes the layout from <LoginForm.X> subcomponents.\n if (rawProps.children !== undefined) {\n return (\n <LoginFormContext.Provider value={contextValue}>\n <div\n className=\"propeller-login-form\"\n data-loading={isLoading ? 'true' : 'false'}\n data-variant={props.accountHeaderLoginForm ? 'compact' : 'full'}\n >\n <form\n className=\"propeller-login-form__form space-y-4\"\n onSubmit={(e) => handleSubmit(e)}\n >\n {rawProps.children}\n </form>\n </div>\n </LoginFormContext.Provider>\n );\n }\n\n return (\n <LoginFormContext.Provider value={contextValue}>\n <div\n className=\"propeller-login-form\"\n data-loading={isLoading ? 'true' : 'false'}\n data-variant={props.accountHeaderLoginForm ? 'compact' : 'full'}\n >\n {resolvedTitle ? (\n <div className=\"propeller-login-form__header space-y-1 text-center mb-6\">\n <h2 className=\"propeller-login-form__title text-2xl font-bold\">{resolvedTitle}</h2>\n {props.subtitle ? (\n <p className=\"propeller-login-form__subtitle text-sm text-muted-foreground\">\n {props.subtitle}\n </p>\n ) : null}\n </div>\n ) : null}\n <form className=\"propeller-login-form__form space-y-4\" onSubmit={(e) => handleSubmit(e)}>\n <LoginFormEmailField />\n <LoginFormPasswordField />\n <LoginFormErrorMessage />\n <LoginFormSubmitButton />\n </form>\n {(showRegister || showGuestCheckout) && !props.accountHeaderLoginForm ? (\n <div className=\"propeller-login-form__footer mt-6 border-t border-border pt-6 space-y-3\">\n <LoginFormRegisterLink />\n <LoginFormGuestCheckoutButton />\n </div>\n ) : null}\n {props.accountHeaderLoginForm ? (\n <div className=\"propeller-login-form__footer flex flex-col gap-2 text-sm pt-3 text-center\">\n <LoginFormForgotPasswordLink />\n <div className=\"propeller-login-form__register text-xs text-muted-foreground\">\n {getLabel(props.labels, 'noAccount', \"Don't have an account?\")}\n <LoginFormRegisterLink />\n </div>\n </div>\n ) : null}\n </div>\n </LoginFormContext.Provider>\n );\n}\n\nfunction LoginFormEmailField(_props: { className?: string } = {}) {\n const { resolved, form } = useLoginFormContext();\n const emailLabel = getLabel(resolved.labels, 'email', 'Email');\n const emailPlaceholder = getLabel(\n resolved.labels,\n 'emailPlaceholder',\n 'name@example.com',\n );\n return (\n <div className={_props.className ?? 'propeller-login-form__field space-y-2'}>\n <label\n htmlFor=\"login-email\"\n className=\"propeller-login-form__label text-sm font-medium leading-none\"\n >\n {emailLabel}\n </label>\n <input\n type=\"email\"\n id=\"login-email\"\n name=\"email\"\n className=\"propeller-login-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={form.email}\n onChange={(e) => form.onEmailChange(e.target.value)}\n placeholder={emailPlaceholder}\n required\n disabled={form.isLoading}\n />\n </div>\n );\n}\n\nfunction LoginFormPasswordField(_props: {\n className?: string;\n showInlineForgotPassword?: boolean;\n} = {}) {\n const { resolved, form } = useLoginFormContext();\n const passwordLabel = getLabel(resolved.labels, 'password', 'Password');\n const passwordPlaceholder = getLabel(\n resolved.labels,\n 'passwordPlaceholder',\n '••••••••',\n );\n const showForgotPassword = resolved.displayForgotPasswordLink !== false;\n // Preserves the existing inline placement when no override is given.\n const showInline =\n _props.showInlineForgotPassword !== undefined\n ? _props.showInlineForgotPassword\n : showForgotPassword && !resolved.accountHeaderLoginForm;\n return (\n <div className={_props.className ?? 'propeller-login-form__field space-y-2'}>\n <div className=\"flex items-center justify-between\">\n <label\n htmlFor=\"login-password\"\n className=\"propeller-login-form__label text-sm font-medium leading-none\"\n >\n {passwordLabel}\n </label>\n {showInline ? <LoginFormForgotPasswordLink /> : null}\n </div>\n <input\n type=\"password\"\n id=\"login-password\"\n name=\"password\"\n className=\"propeller-login-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={form.password}\n onChange={(e) => form.onPasswordChange(e.target.value)}\n placeholder={passwordPlaceholder}\n required\n disabled={form.isLoading}\n />\n </div>\n );\n}\n\nfunction LoginFormSubmitButton(_props: { className?: string } = {}) {\n const { resolved, form } = useLoginFormContext();\n const resolvedButtonText = resolved.buttonText || 'Login';\n return (\n <button\n type=\"submit\"\n className={\n _props.className ??\n 'propeller-login-form__submit inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font-medium text-primary-foreground bg-primary rounded-control hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed'\n }\n disabled={form.isLoading}\n >\n {form.isLoading ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-login-form__spinner animate-spin -ml-1 mr-2 h-4 w-4 text-primary-foreground\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n className=\"opacity-25\"\n />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n className=\"opacity-75\"\n />\n </svg>\n ) : null}\n {form.isLoading ? (\n <>{getLabel(resolved.labels, 'loggingIn', 'Logging in...')}</>\n ) : (\n <>{resolvedButtonText}</>\n )}\n </button>\n );\n}\n\nfunction LoginFormForgotPasswordLink(_props: { className?: string } = {}) {\n const { resolved } = useLoginFormContext();\n if (resolved.displayForgotPasswordLink === false) return null;\n // Two visual variants: compact (header dropdown) and full (inline label row).\n const isCompact = !!resolved.accountHeaderLoginForm;\n const className =\n _props.className ??\n (isCompact\n ? 'propeller-login-form__forgot-link text-secondary hover:underline text-xs'\n : 'propeller-login-form__forgot-link text-sm text-primary hover:underline');\n const text = isCompact\n ? getLabel(resolved.labels, 'forgotPassword', 'Forgot Password?')\n : getLabel(resolved.labels, 'forgotPassword', 'Forgot password?');\n return (\n <button\n type=\"button\"\n className={className}\n onClick={() => {\n if (resolved.onForgotPasswordClick) resolved.onForgotPasswordClick();\n }}\n >\n {text}\n </button>\n );\n}\n\nfunction LoginFormRegisterLink(_props: { className?: string } = {}) {\n const { resolved } = useLoginFormContext();\n if (resolved.displayRegisterLink === false) return null;\n const isCompact = !!resolved.accountHeaderLoginForm;\n if (isCompact) {\n return (\n <button\n type=\"button\"\n className={\n _props.className ??\n 'propeller-login-form__register-btn text-secondary hover:underline font-medium'\n }\n onClick={() => {\n if (resolved.onRegisterClick) resolved.onRegisterClick();\n }}\n >\n {getLabel(resolved.labels, 'registerLink', 'Register')}\n </button>\n );\n }\n const registerText = getLabel(\n resolved.labels,\n 'registerText',\n \"Don't have an account?\",\n );\n const registerLinkText = getLabel(\n resolved.labels,\n 'registerLink',\n 'Create an Account',\n );\n return (\n <div className={_props.className ?? 'propeller-login-form__register text-center'}>\n <p className=\"propeller-login-form__register-prompt text-sm text-muted-foreground mb-2\">\n {registerText}\n </p>\n <button\n type=\"button\"\n className=\"propeller-login-form__register-btn inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font-medium border border-border rounded-control hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\"\n onClick={() => {\n if (resolved.onRegisterClick) resolved.onRegisterClick();\n }}\n >\n {registerLinkText}\n </button>\n </div>\n );\n}\n\nfunction LoginFormGuestCheckoutButton(_props: { className?: string } = {}) {\n const { resolved } = useLoginFormContext();\n if (resolved.displayGuestCheckoutLink === false) return null;\n // Compact mode historically omits the guest-checkout link; preserve that.\n if (resolved.accountHeaderLoginForm) return null;\n const guestCheckoutLinkText = getLabel(\n resolved.labels,\n 'guestCheckoutLink',\n 'Continue as Guest',\n );\n return (\n <div className={_props.className ?? 'propeller-login-form__guest text-center'}>\n <button\n type=\"button\"\n className=\"propeller-login-form__guest-btn text-sm text-primary hover:underline\"\n onClick={() => {\n if (resolved.onGuestCheckoutClick) resolved.onGuestCheckoutClick();\n }}\n >\n {guestCheckoutLinkText}\n </button>\n </div>\n );\n}\n\nfunction LoginFormErrorMessage(_props: { className?: string } = {}) {\n const { form } = useLoginFormContext();\n if (!form.error) return null;\n return (\n <div\n className={\n _props.className ??\n 'propeller-login-form__error text-sm text-destructive bg-destructive/10 p-3 rounded-control'\n }\n >\n {form.error}\n </div>\n );\n}\n\ntype LoginFormComponent = typeof LoginForm & {\n EmailField: typeof LoginFormEmailField;\n PasswordField: typeof LoginFormPasswordField;\n SubmitButton: typeof LoginFormSubmitButton;\n ForgotPasswordLink: typeof LoginFormForgotPasswordLink;\n RegisterLink: typeof LoginFormRegisterLink;\n GuestCheckoutButton: typeof LoginFormGuestCheckoutButton;\n ErrorMessage: typeof LoginFormErrorMessage;\n};\n\nconst LoginFormExport = LoginForm as LoginFormComponent;\nLoginFormExport.EmailField = LoginFormEmailField;\nLoginFormExport.PasswordField = LoginFormPasswordField;\nLoginFormExport.SubmitButton = LoginFormSubmitButton;\nLoginFormExport.ForgotPasswordLink = LoginFormForgotPasswordLink;\nLoginFormExport.RegisterLink = LoginFormRegisterLink;\nLoginFormExport.GuestCheckoutButton = LoginFormGuestCheckoutButton;\nLoginFormExport.ErrorMessage = LoginFormErrorMessage;\n\nexport default LoginFormExport;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { Cart, Contact, Customer, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport DefaultLoginFormImpl from './LoginForm';\nimport type { LoginFormProps } from './LoginForm';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface AccountMenuLink {\n /** Display label for the link */\n label: string;\n /** URL path for the link */\n href: string;\n /** Optional icon name */\n icon?: string;\n}\nexport interface AccountIconAndMenuProps {\n /**\n * Contact/Customer that this component will operate with.\n * When present, shows account navigation. When null, shows login form.\n */\n user?: Contact | Customer | null;\n\n /**\n * Icon for the account icon in header.\n * @default 'default-account-icon'\n */\n icon?: string;\n\n /**\n * Show account dropdown at the bottom of the icon when account icon is clicked.\n * If false, fires onAccountIconClick() instead.\n * @default true\n */\n showAccountMenuOnClick?: boolean;\n\n /**\n * Title for the account dropdown menu.\n * @default 'My account'\n */\n accountMenuTitle?: string;\n\n /**\n * Show login form in dropdown for immediate login when user is not logged in.\n * @default true\n */\n accountHeaderLoginForm?: boolean;\n\n // ── LoginForm pass-through props ────────────────────────────────────────\n\n /**\n * GraphQL client for self-contained login.\n * When provided (and onLoginSubmit is not), LoginForm handles authentication internally.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Title displayed inside the login form.\n * @default 'Welcome Back'\n */\n loginFormTitle?: string;\n\n /** Subtitle displayed inside the login form. */\n loginFormSubtitle?: string;\n\n /**\n * Label for the login submit button.\n * @default 'Log In'\n */\n loginButtonText?: string;\n\n /**\n * Show/hide the forgot password link inside the login form.\n * @default true\n */\n displayForgotPasswordLink?: boolean;\n\n /**\n * Show/hide the register link inside the login form.\n * @default true\n */\n displayRegisterLink?: boolean;\n\n /**\n * Show/hide the guest checkout link inside the login form.\n * @default false\n */\n displayGuestCheckoutLink?: boolean;\n\n /** Fires when the guest checkout link is clicked. */\n onGuestCheckoutClick?: () => void;\n\n /**\n * Error message shown inside the login form.\n * Used in delegation mode (when onLoginSubmit is provided).\n */\n loginError?: string;\n\n /** Callback fired before the login process starts. */\n beforeLogin?: () => void;\n\n /**\n * Callback fired after successful self-contained login.\n * Not called in delegation mode — the parent handles the result there.\n */\n afterLogin?: (\n user: Contact | Customer,\n accessToken?: string,\n refreshToken?: string,\n expiresAt?: string,\n anonymousCart?: Cart | null\n ) => void;\n\n /** Anonymous cart snapshot — forwarded to the embedded `LoginForm` so its `afterLogin` receives it. */\n cart?: Cart | null;\n\n // ── Existing callbacks ──────────────────────────────────────────────────\n\n /**\n * Fires when login form is submitted (delegation mode).\n * Parent should handle actual authentication.\n */\n onLoginSubmit?: (email: string, password: string) => void;\n\n /**\n * Fires when account icon is clicked and showAccountMenuOnClick is false.\n */\n onAccountIconClick?: () => void;\n\n /**\n * Fires when a menu item is clicked. Receives the href.\n */\n onMenuItemClick?: (href: string) => void;\n\n /**\n * Fires when logout is clicked.\n */\n onLogoutClick?: () => void;\n\n /**\n * Fires when \"Forgot Password\" link is clicked.\n */\n onForgotPasswordClick?: () => void;\n\n /**\n * Fires when \"Register\" link is clicked.\n */\n onRegisterClick?: () => void;\n\n /**\n * Whether login is currently in progress (shows loading state on button).\n * @default false\n */\n loginLoading?: boolean;\n\n /**\n * Account navigation links shown when user is authenticated.\n * @default [{ label: 'Dashboard', href: '/account' }, ...]\n */\n menuLinks?: AccountMenuLink[];\n\n /**\n * Labels for the component.\n * Available keys: accountLabel, loginTitle, loginSubtitle, loginButton, signedInAs, logoutLabel.\n */\n labels?: Record<string, string>;\n\n /** Translated labels forwarded to the embedded `<LoginForm>` shown\n * in the dropdown when no user is signed in.\n * See `LoginFormProps.labels` for slugs (email, password, forgotPassword,\n * registerText, registerLink, noAccount, loggingIn, etc.). */\n loginFormLabels?: Record<string, string>;\n\n /** Additional class name for the account icon button. */\n iconClassName?: string;\n\n /** Additional class name for the dropdown menu. */\n menuClassName?: string;\n\n /**\n * Component variant.\n * - 'dropdown' (default): Header icon with popup menu\n * - 'sidebar': Always-visible vertical navigation for account layout\n */\n variant?: 'dropdown' | 'sidebar';\n\n /**\n * Current route path, used in sidebar variant to highlight the active link.\n */\n currentPath?: string;\n\n // ───── Extension API ─────\n // Replaces the embedded <LoginForm> when the consumer is signed out.\n // Receives the same labels/callbacks the default LoginForm would.\n loginFormComponent?: React.ComponentType<LoginFormProps>;\n}\n/**\n * Header account control: renders an account icon with a dropdown menu (or an\n * always-visible sidebar). Shows account navigation and logout when a user is\n * present, otherwise an embedded {@link LoginForm} or a login call-to-action.\n *\n * @remarks Resolves infra props from `<PropellerProvider>` via `useInfraProps`.\n */\nfunction AccountIconAndMenu(rawProps: AccountIconAndMenuProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const LoginFormImpl = props.loginFormComponent ?? DefaultLoginFormImpl;\n const [menuOpen, setMenuOpen] = useState(() => false);\n function isSidebar() {\n return props.variant === 'sidebar';\n }\n function getUserName() {\n const user = props.user as Contact | Customer;\n if (!user) return '';\n const parts = [user.firstName, user.lastName].filter(Boolean);\n if (parts.length > 0) return parts.join(' ');\n if (user.firstName) return user.firstName;\n if (user.email) return user.email;\n return 'User';\n }\n function getMenuTitle() {\n return (\n props.accountMenuTitle ||\n (props.labels as Record<string, string>)?.['accountMenuTitle'] ||\n 'My account'\n );\n }\n function isActiveLink(href: string) {\n if (!props.currentPath) return false;\n if (href.endsWith('/account')) return props.currentPath === href;\n return props.currentPath.startsWith(href);\n }\n function getMenuLinks() {\n if (props.menuLinks && (props.menuLinks as AccountMenuLink[]).length > 0) {\n return props.menuLinks as AccountMenuLink[];\n }\n return [\n {\n label: 'Dashboard',\n href: '/account',\n },\n {\n label: 'Orders',\n href: '/account/orders',\n },\n {\n label: 'Addresses',\n href: '/account/addresses',\n },\n {\n label: 'Quotes',\n href: '/account/quotes',\n },\n {\n label: 'Invoices',\n href: '/account/invoices',\n },\n {\n label: 'Favorites',\n href: '/account/favorites',\n },\n ] as AccountMenuLink[];\n }\n function handleIconClick() {\n if (props.showAccountMenuOnClick !== false) {\n setMenuOpen(!menuOpen);\n } else {\n if (props.onAccountIconClick) props.onAccountIconClick();\n }\n }\n function handleMenuItemClick(\n href: string\n ) {\n setMenuOpen(false);\n if (props.onMenuItemClick) props.onMenuItemClick(href);\n }\n function handleLogoutClick() {\n setMenuOpen(false);\n if (props.onLogoutClick) props.onLogoutClick();\n }\n function handleForgotPasswordClick() {\n setMenuOpen(false);\n if (props.onForgotPasswordClick) props.onForgotPasswordClick();\n }\n function handleRegisterClick() {\n setMenuOpen(false);\n if (props.onRegisterClick) props.onRegisterClick();\n }\n function handleGuestCheckoutClick() {\n setMenuOpen(false);\n if (props.onGuestCheckoutClick) props.onGuestCheckoutClick();\n }\n function closeMenu() {\n setMenuOpen(false);\n }\n // Click-outside-to-close. Listener is closed-over in the effect — the\n // previous code stashed it in state (setClickOutsideListener) but nothing\n // ever read that state. Also adds a cleanup so the listener detaches on\n // unmount; the previous code leaked it.\n useEffect(() => {\n const listener = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n if (target && !target.closest('[data-account-menu]')) {\n setMenuOpen(false);\n }\n };\n document.addEventListener('mousedown', listener);\n return () => document.removeEventListener('mousedown', listener);\n }, []);\n // Close the open menu when the user prop changes from null to a logged-in\n // user — login dismisses the dropdown. Intentional external-state sync\n // (the user object is owned by AuthContext, not this component).\n useEffect(() => {\n if (props.user && menuOpen) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setMenuOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.user]);\n return (\n <div\n className=\"propeller-account-menu relative\"\n data-account-menu\n data-variant={isSidebar() ? 'sidebar' : 'dropdown'}\n data-authenticated={props.user ? 'true' : 'false'}\n >\n {isSidebar() ? (\n <div className=\"propeller-account-menu__sidebar flex flex-col\">\n {!!props.user ? (\n <>\n <div className=\"propeller-account-menu__user px-4 py-3 border-b border-border\">\n <p className=\"propeller-account-menu__user-label text-xs text-muted-foreground uppercase tracking-wider font-semibold mb-1\">\n {getLabel(props.labels, 'signedInAs', 'Signed in as')}\n </p>\n <p className=\"propeller-account-menu__user-name font-medium text-foreground truncate\">{getUserName()}</p>\n </div>\n <nav className=\"propeller-account-menu__nav py-2\">\n <ul className=\"propeller-account-menu__list space-y-0.5\">\n {getMenuLinks()?.map((link) => (\n <li key={link.href} className=\"propeller-account-menu__item\">\n <button\n type=\"button\"\n onClick={(event) => handleMenuItemClick(link.href)}\n data-active={isActiveLink(link.href) ? 'true' : 'false'}\n className={`propeller-account-menu__link flex w-full items-center gap-3 px-4 py-2.5 text-sm font-medium transition-colors ${isActiveLink(link.href) ? 'bg-secondary/5 text-secondary border-l-2 border-secondary' : 'text-muted-foreground hover:bg-surface-hover hover:text-foreground'}`}\n >\n {link.label}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n <div className=\"propeller-account-menu__logout-wrapper px-4 py-3 border-t border-border\">\n <button\n type=\"button\"\n className=\"propeller-account-menu__logout-btn flex w-full items-center gap-3 px-3 py-2 text-sm font-medium text-primary hover:bg-secondary/5 rounded-control transition-colors\"\n onClick={(event) => handleLogoutClick()}\n >\n {getLabel(props.labels, 'logoutLabel', 'Log Out')}\n </button>\n </div>\n </>\n ) : null}\n </div>\n ) : null}\n {!isSidebar() ? (\n <>\n <button\n type=\"button\"\n onClick={(event) => handleIconClick()}\n aria-label={getLabel(props.labels, 'accountLabel', 'Account')}\n data-open={menuOpen ? 'true' : 'false'}\n className={`propeller-account-menu__trigger inline-flex items-center gap-2 px-3 py-2 rounded-control text-sm font-medium transition-colors text-white hover:bg-white/10${props.iconClassName ? ' ' + props.iconClassName : ''}`}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-account-menu__icon w-5 h-5\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z\"\n />\n </svg>\n {props.user ? (\n <span className=\"propeller-account-menu__greeting hidden md:block font-normal\">Hi, {getUserName()}</span>\n ) : null}\n {!props.user ? (\n <span className=\"propeller-account-menu__greeting hidden md:block font-normal\">\n {getLabel(props.labels, 'accountLabel', 'Account')}\n </span>\n ) : null}\n </button>\n {menuOpen ? (\n <div\n className={`propeller-account-menu__popover absolute right-0 mt-2 w-80 bg-popover text-foreground rounded-container shadow-lg border border-border py-4 px-5 z-50${props.menuClassName ? ' ' + props.menuClassName : ''}`}\n >\n {!!props.user ? (\n <>\n <div className=\"propeller-account-menu__user pb-3 mb-3 border-b border-border\">\n <p className=\"propeller-account-menu__user-label text-xs text-muted-foreground uppercase tracking-wider font-semibold mb-1\">\n {getLabel(props.labels, 'signedInAs', 'Signed in as')}\n </p>\n <p className=\"propeller-account-menu__user-name font-medium text-foreground truncate\">{getUserName()}</p>\n </div>\n <nav className=\"propeller-account-menu__nav\">\n <ul className=\"propeller-account-menu__list space-y-0.5\">\n {getMenuLinks()?.map((link) => (\n <li key={link.href} className=\"propeller-account-menu__item\">\n <button\n type=\"button\"\n className=\"propeller-account-menu__link flex w-full items-center gap-3 px-3 py-2 text-sm font-medium rounded-control text-muted-foreground hover:bg-surface-hover hover:text-foreground transition-colors\"\n onClick={(event) => handleMenuItemClick(link.href)}\n >\n {link.label}\n </button>\n </li>\n ))}\n </ul>\n </nav>\n <div className=\"propeller-account-menu__logout-wrapper mt-3 pt-3 border-t border-border\">\n <button\n type=\"button\"\n className=\"propeller-account-menu__logout-btn flex w-full items-center gap-3 px-3 py-2 text-sm font-medium text-primary hover:bg-secondary/5 rounded-control transition-colors\"\n onClick={(event) => handleLogoutClick()}\n >\n {getLabel(props.labels, 'logoutLabel', 'Log Out')}\n </button>\n </div>\n </>\n ) : null}\n {!props.user ? (\n <>\n {props.accountHeaderLoginForm !== false ? (\n <LoginFormImpl\n cart={props.cart}\n title={props.loginFormTitle ?? getLabel(props.labels, 'loginTitle', 'Welcome Back')}\n subtitle={props.loginFormSubtitle ?? getLabel(props.labels, 'loginSubtitle', '')}\n buttonText={props.loginButtonText ?? getLabel(props.labels, 'loginButton', 'Log In')}\n displayForgotPasswordLink={props.displayForgotPasswordLink}\n displayRegisterLink={props.displayRegisterLink}\n displayGuestCheckoutLink={props.displayGuestCheckoutLink}\n labels={props.loginFormLabels}\n onLoginSubmit={props.onLoginSubmit}\n loginLoading={props.loginLoading}\n loginError={props.loginError}\n beforeLogin={props.beforeLogin}\n afterLogin={props.afterLogin}\n onForgotPasswordClick={(event) => handleForgotPasswordClick()}\n onRegisterClick={(event) => handleRegisterClick()}\n onGuestCheckoutClick={(event) => handleGuestCheckoutClick()}\n accountHeaderLoginForm={props.accountHeaderLoginForm}\n />\n ) : null}\n {props.accountHeaderLoginForm === false ? (\n <div className=\"propeller-account-menu__login-cta text-center py-4\">\n <h4 className=\"propeller-account-menu__login-title text-lg font-semibold mb-2\">{getMenuTitle()}</h4>\n <p className=\"propeller-account-menu__login-subtitle text-sm text-muted-foreground mb-4\">\n {getLabel(props.labels, 'loginSubtitle', 'Login to access your account')}\n </p>\n <button\n type=\"button\"\n className=\"propeller-account-menu__login-btn w-full inline-flex justify-center items-center px-4 py-2 rounded-control bg-secondary text-secondary-foreground text-sm font-medium hover:bg-secondary/90 transition-colors\"\n onClick={(event) => {\n closeMenu();\n if (props.onAccountIconClick) props.onAccountIconClick();\n }}\n >\n {getLabel(props.labels, 'loginButton', 'Log In')}\n </button>\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n );\n}\n\nexport default AccountIconAndMenu;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { GraphQLClient, Cart } from '@propeller-commerce/propeller-sdk-v2';\nimport { useCart } from '../composables/react/useCart';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ActionCodeProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The shopping cart used to populate the cart summary data */\n cart: Cart;\n\n /** Action code block title */\n title?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Display the option to remove the action code of the shopping cart. Defaults to true. */\n showRemoveCode?: boolean;\n\n /** Action handler when action code is added to the cart */\n onActionCodeApply?: (code: string, cart: Cart) => void;\n\n /** Action handler when action code is removed from the cart */\n onActionCodeRemove?: (code: string, cart: Cart) => void;\n\n /** Action callback method after action code is applied */\n afterActionCodeApply?: (cart: Cart) => void;\n\n /** Action callback method after action code is removed */\n afterActionCodeRemove?: (cart: Cart) => void;\n\n /** Configuration object for image filters */\n configuration?: any;\n\n /** Language code for CartService operations. Defaults to 'NL'. */\n language?: string;\n}\n\n/**\n * Action-code (coupon) input for the shopping cart: applies or removes a\n * promotional code and surfaces a friendly error message on failure.\n *\n * @remarks Uses {@link useCart} for the apply/remove cart operations.\n */\nfunction ActionCode(rawProps: ActionCodeProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // --- composable ---\n const { addActionCode, removeActionCode, loading, error } = useCart({\n graphqlClient: props.graphqlClient!,\n user: null,\n cartId: props.cart?.cartId,\n configuration: props.configuration,\n });\n\n // --- local UI state ---\n const [code, setCode] = useState<string>(() => '');\n const [fallbackError, setFallbackError] = useState<string>(() => '');\n\n // --- display helpers ---\n\n // Surface a friendly fixed message for any action-code failure — server-side\n // error strings can be cryptic (\"Code not found\", GraphQL \"Bad Request\", etc.)\n // and aren't safe to show to end users. Override via `labels.invalidActionCode`\n // if a specific copy is needed.\n function errorMessage(): string {\n if (!error && !fallbackError) return '';\n return getLabel(\n props.labels,\n 'invalidActionCode',\n 'This action code is not found. Please add a valid action code.',\n );\n }\n function title(): string {\n return props.title || 'Action code';\n }\n function showRemoveCode(): boolean {\n return props.showRemoveCode !== undefined ? props.showRemoveCode : true;\n }\n function appliedCode(): string {\n return props.cart?.actionCode || '';\n }\n function hasAppliedCode(): boolean {\n return !!props.cart?.actionCode;\n }\n\n // --- actions via composable ---\n async function handleApply(): Promise<void> {\n if (!code.trim() || loading) return;\n setFallbackError('');\n if (props.onActionCodeApply) {\n props.onActionCodeApply(code.trim(), props.cart);\n setCode('');\n return;\n }\n const updatedCart = await addActionCode(code.trim());\n if (updatedCart) {\n setCode('');\n if (props.afterActionCodeApply) props.afterActionCodeApply(updatedCart);\n } else if (!error) {\n setFallbackError(getLabel(props.labels, 'errorApply', 'Failed to apply action code. Please try again.'));\n }\n }\n\n async function handleRemove(): Promise<void> {\n if (loading || !hasAppliedCode()) return;\n setFallbackError('');\n const currentCode = appliedCode();\n if (props.onActionCodeRemove) {\n props.onActionCodeRemove(currentCode, props.cart);\n return;\n }\n const updatedCart = await removeActionCode(currentCode);\n if (updatedCart) {\n if (props.afterActionCodeRemove) props.afterActionCodeRemove(updatedCart);\n } else if (!error) {\n setFallbackError(getLabel(props.labels, 'errorRemove', 'Failed to remove action code. Please try again.'));\n }\n }\n\n function handleKeyDown(e: any): void {\n if (e.key === 'Enter') {\n handleApply();\n }\n }\n\n return (\n <div className=\"propeller-action-code w-full bg-card p-6 rounded-container shadow space-y-3\">\n <h2 className=\"text-lg font-bold\">{title()}</h2>\n <>\n {hasAppliedCode() ? (\n <div className=\"flex items-center justify-between bg-secondary/5 border border-secondary/20 rounded-md px-3 py-2\">\n <div className=\"flex items-center gap-2\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"w-4 h-4 text-secondary\"\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n <span className=\"text-sm font-medium text-secondary\">{appliedCode()}</span>\n </div>\n {showRemoveCode() ? (\n <button\n type=\"button\"\n className=\"text-secondary hover:text-secondary text-sm font-medium transition-colors disabled:opacity-50\"\n onClick={(event) => handleRemove()}\n disabled={loading}\n >\n {getLabel(props.labels, 'remove', 'Remove')}\n </button>\n ) : null}\n </div>\n ) : null}\n {!hasAppliedCode() ? (\n <div className=\"flex gap-2\">\n <input\n type=\"text\"\n className=\"propeller-action-code__input flex-1 text-sm border border-input rounded-control px-3 py-2 focus:ring-2 focus:ring-secondary focus:border-transparent disabled:opacity-50\"\n value={code}\n onChange={(e) => {\n setCode(e.target.value);\n }}\n onKeyDown={(e) => handleKeyDown(e)}\n placeholder={getLabel(props.labels, 'placeholder', 'Enter action code')}\n disabled={loading}\n />\n <button\n type=\"button\"\n className=\"propeller-action-code__submit bg-secondary text-secondary-foreground text-sm font-medium px-4 py-2 rounded-control hover:bg-secondary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap\"\n onClick={(event) => handleApply()}\n disabled={loading || !code.trim()}\n >\n {loading ? <>{getLabel(props.labels, 'applying', 'Applying...')}</> : null}\n {!loading ? <>{getLabel(props.labels, 'apply', 'Apply')}</> : null}\n </button>\n </div>\n ) : null}\n {(!!error || !!fallbackError) ? <p className=\"propeller-action-code__error text-sm text-destructive\">{errorMessage()}</p> : null}\n </>\n </div>\n );\n}\n\nexport default ActionCode;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport {\n GraphQLClient,\n Product,\n Cart,\n Contact,\n Customer,\n MediaImageProductSearchInput,\n TransformationsInput,\n CartMainItem,\n CartBaseItem,\n CartChildItemInput,\n Cluster,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useCart } from '../composables/react/useCart';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getProductImageUrl, getProductSku, getLocalizedValue } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice, formatSurcharge } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface AddToCartProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n\n /** Currency symbol used by the formatPrice helper for the success modal. Resolved from PropellerProvider when omitted; final fallback `'€'`. */\n currency?: string;\n\n /** The product to be added to cart */\n product: Product;\n\n /** Cart ID — required when onAddToCart is not provided */\n cartId?: string;\n\n /** The cluster to be added to cart */\n cluster?: Cluster;\n\n /** IDs of the cluster child items, e.g. cluster options */\n childItems?: number[];\n\n /** Called before adding to cart. Return false to abort (e.g. failed validation). */\n beforeAddToCart?: () => boolean;\n\n /** Notes for the cart item */\n notes?: string;\n\n /** Custom price for the product (overrides calculated price) */\n price?: number;\n\n /** Label overrides for UI strings\n *\n * available labels:\n * - outOfStock\n * - noCartId\n * - errorAdding\n * - addedToCart\n * - modalTitle\n * - quantity\n * - continueShopping\n * - proceedToCheckout\n * - requestQuoteButton\n * - add\n * - adding\n */\n labels?: Record<string, string>;\n\n /**\n * If true a new cart is created if no cart ID is provided.\n * Defaults to false.\n */\n createCart?: boolean;\n\n /**\n * Callback to handle a new cart being created.\n * WARNING: If not provided the component create new carts on every add-to-cart.\n */\n onCartCreated?: (cart: Cart) => void;\n\n /**\n * Callback to handle adding the product to cart.\n * If not provided the component calls CartService.addItemToCart internally.\n */\n onAddToCart?: (\n product: Product,\n clusterId?: number,\n quantity?: number,\n childItems?: CartChildItemInput[],\n notes?: string,\n price?: number,\n showModal?: boolean\n ) => Cart;\n\n /**\n * Callback triggered after adding the product to cart.\n */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n\n /**\n * When true a modal popup is shown after a successful add-to-cart\n * with buttons to continue shopping or proceed to checkout.\n * Defaults to false (only a brief inline success message is shown).\n */\n showModal?: boolean;\n\n /**\n * Renders − and + buttons beside the quantity input.\n * Defaults to true.\n */\n allowIncrDecr?: boolean;\n\n /**\n * Validates available stock via InventoryService before adding.\n * Defaults to false.\n */\n enableStockValidation?: boolean;\n\n /** Language code passed to CartService operations. Defaults to 'en'. */\n language?: string;\n\n /** Additional CSS class for the root element */\n className?: string;\n\n /** Callback fired when the \"Proceed to checkout\" modal button is clicked */\n onProceedToCheckout?: () => void;\n\n /** Callback fired when the \"Request a Quote\" modal button is clicked */\n onRequestQuoteClick?: (cart: Cart) => void;\n\n /** Configuration object passed to the component */\n configuration?: {\n language?: string;\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n urls?: { getProductUrl: (product: Product, language?: string) => string };\n };\n\n /** Active company ID from the company switcher. Overrides user's default company for cart creation and lookup. */\n companyId?: number;\n\n /**\n * When true, tax-inclusive price (net) is shown.\n * When false, tax-exclusive price (gross) is shown.\n * Defaults to false.\n */\n includeTax?: boolean;\n\n // ───── Extension API ─────\n // Render branded price/stock in the success modal. AddToCart itself is\n // the component being injected upstream by other hosts, so it does NOT\n // accept an addToCartComponent prop here.\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n /**\n * Reserved slot. The success modal does not currently render stock —\n * out-of-stock paths surface via a brief toast instead. Declared so\n * consumers can pass it through uniformly; consumed if/when the modal\n * gains a stock block in the future.\n */\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n\n // ── Grouped props (preferred — Phase C3) ───────────────────────────────\n // These reduce the 27-prop surface into three focused groups. When both a\n // grouped field and its flat-prop equivalent are supplied, the flat prop\n // wins (back-compat preserved). Consumers migrating to the new shape can\n // drop the equivalent flat props at their leisure.\n\n /**\n * Display toggles. Equivalent flat props: `allowIncrDecr`, `showModal`,\n * `enableStockValidation`.\n */\n display?: AddToCartDisplay;\n\n /**\n * Event callbacks. Equivalent flat props: `beforeAddToCart`, `onAddToCart`,\n * `afterAddToCart`, `onCartCreated`, `onProceedToCheckout`,\n * `onRequestQuoteClick`.\n */\n events?: AddToCartEvents;\n}\n\n/**\n * Display-toggle group for {@link AddToCartProps.display}.\n * @see AddToCartProps.display\n */\nexport interface AddToCartDisplay {\n /** Renders − and + buttons beside the quantity input. Defaults to `true`. */\n allowIncrDecr?: boolean;\n /** Shows a success modal after add-to-cart instead of a brief toast. Defaults to `false`. */\n showModal?: boolean;\n /** Validates available stock via InventoryService before adding. Defaults to `false`. */\n enableStockValidation?: boolean;\n}\n\n/**\n * Event-callback group for {@link AddToCartProps.events}.\n * @see AddToCartProps.events\n */\nexport interface AddToCartEvents {\n /** Called before adding to cart. Return `false` to abort (e.g. failed validation). */\n beforeAddToCart?: () => boolean;\n /** Override for the add-to-cart action; bypasses the internal CartService call. */\n onAddToCart?: AddToCartProps['onAddToCart'];\n /** Fires after the product is added to cart, with the updated cart and added item. */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n /** Fires when a new cart is created internally. */\n onCartCreated?: (cart: Cart) => void;\n /** Fires when the \"Proceed to checkout\" modal button is clicked. */\n onProceedToCheckout?: () => void;\n /** Fires when the \"Request a Quote\" modal button is clicked. */\n onRequestQuoteClick?: (cart: Cart) => void;\n}\n\nexport interface CartQueryVariables {\n /** Cart ID to fetch */ cartId: string;\n /** Language for localized content */ language: string;\n /** Image search filters */ imageSearchFilters: MediaImageProductSearchInput;\n /** Image transformation filters */ imageVariantFilters: TransformationsInput;\n}\n\n/**\n * Merge grouped Phase-C3 props (`display`, `events`) into a flat props\n * object. Flat props win over grouped equivalents when both are supplied —\n * preserves back-compat for the 30+ existing call sites that pass the\n * monolithic shape. Returns a new object so the original `rawProps` is not\n * mutated; downstream code reads `props.x` as before, transparently\n * picking up grouped values when only those are supplied.\n */\nfunction mergeGrouped(p: AddToCartProps): AddToCartProps {\n const d = p.display;\n const e = p.events;\n if (!d && !e) return p;\n return {\n ...p,\n allowIncrDecr: p.allowIncrDecr ?? d?.allowIncrDecr,\n showModal: p.showModal ?? d?.showModal,\n enableStockValidation: p.enableStockValidation ?? d?.enableStockValidation,\n beforeAddToCart: p.beforeAddToCart ?? e?.beforeAddToCart,\n onAddToCart: p.onAddToCart ?? e?.onAddToCart,\n afterAddToCart: p.afterAddToCart ?? e?.afterAddToCart,\n onCartCreated: p.onCartCreated ?? e?.onCartCreated,\n onProceedToCheckout: p.onProceedToCheckout ?? e?.onProceedToCheckout,\n onRequestQuoteClick: p.onRequestQuoteClick ?? e?.onRequestQuoteClick,\n };\n}\n\n/**\n * Add-to-cart control: a quantity stepper plus an \"Add\" button that adds a\n * product (optionally with cluster child items) to the cart, with optional\n * stock validation and a success toast or modal.\n *\n * @remarks Uses {@link useCart} for cart creation and add-item operations.\n */\nfunction AddToCart(rawProps: AddToCartProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n // Then merge the Phase-C3 grouped props (display / events) on top so the\n // rest of the component reads `props.allowIncrDecr` etc. uniformly\n // regardless of whether the consumer passed the flat or grouped shape.\n const props = mergeGrouped(useInfraProps(rawProps));\n\n // --- composable ---\n const { cart, loading, checkoutAllowed, addItem, getMinQuantity, getStep } = useCart({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n companyId: props.companyId,\n configuration: props.configuration,\n onCartCreated: props.onCartCreated,\n });\n\n // --- local UI state ---\n // Lazy-initialize from the product's min quantity (was previously seeded\n // to 1 then overwritten in useEffect — the set-state-in-effect anti-pattern\n // caused an extra render on every mount).\n const [quantity, setQuantity] = useState<number>(() => getMinQuantity(props.product));\n const [toastMessage, setToastMessage] = useState<string>(() => '');\n const [toastType, setToastType] = useState<string>(() => '');\n const [toastVisible, setToastVisible] = useState<boolean>(() => false);\n const [modalVisible, setModalVisible] = useState<boolean>(() => false);\n const [addedCartItem, setAddedCartItem] = useState<CartMainItem | null>(() => null);\n const [activeFullCart, setActiveFullCart] = useState<Cart | null>(() => null);\n const [includeTax] = useState<boolean>(() => false);\n\n // --- display helpers ---\n \n function getProductUrl(): string {\n return props.configuration?.urls?.getProductUrl(props.product, props.language) ?? '#';\n }\n function showToast(message: string, type: string): void {\n setToastMessage(message);\n setToastType(type);\n setToastVisible(true);\n setTimeout(() => {\n setToastVisible(false);\n }, 3000);\n }\n function dismissToast(): void {\n setToastVisible(false);\n }\n function increment(): void {\n setQuantity(quantity + getStep(props.product));\n }\n function decrement(): void {\n const min = getMinQuantity(props.product);\n const step = getStep(props.product);\n if (quantity - step >= min) {\n setQuantity(quantity - step);\n }\n }\n function getModalImageUrl(): string {\n if (addedCartItem) {\n const img = addedCartItem.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url;\n if (img) return img;\n }\n return getProductImageUrl(props.product as Product);\n }\n function getModalName(): string {\n if (addedCartItem) {\n return addedCartItem.product?.names?.[0]?.value || getLocalizedValue((props.product as Product)?.names, props.language as string, 'Product');\n }\n return getLocalizedValue((props.product as Product)?.names, props.language as string, 'Product');\n }\n function getModalPrice(): string {\n if (addedCartItem) {\n const useTax: boolean = props.includeTax !== undefined ? !!props.includeTax : includeTax;\n const price = useTax ? addedCartItem.totalSumNet : addedCartItem.totalSum;\n return formatPrice(price, { symbol: props.currency ?? '€' });\n }\n return formatPrice(props.price !== undefined ? props.price : (props.product as Product)?.price?.gross, { symbol: props.currency ?? '€' });\n }\n function getModalSku(): string {\n if (addedCartItem) return addedCartItem.product?.sku || '';\n return getProductSku(props.product as Product);\n }\n function getModalSurcharges(): string[] {\n // Prefer the cart item's own surcharges (CartItemSurcharge: localized\n // `names`, may carry their own quantity); fall back to the product's\n // surcharges (Surcharge: `name`) for the pre-add state. Quantity is the\n // line quantity.\n type SurchargeLike = {\n name?: { value?: string; language?: string }[];\n names?: { value?: string; language?: string }[];\n type?: string;\n value?: number;\n quantity?: number;\n enabled?: boolean;\n };\n const cartSurcharges = (addedCartItem?.surcharges ?? []) as SurchargeLike[];\n const source: SurchargeLike[] = cartSurcharges.length > 0\n ? cartSurcharges\n : (((props.product as Product)?.surcharges ?? []) as SurchargeLike[]);\n return source\n .filter((s: SurchargeLike) => s.enabled !== false)\n .map((s: SurchargeLike) =>\n formatSurcharge(s, {\n quantity: s.quantity ?? quantity,\n language: props.language,\n currency: props.currency ?? '€',\n })\n )\n .filter((line: string) => line.length > 0);\n }\n function getChildItems(): CartBaseItem[] {\n const children = addedCartItem?.childItems;\n if (!children || !Array.isArray(children)) return [];\n return children;\n }\n /**\n * Resolve the cart line to show in the success modal for THIS add-to-cart.\n *\n * `useCart.addItem` returns the first cart item whose `productId` matches the\n * added product. That's wrong when the cart also holds a bundle whose leader\n * is the same product (same SKU/productId): the bundle's main item matches\n * first, so the modal would render the bundle's members as this product's\n * child items. Re-resolve to the standalone (non-bundle) line for the product\n * — preferring the most recent match — and ignore bundle items. Falls back to\n * `addItem`'s item when no standalone line is found.\n */\n function resolveAddedItem(resultCart: Cart | undefined, fallback: CartMainItem | null): CartMainItem | null {\n const items = resultCart?.items;\n if (!items || !Array.isArray(items)) return fallback;\n const productId = (props.product as Product)?.productId;\n const standalone = items.filter(\n (i: CartMainItem) => i.productId === productId && !i.bundle && !i.bundleId,\n );\n return standalone.length > 0 ? standalone[standalone.length - 1] : fallback;\n }\n function closeModal(): void {\n setModalVisible(false);\n setAddedCartItem(null);\n }\n\n // --- main action ---\n async function handleAddToCart(): Promise<void> {\n if (!props.graphqlClient) return;\n if (props.beforeAddToCart && !props.beforeAddToCart()) return;\n\n const result = await addItem({\n product: props.product,\n cluster: props.cluster,\n childItems: props.childItems,\n quantity,\n notes: props.notes,\n price: props.price,\n onAddToCart: props.onAddToCart\n ? (product, clusterId, qty, childItemInputs, notes, price) =>\n props.onAddToCart!(product, clusterId, qty, childItemInputs, notes, price, props.showModal)\n : undefined,\n afterAddToCart: (resultCart, addedItem) => {\n setActiveFullCart(resultCart);\n setAddedCartItem(resolveAddedItem(resultCart, addedItem || null));\n props.afterAddToCart?.(resultCart, addedItem || undefined);\n },\n enableStockValidation: props.enableStockValidation,\n cartId: props.cartId,\n createCart: props.createCart,\n });\n\n if (!result.ok) {\n showToast(\n result.error === 'Insufficient stock available'\n ? getLabel(props.labels, 'outOfStock', 'Insufficient stock available')\n : result.error === 'No cart ID provided'\n ? getLabel(props.labels, 'noCartId', 'No cart ID provided')\n : getLabel(props.labels, 'errorAdding', 'Failed to add item to cart'),\n 'error'\n );\n return;\n }\n\n setActiveFullCart(result.data.cart);\n setAddedCartItem(resolveAddedItem(result.data.cart, result.data.item || null));\n\n if (props.showModal) {\n setModalVisible(true);\n } else {\n showToast(`${getLocalizedValue((props.product as Product)?.names, props.language as string, 'Product')} ${getLabel(props.labels, 'addedToCart', 'added to cart')}`, 'success');\n }\n }\n\n return (\n <div\n className={`propeller-add-to-cart ${props.className || ''}`}\n data-loading={loading ? 'true' : 'false'}\n >\n <div className=\"propeller-add-to-cart__controls flex items-center gap-2 w-full\">\n {props.allowIncrDecr !== false ? (\n <div className=\"propeller-add-to-cart__stepper flex items-center border border-input rounded-control bg-card h-10\">\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__decrement px-3 h-full text-muted-foreground hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors rounded-l-control select-none\"\n onClick={() => decrement()}\n disabled={quantity <= getMinQuantity(props.product) || loading}\n >\n {' '}\n -{' '}\n </button>\n <input\n type=\"number\"\n className=\"propeller-add-to-cart__quantity w-12 text-center text-sm bg-transparent border-none focus:ring-0 focus:outline-none h-full [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\"\n min={getMinQuantity(props.product)}\n step={getStep(props.product)}\n value={quantity}\n onChange={(e) => {\n const val = parseInt(e.target.value, 10);\n const min = getMinQuantity(props.product);\n const step = getStep(props.product);\n if (!isNaN(val) && val >= min) {\n setQuantity(Math.round((val - min) / step) * step + min);\n }\n }}\n />\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__increment px-3 h-full text-muted-foreground hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors rounded-r-control select-none\"\n onClick={() => increment()}\n disabled={loading}\n >\n {' '}\n +{' '}\n </button>\n </div>\n ) : null}\n {props.allowIncrDecr === false ? (\n <input\n type=\"number\"\n className=\"propeller-add-to-cart__quantity w-16 h-10 text-center text-sm border border-input rounded-control focus:ring-2 focus:ring-secondary focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\"\n min={getMinQuantity(props.product)}\n step={getStep(props.product)}\n value={quantity}\n onChange={(e) => {\n const val = parseInt(e.target.value, 10);\n const min = getMinQuantity(props.product);\n const step = getStep(props.product);\n if (!isNaN(val) && val >= min) {\n setQuantity(Math.round((val - min) / step) * step + min);\n }\n }}\n />\n ) : null}\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__submit flex-1 inline-flex justify-center items-center h-10 px-6 border border-transparent text-sm font-medium rounded-control text-secondary-foreground bg-secondary hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n onClick={() => handleAddToCart()}\n disabled={loading}\n >\n {loading ? <>{getLabel(props.labels, 'adding', 'Adding...')}</> : null}\n {!loading ? <>{getLabel(props.labels, 'add', 'Add')}</> : null}\n </button>\n </div>\n {toastVisible ? (\n <div\n className={`propeller-add-to-cart__toast fixed top-4 right-4 z-50 flex items-start gap-3 w-80 rounded-container shadow-lg p-4 ${toastType === 'success' ? 'bg-success border border-success text-success-foreground' : 'bg-destructive border border-destructive text-destructive-foreground'}`}\n data-toast-type={toastType}\n >\n <div\n className={`propeller-add-to-cart__toast-icon flex-shrink-0 w-5 h-5 mt-0.5 ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastType === 'success' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n ) : null}\n {toastType === 'error' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\"\n />\n </svg>\n ) : null}\n </div>\n <p\n className={`propeller-add-to-cart__toast-message flex-1 text-sm font-medium ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastMessage}\n </p>\n <button\n type=\"button\"\n onClick={() => dismissToast()}\n className={`propeller-add-to-cart__toast-close flex-shrink-0 rounded focus:outline-none ${toastType === 'success' ? 'text-success-foreground hover:text-success-foreground/80' : 'text-destructive-foreground hover:text-destructive-foreground/80'}`}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-4 w-4\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n ) : null}\n {modalVisible ? (\n <div className=\"propeller-add-to-cart__modal fixed inset-0 z-50 flex items-center justify-center px-4\">\n <div\n className=\"propeller-add-to-cart__modal-backdrop fixed inset-0 bg-foreground/20\"\n onClick={() => closeModal()}\n />\n <div className=\"propeller-add-to-cart__modal-content relative w-full max-w-lg bg-card rounded-container shadow-2xl overflow-hidden\">\n <div className=\"propeller-add-to-cart__modal-header flex items-center gap-3 px-6 py-4 border-b border-border-subtle\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"propeller-add-to-cart__modal-success-icon h-5 w-5 flex-shrink-0 text-success\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n <h3 className=\"propeller-add-to-cart__modal-title flex-1 text-base font-semibold text-foreground\">\n {getLabel(props.labels, 'modalTitle', 'Added to cart')}\n </h3>\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__modal-close flex-shrink-0 text-foreground-subtle hover:text-foreground focus:outline-none\"\n onClick={() => closeModal()}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-5 w-5\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n <div className=\"propeller-add-to-cart__modal-body px-6 py-5\">\n <div className=\"propeller-add-to-cart__modal-product flex items-start gap-4\">\n {!!getModalImageUrl() ? (\n <img\n className=\"propeller-add-to-cart__modal-image w-16 h-16 object-contain rounded border border-border-subtle flex-shrink-0\"\n src={getModalImageUrl()}\n alt={getModalName()}\n />\n ) : null}\n {!getModalImageUrl() ? (\n <div className=\"propeller-add-to-cart__modal-image-placeholder w-16 h-16 flex items-center justify-center rounded border border-border-subtle flex-shrink-0 bg-surface-hover\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"w-8 h-8 text-foreground-subtle\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z\"\n />\n </svg>\n </div>\n ) : null}\n <div className=\"flex-1 min-w-0\">\n <a\n className=\"propeller-add-to-cart__modal-product-title text-sm font-medium text-secondary leading-tight hover:underline line-clamp-2\"\n href={getProductUrl()}\n >\n {getModalName()}\n </a>\n {!!getModalSku() ? (\n <p className=\"propeller-add-to-cart__modal-sku text-xs text-foreground-subtle mt-0.5\">SKU: {getModalSku()}</p>\n ) : null}\n {getModalSurcharges().length > 0 ? (\n <div className=\"propeller-add-to-cart__modal-surcharges mt-1 text-xs text-muted-foreground\">\n <span className=\"font-medium\">{getLabel(props.labels, 'surcharges', 'Additional surcharges:')}</span>\n <ul className=\"propeller-add-to-cart__modal-surcharges-list mt-0.5\">\n {getModalSurcharges().map((line, idx) => (\n <li key={idx} className=\"propeller-add-to-cart__modal-surcharge\">{line}</li>\n ))}\n </ul>\n </div>\n ) : null}\n </div>\n <div className=\"flex-shrink-0 text-right\">\n <p className=\"propeller-add-to-cart__modal-quantity text-xs text-muted-foreground\">\n {getLabel(props.labels, 'quantity', 'Quantity')}: {quantity}\n </p>\n {/*\n * Extension API — modal price slot.\n * Direct prop access (no useResolvedProps/RESOLVE_SPEC\n * cascade) because AddToCart does not otherwise wire the\n * resolver; adding the full resolver indirection for two\n * slots would be extra work outside the task. Without\n * `priceComponent`, the rendering is byte-identical to the\n * pre-change inline `getModalPrice()` text.\n */}\n {(() => {\n const PriceImpl = props.priceComponent;\n if (PriceImpl) {\n return (\n <PriceImpl\n price={addedCartItem?.product?.price ?? props.product.price}\n includeTax={props.includeTax}\n currency={props.currency}\n labels={props.labels}\n />\n );\n }\n return !!getModalPrice() ? (\n <p className=\"propeller-add-to-cart__modal-price text-sm font-semibold text-foreground mt-0.5\">{getModalPrice()}</p>\n ) : null;\n })()}\n </div>\n </div>\n {getChildItems().length > 0 ? (\n <div className=\"propeller-add-to-cart__modal-children mt-3 ml-20 space-y-1 border-l-2 border-border-subtle pl-2\">\n {getChildItems()?.map((child, idx) => (\n <div\n className=\"propeller-add-to-cart__modal-child flex justify-between items-center text-xs text-muted-foreground\"\n key={idx}\n >\n <span className=\"line-clamp-1\">\n {child.product?.names?.[0]?.value || 'Option'}\n </span>\n <span className=\"text-foreground-subtle whitespace-nowrap ml-2\">\n {formatPrice(\n ((props.includeTax !== undefined ? !!props.includeTax : includeTax)\n ? child.totalSumNet\n : child.totalSum) ?? 0,\n { symbol: props.currency ?? '\\u20AC' }\n )}\n </span>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n <div className=\"propeller-add-to-cart__modal-actions flex gap-3 px-6 py-4 border-t border-border-subtle\">\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__modal-continue flex-1 inline-flex justify-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-secondary focus:ring-offset-2\"\n onClick={() => closeModal()}\n >\n {getLabel(props.labels, 'continueShopping', 'Continue shopping')}\n </button>\n {checkoutAllowed && props.onRequestQuoteClick && props.user && 'contactId' in props.user ? (\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__modal-quote flex-1 inline-flex justify-center rounded-control border border-secondary bg-card px-4 py-2 text-sm font-medium text-secondary hover:bg-secondary/5 focus:outline-none focus:ring-2 focus:ring-secondary focus:ring-offset-2\"\n onClick={() => {\n closeModal();\n if (cart) props.onRequestQuoteClick!(cart);\n }}\n >\n {getLabel(props.labels, 'requestQuoteButton', 'Request a Quote')}\n </button>\n ) : null}\n {checkoutAllowed ? (\n <button\n type=\"button\"\n className=\"propeller-add-to-cart__modal-checkout flex-1 inline-flex justify-center rounded-control border border-transparent bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-secondary focus:ring-offset-2\"\n onClick={() => {\n closeModal();\n if (props.onProceedToCheckout) props.onProceedToCheckout();\n }}\n >\n {getLabel(props.labels, 'proceedToCheckout', 'Proceed to checkout')}\n </button>\n ) : null}\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n// Memoized: rendered inside the memoized ProductCard; ProductCard now passes\n// stable (context-resolved) props so shallow-equal props skip re-render and\n// avoid a redundant useCart pass (rbp §5.2).\nexport default React.memo(AddToCart);\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\n\nimport { useState, useEffect } from 'react';\nimport type {\n FavoriteList,\n GraphQLClient,\n Contact,\n Customer,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useFavorites } from '../composables/react/useFavorites';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface AddToFavoriteProps {\n /** The initialized GraphQL Client instance. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The authenticated user. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n\n /** Product ID to add/remove from favorites (for products) */\n productId?: number;\n\n /** Cluster ID to add/remove from favorites (for clusters) */\n clusterId?: number;\n\n /** Extra CSS class applied to the root button */\n className?: string;\n\n /** UI string overrides */\n labels?: Record<string, string>;\n\n /** Called after a favorite list mutation (add/remove) succeeds */\n onFavoriteChanged?: () => void;\n}\n\n/**\n * Favorite toggle button for a product or cluster: opens a modal to add the\n * item to one of the user's favorite lists or remove it from lists it belongs\n * to. Renders nothing when no user is present.\n *\n * @remarks Uses {@link useFavorites} for favorite-list operations.\n */\nfunction AddToFavorite(rawProps: AddToFavoriteProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const { lists, addToList, removeFromList } = useFavorites({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n });\n\n const [isOpen, setIsOpen] = useState(() => false);\n const [loading, setLoading] = useState(() => false);\n const [_isMounted, set_isMounted] = useState(() => false);\n const [selectedListId, setSelectedListId] = useState(() => '');\n const [memberListIds, setMemberListIds] = useState<Set<string>>(() => new Set<string>());\n\n\n function isProduct(): boolean {\n return !!props.productId;\n }\n\n function itemId(): number {\n return (props.productId || props.clusterId || 0) as number;\n }\n\n function isFavorited(): boolean {\n return memberListIds.size > 0;\n }\n\n function getMemberLists(): FavoriteList[] {\n return lists.filter((list: FavoriteList) => memberListIds.has(String(list.id)));\n }\n\n function getNonMemberLists(): FavoriteList[] {\n return lists.filter((list: FavoriteList) => !memberListIds.has(String(list.id)));\n }\n\n function toggleModal() {\n if (!props.user) return;\n if (!isOpen) {\n const nonMember = getNonMemberLists();\n if (nonMember.length > 0 && !selectedListId) {\n setSelectedListId(String(nonMember[0].id));\n }\n }\n setIsOpen(!isOpen);\n }\n\n function closeModal() {\n setIsOpen(false);\n }\n\n async function handleAddToList() {\n if (!selectedListId || loading) return;\n setLoading(true);\n try {\n await addToList(selectedListId, props.productId, props.clusterId);\n const newMemberIds = new Set(memberListIds);\n newMemberIds.add(String(selectedListId));\n setMemberListIds(newMemberIds);\n setSelectedListId('');\n setIsOpen(false);\n if (props.onFavoriteChanged) props.onFavoriteChanged();\n } catch (error) {\n console.error('Error adding to favorite list:', error);\n } finally {\n setLoading(false);\n }\n }\n\n async function handleRemoveFromList(listId: string) {\n if (loading) return;\n setLoading(true);\n try {\n await removeFromList(listId, props.productId, props.clusterId);\n const newMemberIds = new Set(memberListIds);\n newMemberIds.delete(String(listId));\n setMemberListIds(newMemberIds);\n setSelectedListId('');\n setIsOpen(false);\n if (props.onFavoriteChanged) props.onFavoriteChanged();\n } catch (error) {\n console.error('Error removing from favorite list:', error);\n } finally {\n setLoading(false);\n }\n }\n\n function computeMemberListIds(): Set<string> {\n if (!props.user || !itemId()) return new Set<string>();\n const memberIds = new Set<string>();\n lists.forEach((list: FavoriteList) => {\n const productsRef = list?.products as\n | { items?: { productId?: number; clusterId?: number }[] }\n | undefined;\n const clustersRef = list?.clusters as\n | { items?: { clusterId?: number }[] }\n | undefined;\n if (isProduct()) {\n if (productsRef?.items?.some((item) => item.productId === itemId())) {\n memberIds.add(String(list.id));\n }\n } else {\n const inProducts = productsRef?.items?.some((item) => item.clusterId === itemId());\n const inClusters = clustersRef?.items?.some((item) => item.clusterId === itemId());\n if (inProducts || inClusters) {\n memberIds.add(String(list.id));\n }\n }\n });\n return memberIds;\n }\n\n useEffect(() => {\n set_isMounted(true);\n }, []);\n\n useEffect(() => {\n setMemberListIds(computeMemberListIds());\n }, [props.user, props.productId, props.clusterId, lists]);\n\n // Note: the previous build listened for a global `userLoggedIn` window\n // event and re-read the user from localStorage to refresh membership.\n // That cross-tab listener has been removed (Phase D.3 / D.4): the parent\n // AuthContext propagates user changes via the `user` prop, so the effect\n // above already re-runs and updates membership. A separately-tab login is\n // an edge case the SDK doesn't currently support cleanly anyway.\n\n return (\n <>\n {props.user ? (\n <>\n <div className=\"propeller-add-to-favorite relative inline-block\" data-favorited={isFavorited() ? 'true' : 'false'}>\n <button\n type=\"button\"\n onClick={(event) => toggleModal()}\n title={\n isFavorited()\n ? getLabel(props.labels, 'removeFromFavorites', 'Remove from favorites')\n : getLabel(props.labels, 'addToFavorites', 'Add to favorites')\n }\n className={`propeller-add-to-favorite__btn inline-flex items-center justify-center rounded-control border p-2.5 transition-colors ${isFavorited() ? 'border-primary/30 bg-primary/5 text-primary hover:bg-primary/10' : 'border-border bg-card text-foreground-subtle hover:text-primary hover:border-primary/30 hover:bg-primary/5'} ${props.className || ''}`}\n >\n {isFavorited() ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3.332.67-4.5 2.17C10.832 3.67 9.26 3 7.5 3A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\" />\n </svg>\n ) : null}\n {!isFavorited() ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3.332.67-4.5 2.17C10.832 3.67 9.26 3 7.5 3A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\" />\n </svg>\n ) : null}\n </button>\n {isOpen && _isMounted ? (\n <div className=\"propeller-add-to-favorite__modal fixed inset-0 bg-foreground/50 backdrop-blur-sm flex items-center justify-center z-50 p-4\">\n <div className=\"propeller-add-to-favorite__modal-content bg-card rounded-container max-w-md w-full shadow-lg border border-border\">\n <div className=\"propeller-add-to-favorite__modal-header flex justify-between items-center p-6 pb-4\">\n <h3 className=\"propeller-add-to-favorite__modal-title text-xl font-bold\">\n {getLabel(props.labels, 'modalTitle', 'Favorite product?')}\n </h3>\n <button\n type=\"button\"\n className=\"propeller-add-to-favorite__modal-close h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-muted-foreground hover:text-foreground hover:bg-surface-hover\"\n onClick={(event) => closeModal()}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n </div>\n <div className=\"propeller-add-to-favorite__modal-body px-6 pb-6 space-y-4\">\n {getMemberLists().length > 0 ? (\n <>\n <div className=\"propeller-add-to-favorite__member-lists space-y-2\">\n {getMemberLists()?.map((list) => (\n <button\n type=\"button\"\n className=\"propeller-add-to-favorite__member-list-item flex items-center gap-2 py-2 w-full text-left hover:bg-surface-hover rounded-control px-1 transition-colors disabled:opacity-50\"\n key={list.id}\n onClick={(event) => handleRemoveFromList(String(list.id))}\n disabled={loading}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"text-primary flex-shrink-0\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n <span className=\"text-sm font-medium\">{list.name}</span>\n </button>\n ))}\n <button\n type=\"button\"\n className=\"propeller-add-to-favorite__submit-btn w-full py-2.5 px-4 text-sm font-medium text-primary-foreground bg-primary hover:bg-primary/80 rounded-control transition-colors disabled:opacity-50\"\n onClick={(event) => {\n const memberLists = getMemberLists();\n if (memberLists.length > 0) {\n handleRemoveFromList(String(memberLists[0].id));\n }\n }}\n disabled={loading}\n >\n {loading ? (\n <>{getLabel(props.labels, 'removing', 'Removing...')}</>\n ) : (\n <>{getLabel(props.labels, 'removeFromFavorites', 'Remove from favorites')}</>\n )}\n </button>\n </div>\n <div className=\"propeller-add-to-favorite__divider border-t border-border\" />\n </>\n ) : null}\n {getNonMemberLists().length > 0 ? (\n <div className=\"propeller-add-to-favorite__add-form space-y-3\">\n <div className=\"space-y-1\">\n <label className=\"propeller-add-to-favorite__select-label text-xs text-muted-foreground\">\n {getLabel(props.labels, 'chooseList', 'Choose a favorites list*')}\n </label>\n <select\n className=\"propeller-add-to-favorite__select block w-full rounded-control border border-input px-3 py-2.5 text-sm focus:border-primary focus:ring-primary\"\n value={selectedListId}\n onChange={(e) => {\n setSelectedListId(e.target.value);\n }}\n >\n {getNonMemberLists()?.map((list) => (\n <option key={list.id} value={String(list.id)}>\n {list.name}\n </option>\n ))}\n </select>\n </div>\n <button\n type=\"button\"\n className=\"propeller-add-to-favorite__submit-btn w-full py-2.5 px-4 text-sm font-medium text-primary-foreground bg-primary hover:bg-primary/80 rounded-control transition-colors disabled:opacity-50\"\n onClick={(event) => handleAddToList()}\n disabled={!selectedListId || loading}\n >\n {loading ? (\n <>{getLabel(props.labels, 'adding', 'Adding...')}</>\n ) : (\n <>{getLabel(props.labels, 'addToFavorites', 'Add to favorites')}</>\n )}\n </button>\n </div>\n ) : null}\n {getMemberLists().length === 0 && getNonMemberLists().length === 0 ? (\n <div className=\"propeller-add-to-favorite__empty py-4 text-center text-muted-foreground text-sm\">\n {getLabel(props.labels, 'noLists', 'You have no favorite lists. Create one in your account first.')}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n ) : null}\n </div>\n </>\n ) : null}\n </>\n );\n}\n\nexport default AddToFavorite;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Address, CartAddress, Contact, Customer, Gender, GraphQLClient, OrderAddress, WarehouseAddress, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { useAddress } from '../composables/react/useAddress';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getCountryName as _getCountryName } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface AddressCardProps {\n /** GraphQL client for the Propeller SDK (only needed when editing) */\n graphqlClient?: GraphQLClient;\n\n /** The address to display (Address | CartAddress | WarehouseAddress | OrderAddress) */\n address: Address | CartAddress | WarehouseAddress | OrderAddress | null;\n\n /** Display company name @default true */\n showCompanyName?: boolean;\n\n /** Display salutation (Mr./Mrs.) @default true */\n showSalutation?: boolean;\n\n /** Display full name @default true */\n showFullName?: boolean;\n\n /** Display street @default true */\n showStreet?: boolean;\n\n /** Display house number and extension @default true */\n showNumberExtension?: boolean;\n\n /** Display postal code @default true */\n showPostalCode?: boolean;\n\n /** Display city @default true */\n showCity?: boolean;\n\n /** Display country name @default true */\n showCountry?: boolean;\n\n /** Display email @default false */\n showEmail?: boolean;\n\n /** Display phone @default false */\n showPhone?: boolean;\n\n /** Display action buttons (edit, delete, set default) @default true */\n enableActions?: boolean;\n\n /** Display Edit button @default true */\n enableEdit?: boolean;\n\n /** Display Delete button @default true */\n enableDelete?: boolean;\n\n /** Display Set Default button @default true */\n enableSetDefault?: boolean;\n\n /** Display the \"Default ... Address\" badge @default false */\n showDefaultBadge?: boolean;\n\n /** Called when address is edited; receives the updated address object */\n onEdit?: (address: Address) => void | Promise<void>;\n\n /** Called after address edit completes */\n afterEdit?: (address: Address) => void | Promise<void>;\n\n /** Called when address is deleted; receives the address ID */\n onDelete?: (addressId: Address) => void;\n\n /** Called after address deletion completes */\n afterDelete?: (addressId: Address) => void;\n\n /** Called when address is set as default */\n onSetDefault?: (address: Address) => void;\n\n /** Called after address is set as default */\n afterSetDefault?: (address: Address) => void;\n\n /** List of countries for the country dropdown [{code: 'NL', name: 'Netherlands'}, ...] */\n countries?: {\n code: string;\n name: string;\n }[];\n\n /** When true, renders in \"new address\" mode: auto-opens the edit form, hides the card body */\n isNew?: boolean;\n\n /** Called when the form is cancelled in new mode */\n onCancel?: () => void;\n\n /** When true, renders the form inline instead of in a modal overlay. @default false */\n inline?: boolean;\n\n /** Address type for new addresses (e.g., 'DELIVERY', 'INVOICE'). Used when creating, not editing. */\n addressType?: string;\n\n /** Show ICP/ICS (intra-community supply) checkbox. @default false */\n showIcp?: boolean;\n\n /** Title for the form or section */\n title?: string;\n\n /** Labels for form fields and buttons */\n labels?: Record<string, string>;\n\n /** Called before save starts */\n beforeSave?: () => void;\n\n /** The authenticated user (needed by useAddress for SDK operations) */\n user?: Contact | Customer | null;\n\n /** Compound mode opt-in for the read-only card region. When provided,\n * the read-only card renders the compound subtree (using <AddressCard.X>\n * subcomponents) instead of the default layout. Edit forms / modals\n * stay monolithic regardless. */\n children?: React.ReactNode;\n}\n\ninterface AddressCardContextValue {\n address: NonNullable<AddressCardProps['address']>;\n resolved: AddressCardProps;\n derived: {\n fullName: string;\n streetLine: string;\n cityLine: string;\n countryName: string;\n isDefault: boolean;\n addressType: string;\n addressTypeLabel: string;\n company: string;\n email: string;\n phone: string;\n };\n actions: {\n onEdit: () => void;\n onDelete: () => void;\n onSetDefault: () => void;\n isSaving: boolean;\n };\n}\n\nconst AddressCardContext = React.createContext<AddressCardContextValue | null>(null);\n\nfunction useAddressCardContext(): AddressCardContextValue {\n const ctx = React.useContext(AddressCardContext);\n if (!ctx) {\n throw new Error(\n 'AddressCard compound subcomponents must be rendered inside <AddressCard>.',\n );\n }\n return ctx;\n}\n\n/**\n * Displays a single address with configurable fields and edit/delete/set-default\n * actions. Also renders the address edit form (inline or in a modal) and a\n * \"new address\" mode.\n *\n * @remarks Uses {@link useAddress} for SDK-backed update/delete/set-default\n * operations; in callback-only mode (`onEdit`/`onDelete`) the hook is unused.\n */\nfunction AddressCard(rawProps: AddressCardProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // Hook MUST be called unconditionally (Rules of Hooks). It tolerates null\n // graphqlClient/user — its CRUD methods short-circuit with an error result\n // until both are present. The component also supports callback-only mode\n // (onEdit/onDelete props), in which case `addressHook` is never invoked.\n const addressHook = useAddress({\n graphqlClient: props.graphqlClient,\n user: props.user,\n });\n // Whether the hook is \"live\" for SDK calls. Used downstream to gate\n // addressHook usage in handlers (so we don't fire a no-op SDK call).\n const hookReady = !!props.graphqlClient && !!props.user;\n\n const [showEditModal, setShowEditModal] = useState(() => false);\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(() => false);\n const [saving, setSaving] = useState(() => false);\n const [localAddress, setLocalAddress] = useState<any>(() => null);\n const [editCompany, setEditCompany] = useState(() => '');\n const [editGender, setEditGender] = useState<Gender>(() => Gender.U);\n const [editFirstName, setEditFirstName] = useState(() => '');\n const [editMiddleName, setEditMiddleName] = useState(() => '');\n const [editLastName, setEditLastName] = useState(() => '');\n const [editStreet, setEditStreet] = useState(() => '');\n const [editNumber, setEditNumber] = useState(() => '');\n const [editNumberExtension, setEditNumberExtension] = useState(() => '');\n const [editPostalCode, setEditPostalCode] = useState(() => '');\n const [editCity, setEditCity] = useState(() => '');\n const [editCountry, setEditCountry] = useState(() => '');\n const [editEmail, setEditEmail] = useState(() => '');\n const [editPhone, setEditPhone] = useState(() => '');\n const [editNotes, setEditNotes] = useState(() => '');\n const [editIcp, setEditIcp] = useState<YesNo>(() => YesNo.N);\n\n const isSaving = hookReady ? addressHook.loading : saving;\n\n \n\n function getCountryName(code: string): string {\n return _getCountryName(code, props.countries);\n }\n\n // The address shape is a union of Address|CartAddress|WarehouseAddress|\n // OrderAddress|null|local edited form, and the JSX reads dozens of fields\n // via `addr?.()?.x ? push(addr().x) : null` where the narrowing doesn't\n // carry to the second call. Typing this strictly would force ~40 line\n // edits to use a single local const per call instead of double-invocation.\n // Out of scope here — flagged for the AddressCard compound-primitive\n // rework in Phase C.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function addr(): any {\n return localAddress || props.address;\n }\n\n function showCard(): boolean {\n if (props.isNew) return false;\n if (props.inline && !props.address) return false;\n return true;\n }\n\n function salutation(): string {\n const g = addr?.()?.gender;\n if (g === 'M') return 'Mr.';\n if (g === 'F') return 'Mrs.';\n return '';\n }\n\n function fullName(): string {\n const parts: string[] = [];\n if (props.showSalutation !== false && salutation()) {\n parts.push(salutation());\n }\n if (addr?.()?.firstName) parts.push(addr().firstName);\n if (addr?.()?.middleName) parts.push(addr().middleName);\n if (addr?.()?.lastName) parts.push(addr().lastName);\n return parts.join(' ');\n }\n\n function streetLine(): string {\n const parts: string[] = [];\n if (addr?.()?.street) parts.push(addr().street);\n if (props.showNumberExtension !== false) {\n if (addr?.()?.number) parts.push(addr().number);\n if (addr?.()?.numberExtension) parts.push(addr().numberExtension);\n }\n return parts.join(' ');\n }\n\n function cityLine(): string {\n const parts: string[] = [];\n if (props.showPostalCode !== false && addr?.()?.postalCode) {\n parts.push(addr().postalCode);\n }\n if (props.showCity !== false && addr?.()?.city) {\n parts.push(addr().city);\n }\n return parts.join(' ');\n }\n\n function formTitle(): string {\n if (props.title) return props.title;\n if (props.isNew) return getLabel(props.labels, 'newTitle', 'New Address');\n return getLabel(props.labels, 'editTitle', 'Edit Address');\n }\n\n function openEditModal() {\n const a = addr();\n setEditCompany(a?.company || '');\n setEditGender(a?.gender || 'M');\n setEditFirstName(a?.firstName || '');\n setEditMiddleName(a?.middleName || '');\n setEditLastName(a?.lastName || '');\n setEditStreet(a?.street || '');\n setEditNumber(a?.number || '');\n setEditNumberExtension(a?.numberExtension || '');\n setEditPostalCode(a?.postalCode || '');\n setEditCity(a?.city || '');\n setEditCountry(a?.country || '');\n setEditEmail(a?.email || '');\n setEditPhone(a?.phone || '');\n setEditNotes(a?.notes || '');\n setEditIcp(a?.icp || YesNo.N);\n setShowEditModal(true);\n }\n\n async function handleSaveEdit(e: React.FormEvent) {\n e.preventDefault();\n if (isSaving) return;\n if (props.beforeSave) {\n props.beforeSave();\n }\n const editedAddress = {\n id: addr?.()?.id,\n type: addr?.()?.type || props.addressType || '',\n isDefault: addr?.()?.isDefault,\n company: editCompany,\n gender: editGender,\n firstName: editFirstName,\n middleName: editMiddleName,\n lastName: editLastName,\n street: editStreet,\n number: editNumber,\n numberExtension: editNumberExtension,\n postalCode: editPostalCode,\n city: editCity,\n country: editCountry,\n email: editEmail,\n phone: editPhone,\n notes: editNotes,\n icp: editIcp as YesNo,\n } as unknown as Address;\n setLocalAddress(editedAddress);\n setSaving(true);\n try {\n if (props.onEdit) {\n await props.onEdit(editedAddress);\n } else if (hookReady && addr?.()?.id) {\n await addressHook.updateAddress(addr().id, editedAddress);\n }\n setShowEditModal(false);\n if (props.afterEdit) {\n await props.afterEdit(editedAddress);\n }\n } finally {\n setSaving(false);\n }\n }\n\n function confirmDelete() {\n const id = addr?.()?.id;\n if (id != null) {\n if (props.onDelete) {\n props.onDelete(addr());\n } else if (hookReady) {\n addressHook.deleteAddress(id);\n }\n setShowDeleteConfirm(false);\n if (props.afterDelete) {\n props.afterDelete(addr());\n }\n } else {\n setShowDeleteConfirm(false);\n }\n }\n\n function handleSetDefault() {\n if (props.onSetDefault) {\n props.onSetDefault(addr());\n } else if (hookReady && addr?.()?.id) {\n addressHook.setDefaultAddress(addr().id);\n }\n if (props.afterSetDefault) {\n props.afterSetDefault(addr());\n }\n }\n\n function closeEditModal() {\n setShowEditModal(false);\n if (props.isNew && props.onCancel) {\n props.onCancel();\n }\n }\n\n useEffect(() => {\n if (props.isNew || (props.inline && !props.address)) {\n openEditModal();\n }\n }, []);\n\n useEffect(() => {\n setLocalAddress(null);\n }, [props.address]);\n\n // Build the compound context value when there is an address to render. The\n // derived fields mirror the inline helpers used by the default read-only\n // layout so subcomponents and the default layout share a single source of\n // truth.\n const currentAddr = addr();\n const addrType: string = currentAddr?.type || '';\n const contextValue: AddressCardContextValue | null = currentAddr\n ? {\n address: currentAddr as NonNullable<AddressCardProps['address']>,\n resolved: props,\n derived: {\n fullName: fullName(),\n streetLine: streetLine(),\n cityLine: cityLine(),\n countryName: currentAddr?.country ? getCountryName(currentAddr.country) : '',\n isDefault: currentAddr?.isDefault === 'Y',\n addressType: addrType,\n addressTypeLabel: getLabel(props.labels, 'addressType:' + addrType, addrType),\n company: currentAddr?.company || '',\n email: currentAddr?.email || '',\n phone: currentAddr?.phone || '',\n },\n actions: {\n onEdit: openEditModal,\n onDelete: () => setShowDeleteConfirm(true),\n onSetDefault: handleSetDefault,\n isSaving,\n },\n }\n : null;\n\n return (\n <div className=\"propeller-address-card\">\n {showCard() && contextValue ? (\n rawProps.children !== undefined ? (\n <AddressCardContext.Provider value={contextValue}>\n <div\n className=\"propeller-address-card__card bg-card p-4 rounded-container shadow-sm border border-border h-full flex flex-col\"\n data-default={currentAddr?.isDefault === 'Y' ? 'true' : 'false'}\n data-type={addrType}\n >\n {rawProps.children}\n </div>\n </AddressCardContext.Provider>\n ) : (\n <AddressCardContext.Provider value={contextValue}>\n <div\n className=\"propeller-address-card__card bg-card p-4 rounded-container shadow-sm border border-border h-full flex flex-col\"\n data-default={currentAddr?.isDefault === 'Y' ? 'true' : 'false'}\n data-type={addrType}\n >\n <div className=\"propeller-address-card__body flex-grow\">\n <AddressCardTypeBadge />\n <AddressCardCompany />\n <AddressCardName />\n <AddressCardAddressLines />\n <AddressCardCountry />\n <AddressCardEmail />\n <AddressCardPhone />\n <AddressCardDefaultBadge />\n </div>\n <AddressCardActions />\n </div>\n </AddressCardContext.Provider>\n )\n ) : null}\n {props.inline && showEditModal ? (\n <div className=\"propeller-address-card__form bg-card p-6 rounded-container border border-border\">\n <form onSubmit={(e) => handleSaveEdit(e)}>\n {!!formTitle() ? <h3 className=\"text-xl font-bold mb-4\">{formTitle()}</h3> : null}\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'gender', 'Gender')}\n </label>\n <select\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input bg-card\"\n value={editGender}\n onChange={(e) => {\n setEditGender(e.target.value as Gender);\n }}\n >\n <option value=\"M\">{getLabel(props.labels, 'genderMale', 'Male')}</option>\n <option value=\"F\">{getLabel(props.labels, 'genderFemale', 'Female')}</option>\n <option value=\"U\">{getLabel(props.labels, 'genderOther', 'Other')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'company', 'Company')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editCompany}\n onChange={(e) => {\n setEditCompany(e.target.value);\n }}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-3 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'firstName', 'First Name')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editFirstName}\n onChange={(e) => {\n setEditFirstName(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'middleName', 'Middle Name')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editMiddleName}\n onChange={(e) => {\n setEditMiddleName(e.target.value);\n }}\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'lastName', 'Last Name')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editLastName}\n onChange={(e) => {\n setEditLastName(e.target.value);\n }}\n required\n />\n </div>\n </div>\n <div className=\"grid grid-cols-12 gap-4\">\n <div className=\"col-span-8\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'street', 'Street')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editStreet}\n onChange={(e) => {\n setEditStreet(e.target.value);\n }}\n required\n />\n </div>\n <div className=\"col-span-2\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'number', 'Number')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editNumber}\n onChange={(e) => {\n setEditNumber(e.target.value);\n }}\n required\n />\n </div>\n <div className=\"col-span-2\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'numberExtension', 'Ext')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editNumberExtension}\n onChange={(e) => {\n setEditNumberExtension(e.target.value);\n }}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'postalCode', 'Postal Code')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editPostalCode}\n onChange={(e) => {\n setEditPostalCode(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'city', 'City')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editCity}\n onChange={(e) => {\n setEditCity(e.target.value);\n }}\n required\n />\n </div>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'country', 'Country')} *\n </label>\n <select\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input bg-card\"\n value={editCountry}\n onChange={(e) => {\n setEditCountry(e.target.value);\n }}\n required\n >\n <option value=\"\">{getLabel(props.labels, 'selectCountry', 'Select country')}</option>\n {(props.countries || []).map((c) => (\n <option key={c.code} value={c.code}>\n {c.name}\n </option>\n ))}\n </select>\n </div>\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'email', 'Email')} *\n </label>\n <input\n type=\"email\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editEmail}\n onChange={(e) => {\n setEditEmail(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'phone', 'Phone')}\n </label>\n <input\n type=\"tel\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editPhone}\n onChange={(e) => {\n setEditPhone(e.target.value);\n }}\n />\n </div>\n </div>\n {!!props.showIcp ? (\n <div className=\"flex items-center gap-2\">\n <input\n type=\"checkbox\"\n id=\"icp-inline\"\n className=\"propeller-address-card__checkbox h-4 w-4 rounded border-input text-primary focus:ring-primary\"\n checked={editIcp === YesNo.Y}\n onChange={(e) => {\n setEditIcp(e.target.checked ? YesNo.Y : YesNo.N);\n }}\n />\n <label htmlFor=\"icp-inline\" className=\"text-sm font-medium\">\n {getLabel(props.labels, 'icp', 'ICP/ICS (Intra-Community Supply)')}\n </label>\n </div>\n ) : null}\n </div>\n <div className=\"flex justify-end gap-3 pt-4 mt-4 border-t\">\n {!props.isNew ? (\n <button\n type=\"button\"\n className=\"propeller-address-card__cancel-btn px-4 py-2 border border-border rounded-control hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => closeEditModal()}\n disabled={isSaving}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n ) : null}\n {props.isNew && !!props.onCancel ? (\n <button\n type=\"button\"\n className=\"propeller-address-card__cancel-btn px-4 py-2 border border-border rounded-control hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => closeEditModal()}\n disabled={isSaving}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n ) : null}\n <button\n type=\"submit\"\n className=\"propeller-address-card__submit-btn px-4 py-2 bg-primary text-primary-foreground rounded-control hover:bg-primary/90 disabled:opacity-50\"\n disabled={isSaving}\n >\n {isSaving ? <>{getLabel(props.labels, 'saving', 'Saving...')}</> : <>{getLabel(props.labels, 'save', 'Save')}</>}\n </button>\n </div>\n </form>\n </div>\n ) : null}\n {!props.inline && showEditModal ? (\n <div className=\"propeller-address-card__modal fixed inset-0 bg-foreground/50 flex items-center justify-center z-50 overflow-y-auto py-10\">\n <div className=\"propeller-address-card__modal-content bg-card p-6 rounded-container max-w-2xl w-full mx-4 shadow-xl\">\n <form onSubmit={(e) => handleSaveEdit(e)}>\n <div className=\"flex justify-between items-center mb-4\">\n <h3 className=\"text-xl font-bold\">{formTitle()}</h3>\n <button\n type=\"button\"\n className=\"propeller-address-card__modal-close text-muted-foreground hover:text-foreground text-xl leading-none\"\n onClick={(event) => closeEditModal()}\n >\n &times;\n </button>\n </div>\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'gender', 'Gender')}\n </label>\n <select\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input bg-card\"\n value={editGender}\n onChange={(e) => {\n setEditGender(e.target.value as Gender);\n }}\n >\n <option value=\"M\">{getLabel(props.labels, 'genderMale', 'Male')}</option>\n <option value=\"F\">{getLabel(props.labels, 'genderFemale', 'Female')}</option>\n <option value=\"U\">{getLabel(props.labels, 'genderOther', 'Other')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'company', 'Company')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editCompany}\n onChange={(e) => {\n setEditCompany(e.target.value);\n }}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-3 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'firstName', 'First Name')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editFirstName}\n onChange={(e) => {\n setEditFirstName(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'middleName', 'Middle Name')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editMiddleName}\n onChange={(e) => {\n setEditMiddleName(e.target.value);\n }}\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'lastName', 'Last Name')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editLastName}\n onChange={(e) => {\n setEditLastName(e.target.value);\n }}\n required\n />\n </div>\n </div>\n <div className=\"grid grid-cols-12 gap-4\">\n <div className=\"col-span-8\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'street', 'Street')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editStreet}\n onChange={(e) => {\n setEditStreet(e.target.value);\n }}\n required\n />\n </div>\n <div className=\"col-span-2\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'number', 'Number')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editNumber}\n onChange={(e) => {\n setEditNumber(e.target.value);\n }}\n required\n />\n </div>\n <div className=\"col-span-2\">\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'numberExtension', 'Ext')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editNumberExtension}\n onChange={(e) => {\n setEditNumberExtension(e.target.value);\n }}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'postalCode', 'Postal Code')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editPostalCode}\n onChange={(e) => {\n setEditPostalCode(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'city', 'City')} *\n </label>\n <input\n type=\"text\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editCity}\n onChange={(e) => {\n setEditCity(e.target.value);\n }}\n required\n />\n </div>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'country', 'Country')} *\n </label>\n <select\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input bg-card\"\n value={editCountry}\n onChange={(e) => {\n setEditCountry(e.target.value);\n }}\n required\n >\n <option value=\"\">{getLabel(props.labels, 'selectCountry', 'Select country')}</option>\n {(props.countries || []).map((c) => (\n <option key={c.code} value={c.code}>\n {c.name}\n </option>\n ))}\n </select>\n </div>\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'email', 'Email')} *\n </label>\n <input\n type=\"email\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editEmail}\n onChange={(e) => {\n setEditEmail(e.target.value);\n }}\n required\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">\n {getLabel(props.labels, 'phone', 'Phone')}\n </label>\n <input\n type=\"tel\"\n className=\"propeller-address-card__input w-full h-10 px-3 rounded-control border border-input\"\n value={editPhone}\n onChange={(e) => {\n setEditPhone(e.target.value);\n }}\n />\n </div>\n </div>\n {!!props.showIcp ? (\n <div className=\"flex items-center gap-2\">\n <input\n type=\"checkbox\"\n id=\"icp-modal\"\n className=\"propeller-address-card__checkbox h-4 w-4 rounded border-input text-primary focus:ring-primary\"\n checked={editIcp === YesNo.Y}\n onChange={(e) => {\n setEditIcp(e.target.checked ? YesNo.Y : YesNo.N);\n }}\n />\n <label htmlFor=\"icp-modal\" className=\"text-sm font-medium\">\n {getLabel(props.labels, 'icp', 'ICP/ICS (Intra-Community Supply)')}\n </label>\n </div>\n ) : null}\n </div>\n <div className=\"flex justify-end gap-3 pt-4 mt-4 border-t\">\n <button\n type=\"button\"\n className=\"propeller-address-card__cancel-btn px-4 py-2 border border-border rounded-control hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => closeEditModal()}\n disabled={isSaving}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n <button\n type=\"submit\"\n className=\"propeller-address-card__submit-btn px-4 py-2 bg-primary text-primary-foreground rounded-control hover:bg-primary/90 disabled:opacity-50\"\n disabled={isSaving}\n >\n {isSaving ? (\n <>{getLabel(props.labels, 'saving', 'Saving...')}</>\n ) : (\n <>{getLabel(props.labels, 'save', 'Save')}</>\n )}\n </button>\n </div>\n </form>\n </div>\n </div>\n ) : null}\n {showDeleteConfirm ? (\n <div className=\"propeller-address-card__delete-modal fixed inset-0 bg-foreground/50 flex items-center justify-center z-50\">\n <div className=\"propeller-address-card__delete-modal-content bg-card p-6 rounded-container max-w-sm w-full mx-4\">\n <h3 className=\"text-xl font-bold mb-4\">\n {getLabel(props.labels, 'confirmDeleteTitle', 'Confirm Delete')}\n </h3>\n <p className=\"propeller-address-card__delete-message mb-6 text-muted-foreground\">\n {getLabel(props.labels, 'confirmDeleteMessage', 'Are you sure you want to delete this address?')}\n </p>\n <div className=\"flex justify-end gap-4\">\n <button\n className=\"propeller-address-card__cancel-btn px-4 py-2 border border-border rounded-control hover:bg-surface-hover\"\n onClick={(event) => {\n setShowDeleteConfirm(false);\n }}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n <button\n className=\"propeller-address-card__confirm-btn px-4 py-2 bg-primary text-primary-foreground rounded-control hover:bg-primary/80\"\n onClick={(event) => confirmDelete()}\n >\n {getLabel(props.labels, 'delete', 'Delete')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\n/**\n * Optional type badge. Renders nothing when no `addressType` prop is set\n * (the surrounding parent — e.g. AddressSelector — typically renders a\n * type heading instead). When `addressType` is provided, renders a small\n * pill labelled via `labels['addressType:' + addressType]`.\n */\nfunction AddressCardTypeBadge(props: { className?: string }) {\n const { derived } = useAddressCardContext();\n if (!derived.addressType) return null;\n return (\n <span\n className={\n props.className ??\n 'propeller-address-card__type-badge inline-block rounded bg-secondary/10 text-secondary text-xs px-2 py-1 mb-2'\n }\n >\n {derived.addressTypeLabel}\n </span>\n );\n}\n\n/**\n * Internal — renders the company name line. Kept private (not on the\n * compound API surface) to keep the public compound API focused on the\n * six sections listed in the spec. Honours `showCompanyName` (default true).\n */\nfunction AddressCardCompany() {\n const { derived, resolved } = useAddressCardContext();\n if (resolved.showCompanyName === false) return null;\n if (!derived.company) return null;\n return <div className=\"propeller-address-card__company font-bold text-lg mb-1\">{derived.company}</div>;\n}\n\nfunction AddressCardName(props: { className?: string }) {\n const { derived, resolved } = useAddressCardContext();\n if (resolved.showFullName === false) return null;\n if (!derived.fullName) return null;\n return (\n <div className={props.className ?? 'propeller-address-card__name font-medium mb-1'}>\n {derived.fullName}\n </div>\n );\n}\n\nfunction AddressCardAddressLines(props: { className?: string }) {\n const { derived, resolved } = useAddressCardContext();\n const showStreet = resolved.showStreet !== false && !!derived.streetLine;\n const showCity = !!derived.cityLine;\n if (!showStreet && !showCity) return null;\n if (props.className !== undefined) {\n return (\n <div className={props.className}>\n {showStreet ? <div>{derived.streetLine}</div> : null}\n {showCity ? <div>{derived.cityLine}</div> : null}\n </div>\n );\n }\n return (\n <>\n {showStreet ? (\n <div className=\"propeller-address-card__street text-muted-foreground\">{derived.streetLine}</div>\n ) : null}\n {showCity ? (\n <div className=\"propeller-address-card__city text-muted-foreground\">{derived.cityLine}</div>\n ) : null}\n </>\n );\n}\n\nfunction AddressCardCountry(props: { className?: string }) {\n const { derived, resolved } = useAddressCardContext();\n if (resolved.showCountry === false) return null;\n if (!derived.countryName) return null;\n return (\n <div className={props.className ?? 'propeller-address-card__country text-muted-foreground'}>\n {derived.countryName}\n </div>\n );\n}\n\n/**\n * Internal — renders the email line. Kept private; honours `showEmail`\n * (default false).\n */\nfunction AddressCardEmail() {\n const { derived, resolved } = useAddressCardContext();\n if (!resolved.showEmail) return null;\n if (!derived.email) return null;\n return <div className=\"propeller-address-card__email text-muted-foreground\">{derived.email}</div>;\n}\n\n/**\n * Internal — renders the phone line. Kept private; honours `showPhone`\n * (default false).\n */\nfunction AddressCardPhone() {\n const { derived, resolved } = useAddressCardContext();\n if (!resolved.showPhone) return null;\n if (!derived.phone) return null;\n return <div className=\"propeller-address-card__phone text-muted-foreground\">{derived.phone}</div>;\n}\n\nfunction AddressCardActions(props: { className?: string }) {\n const { resolved, actions, derived } = useAddressCardContext();\n if (resolved.enableActions === false) return null;\n return (\n <div\n className={\n props.className ??\n 'propeller-address-card__actions mt-4 pt-4 border-t border-border-subtle flex flex-wrap gap-2'\n }\n >\n {resolved.enableEdit !== false ? (\n <button\n className=\"propeller-address-card__edit-btn text-primary hover:text-primary/80 text-sm font-medium\"\n onClick={() => actions.onEdit()}\n >\n {getLabel(resolved.labels, 'edit', 'Edit')}\n </button>\n ) : null}\n {resolved.enableDelete !== false ? (\n <button\n className=\"propeller-address-card__delete-btn text-muted-foreground hover:text-foreground text-sm font-medium\"\n onClick={() => actions.onDelete()}\n >\n {getLabel(resolved.labels, 'delete', 'Delete')}\n </button>\n ) : null}\n {resolved.enableSetDefault !== false && !derived.isDefault ? (\n <button\n className=\"propeller-address-card__default-btn text-primary hover:text-primary/80 text-sm font-medium ml-auto\"\n onClick={() => actions.onSetDefault()}\n >\n {getLabel(resolved.labels, 'setDefault', 'Set Default')}\n </button>\n ) : null}\n </div>\n );\n}\n\nfunction AddressCardDefaultBadge(props: { className?: string }) {\n const { derived, resolved, address } = useAddressCardContext();\n if (resolved.showDefaultBadge !== true) return null;\n if (!derived.isDefault) return null;\n if (props.className !== undefined) {\n return (\n <div className={props.className}>\n Default {(address as { type?: string }).type} Address\n </div>\n );\n }\n return (\n <div className=\"mt-2\">\n <span className=\"propeller-address-card__default-badge bg-secondary/10 text-secondary text-xs px-2 py-1 rounded-full\">\n Default {(address as { type?: string }).type} Address\n </span>\n </div>\n );\n}\n\ntype AddressCardComponent = typeof AddressCard & {\n TypeBadge: typeof AddressCardTypeBadge;\n Name: typeof AddressCardName;\n AddressLines: typeof AddressCardAddressLines;\n Country: typeof AddressCardCountry;\n Actions: typeof AddressCardActions;\n DefaultBadge: typeof AddressCardDefaultBadge;\n};\n\nconst AddressCardExport = AddressCard as AddressCardComponent;\nAddressCardExport.TypeBadge = AddressCardTypeBadge;\nAddressCardExport.Name = AddressCardName;\nAddressCardExport.AddressLines = AddressCardAddressLines;\nAddressCardExport.Country = AddressCardCountry;\nAddressCardExport.Actions = AddressCardActions;\nAddressCardExport.DefaultBadge = AddressCardDefaultBadge;\n\nexport default AddressCardExport;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Address, AddressType, Company, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport DefaultAddressCardImpl from './AddressCard';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface AddressSelectorProps {\n /** Authenticated user — addresses are derived from their profile. */\n user: Contact | Customer | null;\n\n /**\n * Active company ID (for Contact users).\n * Pass the value from the company switcher so the correct company's addresses are listed. */ companyId?: number;\n /** * Filter addresses to this type. * Defaults to AddressType.delivery. */ addressType?: string;\n /** Called when the user picks an address from the modal. Supports async. */ onAddressSelected?: (\n address: Address\n ) => void | Promise<void>;\n /** Country list forwarded to AddressCard [{code: 'NL', name: 'Netherlands'}, ...] */ countries?: {\n code: string;\n name: string;\n }[];\n /** Label overrides. Keys: chooseAddress, modalTitle, noAddresses */ labels?: Record<\n string,\n string\n >;\n /** Extra CSS class on the root element. */ className?: string;\n\n // ───── Extension API ─────\n // Replaces each <AddressCard> rendered inside the selector list.\n // Receives the same props the default AddressCard would.\n addressCardComponent?: React.ComponentType<import('./AddressCard').AddressCardProps>;\n}\n/**\n * Address picker: a trigger button that opens a modal listing the user's\n * addresses (filtered by type) as selectable {@link AddressCard} tiles.\n */\nfunction AddressSelector(props: AddressSelectorProps) {\n const [showModal, setShowModal] = useState(() => false);\n const [selectedAddress, setSelectedAddress] = useState<Address | null>(null);\n const [isLoading, setIsLoading] = useState(() => false);\n const AddressCardImpl = props.addressCardComponent ?? DefaultAddressCardImpl;\n function getActiveCompany() {\n const user = props.user as Contact | Customer | null;\n if (!user || !('contactId' in user)) return null;\n const contact = user as Contact;\n const cid = props.companyId as number;\n if (cid) {\n const companiesRaw = (contact as Contact).companies;\n const items = (companiesRaw?.items ?? companiesRaw) as Company[] | undefined;\n if (Array.isArray(items)) {\n for (let i = 0; i < items.length; i++) {\n if (items[i].companyId === cid) return items[i];\n }\n }\n if ((contact.company as Company)?.companyId === cid) return contact.company as Company;\n }\n return (contact.company as Company | undefined) ?? null;\n }\n function getAddresses() {\n const user = props.user as Contact | Customer | null;\n if (!user) return [];\n const type = (props.addressType as string) || AddressType.delivery;\n let all: Address[] = [];\n if ('contactId' in user) {\n const company = getActiveCompany();\n all = ((company as Company)?.addresses || []) as Address[];\n } else if ('customerId' in user) {\n all = ((user as Customer).addresses || []) as Address[];\n }\n return all.filter((a: Address) => a.type === type);\n }\n function handleTileClick(address: Address) {\n setSelectedAddress(address);\n }\n async function handleConfirm() {\n if (!selectedAddress || isLoading) return;\n setIsLoading(true);\n try {\n if (props.onAddressSelected) {\n await props.onAddressSelected(selectedAddress as Address);\n }\n setShowModal(false);\n setSelectedAddress(null);\n } finally {\n setIsLoading(false);\n }\n }\n return (\n <div className={`propeller-address-selector ${(props.className as string) || ''}`}>\n <button\n type=\"button\"\n className=\"propeller-address-selector__trigger inline-flex items-center gap-2 px-4 py-2 border border-input rounded-control text-sm font-medium text-foreground bg-card hover:bg-surface-hover transition-colors\"\n onClick={(event) => {\n setShowModal(true);\n }}\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"w-4 h-4\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z\"\n strokeWidth={2}\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15 11a3 3 0 11-6 0 3 3 0 016 0z\"\n strokeWidth={2}\n />\n </svg>\n {getLabel(props.labels, 'chooseAddress', 'Choose address')}\n </button>\n {showModal ? (\n <div className=\"propeller-address-selector__modal fixed inset-0 bg-foreground/50 flex items-start justify-center z-50 overflow-y-auto py-10\">\n <div className=\"propeller-address-selector__modal-content bg-card p-6 rounded-container max-w-2xl w-full mx-4 shadow-xl\">\n <div className=\"propeller-address-selector__modal-header flex justify-between items-center mb-6\">\n <h3 className=\"propeller-address-selector__modal-title text-xl font-bold\">{getLabel(props.labels, 'modalTitle', 'Choose an address')}</h3>\n <button\n type=\"button\"\n className=\"propeller-address-selector__modal-close text-muted-foreground hover:text-foreground text-xl leading-none\"\n onClick={(event) => {\n setShowModal(false);\n }}\n >\n {' '}\n &times;{' '}\n </button>\n </div>\n {getAddresses().length === 0 ? (\n <p className=\"propeller-address-selector__empty text-muted-foreground italic\">\n {getLabel(props.labels, 'noAddresses', 'No addresses found.')}\n </p>\n ) : null}\n {getAddresses().length > 0 ? (\n <>\n <div className=\"propeller-address-selector__list grid grid-cols-2 gap-4\">\n {getAddresses()?.map((address) => (\n <div\n key={(address as Address).id}\n onClick={(event) => handleTileClick(address)}\n data-selected={selectedAddress?.id === (address as Address).id ? 'true' : 'false'}\n className={`propeller-address-selector__option cursor-pointer rounded-container transition-all ring-2 ${selectedAddress?.id === (address as Address).id ? 'ring-primary' : 'ring-transparent hover:ring-primary/40'}`}\n >\n <AddressCardImpl\n address={address}\n enableActions={false}\n countries={props.countries}\n />\n </div>\n ))}\n </div>{' '}\n <div className=\"propeller-address-selector__modal-actions flex justify-end mt-6 pt-4 border-t border-border-subtle\">\n <button\n type=\"button\"\n className=\"propeller-address-selector__confirm-btn inline-flex items-center gap-2 px-5 py-2.5 bg-primary text-primary-foreground rounded-control text-sm font-medium hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n disabled={!selectedAddress || isLoading}\n onClick={(event) => handleConfirm()}\n >\n {isLoading ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" className=\"w-4 h-4 animate-spin\">\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n className=\"opacity-25\"\n />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n className=\"opacity-75\"\n />\n </svg>\n ) : null}\n {isLoading ? (\n <>{getLabel(props.labels, 'updating', 'Updating...')}</>\n ) : (\n <>{getLabel(props.labels, 'useThisAddress', 'Use this address')}</>\n )}\n </button>\n </div>\n </>\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n );\n}\nexport default AddressSelector;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { Category, LocalizedString } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface BreadcrumbsProps {\n /**\n * The category path from the category, product or cluster response.\n * Obtain from `category.categoryPath` or `product.category.categoryPath`.\n */\n categoryPath: Category[];\n\n /**\n * When true (default), the last item in the path is displayed as the\n * current page (non-clickable, aria-current=\"page\").\n * When false, the last item is omitted.\n * Ignored when `currentLabel` is provided — the extra crumb becomes\n * the current page instead.\n */\n showCurrent?: boolean;\n\n /**\n * The category of the current page. When provided and not already\n * the last item in `categoryPath`, it is appended automatically so\n * the trail always ends at the current category. This makes the\n * component correct whether the API's categoryPath includes the\n * current category or only its ancestors.\n */\n currentCategory?: Category;\n\n /**\n * Optional trailing crumb appended after the category path — typically\n * the name of the current product or cluster on a detail page.\n * When provided, this crumb is marked as the current page and the\n * last category becomes a normal link.\n */\n currentLabel?: string;\n\n /**\n * Optional URL for the trailing `currentLabel` crumb. When omitted,\n * the crumb is rendered as a non-link `<span>`.\n */\n currentUrl?: string;\n\n /**\n * When true (default), a \"Home\" link is prepended to the trail.\n */\n showHome?: boolean;\n\n /**\n * URL for the Home link. Defaults to '/'.\n */\n homeUrl?: string;\n\n /**\n * Language code used to resolve localised category names and slugs.\n * Defaults to 'NL'.\n */\n language?: string;\n\n /**\n * Custom URL builder for category links.\n * Receives the Category object and its zero-based index in the path.\n * When omitted, URLs default to `/category/{categoryId}/{slug}`.\n */\n getUrl?: (category: Category, index: number) => string;\n\n /**\n * Override any UI string.\n * Available keys: home, separator\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /** Configuration object passed to the component */\n configuration?: any;\n}\n/**\n * Renders a breadcrumb trail from a category path, with an optional Home link\n * and an optional trailing crumb for the current product/cluster page.\n */\nfunction Breadcrumbs(props: BreadcrumbsProps) {\n const lang = props.language || 'NL';\n // Filter the path to drop the base category, then optionally append the\n // explicit currentCategory if the API didn't already include it as the tail.\n const path = props.categoryPath || [];\n const baseId = props.configuration?.baseCategoryId;\n const filtered = baseId\n ? path.filter((cat: Category) => cat.categoryId !== baseId)\n : path;\n let items = filtered;\n if (props.currentCategory) {\n const last = filtered[filtered.length - 1];\n if (!last || last.categoryId !== props.currentCategory.categoryId) {\n items = [...filtered, props.currentCategory];\n }\n }\n const displayItems = props.showCurrent === false && items.length > 0\n ? items.slice(0, items.length - 1)\n : items;\n function getCategoryName(cat: Category): string {\n const match = cat.name?.find((n: LocalizedString) => n.language === lang);\n return match?.value || cat.name?.[0]?.value || '';\n }\n function getCategoryUrl(cat: Category, index: number): string {\n if (props.getUrl) return props.getUrl(cat, index);\n // Consumer-provided URL builder takes precedence. Fall back to the\n // configuration helper when present (legacy boilerplate pattern), then\n // to the documented default `/category/{categoryId}/{slug}` URL.\n // Reading `configuration.urls.getCategoryUrl` unconditionally crashed\n // pages that don't thread `configuration` into the Breadcrumbs island\n // (CategoryBreadcrumbsIsland / ProductBreadcrumbsIsland in the Next\n // boilerplate both pass only `categoryPath` + `labels`).\n // Invoke the configuration helper as a method (not via an extracted\n // reference) so that `this` is still bound to `configuration.urls` —\n // some boilerplates write the helper as `getCategoryUrl(...) { return\n // ...this.pattern... }` and detaching the reference crashes with\n // \"Cannot read properties of undefined (reading 'pattern')\".\n const urls = props.configuration?.urls;\n if (urls && typeof urls.getCategoryUrl === 'function') {\n return urls.getCategoryUrl(cat, props.language);\n }\n const slug = cat.slug?.find((s: LocalizedString) => s.language === lang)?.value\n || cat.slug?.[0]?.value\n || '';\n return `/category/${cat.categoryId}/${slug}`;\n }\n function isCurrentItem(index: number): boolean {\n if (props.showCurrent === false) return false;\n if (props.currentLabel) return false;\n return index === displayItems.length - 1;\n }\n // Show separator when Home precedes this item, or when a previous category item exists.\n const showSeparatorBefore = (index: number) =>\n props.showHome !== false || index > 0;\n return (\n <nav aria-label={getLabel(props.labels, 'breadcrumbAriaLabel', 'Breadcrumb')} className={`propeller-breadcrumbs ${props.className || ''}`}>\n <ol className=\"propeller-breadcrumbs__list flex flex-wrap items-center text-sm text-muted-foreground\">\n {props.showHome !== false ? (\n <li className=\"propeller-breadcrumbs__item flex items-center\" data-home=\"true\">\n <a\n className=\"propeller-breadcrumbs__link hover:text-foreground transition-colors\"\n href={props.homeUrl || '/'}\n >\n {getLabel(props.labels, 'home', 'Home')}\n </a>\n </li>\n ) : null}\n {displayItems.map((cat, index) => (\n <li\n className=\"propeller-breadcrumbs__item flex items-center\"\n key={cat.categoryId || index}\n data-current={isCurrentItem(index) ? 'true' : 'false'}\n >\n {showSeparatorBefore(index) ? (\n <span aria-hidden=\"true\" className=\"propeller-breadcrumbs__separator mx-2 select-none text-muted-foreground/40\">\n {getLabel(props.labels, 'separator', '/')}\n </span>\n ) : null}\n {isCurrentItem(index) ? (\n <span\n aria-current=\"page\"\n className=\"propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground\"\n >\n {getCategoryName(cat)}\n </span>\n ) : null}\n {!isCurrentItem(index) ? (\n <a\n className=\"propeller-breadcrumbs__link hover:text-foreground transition-colors\"\n href={getCategoryUrl(cat, index)}\n >\n {getCategoryName(cat)}\n </a>\n ) : null}\n </li>\n ))}\n {props.currentLabel ? (\n <li\n className=\"propeller-breadcrumbs__item flex items-center\"\n data-current=\"true\"\n >\n <span aria-hidden=\"true\" className=\"propeller-breadcrumbs__separator mx-2 select-none text-muted-foreground/40\">\n {getLabel(props.labels, 'separator', '/')}\n </span>\n {props.currentUrl ? (\n <a\n aria-current=\"page\"\n className=\"propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground\"\n href={props.currentUrl}\n >\n {props.currentLabel}\n </a>\n ) : (\n <span\n aria-current=\"page\"\n className=\"propeller-breadcrumbs__link propeller-breadcrumbs__link--current text-foreground\"\n >\n {props.currentLabel}\n </span>\n )}\n </li>\n ) : null}\n </ol>\n </nav>\n );\n}\n\nexport default Breadcrumbs;\n","'use client';\n/**\n * Client wrapper around the pure `Breadcrumbs` component. Resolves\n * `language` and `configuration` from `<PropellerProvider>` when the caller\n * doesn't pass them explicitly, then forwards every prop to the pure\n * component. The pure version stays exported from `/pure` for RSC use,\n * where explicit props are required and the provider isn't reachable.\n */\nimport * as React from 'react';\nimport Breadcrumbs, { type BreadcrumbsProps } from './Breadcrumbs';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction BreadcrumbsWithProvider(rawProps: BreadcrumbsProps) {\n const props = useInfraProps(rawProps);\n return <Breadcrumbs {...props} />;\n}\n\nexport default BreadcrumbsWithProvider;\nexport type { BreadcrumbsProps };\n","'use client';\n/**\n * @rsc-blocked — Client-only component: imported by client cart surfaces. It\n * holds no state itself, but ships under the `\"use client\"` package boundary\n * alongside the other cart components. The 'use client' header marks it.\n */\nimport * as React from 'react';\n\nimport { Cart, CartBaseItem } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getLocalizedValue } from '@propeller-commerce/propeller-v2-core-ui';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface CartBonusItemsProps {\n /** Cart whose `bonusItems` (free items added via incentives) are displayed. */\n cart?: Cart | null;\n\n /** Pre-resolved bonus items. When omitted, `cart.bonusItems` is used. */\n bonusItems?: CartBaseItem[];\n\n /** When true, the tax-inclusive total (`totalPriceNet`) is shown. Resolved from PropellerProvider when omitted; defaults to false. */\n includeTax?: boolean;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n /** Active language for localized product names. Resolved from PropellerProvider when omitted. */\n language?: string;\n\n /** Additional CSS class for the root element. */\n className?: string;\n\n /**\n * Label overrides. Keys: `title` ('Bonus items'), `sku` ('SKU').\n */\n labels?: Record<string, string>;\n}\n\n/**\n * Renders a cart's bonus items — free items added through incentives — as a\n * read-only list (image, name, SKU, quantity, total price). No quantity\n * stepper, delete or cross-sells: bonus items aren't directly editable.\n *\n * Renders nothing when there are no bonus items, so it's safe to drop into any\n * cart surface (cart page, sidebar) unconditionally.\n *\n * `currency` / `includeTax` / `language` resolve from `<PropellerProvider>` via\n * `useInfraProps` when not passed explicitly — host surfaces inside the\n * provider don't need to thread them through.\n */\nfunction CartBonusItems(rawProps: CartBonusItemsProps) {\n const props = useInfraProps(rawProps);\n const items: CartBaseItem[] = props.bonusItems ?? props.cart?.bonusItems ?? [];\n if (items.length === 0) return null;\n\n const currency = props.currency ?? '€';\n const money = (value: number | null | undefined): string =>\n formatPrice(value, { symbol: currency });\n const productName = (item: CartBaseItem): string =>\n getLocalizedValue(item.product?.names, props.language as string, 'Product');\n const productImage = (item: CartBaseItem): string =>\n item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n\n return (\n <div className={`propeller-cart-bonus-items ${props.className || 'mt-2'}`}>\n <h2 className=\"propeller-cart-bonus-items__title text-lg font-semibold mb-3\">\n {getLabel(props.labels, 'title', 'Bonus items')}\n </h2>\n <div className=\"propeller-cart-bonus-items__list space-y-4\">\n {items.map((item: CartBaseItem) => {\n const img = productImage(item);\n const name = productName(item);\n const total = props.includeTax ? item.totalPriceNet : item.totalPrice;\n return (\n <div\n key={item.itemId}\n className=\"propeller-cart-bonus-item flex items-center gap-4 bg-card p-4 rounded-container shadow-sm border border-border\"\n >\n <div className=\"propeller-cart-bonus-item__media w-20 h-20 flex-shrink-0 bg-surface-hover rounded-control overflow-hidden flex items-center justify-center\">\n {img ? (\n <img className=\"propeller-cart-bonus-item__image w-full h-full object-contain p-1\" src={img} alt={name} />\n ) : (\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"propeller-cart-bonus-item__image-placeholder w-8 h-8 text-foreground-subtle\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z\"\n />\n </svg>\n )}\n </div>\n <div className=\"propeller-cart-bonus-item__body flex-1 min-w-0\">\n {item.product?.sku ? (\n <p className=\"propeller-cart-bonus-item__sku font-mono text-xs text-foreground-subtle\">\n {getLabel(props.labels, 'sku', 'SKU')}: {item.product.sku}\n </p>\n ) : null}\n <p className=\"propeller-cart-bonus-item__title font-semibold text-sm md:text-base text-foreground line-clamp-2\">\n {name}\n </p>\n </div>\n <div className=\"propeller-cart-bonus-item__qty text-sm text-muted-foreground whitespace-nowrap\">\n {item.quantity} &times;\n </div>\n <div className=\"propeller-cart-bonus-item__price font-semibold text-foreground whitespace-nowrap\">\n {money(total)}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nexport default CartBonusItems;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Cart, CartCarrier } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface CartCarriersProps {\n /** Shopping cart object from which the carriers will be displayed */\n cart: Cart;\n\n /** The CSS class for the carriers container */\n carriersContainerClass?: string;\n\n /** Display the carrier logo */\n showCarrierLogo?: boolean;\n\n /** Action when a carrier is selected */\n onCarrierSelect?: (carrier: CartCarrier) => void;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Show carrier price (default: true) */\n showPrice?: boolean;\n\n /** Currency symbol for prices. Defaults to '€'. */\n currency?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n}\n/**\n * Renders the cart's available delivery carriers as a selectable grid,\n * showing each carrier's logo, price and delivery deadline.\n */\nfunction CartCarriers(props: CartCarriersProps) {\n const [selectedName, setSelectedName] = useState('');\n const containerClass = props.carriersContainerClass || 'cart-carriers';\n const showLogo = props.showCarrierLogo !== false;\n const carriers: CartCarrier[] = props.cart?.carriers || [];\n function formatCarrierPrice(price: number): string {\n if (props.formatPrice) return props.formatPrice(price);\n return formatPrice(price || 0, { symbol: props.currency ?? '\\u20AC' });\n }\n function handleSelect(carrier: CartCarrier): void {\n setSelectedName(carrier.name);\n if (props.onCarrierSelect) props.onCarrierSelect(carrier);\n }\n // Adopt the cart's stored carrier once it loads (cart may be undefined on\n // mount, then arrive). Intentional external-prop → local-state sync;\n // derived-from-props can't replace this because handleSelect lets the user\n // override the cart value locally and we also fire onCarrierSelect.\n useEffect(() => {\n if (!selectedName && props.cart?.postageData?.carrier) {\n const name = props.cart.postageData.carrier as string;\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedName(name);\n if (props.onCarrierSelect) {\n const match = carriers.find((c: CartCarrier) => c.name === name);\n if (match) props.onCarrierSelect(match);\n }\n }\n }, [props.cart, selectedName, props.onCarrierSelect, carriers, props]);\n return (\n <div className={`propeller-cart-carriers ${containerClass}`}>\n {carriers.length > 0 ? (\n <div className=\"propeller-cart-carriers__grid grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {carriers.map((carrier, index) => (\n <div\n key={`${carrier.name}-${index}`}\n onClick={() => handleSelect(carrier)}\n data-selected={selectedName === carrier.name ? 'true' : 'false'}\n className={`propeller-cart-carriers__carrier cursor-pointer border border-border rounded-container p-4 flex flex-col gap-2 transition-all ${selectedName === carrier.name ? 'border-secondary bg-secondary/5 shadow-sm' : 'hover:border-secondary/30'}`}\n >\n <div className=\"propeller-cart-carriers__carrier-row flex justify-between items-center\">\n <div className=\"flex items-center gap-2\">\n {showLogo && (carrier.logo || '') ? (\n <img className=\"propeller-cart-carriers__carrier-logo h-6 w-auto\" src={(carrier.logo || '')} alt={carrier.name} />\n ) : null}\n <span className=\"propeller-cart-carriers__carrier-name font-medium\">{carrier.name}</span>\n </div>\n {props.showPrice !== false ? (\n <span className=\"propeller-cart-carriers__carrier-price text-xs bg-surface-hover text-muted-foreground px-2 py-1 rounded-full\">\n {formatCarrierPrice(carrier.price)}\n </span>\n ) : null}\n </div>\n {carrier.deliveryDeadline ? (\n <p className=\"propeller-cart-carriers__carrier-deadline text-xs text-muted-foreground\">\n {getLabel(props.labels, 'deliveryDeadline', 'Delivery deadline:')}\n {carrier.deliveryDeadline}\n </p>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n {carriers.length === 0 ? (\n <p className=\"propeller-cart-carriers__empty text-muted-foreground italic\">{getLabel(props.labels, 'noCarriers', 'No carriers available.')}</p>\n ) : null}\n </div>\n );\n}\n\nexport default CartCarriers;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { ProductInventory } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ItemStockProps {\n /**\n * Product inventory to display stock and availability for.\n * Required — drives all stock calculations and display logic.\n */\n inventory: ProductInventory;\n\n /**\n * Shows whether the product is available or not available.\n * Defaults to true.\n */\n showAvailability?: boolean;\n\n /**\n * Shows the actual stock quantity (`inventory.totalQuantity`).\n * Defaults to true.\n */\n showStock?: boolean;\n\n /**\n * UI string overrides.\n * Available keys: inStock, outOfStock, lowStock, available, notAvailable, pieces\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders stock badges for a product: an availability indicator and/or a\n * stock-status badge (in stock / low stock / out of stock) with quantity.\n */\nfunction ItemStock(props: ItemStockProps) {\n \n function getTotalQuantity(): number {\n const qty = (props.inventory as ProductInventory)?.totalQuantity;\n return qty !== undefined && qty !== null ? qty : -1;\n }\n function isAvailable(): boolean {\n return getTotalQuantity() > 0;\n }\n function getStockStatusLabel(): string {\n const qty = getTotalQuantity();\n if (qty < 0) return '';\n if (qty === 0) return getLabel(props.labels, 'outOfStock', 'Out of stock');\n if (qty <= 5) return getLabel(props.labels, 'lowStock', 'Low stock');\n return getLabel(props.labels, 'inStock', 'In stock');\n }\n function getStockStatusClass(): string {\n const qty = getTotalQuantity();\n if (qty <= 0) return 'text-destructive bg-destructive/10 border-destructive/20';\n if (qty <= 5) return 'text-warning bg-warning/10 border-warning/20';\n return 'text-success bg-success/10 border-success/20';\n }\n function getStockStatusData(): string {\n const qty = getTotalQuantity();\n if (qty <= 0) return 'out';\n if (qty <= 5) return 'low';\n return 'in';\n }\n function getAvailabilityLabel(): string {\n return isAvailable()\n ? getLabel(props.labels, 'available', 'Available')\n : getLabel(props.labels, 'notAvailable', 'Not available');\n }\n function getAvailabilityClass(): string {\n return isAvailable()\n ? 'text-success bg-success/10 border-success/20'\n : 'text-destructive bg-destructive/10 border-destructive/20';\n }\n function getAvailabilityDotClass(): string {\n return isAvailable() ? 'bg-success' : 'bg-destructive';\n }\n function hasInventory(): boolean {\n return !!(props.inventory as ProductInventory) && getTotalQuantity() >= 0;\n }\n return (\n <>\n {hasInventory() ? (\n <>\n <div\n className={`propeller-item-stock flex flex-wrap items-center gap-1.5 ${(props.className as string) || ''}`}\n data-available={isAvailable() ? 'true' : 'false'}\n data-stock={getStockStatusData()}\n >\n {props.showAvailability !== false ? (\n <span\n className={`propeller-item-stock__availability inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium ${getAvailabilityClass()}`}\n >\n <span\n className={`propeller-item-stock__availability-dot h-1.5 w-1.5 flex-shrink-0 rounded-full ${getAvailabilityDotClass()}`}\n />\n {getAvailabilityLabel()}\n </span>\n ) : null}\n {props.showStock !== false && !!getStockStatusLabel() ? (\n <span\n className={`propeller-item-stock__status inline-flex items-center gap-1 whitespace-nowrap rounded-full border px-2 py-0.5 text-[11px] font-medium ${getStockStatusClass()}`}\n >\n {getStockStatusLabel()}\n {getTotalQuantity() > 0 ? (\n <span className=\"propeller-item-stock__count opacity-70\">\n ({getTotalQuantity()}\n {getLabel(props.labels, 'pieces', 'pcs')})\n </span>\n ) : null}\n </span>\n ) : null}\n </div>\n </>\n ) : null}\n </>\n );\n}\n\n// Memoized: pure leaf rendered inside memoized cards; skips re-render when its\n// (inventory / labels / flags) props are shallow-equal (rbp §5.2).\nexport default React.memo(ItemStock);\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { BundleItem, Cart, CartBaseItem, CartMainItem, Cluster, Contact, Crossupsell, Customer, GraphQLClient, MediaImageProductSearchInput, Product, ProductInventory, TransformationsInput, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { useCart } from '../composables/react/useCart';\nimport { useResolvedProps, type ResolveSpec } from '../composables/react/useResolvedProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice, formatSurcharge } from '@propeller-commerce/propeller-v2-core-ui';\nimport DefaultItemStockImpl from './ItemStock';\n\nexport interface CartItemProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The shopping cart unique identifier */\n cartId: string;\n\n /** Tax zone for price calculations */\n taxZone?: string;\n\n /** Authenticated user for cart operations */\n user?: Contact | Customer | null;\n\n /** A shopping cart item */\n cartItem: CartMainItem;\n\n /** Should the item title be a link to the PDP. Defaults to true. */\n titleLinkable?: boolean;\n\n /** Should the stock be displayed in the cart item. Defaults to false. */\n showStockComponent?: boolean;\n\n /** Display the SKU of the cart item beneath the item name. Defaults to true. */\n showSku?: boolean;\n\n /** +/- buttons on left and right of quantity input. Defaults to true. */\n enableIncrementDecrement?: boolean;\n\n /** Should the cart item notes field be displayed. Defaults to false. */\n showCartItemNotesField?: boolean;\n\n /** Action callback when a cart item quantity is changed */\n onQuantityChange?: (item: CartMainItem, quantity: number) => void;\n\n /** Action callback when a cart item note is changed */\n onNoteChange?: (item: CartMainItem, note: string) => void;\n\n /** Action callback when a cart item is deleted */\n onDelete?: (item: CartMainItem) => void;\n\n /** Callback with the updated cart after any cart mutation */\n afterCartUpdate?: (cart: Cart) => void;\n\n /** Label overrides for UI strings\n *\n * Available keys: remove, notes, notesPlaceholder, includedOptions, updating, deleting\n */\n labels?: Record<string, string>;\n\n /** Language code for CartService operations. Defaults to 'NL'. */\n language?: string;\n\n /** Configuration object for image filters and URL generation */\n configuration?: {\n language?: string;\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersSmall?: TransformationsInput;\n imageVariantFiltersMedium?: TransformationsInput;\n urls?: { getProductUrl: (product: Product, language?: string) => string };\n };\n\n /** Show cross-sell/upsell product suggestions below the item. Defaults to false. */\n showCrossupsells?: boolean;\n\n /** Which cross-sell types to fetch. Defaults to ['ACCESSORIES']. Values: 'ACCESSORIES', 'ALTERNATIVES', 'OPTIONS', 'PARTS', 'RELATED' */\n crossupsellTypes?: string[];\n\n /** Maximum number of cross-sell products to display. Defaults to 3. */\n crossupsellLimit?: number;\n\n /** Callback when a cross-sell product is clicked */\n onCrossupsellClick?: (product: Product | Cluster) => void;\n\n /** Additional CSS class for the root element */\n className?: string;\n\n /** Include tax in price. Defaults to false. */\n includeTax?: boolean;\n\n /** Active company ID — used to look up the user's PAC for this company */\n companyId?: number;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n // ───── Extension API ─────\n // Per-row overrides for sub-components. Precedence:\n // explicit prop > ProductGridConfig context > infra > default.\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n surchargesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ProductSurchargesComponentProps>;\n\n /** When false, root element drops the card frame\n * ('bg-card p-4 rounded-container shadow-sm border border-border'),\n * leaving only the flex layout. Default: true. Used by drawer / summary\n * widgets. */\n cardFrame?: boolean;\n\n /** When false, the delete button (and <CartItem.Delete /> in compound\n * mode) returns null. Default: true. */\n showDelete?: boolean;\n\n /** When true, quantity renders as 'Qty: {n}' text — no stepper, no\n * input. Default: false. Independent from enableIncrementDecrement\n * (which only swaps stepper buttons for a bare number input — both\n * modes are still interactive). */\n readOnlyQuantity?: boolean;\n\n /** Optional title click callback. Fires BEFORE default navigation; the\n * consumer may call event.preventDefault() to suppress nav. Used by\n * the cart drawer to close the sidebar on title click. */\n onTitleClick?: (event: React.MouseEvent, item: CartMainItem) => void;\n\n /** Compound mode opt-in. When provided, CartItem renders the compound\n * subtree (using <CartItem.X> subcomponents) instead of the legacy\n * monolithic layout. */\n children?: React.ReactNode;\n}\n\n/**\n * Renders a single cart line item with image, title, price, quantity stepper,\n * notes field and optional cross-sell/upsell suggestions. Supports bundles and\n * cluster option child items.\n *\n * @remarks Uses {@link useCart} for quantity/notes updates, deletion and\n * cross-sell fetching.\n */\nconst CART_ITEM_RESOLVE_SPEC: ResolveSpec<CartItemProps> = {\n graphqlClient: { infra: 'graphqlClient' },\n user: { infra: 'user' },\n companyId: { infra: 'companyId' },\n configuration: { infra: 'configuration' },\n language: { infra: 'language', default: 'NL' },\n currency: { infra: 'currency', default: '€' },\n includeTax: { infra: 'includeTax' },\n priceComponent: { grid: 'priceComponent' },\n stockComponent: { grid: 'stockComponent' },\n surchargesComponent: { grid: 'surchargesComponent' },\n};\n\n// ── Compound API context ────────────────────────────────────────────────────\n// useCartItemContext (not useCartItem) to avoid clashing with any future\n// useCartItem composable. Matches the pattern set by ProductInfo.\n\ninterface CartItemContextValue {\n cartItem: CartMainItem;\n resolved: CartItemProps;\n derived: {\n name: string;\n sku: string;\n imageUrl: string;\n productUrl: string;\n isBundle: boolean;\n bundleName: string;\n bundleLeaderName: string;\n bundleLeaderPrice: string;\n bundleNonLeaders: BundleItem[];\n surcharges: string[];\n inventory: ProductInventory | null;\n formattedPrice: string;\n bundlePrice: string;\n useTax: boolean;\n language: string;\n currency: string;\n quantity: number;\n minQuantity: number;\n step: number;\n };\n state: {\n notes: string;\n loading: boolean;\n deleting: boolean;\n crossupsells: Crossupsell[];\n visibleCrossupsells: Crossupsell[];\n addingCrossupsellId: number | null;\n };\n helpers: {\n getBundleItemName: (bundleItem: BundleItem) => string;\n getBundleItemPrice: (bundleItem: BundleItem) => string;\n getCrossupsellName: (item: Crossupsell) => string;\n getCrossupsellImageUrl: (item: Crossupsell) => string;\n getCrossupsellUrl: (item: Crossupsell) => string;\n getCrossupsellPrice: (item: Crossupsell) => string;\n getCrossupsellProductId: (item: Crossupsell) => number | undefined;\n };\n handlers: {\n onQuantityChange: (newQuantity: number) => void;\n onNoteChange: (newNote: string) => void;\n onDelete: () => void;\n onTitleClick: (event: React.MouseEvent) => void;\n onCrossupsellClick: (item: Crossupsell, event: React.MouseEvent) => void;\n onAddCrossupsellToCart: (item: Crossupsell) => void;\n };\n}\n\nconst CartItemContext = React.createContext<CartItemContextValue | null>(null);\n\nfunction useCartItemContext(): CartItemContextValue {\n const ctx = React.useContext(CartItemContext);\n if (!ctx) {\n throw new Error(\n 'CartItem compound subcomponents must be rendered inside <CartItem>.',\n );\n }\n return ctx;\n}\n\nfunction CartItem(rawProps: CartItemProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>,\n // and injected sub-component slots cascade from the ProductGrid config (Tier 2).\n const props = useResolvedProps(rawProps, CART_ITEM_RESOLVE_SPEC);\n // --- composable ---\n const { updateItemQuantity, updateItemNotes, deleteItem, getCrossupsells, addItem, getMinQuantity, getStep } = useCart({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n cartId: props.cartId,\n configuration: props.configuration,\n companyId: props.companyId,\n });\n\n // --- local UI state ---\n // Lazy-initialize from props.cartItem; the previous code seeded to 1/''\n // and then setX in a mount effect, an unnecessary extra render.\n const [quantity, setQuantity] = useState<number>(() => props.cartItem.quantity || 1);\n const [notes, setNotes] = useState<string>(() => props.cartItem.notes || '');\n const [loading, setLoading] = useState<boolean>(() => false);\n const [deleting, setDeleting] = useState<boolean>(() => false);\n const [crossupsells, setCrossupsells] = useState<Crossupsell[]>(() => []);\n const [crossupsellsLoading, setCrossupsellsLoading] = useState<boolean>(() => false);\n const [addingCrossupsellId, setAddingCrossupsellId] = useState<number | null>(() => null);\n\n // Order quantity rules from the product: `minimumQuantity` (floor) and `unit`\n // (step) — the cart stepper must honour the product's order rules, not\n // hardcode 1 (e.g. a product sold per 6 should step 6/12/18, min 6).\n const minQuantity = getMinQuantity(props.cartItem.product);\n const step = getStep(props.cartItem.product);\n\n // --- display helpers ---\n \n function getProductName(): string {\n return props.cartItem.product?.names?.[0]?.value || 'Product';\n }\n function getProductUrl(): string {\n if (props.configuration?.urls && props.cartItem.product) {\n return props.configuration.urls.getProductUrl(props.cartItem.product as Product, props.language);\n }\n return '#';\n }\n function getProductImageUrl(): string {\n return props.cartItem.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n }\n function getProductSku(): string {\n return props.cartItem.product?.sku || '';\n }\n function getSurcharges(): string[] {\n // Cart-line surcharges (CartItemSurcharge: localized `names`, own quantity)\n // — each shown as `{qty} x {currency} {value} (name)`\n // for flat fees, `{qty} x {value}% (name)` for percentages.\n type SurchargeLike = {\n name?: { value?: string; language?: string }[];\n names?: { value?: string; language?: string }[];\n type?: string;\n value?: number;\n quantity?: number;\n enabled?: boolean;\n };\n const list = ((props.cartItem.surcharges ?? []) as SurchargeLike[]).filter(\n (s: SurchargeLike) => s.enabled !== false\n );\n return list\n .map((s: SurchargeLike) =>\n formatSurcharge(s, {\n quantity: s.quantity ?? props.cartItem.quantity ?? 1,\n language: props.language,\n currency: props.currency ?? '€',\n })\n )\n .filter((line: string) => line.length > 0);\n }\n function getInventory(): ProductInventory | null {\n const inv = props.cartItem.product?.inventory;\n return inv || null;\n }\n function getFormattedPrice(): string {\n const item = props.cartItem;\n const price = props.includeTax ? item?.totalSumNet || 0 : item?.totalSum || 0;\n return formatPrice(price, { symbol: props.currency ?? '\\u20AC' });\n }\n function isBundleItem(): boolean {\n return !!props.cartItem.bundle;\n }\n function getBundleName(): string {\n return props.cartItem.bundle?.name || 'Bundle';\n }\n function getBundlePrice(): string {\n const price = props.cartItem.bundle?.price?.net;\n if (price === undefined || price === null) return '';\n return formatPrice(price, { symbol: props.currency ?? '\\u20AC' });\n }\n function getBundleLeaderName(): string {\n const items = props.cartItem.bundle?.items;\n if (!items) return '';\n const leader = items.find((bi: BundleItem) => bi.isLeader === YesNo.Y);\n if (!leader) return '';\n return leader.product.names?.[0]?.value || 'Product';\n }\n function getBundleLeaderPrice(): string {\n const items = props.cartItem.bundle?.items;\n if (!items) return '';\n const leader = items.find((bi: BundleItem) => bi.isLeader === YesNo.Y);\n if (!leader) return '';\n const price = leader.price?.net;\n if (price === undefined || price === null) return '';\n return formatPrice(price, { symbol: props.currency ?? '\\u20AC' });\n }\n function getBundleNonLeaders(): BundleItem[] {\n const items = props.cartItem.bundle?.items;\n if (!items) return [];\n return items.filter((bi: BundleItem) => bi.isLeader !== YesNo.Y);\n }\n function getBundleItemName(bundleItem: BundleItem): string {\n return bundleItem.product.names?.[0]?.value || 'Product';\n }\n function getBundleItemPrice(bundleItem: BundleItem): string {\n const price = bundleItem.price?.net;\n if (price === undefined || price === null) return '';\n return formatPrice(price, { symbol: props.currency ?? '\\u20AC' });\n }\n function getCrossupsellName(item: Crossupsell): string {\n const product = item?.productTo || item?.clusterTo;\n return product?.names?.[0]?.value || 'Product';\n }\n function getCrossupsellImageUrl(item: Crossupsell): string {\n const product = (item?.productTo || item?.clusterTo) as Product | undefined;\n return product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n }\n function getCrossupsellUrl(item: Crossupsell): string {\n const product = item?.productTo || item?.clusterTo;\n if (props.configuration?.urls && product) {\n return props.configuration.urls.getProductUrl(product as Product, props.language);\n }\n return '#';\n }\n function getVisibleCrossupsells(): Crossupsell[] {\n const items = crossupsells || [];\n const limit = props.crossupsellLimit || 3;\n return items.slice(0, limit);\n }\n\n // --- actions via composable ---\n async function handleQuantityChange(newQuantity: number): Promise<void> {\n if (newQuantity < 1 || loading) return;\n setQuantity(newQuantity);\n setLoading(true);\n if (props.onQuantityChange) {\n props.onQuantityChange(props.cartItem, newQuantity);\n setLoading(false);\n return;\n }\n try {\n const updatedCart = await updateItemQuantity(props.cartItem.itemId.toString(), newQuantity);\n if (updatedCart && props.afterCartUpdate) props.afterCartUpdate(updatedCart);\n setLoading(false);\n } catch (error: any) {\n console.error('Failed to update cart item quantity:', error);\n setQuantity(props.cartItem.quantity);\n setLoading(false);\n }\n }\n\n function handleNoteChange(note: string): void {\n setNotes(note);\n if (props.onNoteChange) {\n props.onNoteChange(props.cartItem, note);\n return;\n }\n updateItemNotes(props.cartItem.itemId, note, 500);\n }\n\n async function handleDelete(): Promise<void> {\n if (deleting) return;\n setDeleting(true);\n if (props.onDelete) {\n props.onDelete(props.cartItem);\n setDeleting(false);\n return;\n }\n try {\n const updatedCart = await deleteItem(props.cartItem.itemId);\n if (updatedCart && props.afterCartUpdate) props.afterCartUpdate(updatedCart);\n setDeleting(false);\n } catch (error: any) {\n console.error('Failed to delete cart item:', error);\n setDeleting(false);\n }\n }\n\n function fetchCrossupsells(): void {\n if (!props.showCrossupsells) return;\n setCrossupsellsLoading(true);\n getCrossupsells({\n productId: props.cartItem?.productId,\n clusterId: props.cartItem?.clusterId,\n types: props.crossupsellTypes,\n taxZone: props.taxZone,\n imageVariantFilters: props.configuration?.imageVariantFiltersMedium,\n }).then((items) => {\n setCrossupsells(items);\n setCrossupsellsLoading(false);\n }).catch(() => {\n setCrossupsells([]);\n setCrossupsellsLoading(false);\n });\n }\n\n function getCrossupsellProductId(item: Crossupsell): number | undefined {\n const product = (item?.productTo || item?.clusterTo) as Product | undefined;\n return (product as Product)?.productId || product?.id;\n }\n\n function getCrossupsellPrice(item: Crossupsell): string {\n const product = (item?.productTo || item?.clusterTo) as Product | undefined;\n const price = product?.price;\n if (!price) return '';\n const value = props.includeTax ? price.net : price.gross;\n if (value === undefined || value === null) return '';\n return formatPrice(value, { symbol: props.currency ?? '\\u20AC' });\n }\n\n async function handleAddCrossupsellToCart(item: Crossupsell): Promise<void> {\n if (!props.cartId || addingCrossupsellId) return;\n const productId = getCrossupsellProductId(item);\n if (!productId) return;\n setAddingCrossupsellId(productId);\n const result = await addItem({ product: { productId } as Product, quantity: 1, cartId: props.cartId });\n setAddingCrossupsellId(null);\n if (result.ok && props.afterCartUpdate) {\n props.afterCartUpdate(result.data.cart);\n }\n }\n\n // Mount-only: fetch related crossupsells once we know the cart context.\n useEffect(() => {\n fetchCrossupsells();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Re-sync local quantity/notes when the cart item changes externally —\n // e.g. server-side reconciliation after an optimistic update, or a\n // different item being swapped into the same component instance via\n // parent re-render. Intentional external-state sync.\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setQuantity(props.cartItem.quantity || 1);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setNotes(props.cartItem.notes || '');\n }, [props.cartItem]);\n\n // ── Build the compound-API context value ──────────────────────────────────\n const contextValue: CartItemContextValue = {\n cartItem: props.cartItem,\n resolved: props,\n derived: {\n name: getProductName(),\n sku: getProductSku(),\n imageUrl: getProductImageUrl(),\n productUrl: getProductUrl(),\n isBundle: isBundleItem(),\n bundleName: getBundleName(),\n bundleLeaderName: getBundleLeaderName(),\n bundleLeaderPrice: getBundleLeaderPrice(),\n bundleNonLeaders: getBundleNonLeaders(),\n surcharges: getSurcharges(),\n inventory: getInventory(),\n formattedPrice: getFormattedPrice(),\n bundlePrice: getBundlePrice(),\n useTax: props.includeTax ?? false,\n language: props.language ?? 'NL',\n currency: props.currency ?? '€',\n quantity,\n minQuantity,\n step,\n },\n state: {\n notes,\n loading,\n deleting,\n crossupsells,\n visibleCrossupsells: getVisibleCrossupsells(),\n addingCrossupsellId,\n },\n helpers: {\n getBundleItemName,\n getBundleItemPrice,\n getCrossupsellName,\n getCrossupsellImageUrl,\n getCrossupsellUrl,\n getCrossupsellPrice,\n getCrossupsellProductId,\n },\n handlers: {\n onQuantityChange: handleQuantityChange,\n onNoteChange: handleNoteChange,\n onDelete: handleDelete,\n onTitleClick: (e) => props.onTitleClick?.(e, props.cartItem),\n onCrossupsellClick: (item, e) => {\n if (props.onCrossupsellClick) {\n e.preventDefault();\n props.onCrossupsellClick(\n (item.productTo || item.clusterTo) as Product | Cluster\n );\n }\n },\n onAddCrossupsellToCart: (item) => {\n handleAddCrossupsellToCart(item);\n },\n },\n };\n\n // Compound mode: caller passes children → render their tree wrapped in the\n // root container + provider, skipping the legacy monolithic layout.\n if (rawProps.children !== undefined) {\n return (\n <CartItemContext.Provider value={contextValue}>\n <div\n className={`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? '' : 'bg-card p-4 rounded-container shadow-sm border border-border'} ${props.className || ''}`}\n data-bundle={isBundleItem() ? 'true' : 'false'}\n data-loading={loading ? 'true' : 'false'}\n >\n {rawProps.children}\n </div>\n </CartItemContext.Provider>\n );\n }\n\n // Legacy monolithic mode: composes the same subcomponents internally so the\n // DOM (when no children are passed) is byte-identical to today. Single\n // rendering path — both modes flow through the subcomponents below.\n return (\n <CartItemContext.Provider value={contextValue}>\n <div\n className={`propeller-cart-item flex flex-wrap md:flex-nowrap items-start gap-4 ${props.cardFrame === false ? '' : 'bg-card p-4 rounded-container shadow-sm border border-border'} ${props.className || ''}`}\n data-bundle={isBundleItem() ? 'true' : 'false'}\n data-loading={loading ? 'true' : 'false'}\n >\n {/* `items-start` on the root anchors the image / body / footer to the\n top of the row. With `items-center` (previous default), the image\n and footer drifted to the vertical middle of a tall body — which\n looks broken when cross-sells push the body to 200px+ while the\n image stays at 96px. The footer (price + qty + delete) gets a\n small md:mt-1 below to optically align with the title baseline\n rather than the very edge of the card. */}\n <CartItemImage />\n <div className=\"propeller-cart-item__body flex-1 min-w-0\">\n <CartItemSku />\n <CartItemTitle />\n <CartItemSurcharges />\n <CartItemStock />\n <CartItemBundleItems />\n <CartItemChildItems />\n <CartItemNotes />\n <CartItemCrossupsells />\n </div>\n <div className=\"propeller-cart-item__footer w-full md:w-auto md:mt-1 flex items-center gap-3 md:gap-4 border-t md:border-t-0 border-border-subtle pt-2 md:pt-0 flex-shrink-0\">\n <CartItemPrice />\n <CartItemQuantity />\n {loading ? (\n <span className=\"propeller-cart-item__updating text-xs text-foreground-subtle\">{getLabel(props.labels, 'updating', 'Updating...')}</span>\n ) : null}\n <CartItemDelete />\n </div>\n </div>\n </CartItemContext.Provider>\n );\n}\n\n// ── Compound subcomponents (the partner-facing surface) ────────────────────\n// Each subcomponent reads shared data via useCartItemContext(). Defaults\n// match the legacy monolithic markup verbatim so the rendered DOM is\n// byte-identical when no children are passed to <CartItem>.\n\n/** Product / placeholder image. */\nfunction CartItemImage(props: { className?: string } = {}) {\n const { derived } = useCartItemContext();\n return (\n <div className={props.className ?? 'propeller-cart-item__media w-20 h-20 md:w-24 md:h-24 flex-shrink-0 bg-surface-hover flex items-center justify-center overflow-hidden relative rounded-control'}>\n {!!derived.imageUrl ? (\n <img\n className=\"propeller-cart-item__image w-full h-full object-contain p-1\"\n src={derived.imageUrl}\n alt={derived.name}\n />\n ) : null}\n {!derived.imageUrl ? (\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"propeller-cart-item__image-placeholder w-8 h-8 text-foreground-subtle\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z\"\n />\n </svg>\n ) : null}\n </div>\n );\n}\n\n/** SKU line. Null for bundle items, when showSku is false, or when the\n * product has no SKU. */\nfunction CartItemSku(props: { className?: string } = {}) {\n const { derived, resolved } = useCartItemContext();\n if (derived.isBundle) return null;\n if (resolved.showSku === false) return null;\n if (!derived.sku) return null;\n return (\n <p className={props.className ?? 'propeller-cart-item__sku font-mono text-xs text-foreground-subtle'}>\n {derived.sku}\n </p>\n );\n}\n\n/** Title line — bundle name (plain span) or product name (link / span by\n * titleLinkable). */\nfunction CartItemTitle(props: { className?: string } = {}) {\n const { derived, resolved, handlers } = useCartItemContext();\n if (derived.isBundle) {\n return (\n <span className={props.className ?? 'propeller-cart-item__title font-semibold text-sm md:text-base text-foreground line-clamp-2'}>\n {derived.bundleName}\n </span>\n );\n }\n if (resolved.titleLinkable !== false) {\n return (\n <a\n className={props.className ?? 'propeller-cart-item__title font-semibold text-sm md:text-base text-foreground hover:text-primary transition-colors line-clamp-2'}\n href={derived.productUrl}\n onClick={handlers.onTitleClick}\n >\n {derived.name}\n </a>\n );\n }\n return (\n <span className={props.className ?? 'propeller-cart-item__title font-semibold text-sm md:text-base text-foreground line-clamp-2'}>\n {derived.name}\n </span>\n );\n}\n\n/** Surcharges list (with injectable surchargesComponent override). Null for\n * bundles or when no surcharges. */\nfunction CartItemSurcharges(props: { className?: string } = {}) {\n const { cartItem, derived, resolved } = useCartItemContext();\n if (derived.isBundle) return null;\n const SurchargesImpl = resolved.surchargesComponent;\n if (SurchargesImpl) {\n return (\n <SurchargesImpl\n cartItem={cartItem}\n includeTax={resolved.includeTax}\n labels={resolved.labels}\n />\n );\n }\n if (derived.surcharges.length === 0) return null;\n return (\n <div className={props.className ?? 'propeller-cart-item__surcharges mt-1 text-xs text-muted-foreground'}>\n <span className=\"font-medium\">{getLabel(resolved.labels, 'surcharges', 'Additional surcharges:')}</span>\n <ul className=\"propeller-cart-item__surcharges-list mt-0.5\">\n {derived.surcharges.map((line, idx) => (\n <li key={idx} className=\"propeller-cart-item__surcharge\">{line}</li>\n ))}\n </ul>\n </div>\n );\n}\n\n/** Stock indicator (with injectable stockComponent override). Null unless\n * showStockComponent is true and the product has an inventory. */\nfunction CartItemStock(props: { className?: string } = {}) {\n const { derived, resolved } = useCartItemContext();\n if (resolved.showStockComponent !== true) return null;\n if (!derived.inventory) return null;\n const StockImpl = resolved.stockComponent ?? DefaultItemStockImpl;\n return (\n <div className={props.className ?? 'mt-1'}>\n <StockImpl\n inventory={derived.inventory}\n showStock\n showAvailability\n labels={resolved.labels}\n />\n </div>\n );\n}\n\n/** Bundle leader + non-leader items list. Null when the cart item is not a\n * bundle. */\nfunction CartItemBundleItems(props: { className?: string } = {}) {\n const { derived, helpers } = useCartItemContext();\n if (!derived.isBundle) return null;\n return (\n <div className={props.className ?? 'propeller-cart-item__bundle mt-3 space-y-1.5 border-l-2 border-border pl-3'}>\n {!!derived.bundleLeaderName ? (\n <div className=\"propeller-cart-item__bundle-leader flex flex-wrap gap-x-2 text-sm text-muted-foreground\">\n <span className=\"font-semibold text-foreground\">{derived.bundleLeaderName}</span>\n {!!derived.bundleLeaderPrice ? (\n <>\n <div className=\"flex-1 border-b border-dotted border-border mx-1 mb-1\" />\n <span className=\"font-semibold text-foreground\">{derived.bundleLeaderPrice}</span>\n </>\n ) : null}\n </div>\n ) : null}\n {derived.bundleNonLeaders?.map((bundleItem, idx) => (\n <div className=\"propeller-cart-item__bundle-item flex flex-wrap gap-x-2 text-sm text-muted-foreground\" key={idx}>\n <span className=\"font-medium\">{helpers.getBundleItemName(bundleItem)}</span>\n {!!helpers.getBundleItemPrice(bundleItem) ? (\n <>\n <div className=\"flex-1 border-b border-dotted border-border mx-1 mb-1\" />\n <span className=\"font-semibold text-foreground\">\n {helpers.getBundleItemPrice(bundleItem)}\n </span>\n </>\n ) : null}\n </div>\n ))}\n </div>\n );\n}\n\n/** Cluster child items (options) list. Null unless the cart item is a\n * cluster line with children. */\nfunction CartItemChildItems(props: { className?: string } = {}) {\n const { cartItem, resolved } = useCartItemContext();\n if (!cartItem.clusterId) return null;\n if (!cartItem.childItems || cartItem.childItems.length === 0) return null;\n return (\n <div className={props.className ?? 'propeller-cart-item__options mt-3 space-y-1.5 border-l-2 border-border pl-3'}>\n <p className=\"propeller-cart-item__options-label text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-1\">\n {getLabel(resolved.labels, 'includedOptions', 'Included Options:')}\n </p>\n {(cartItem.childItems || []).map((child, idx) => (\n <div className=\"propeller-cart-item__option flex flex-wrap gap-x-2 text-sm text-muted-foreground\" key={idx}>\n <span className=\"font-medium\">{child.product.names?.[0]?.value || 'Option'}</span>\n <span className=\"text-foreground-subtle hidden sm:inline\">-</span>\n <span className=\"text-foreground-subtle text-xs self-center\">{child.product.sku}</span>\n <div className=\"flex-1 border-b border-dotted border-border mx-1 mb-1\" />\n <span className=\"font-semibold text-foreground\">{formatPrice(child.totalSum, { symbol: resolved.currency ?? '€' })}</span>\n </div>\n ))}\n </div>\n );\n}\n\n/** Notes textarea. Null unless showCartItemNotesField is true. */\nfunction CartItemNotes(props: { className?: string } = {}) {\n const { resolved, state, handlers } = useCartItemContext();\n if (resolved.showCartItemNotesField !== true) return null;\n return (\n <div className={props.className ?? 'propeller-cart-item__notes mt-3'}>\n <label className=\"propeller-cart-item__notes-label text-xs font-medium text-muted-foreground block mb-1\">\n {getLabel(resolved.labels, 'notes', 'Notes')}\n </label>\n <textarea\n className=\"propeller-cart-item__notes-input w-full text-sm border border-input rounded-control px-3 py-2 focus:ring-2 focus:ring-secondary focus:border-transparent resize-none\"\n value={state.notes}\n onChange={(e) => handlers.onNoteChange(e.target.value)}\n placeholder={getLabel(resolved.labels, 'notesPlaceholder', 'Add a note for this item...')}\n rows={2}\n />\n </div>\n );\n}\n\n/** Cross-sell / upsell list. Null when there are no visible crossupsells\n * (also gated by showCrossupsells on the parent, since that's what\n * populates the state). */\nfunction CartItemCrossupsells(props: { className?: string } = {}) {\n const { resolved, state, helpers, handlers } = useCartItemContext();\n if (state.visibleCrossupsells.length === 0) return null;\n return (\n <div className={props.className ?? 'propeller-cart-item__crossupsells mt-3 pt-3 border-t border-border'}>\n <p className=\"propeller-cart-item__crossupsells-label text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2\">\n {getLabel(resolved.labels, 'crossupsellTitle', 'You might also like')}\n </p>\n <div className=\"flex flex-col gap-2\">\n {state.visibleCrossupsells?.map((item, idx) => (\n <div\n className=\"propeller-cart-item__crossupsell flex items-center gap-2 p-2 rounded-control border border-border hover:border-primary/30 hover:bg-surface-hover transition-colors\"\n key={idx}\n >\n <a\n className=\"propeller-cart-item__crossupsell-link flex items-center gap-2 flex-1 min-w-0\"\n href={helpers.getCrossupsellUrl(item)}\n onClick={(e) => handlers.onCrossupsellClick(item, e)}\n >\n {!!helpers.getCrossupsellImageUrl(item) ? (\n <img\n className=\"propeller-cart-item__crossupsell-image w-10 h-10 object-contain rounded flex-shrink-0\"\n src={helpers.getCrossupsellImageUrl(item)}\n alt={helpers.getCrossupsellName(item)}\n />\n ) : null}\n <div className=\"min-w-0\">\n <span className=\"propeller-cart-item__crossupsell-title text-xs font-medium text-muted-foreground line-clamp-2\">\n {helpers.getCrossupsellName(item)}\n </span>\n {!!helpers.getCrossupsellPrice(item) ? (\n <span className=\"propeller-cart-item__crossupsell-price text-xs font-bold text-foreground block\">\n {helpers.getCrossupsellPrice(item)}\n </span>\n ) : null}\n </div>\n </a>\n <button\n type=\"button\"\n className=\"propeller-cart-item__crossupsell-btn flex-shrink-0 inline-flex items-center justify-center h-7 w-7 rounded-control bg-primary text-primary-foreground hover:bg-primary/80 transition-colors disabled:opacity-50\"\n title={getLabel(resolved.labels, 'addToCart', 'Add to cart')}\n disabled={state.addingCrossupsellId === helpers.getCrossupsellProductId(item)}\n onClick={(e) => {\n e.stopPropagation();\n handlers.onAddCrossupsellToCart(item);\n }}\n >\n {state.addingCrossupsellId === helpers.getCrossupsellProductId(item) ? (\n <div className=\"w-3.5 h-3.5 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin\" />\n ) : null}\n {state.addingCrossupsellId !== helpers.getCrossupsellProductId(item) ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"21\" r=\"1\" />\n <circle cx=\"19\" cy=\"21\" r=\"1\" />\n <path d=\"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\" />\n </svg>\n ) : null}\n </button>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\n/** Price line — bundle price (plain) or product price (with injectable\n * priceComponent override). Null for bundles without a bundle price. */\nfunction CartItemPrice(props: { className?: string } = {}) {\n const { cartItem, derived, resolved } = useCartItemContext();\n if (derived.isBundle) {\n if (!derived.bundlePrice) return null;\n return (\n <p className={props.className ?? 'propeller-cart-item__price text-sm md:text-base font-bold text-foreground whitespace-nowrap'}>\n {derived.bundlePrice}\n </p>\n );\n }\n const PriceImpl = resolved.priceComponent;\n if (PriceImpl) {\n // Contract-vs-data note: the default path shows the line-item total\n // (`cartItem.totalSum`/`totalSumNet`). The injected component receives\n // the closest contract match — the product's catalog price\n // (`cartItem.product.price`). The injected price will not include\n // line-level surcharges or totals.\n return (\n <p className={props.className ?? 'propeller-cart-item__price text-sm md:text-base font-bold text-foreground whitespace-nowrap'}>\n <PriceImpl\n price={cartItem?.product?.price}\n includeTax={resolved.includeTax}\n currency={resolved.currency}\n labels={resolved.labels}\n />\n </p>\n );\n }\n return (\n <p className={props.className ?? 'propeller-cart-item__price text-sm md:text-base font-bold text-foreground whitespace-nowrap'}>\n {derived.formattedPrice}\n </p>\n );\n}\n\n/** Quantity control — read-only text, stepper (default), or bare input. */\nfunction CartItemQuantity(props: { className?: string } = {}) {\n const { derived, resolved, state, handlers } = useCartItemContext();\n if (resolved.readOnlyQuantity) {\n return (\n <div className={props.className ?? 'propeller-cart-item__quantity-readonly text-sm text-foreground-subtle'}>\n {getLabel(resolved.labels, 'qtyPrefix', 'Qty:')} {derived.quantity}\n </div>\n );\n }\n if (resolved.enableIncrementDecrement !== false) {\n return (\n <div className={props.className ?? 'propeller-cart-item__stepper flex items-center border border-input rounded-control bg-card h-9'}>\n <button\n type=\"button\"\n className=\"propeller-cart-item__decrement px-2.5 h-full text-muted-foreground hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors rounded-l-control select-none\"\n onClick={() => handlers.onQuantityChange(derived.quantity - derived.step)}\n disabled={derived.quantity <= derived.minQuantity || state.loading}\n >\n -\n </button>\n <input\n type=\"number\"\n className=\"propeller-cart-item__quantity w-10 text-center text-sm bg-transparent border-x border-input h-full focus:ring-0 focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none\"\n min={derived.minQuantity}\n step={derived.step}\n value={derived.quantity}\n onChange={(e) => {\n const val = parseInt(e.target.value, 10);\n if (!isNaN(val) && val >= derived.minQuantity) {\n // Snap to the nearest valid min + step multiple.\n handlers.onQuantityChange(Math.round((val - derived.minQuantity) / derived.step) * derived.step + derived.minQuantity);\n }\n }}\n />\n <button\n type=\"button\"\n className=\"propeller-cart-item__increment px-2.5 h-full text-muted-foreground hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed transition-colors rounded-r-control select-none\"\n onClick={() => handlers.onQuantityChange(derived.quantity + derived.step)}\n disabled={state.loading}\n >\n +\n </button>\n </div>\n );\n }\n return (\n <input\n type=\"number\"\n className={props.className ?? 'propeller-cart-item__quantity w-14 h-9 text-center text-sm border border-input rounded-control focus:ring-2 focus:ring-primary focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none'}\n min={derived.minQuantity}\n step={derived.step}\n value={derived.quantity}\n onChange={(e) => {\n const val = parseInt(e.target.value, 10);\n if (!isNaN(val) && val >= derived.minQuantity) {\n handlers.onQuantityChange(Math.round((val - derived.minQuantity) / derived.step) * derived.step + derived.minQuantity);\n }\n }}\n />\n );\n}\n\n/** Delete button. Null when showDelete is false. */\nfunction CartItemDelete(props: { className?: string } = {}) {\n const { resolved, state, handlers } = useCartItemContext();\n if (resolved.showDelete === false) return null;\n return (\n <button\n type=\"button\"\n className={props.className ?? 'propeller-cart-item__delete h-8 w-8 p-0 ml-auto inline-flex items-center justify-center rounded-control text-foreground-subtle hover:text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50'}\n onClick={() => handlers.onDelete()}\n disabled={state.deleting}\n >\n {state.deleting ? (\n <div className=\"w-4 h-4 border-2 border-foreground-subtle border-t-transparent rounded-full animate-spin\" />\n ) : null}\n {!state.deleting ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 6h18\" />\n <path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n </svg>\n ) : null}\n </button>\n );\n}\n\n// ── Static attachments (compound API surface) ───────────────────────────────\n\ntype CartItemComponent = typeof CartItem & {\n Image: typeof CartItemImage;\n Title: typeof CartItemTitle;\n Sku: typeof CartItemSku;\n Surcharges: typeof CartItemSurcharges;\n Stock: typeof CartItemStock;\n BundleItems: typeof CartItemBundleItems;\n ChildItems: typeof CartItemChildItems;\n Notes: typeof CartItemNotes;\n Crossupsells: typeof CartItemCrossupsells;\n Price: typeof CartItemPrice;\n Quantity: typeof CartItemQuantity;\n Delete: typeof CartItemDelete;\n};\n\nconst CartItemExport = CartItem as CartItemComponent;\nCartItemExport.Image = CartItemImage;\nCartItemExport.Title = CartItemTitle;\nCartItemExport.Sku = CartItemSku;\nCartItemExport.Surcharges = CartItemSurcharges;\nCartItemExport.Stock = CartItemStock;\nCartItemExport.BundleItems = CartItemBundleItems;\nCartItemExport.ChildItems = CartItemChildItems;\nCartItemExport.Notes = CartItemNotes;\nCartItemExport.Crossupsells = CartItemCrossupsells;\nCartItemExport.Price = CartItemPrice;\nCartItemExport.Quantity = CartItemQuantity;\nCartItemExport.Delete = CartItemDelete;\n\nexport default CartItemExport;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Cart, CartMainItem, Contact, Customer, GraphQLClient, PurchaseAuthorizationConfig, PurchaseRole } from '@propeller-commerce/propeller-sdk-v2';\nimport { useCart } from '../composables/react/useCart';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\nimport DefaultCartBonusItemsImpl from './CartBonusItems';\nimport CartItem from './CartItem';\n\nexport interface CartIconAndSidebarProps {\n /**\n * Shopping cart that this component will operate with.\n * Should be passed from a cart state.\n */\n cart: Cart;\n\n /**\n * Icon for the cart icon in header.\n * @default 'default-cart-icon'\n */\n icon?: string;\n\n /**\n * Shows item count badge on the cart icon.\n * @default true\n */\n showBadge?: boolean;\n\n /**\n * Shows the totals of the shopping cart beneath the icon when hovered.\n * @default false\n */\n showTotals?: boolean;\n\n /**\n * Show cart sidebar at the right side of the screen when cart icon is clicked.\n * If false it will fire onCartIconClick() instead.\n * @default true\n */\n showCartSidebarOnClick?: boolean;\n\n /**\n * Fires a click event when showCartSidebarOnClick is set to false.\n */\n onCartIconClick?: (cart: Cart) => void;\n\n /**\n * Title for the shopping cart sidebar.\n * @default 'Shopping cart'\n */\n cartSidebarTitle?: string;\n\n /**\n * Show checkout button in cart sidebar for immediate checkout.\n * @default true\n */\n cartCheckoutButton?: boolean;\n\n /**\n * Fires a click event when the checkout button in the sidebar is clicked.\n */\n onCheckoutButtonClick?: (cart: Cart) => void;\n\n /**\n * Show shopping cart page button in cart sidebar.\n * @default true\n */\n cartPageButton?: boolean;\n\n /**\n * Fires a click event when the shopping cart button in the sidebar is clicked.\n */\n onCartPageButtonClick?: (cart: Cart) => void;\n\n /**\n * Labels for the component.\n * Available keys: cartIconLabel, totalLabel, itemsLabel, emptyCart,\n * continueShopping, qty, total, checkoutButton, cartPageButton, closeLabel\n */\n labels?: Record<string, string>;\n\n /** Logged-in user — used to determine purchaser role and authorization limit */\n user?: Contact | Customer;\n\n /** Configuration object passed to the component */\n configuration?: any;\n\n /** Language code passed to CartService operations. Defaults to 'en'. */\n language?: string;\n\n /** Active company ID — used to look up the user's PAC for this company */\n companyId?: number;\n\n /** Callback fired when \"Request a Quote\" is clicked in the sidebar. Only shown for contacts when prop is provided. */\n onRequestQuoteClick?: (cart: Cart) => void;\n\n /** GraphQL client — used for internal CartService calls (e.g. purchase authorization) */\n graphqlClient?: GraphQLClient;\n\n /** Override the internal request purchase authorization call */\n onRequestAuthorization?: (cart: Cart) => void;\n\n /** Fires after a successful purchase authorization request with the updated cart */\n afterRequestAuthorization?: (cart: Cart) => void;\n\n /** Error handler for authorization request failures */\n onError?: (error: Error) => void;\n\n /** * Additional class name for the shopping cart icon. */\n iconClassName?: string;\n\n /** * Additional class name for the shopping cart sidebar. */\n sidebarClassName?: string;\n\n // ───── Extension API ─────\n /**\n * Replaces each cart row rendered inside the drawer with a custom CartItem.\n * The drawer composes CartItem with cardFrame=false, showDelete=false,\n * readOnlyQuantity, and onTitleClick wired to close the sidebar — any\n * consumer-supplied replacement receives these variant props plus the\n * cart data.\n */\n cartItemComponent?: React.ComponentType<import('./CartItem').CartItemProps>;\n // Replaces the embedded <CartBonusItems> bonus-line block. Active.\n cartBonusItemsComponent?: React.ComponentType<import('./CartBonusItems').CartBonusItemsProps>;\n}\n\n// ── Pure helpers (module scope — created once, not per render) ──────────────────\n\n/** Finds the user's PURCHASER PAC for the active company (shared by both\n * checkout / request-authorization button decisions). */\nfunction findPurchaserPAC(\n user: Contact | Customer | undefined,\n companyId: number | undefined\n): PurchaseAuthorizationConfig | undefined {\n if (!user || !('contactId' in user) || !companyId) return undefined;\n const items: PurchaseAuthorizationConfig[] =\n (user as Contact).purchaseAuthorizationConfigs?.items ?? [];\n return items.find(\n (pac) => pac.purchaseRole === PurchaseRole.PURCHASER && pac.company?.companyId === companyId\n );\n}\n\n/**\n * Header cart control: a cart icon with an item-count badge and optional\n * hover totals, plus a slide-in sidebar listing cart items with checkout,\n * view-cart, request-quote and purchase-authorization actions.\n *\n * @remarks Uses {@link useCart} for the purchase-authorization request.\n */\nfunction CartIconAndSidebar(rawProps: CartIconAndSidebarProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // Slot resolution: explicit prop > default.\n const CartBonusItemsImpl = props.cartBonusItemsComponent ?? DefaultCartBonusItemsImpl;\n const CartItemImpl = props.cartItemComponent ?? CartItem;\n const currencySymbol = props.currency ?? '€';\n const money = (value: number | null | undefined): string =>\n value === undefined || value === null ? '' : formatPrice(value, { symbol: currencySymbol });\n // --- composable ---\n const { requestAuthorization } = useCart({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n cartId: props.cart?.cartId,\n companyId: props.companyId,\n });\n\n const [isMounted, setIsMounted] = useState(false);\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [requestLoading, setRequestLoading] = useState(false);\n\n // Cart-derived values — computed once per render (previously getItems() /\n // getTotalItems() were redefined every render and each called ~6× in the JSX,\n // re-filtering / re-summing the cart on every read).\n const items = (props.cart?.items ?? []).filter(\n (item: CartMainItem) => item && item.product\n );\n const totalItems = (props.cart?.items ?? []).reduce(\n (sum: number, item: CartMainItem) => sum + item.quantity,\n 0\n );\n const totalNet = props.cart?.total?.totalNet;\n const totalPrice = totalNet === undefined || totalNet === null ? money(0) : money(totalNet);\n const sidebarTitle =\n props.cartSidebarTitle || props.labels?.['cartSidebarTitle'] || 'Shopping cart';\n\n // Purchase-authorization gate (shared PAC lookup, divergent only on the\n // limit comparison).\n const purchaserPAC = findPurchaserPAC(props.user, props.companyId);\n const totalGross = props.cart?.total?.totalGross ?? 0;\n const overLimit = !!purchaserPAC && totalGross > (purchaserPAC.authorizationLimit ?? 0);\n\n const showCheckoutButton =\n props.cartCheckoutButton === false\n ? false\n : !props.user || !('contactId' in props.user) || !props.companyId || !purchaserPAC\n ? true\n : !overLimit;\n const showRequestAuthorizationButton = !!purchaserPAC && overLimit;\n\n function handleIconClick(): void {\n if (props.showCartSidebarOnClick !== false) {\n setSidebarOpen(true);\n } else {\n if (props.onCartIconClick) props.onCartIconClick(props.cart);\n }\n }\n\n function closeSidebar(): void {\n setSidebarOpen(false);\n }\n\n function handleCheckoutClick(): void {\n setSidebarOpen(false);\n if (props.onCheckoutButtonClick) props.onCheckoutButtonClick(props.cart);\n }\n\n function handleCartPageClick(): void {\n setSidebarOpen(false);\n if (props.onCartPageButtonClick) props.onCartPageButtonClick(props.cart);\n }\n\n async function handleRequestAuthorizationClick(): Promise<void> {\n setRequestLoading(true);\n try {\n let updatedCart: Cart = props.cart;\n if (props.onRequestAuthorization) {\n props.onRequestAuthorization(props.cart);\n } else {\n const result = await requestAuthorization();\n if (!result.ok) throw new Error(result.error || 'Failed to request authorization');\n updatedCart = props.cart;\n }\n if (props.afterRequestAuthorization) {\n props.afterRequestAuthorization(updatedCart);\n }\n } catch (err: unknown) {\n if (props.onError) {\n props.onError(err instanceof Error ? err : new Error(String(err)));\n }\n } finally {\n setRequestLoading(false);\n }\n }\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n return (\n <div className=\"propeller-cart-icon relative\" data-sidebar-open={sidebarOpen ? 'true' : 'false'}>\n <div\n className=\"propeller-cart-icon__trigger-wrapper relative\"\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <button\n type=\"button\"\n onClick={() => handleIconClick()}\n aria-label={getLabel(props.labels, 'cartIconLabel', 'Shopping cart')}\n className={`propeller-cart-icon__trigger relative inline-flex items-center justify-center p-2 rounded-control transition-colors text-foreground${props.iconClassName ? ' ' + props.iconClassName : ''}`}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-cart-icon__icon w-6 h-6\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007z\"\n />\n </svg>\n {isMounted && props.showBadge !== false && totalItems > 0 ? (\n <span className=\"propeller-cart-icon__badge absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center rounded-full bg-primary text-primary-foreground text-[10px] font-bold pointer-events-none\">\n {totalItems}\n </span>\n ) : null}\n </button>\n {props.showTotals && isHovered && totalItems > 0 ? (\n <div className=\"propeller-cart-icon__popover absolute top-full right-0 mt-1 z-40 bg-popover border border-border rounded-container shadow-lg px-3 py-2 min-w-[140px] text-sm whitespace-nowrap\">\n <div className=\"flex justify-between gap-4\">\n <span className=\"propeller-cart-icon__popover-label text-muted-foreground\">\n {getLabel(props.labels, 'totalLabel', 'Total')}\n </span>\n <span className=\"propeller-cart-icon__popover-total font-semibold text-foreground\">\n {totalPrice}\n </span>\n </div>\n <div className=\"propeller-cart-icon__popover-count text-xs text-foreground-subtle mt-0.5\">\n {totalItems}\n {getLabel(props.labels, 'itemsLabel', 'item(s)')}\n </div>\n </div>\n ) : null}\n </div>\n {sidebarOpen ? (\n <div\n aria-hidden=\"true\"\n className=\"propeller-cart-icon__backdrop fixed inset-0 bg-foreground/80 backdrop-blur-sm z-[70]\"\n onClick={() => closeSidebar()}\n />\n ) : null}\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={sidebarTitle}\n data-open={sidebarOpen ? 'true' : 'false'}\n className={`propeller-cart-icon__sidebar fixed inset-y-0 right-0 z-[70] w-full max-w-md bg-card shadow-2xl transform transition-transform duration-300 ease-in-out border-l border-border${sidebarOpen ? ' translate-x-0' : ' translate-x-full'}${props.sidebarClassName ? ' ' + props.sidebarClassName : ''}`}\n >\n <div className=\"flex flex-col h-full\">\n {isMounted ? (\n <>\n <div className=\"propeller-cart-icon__sidebar-header flex items-center justify-between px-5 py-4 border-b border-border\">\n <div className=\"flex items-center gap-2\">\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"w-5 h-5 text-muted-foreground\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007z\"\n />\n </svg>\n <h2 className=\"propeller-cart-icon__sidebar-title text-base font-semibold text-foreground\">\n {sidebarTitle}\n </h2>\n <span className=\"propeller-cart-icon__sidebar-count inline-flex items-center justify-center h-5 min-w-[20px] px-1.5 rounded-full bg-secondary/10 text-secondary text-xs font-bold\">\n {totalItems}\n </span>\n </div>\n <button\n type=\"button\"\n className=\"propeller-cart-icon__sidebar-close p-1 rounded-control text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors\"\n onClick={() => closeSidebar()}\n aria-label={getLabel(props.labels, 'closeLabel', 'Close')}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"w-5 h-5\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>{' '}\n <div className=\"propeller-cart-icon__sidebar-body flex-1 overflow-y-auto px-5 py-4 space-y-4\">\n {items.length === 0 ? (\n <div className=\"propeller-cart-icon__empty flex flex-col items-center justify-center h-full text-center space-y-4 py-16\">\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-cart-icon__empty-icon w-12 h-12 text-foreground-subtle\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15.75 10.5V6a3.75 3.75 0 10-7.5 0v4.5m11.356-1.993l1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 01-1.12-1.243l1.264-12A1.125 1.125 0 015.513 7.5h12.974c.576 0 1.059.435 1.119 1.007z\"\n />\n </svg>\n <p className=\"propeller-cart-icon__empty-message text-sm text-muted-foreground\">\n {getLabel(props.labels, 'emptyCart', 'Your cart is empty.')}\n </p>\n <button\n type=\"button\"\n className=\"propeller-cart-icon__empty-action text-sm text-secondary hover:underline\"\n onClick={() => closeSidebar()}\n >\n {getLabel(props.labels, 'continueShopping', 'Continue Shopping')}\n </button>\n </div>\n ) : (\n <>\n {items.map((item) => (\n <CartItemImpl\n key={item.itemId}\n cartItem={item}\n cartId={props.cart?.cartId ?? ''}\n graphqlClient={props.graphqlClient}\n user={props.user}\n language={props.language}\n configuration={props.configuration}\n companyId={props.companyId}\n cardFrame={false}\n showDelete={false}\n readOnlyQuantity\n onTitleClick={() => closeSidebar()}\n showCartItemNotesField={false}\n showCrossupsells={false}\n showStockComponent={false}\n includeTax={false}\n className=\"propeller-cart-icon__item\"\n >\n <CartItem.Image className=\"w-20 h-20 flex-shrink-0 bg-surface-hover rounded-control overflow-hidden border border-border-subtle\" />\n <div className=\"flex-1 min-w-0 flex flex-col justify-between py-1\">\n <div>\n <CartItem.Title className=\"propeller-cart-icon__item-name text-sm font-medium hover:text-primary line-clamp-2\" />\n <CartItem.Sku className=\"text-xs text-foreground-subtle mt-0.5\" />\n <CartItem.BundleItems className=\"mt-1 border-l-2 border-secondary/10 pl-2 space-y-1\" />\n <CartItem.ChildItems className=\"mt-1 border-l-2 border-border-subtle pl-2 space-y-1\" />\n <CartItem.Surcharges className=\"mt-1 text-xs text-foreground-subtle\" />\n </div>\n <div className=\"mt-2 flex items-center justify-between text-sm\">\n <CartItem.Quantity />\n <CartItem.Price className=\"font-semibold\" />\n </div>\n </div>\n </CartItemImpl>\n ))}\n </>\n )}\n {/* Bonus items — free items added via incentives. Read-only.\n `includeTax` is pinned true so totals match the sidebar's\n net (incl-VAT) prices; currency/language resolve from the\n PropellerProvider. */}\n <CartBonusItemsImpl cart={props.cart} includeTax={true} className=\"mt-4\" />\n </div>{' '}\n {items.length > 0 ? (\n <div className=\"propeller-cart-icon__sidebar-footer px-5 py-4 border-t border-border space-y-3 bg-surface-hover\">\n <div className=\"propeller-cart-icon__total-row flex justify-between items-center\">\n <span className=\"propeller-cart-icon__total-label text-sm font-medium text-muted-foreground\">\n {getLabel(props.labels, 'total', 'Total')}\n </span>\n <span className=\"propeller-cart-icon__total-value text-base font-bold text-foreground\">\n {totalPrice}\n </span>\n </div>\n {showCheckoutButton && !showRequestAuthorizationButton ? (\n <button\n type=\"button\"\n className=\"propeller-cart-icon__checkout-btn w-full inline-flex justify-center items-center px-4 py-2.5 rounded-control bg-secondary text-secondary-foreground text-sm font-medium hover:bg-secondary/90 transition-colors\"\n onClick={() => handleCheckoutClick()}\n >\n {getLabel(props.labels, 'checkoutButton', 'Checkout')}\n </button>\n ) : null}\n {showRequestAuthorizationButton ? (\n <button\n type=\"button\"\n className=\"propeller-cart-icon__authorization-btn w-full inline-flex justify-center items-center px-4 py-2.5 rounded-control bg-secondary text-secondary-foreground text-sm font-medium hover:bg-secondary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\"\n onClick={() => handleRequestAuthorizationClick()}\n disabled={requestLoading}\n >\n {requestLoading\n ? getLabel(props.labels, 'requestingAuthorization', 'Requesting...')\n : getLabel(\n props.labels,\n 'requestAuthorizationButton',\n 'Request Authorization'\n )}\n </button>\n ) : null}\n {!showRequestAuthorizationButton &&\n !!props.onRequestQuoteClick &&\n !!props.user &&\n 'contactId' in props.user ? (\n <button\n type=\"button\"\n className=\"propeller-cart-icon__quote-btn w-full inline-flex justify-center items-center px-4 py-2.5 rounded-control border border-secondary bg-card text-secondary text-sm font-medium hover:bg-secondary/5 transition-colors\"\n onClick={() => {\n closeSidebar();\n if (props.onRequestQuoteClick) props.onRequestQuoteClick(props.cart);\n }}\n >\n {getLabel(props.labels, 'requestQuoteButton', 'Request a Quote')}\n </button>\n ) : null}\n {props.cartPageButton !== false ? (\n <button\n type=\"button\"\n className=\"propeller-cart-icon__view-cart-btn w-full inline-flex justify-center items-center px-4 py-2.5 rounded-control border border-input bg-card text-foreground text-sm font-medium hover:bg-surface-hover transition-colors\"\n onClick={() => handleCartPageClick()}\n >\n {getLabel(props.labels, 'cartPageButton', 'View Cart Details')}\n </button>\n ) : null}\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n </div>\n </div>\n );\n}\nexport default CartIconAndSidebar;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Cart, CartAddress, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getCountryName as _getCountryName } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface CartOverviewProps {\n /** GraphQL client for the Propeller SDK. Optional — currently unused internally; kept for API/Vue parity. */\n graphqlClient?: GraphQLClient;\n\n /** Shopping cart object from which the cart overview will be displayed */\n cart: Cart;\n\n /** The CSS class for the cart overview container */\n overviewContainerClass?: string;\n\n /** Title of the cart overview */\n title?: string;\n\n /** Labels for the cart overview form fields and buttons */\n labels?: Record<string, string>;\n\n /** Show the notes field for the cart */\n showNotes?: boolean;\n\n /** Show the reference field for the cart */\n showReference?: boolean;\n\n /** Show the terms and conditions acceptance */\n showTermsAndConditions?: boolean;\n\n /** Action when the \"Terms and conditions\" link is clicked */\n onTermsAndConditionsClick?: () => void;\n\n /** Show the \"Purchase\" button for placing an order */\n showPurchaseButton?: boolean;\n\n /** Action when the purchase button is clicked. Receives cart, reference, and notes */\n onPurchaseButtonClick?: (cart: Cart, reference: string, notes: string) => void;\n\n /**\n * Optional list of countries used to resolve ISO codes (e.g. 'NL') to display\n * names (e.g. 'Netherlands') in the address blocks. When omitted, the shared\n * built-in COUNTRIES list is used as a fallback.\n */\n countries?: { code: string; name: string }[];\n}\n/**\n * Final cart review panel: shows invoice/delivery addresses, payment, carrier\n * and delivery date, with optional reference, notes, terms acceptance and a\n * place-order button.\n */\nfunction CartOverview(props: CartOverviewProps) {\n const [reference, setReference] = useState('');\n const [notes, setNotes] = useState('');\n const [termsAccepted, setTermsAccepted] = useState(false);\n const [loading, setLoading] = useState(false);\n const containerClass = props.overviewContainerClass || 'cart-overview';\n const showNotes = props.showNotes !== false;\n const showReference = props.showReference !== false;\n const showTermsAndConditions = props.showTermsAndConditions !== false;\n const showPurchaseButton = props.showPurchaseButton !== false;\n const invoiceAddress: CartAddress | undefined = props.cart?.invoiceAddress;\n const deliveryAddress: CartAddress | undefined = props.cart?.deliveryAddress;\n const getCountryName = (code: string) => _getCountryName(code, props.countries);\n const paymentMethod = props.cart?.paymentData?.method || '';\n const carrierName = props.cart?.postageData?.carrier || '';\n function requestDate(): string {\n const date = props.cart?.postageData?.requestDate;\n if (!date) return '';\n try {\n return new Date(date).toLocaleDateString();\n } catch {\n return date;\n }\n }\n function handleTermsLinkClick(event: React.MouseEvent): void {\n event.preventDefault();\n if (props.onTermsAndConditionsClick) props.onTermsAndConditionsClick();\n }\n const isPurchaseDisabled = (showTermsAndConditions && !termsAccepted) || loading;\n function handlePurchaseClick(): void {\n if (isPurchaseDisabled) return;\n setLoading(true);\n if (props.onPurchaseButtonClick) {\n props.onPurchaseButtonClick(props.cart, reference, notes);\n }\n }\n return (\n <div className={`propeller-cart-overview ${containerClass}`}>\n {props.title ? <h2 className=\"propeller-cart-overview__title text-xl font-bold mb-4\">{props.title}</h2> : null}\n <div className=\"propeller-cart-overview__addresses grid grid-cols-1 md:grid-cols-2 gap-6 pb-5\">\n <div className=\"propeller-cart-overview__address space-y-2\" data-address=\"invoice\">\n <h3 className=\"propeller-cart-overview__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'invoiceAddress', 'Invoice Address')}\n </h3>\n {invoiceAddress && invoiceAddress.street ? (\n <div className=\"text-sm space-y-1\">\n {invoiceAddress.company ? (\n <p className=\"font-medium\">{invoiceAddress.company}</p>\n ) : null}\n <p>\n {[\n invoiceAddress.firstName,\n invoiceAddress.middleName,\n invoiceAddress.lastName,\n ]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[\n invoiceAddress.street,\n invoiceAddress.number,\n invoiceAddress.numberExtension,\n ]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[invoiceAddress.postalCode, invoiceAddress.city].filter(Boolean).join(' ')}\n </p>\n {invoiceAddress.country ? <p>{getCountryName(invoiceAddress.country!)}</p> : null}\n {invoiceAddress.email ? (\n <p className=\"propeller-cart-overview__address-email text-muted-foreground\">{invoiceAddress.email}</p>\n ) : null}\n </div>\n ) : null}\n </div>\n <div className=\"propeller-cart-overview__address space-y-2\" data-address=\"delivery\">\n <h3 className=\"propeller-cart-overview__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'deliveryAddress', 'Delivery Address')}\n </h3>\n {deliveryAddress && deliveryAddress.street ? (\n <div className=\"text-sm space-y-1\">\n {deliveryAddress.company ? (\n <p className=\"font-medium\">{deliveryAddress.company}</p>\n ) : null}\n <p>\n {[\n deliveryAddress.firstName,\n deliveryAddress.middleName,\n deliveryAddress.lastName,\n ]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[\n deliveryAddress.street,\n deliveryAddress.number,\n deliveryAddress.numberExtension,\n ]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[deliveryAddress.postalCode, deliveryAddress.city].filter(Boolean).join(' ')}\n </p>\n {deliveryAddress.country ? <p>{getCountryName(deliveryAddress.country!)}</p> : null}\n {deliveryAddress.email ? (\n <p className=\"propeller-cart-overview__address-email text-muted-foreground\">{deliveryAddress.email}</p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n <div className=\"propeller-cart-overview__info-panel bg-surface-hover p-4 rounded-control border border-border space-y-2 text-sm\">\n {paymentMethod ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'payment', 'Payment:')}</span>\n <span>{paymentMethod}</span>\n </div>\n ) : null}\n {carrierName ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'carrier', 'Carrier:')}</span>\n <span>{carrierName}</span>\n </div>\n ) : null}\n {requestDate() ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'deliveryDate', 'Delivery Date:')}</span>\n <span>{requestDate()}</span>\n </div>\n ) : null}\n </div>\n <div className=\"space-y-4 mt-6\">\n {showReference ? (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {getLabel(props.labels, 'referenceLabel', 'Reference (Optional)')}\n </label>\n <input\n type=\"text\"\n className=\"propeller-cart-overview__input flex w-full rounded-control border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-secondary\"\n value={reference}\n onChange={(event) => setReference(event.target.value.slice(0, 255))}\n placeholder={getLabel(props.labels, 'referencePlaceholder', 'Your reference number')}\n maxLength={255}\n />\n </div>\n ) : null}\n {showNotes ? (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium\">\n {getLabel(props.labels, 'notesLabel', 'Order Notes (Optional)')}\n </label>\n <textarea\n className=\"propeller-cart-overview__textarea flex w-full rounded-control border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-secondary min-h-[80px]\"\n value={notes}\n onChange={(event) => setNotes(event.target.value.slice(0, 255))}\n placeholder={getLabel(props.labels, 'notesPlaceholder', 'Special instructions or comments')}\n maxLength={255}\n />\n </div>\n ) : null}\n {showTermsAndConditions ? (\n <div className=\"flex items-center space-x-2 pt-2\">\n <input\n type=\"checkbox\"\n id=\"cart-overview-terms\"\n className=\"propeller-cart-overview__checkbox h-4 w-4 rounded border-input text-primary focus:ring-primary\"\n checked={termsAccepted}\n onChange={(event) => setTermsAccepted(event.target.checked)}\n />\n <label htmlFor=\"cart-overview-terms\" className=\"text-sm leading-none\">\n {getLabel(props.labels, 'termsPrefix', 'I agree to the')}\n <a\n href=\"#\"\n className=\"text-primary hover:underline font-medium\"\n onClick={handleTermsLinkClick}\n >\n {getLabel(props.labels, 'termsLink', 'Terms and Conditions')}\n </a>\n </label>\n </div>\n ) : null}\n {showPurchaseButton ? (\n <button\n type=\"button\"\n className=\"propeller-cart-overview__submit flex items-center justify-center gap-2 w-full bg-primary text-primary-foreground text-center py-3 rounded-container hover:bg-primary/80 transition font-semibold text-lg disabled:opacity-50 disabled:cursor-not-allowed mt-2\"\n onClick={handlePurchaseClick}\n disabled={isPurchaseDisabled}\n >\n {loading ? (\n <div className=\"propeller-cart-overview__spinner w-5 h-5 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin\" />\n ) : null}\n {loading ? <>{getLabel(props.labels, 'processing', 'Processing...')}</> : null}\n {!loading ? <>{getLabel(props.labels, 'purchaseButton', 'Place Order')}</> : null}\n </button>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport default CartOverview;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Cart, CartPaymethod, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface CartPaymethodsProps {\n /** Shopping cart object from which the payment methods will be displayed */\n cart: Cart;\n\n /** Authenticated user — used for cart creation / lookup. Resolved from `<PropellerProvider>` when not passed explicitly. */\n user?: Contact | Customer | null;\n\n /** The CSS class for the payment methods container */\n paymentsContainerClass?: string;\n\n /** Display the on account payment method for anonymous users */\n showOnAccountForGuests?: boolean;\n\n /** Action when a payment method is selected */\n onPaymethodSelect?: (paymethod: CartPaymethod) => void;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol for prices. Defaults to '€'. */\n currency?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n}\nfunction isOnAccountMethod(method: CartPaymethod): boolean {\n const code = (method.code || '').toLowerCase();\n return code === 'on_account' || code === 'onaccount' || code === 'on-account';\n}\n\n/**\n * Renders the cart's available payment methods as a selectable grid. Hides the\n * \"on account\" method for guest users unless `showOnAccountForGuests` is set.\n */\nfunction CartPaymethods(rawProps: CartPaymethodsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [selectedCode, setSelectedCode] = useState('');\n const containerClass = props.paymentsContainerClass || 'cart-paymethods';\n const showOnAccountForGuests = !!props.showOnAccountForGuests;\n const isGuest = !props.user;\n const payMethods: CartPaymethod[] = (props.cart?.payMethods || []).filter((m: CartPaymethod) => {\n if (!m?.code) return false;\n if (!showOnAccountForGuests && isGuest && isOnAccountMethod(m)) return false;\n return true;\n });\n function formatMethodPrice(price: number): string {\n if (props.formatPrice) return props.formatPrice(price);\n return formatPrice(price || 0, { symbol: props.currency ?? '\\u20AC' });\n }\n function handleSelect(method: CartPaymethod): void {\n setSelectedCode(method.code);\n if (props.onPaymethodSelect) props.onPaymethodSelect(method);\n }\n // Adopt the cart's stored payment method once it loads (cart may be\n // undefined on mount, then arrive). Intentional external-prop →\n // local-state sync; derived-from-props can't replace this because\n // handleSelect lets the user override the cart value locally and we also\n // fire onPaymethodSelect.\n useEffect(() => {\n if (!selectedCode && props.cart?.paymentData?.method) {\n const code = props.cart.paymentData.method as string;\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedCode(code);\n if (props.onPaymethodSelect) {\n const match = payMethods.find((m: CartPaymethod) => m.code === code);\n if (match) props.onPaymethodSelect(match);\n }\n }\n }, [props.cart, selectedCode, props.onPaymethodSelect, payMethods, props]);\n return (\n <div className={`propeller-cart-paymethods ${containerClass}`}>\n {payMethods.length > 0 ? (\n <div className=\"propeller-cart-paymethods__grid grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3\">\n {payMethods.map((method, index) => (\n <div\n key={method.code}\n onClick={() => handleSelect(method)}\n data-selected={selectedCode === method.code ? 'true' : 'false'}\n className={`propeller-cart-paymethods__method cursor-pointer border border-border rounded-container p-4 flex flex-col gap-2 transition-all ${selectedCode === method.code ? 'border-secondary bg-secondary/5 shadow-sm' : 'hover:border-secondary/30'}`}\n >\n <div className=\"propeller-cart-paymethods__method-row flex justify-between items-center\">\n <div className=\"flex items-center gap-2\">\n <span className=\"propeller-cart-paymethods__method-name font-medium\">{method.name || method.code}</span>\n </div>\n {method.price > 0 ? (\n <span className=\"propeller-cart-paymethods__method-price text-xs bg-surface-hover text-muted-foreground px-2 py-1 rounded-full\">\n {formatMethodPrice(method.price)}\n </span>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n {payMethods.length === 0 ? (\n <p className=\"propeller-cart-paymethods__empty text-muted-foreground italic\">\n {getLabel(props.labels, 'noMethods', 'No payment methods available.')}\n </p>\n ) : null}\n </div>\n );\n}\n\nexport default CartPaymethods;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Cart, Contact, Customer, GraphQLClient, PurchaseRole } from '@propeller-commerce/propeller-sdk-v2';\nimport { useCart } from '../composables/react/useCart';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface CartSummaryProps {\n /** The shopping cart used to populate the cart summary data */\n cart: Cart;\n\n /** Cart summary block title */\n title?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Display the subtotal of the shopping cart. Defaults to `true`. */\n showSubtotal?: boolean;\n\n /** Display the total discount of the shopping cart. Defaults to `true`. */\n showDiscount?: boolean;\n\n /** Display the shipping costs of the shopping cart. Defaults to `true`. */\n showShippingCosts?: boolean;\n\n /** Display all VAT lines of the shopping cart. Defaults to `true`. */\n showVATs?: boolean;\n\n /** Display the total of the shopping cart excluding VAT. Defaults to `true`. */\n showTotalExclVat?: boolean;\n\n /** Display the total VAT of the shopping cart. Defaults to `true`. */\n showTotalVat?: boolean;\n\n /** Display the checkout button. Defaults to `true`. */\n showCheckoutButton?: boolean;\n\n /** Action handler when the checkout button is clicked */\n onCheckoutButtonClick?: (cart: Cart) => void;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n /** GraphQL client — required for the default requestPurchaseAuthorization handler */\n graphqlClient?: GraphQLClient;\n\n /** Logged-in user — used to determine purchaser role and authorization limit */\n user?: Contact | Customer;\n\n /** Active company ID — used to look up the user's PAC for this company */ companyId?: number;\n /** * Override the default CartService.requestPurchaseAuthorization() call. * Note: when this override is used, afterRequestAuthorization receives the original cart. */ onRequestAuthorization?: (\n cart: Cart\n ) => void;\n /** Fires after authorization request is sent; receives the updated cart */ afterRequestAuthorization?: (\n cart: Cart\n ) => void;\n /** Called when requestPurchaseAuthorization fails; receives the error */ onError?: (\n err: Error\n ) => void;\n /** Callback fired when \"Request a Quote\" is clicked. Only shown for contacts when prop is provided. */\n onRequestQuoteClick?: (cart: Cart) => void;\n}\n\n/**\n * Order totals panel: lists subtotal, discount, shipping, VAT lines and grand\n * total, with a checkout button (or a request-authorization button when the\n * cart exceeds the user's purchase-authorization limit).\n *\n * @remarks Uses {@link useCart} for the purchase-authorization request.\n */\nfunction CartSummary(rawProps: CartSummaryProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // --- composable ---\n // Note: useCart's `checkoutAllowed` is intentionally NOT used here. That\n // composable has its own internal cart ref that stays null when the consumer\n // (this component) doesn't call addItem/resolveCart, which would falsely\n // report \"checkout allowed\" for users over their authorization limit.\n // showRequestAuthorizationButton below computes against props.cart directly,\n // matching CartIconAndSidebar's pattern so the cart page and the header\n // sidebar always agree.\n const { requestAuthorization } = useCart({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n cartId: props.cart?.cartId,\n companyId: props.companyId,\n });\n\n // --- local UI state ---\n const [requestLoading, setRequestLoading] = useState<boolean>(() => false);\n\n // --- display helpers ---\n function title(): string {\n return props.title || 'Order summary';\n }\n function showSubtotal(): boolean {\n return props.showSubtotal !== undefined ? props.showSubtotal : true;\n }\n function showDiscount(): boolean {\n return props.showDiscount !== undefined ? props.showDiscount : true;\n }\n function showShippingCosts(): boolean {\n return props.showShippingCosts !== undefined ? props.showShippingCosts : true;\n }\n function showVATs(): boolean {\n return props.showVATs !== undefined ? props.showVATs : true;\n }\n function showTotalExclVat(): boolean {\n return props.showTotalExclVat !== undefined ? props.showTotalExclVat : true;\n }\n function showTotalVat(): boolean {\n return props.showTotalVat !== undefined ? props.showTotalVat : true;\n }\n function showCheckoutButton(): boolean {\n return props.showCheckoutButton !== undefined ? props.showCheckoutButton : true;\n }\n \n function formatItemPrice(price: number): string {\n if (props.formatPrice) {\n return props.formatPrice(price);\n }\n return formatPrice(price || 0, { symbol: props.currency ?? '\\u20AC' });\n }\n function subtotal(): number {\n return props.cart?.total?.subTotal || 0;\n }\n function hasDiscount(): boolean {\n const total = props.cart?.total;\n return (total?.discount || 0) > 0;\n }\n function discountAmount(): number {\n return props.cart?.total?.discount || 0;\n }\n function hasShippingCosts(): boolean {\n return (props.cart?.postageData?.price || 0) > 0;\n }\n function shippingCosts(): number {\n return Number(props.cart?.postageData?.price || 0);\n }\n function totalExclVat(): number {\n return props.cart?.total?.totalGross || 0;\n }\n function taxLevels(): NonNullable<Cart['taxLevels']> {\n const levels = props.cart?.taxLevels || [];\n return levels.filter((t) => t.taxPercentage > 0 && t.price > 0);\n }\n function totalVat(): number {\n const net = props.cart?.total?.totalNet || 0;\n const gross = props.cart?.total?.totalGross || 0;\n return net - gross;\n }\n function totalInclVat(): number {\n return props.cart?.total?.totalNet || 0;\n }\n function handleCheckoutClick(): void {\n if (props.onCheckoutButtonClick) {\n props.onCheckoutButtonClick(props.cart);\n }\n }\n function showRequestAuthorizationButton(): boolean {\n if (!props.user || !('contactId' in props.user)) return false;\n if (!props.companyId) return false;\n if (!props.cart) return false;\n // user has been through toPlain() in AuthContext, so SDK field names are canonical.\n const items = props.user.purchaseAuthorizationConfigs?.items ?? [];\n const purchaserPAC = items.find(\n (pac) => pac.purchaseRole === PurchaseRole.PURCHASER\n && Number(pac.company?.companyId) === Number(props.companyId)\n );\n if (!purchaserPAC) return false;\n const limit = purchaserPAC.authorizationLimit ?? 0;\n const totalGross = props.cart.total?.totalGross ?? 0;\n return totalGross > limit;\n }\n\n function showRequestQuoteButton(): boolean {\n return !!props.onRequestQuoteClick && !!props.user && 'contactId' in props.user;\n }\n\n async function handleRequestAuthorizationClick(): Promise<void> {\n setRequestLoading(true);\n try {\n if (props.onRequestAuthorization) {\n props.onRequestAuthorization(props.cart);\n props.afterRequestAuthorization?.(props.cart);\n } else {\n const result = await requestAuthorization();\n if (!result.ok) throw new Error(result.error || 'Failed to request authorization');\n props.afterRequestAuthorization?.(props.cart);\n }\n } catch (err: any) {\n if (props.onError) {\n props.onError(err instanceof Error ? err : new Error(String(err)));\n }\n } finally {\n setRequestLoading(false);\n }\n }\n\n return (\n <div className=\"propeller-cart-summary w-full bg-card space-y-3\">\n <h2 className=\"propeller-cart-summary__title text-xl font-bold mb-4\">{title()}</h2>\n {showSubtotal() ? (\n <div className=\"propeller-cart-summary__row flex justify-between text-muted-foreground\" data-row=\"subtotal\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'subtotal', 'Subtotal:')}</span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(subtotal())}</span>\n </div>\n ) : null}\n {showDiscount() && hasDiscount() ? (\n <div className=\"propeller-cart-summary__row flex justify-between text-success\" data-row=\"discount\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'discount', 'Discount:')}</span>\n <span className=\"propeller-cart-summary__value\">-{formatItemPrice(discountAmount())}</span>\n </div>\n ) : null}\n {showShippingCosts() && hasShippingCosts() ? (\n <div className=\"propeller-cart-summary__row flex justify-between text-muted-foreground\" data-row=\"shipping-costs\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'shippingCosts', 'Shipping costs:')}</span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(shippingCosts())}</span>\n </div>\n ) : null}\n {showTotalExclVat() ? (\n <div className=\"propeller-cart-summary__row flex justify-between text-muted-foreground pt-2 border-t\" data-row=\"total-excl-vat\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'totalExclVat', 'Total excl. VAT:')}</span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(totalExclVat())}</span>\n </div>\n ) : null}\n {showVATs() && taxLevels().length > 0 ? (\n <>\n {taxLevels()?.map((tax, index) => (\n <div className=\"propeller-cart-summary__row flex justify-between text-muted-foreground text-sm\" key={index} data-row=\"vat-line\">\n <span className=\"propeller-cart-summary__label\">\n {tax.taxPercentage}% {getLabel(props.labels, 'vat', 'VAT')}:\n </span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(Number(tax.price))}</span>\n </div>\n ))}\n </>\n ) : null}\n {showTotalVat() && totalVat() > 0 ? (\n <div className=\"propeller-cart-summary__row flex justify-between text-muted-foreground text-sm\" data-row=\"total-vat\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'totalVat', 'Total VAT:')}</span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(totalVat())}</span>\n </div>\n ) : null}\n <div className=\"propeller-cart-summary__row propeller-cart-summary__row--total flex justify-between text-xl font-bold pt-4 border-t text-foreground mt-2\" data-row=\"total\">\n <span className=\"propeller-cart-summary__label\">{getLabel(props.labels, 'total', 'Total:')}</span>\n <span className=\"propeller-cart-summary__value\">{formatItemPrice(totalInclVat())}</span>\n </div>\n {showCheckoutButton() && !showRequestAuthorizationButton() ? (\n <>\n <button\n type=\"button\"\n className=\"propeller-cart-summary__checkout-btn block w-full bg-secondary text-secondary-foreground text-center py-3 rounded-container hover:bg-secondary/90 transition font-semibold mt-4\"\n onClick={(event) => handleCheckoutClick()}\n >\n {getLabel(props.labels, 'checkoutButton', 'Continue to Checkout')}\n </button>{' '}\n {!!props.onRequestQuoteClick && showRequestQuoteButton() ? (\n <button\n type=\"button\"\n className=\"propeller-cart-summary__quote-btn block w-full bg-card border border-secondary text-secondary text-center py-3 rounded-container hover:bg-secondary/5 transition font-semibold mt-2\"\n onClick={(event) =>\n props.onRequestQuoteClick && props.onRequestQuoteClick(props.cart)\n }\n >\n {getLabel(props.labels, 'requestQuoteButton', 'Request a Quote')}\n </button>\n ) : null}\n </>\n ) : null}\n {showRequestAuthorizationButton() ? (\n <button\n type=\"button\"\n className=\"propeller-cart-summary__authorization-btn block w-full bg-secondary text-secondary-foreground text-center py-3 rounded-container hover:bg-secondary/90 transition font-semibold mt-4 disabled:opacity-50 disabled:cursor-not-allowed\"\n onClick={(event) => handleRequestAuthorizationClick()}\n disabled={requestLoading}\n >\n {requestLoading ? <>{getLabel(props.labels, 'requestingAuthorization', 'Requesting...')}</> : null}\n {!requestLoading ? (\n <>{getLabel(props.labels, 'requestAuthorizationButton', 'Request Authorization')}</>\n ) : null}\n </button>\n ) : null}\n </div>\n );\n}\nexport default CartSummary;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport type { Category, LocalizedString } from '@propeller-commerce/propeller-sdk-v2';\n\nexport interface CategoryDescriptionProps {\n // ── Required ────────────────────────────────────────────────────────────\n\n /**\n * Language code used to resolve the correct localised description\n * from `category.description`.\n */\n language: string;\n\n // ── Optional ────────────────────────────────────────────────────────────\n\n /**\n * Propeller Category object.\n * The component reads `category.description` (an array of LocalizedString)\n * and renders the matching language entry as HTML.\n */\n category?: Category;\n\n /**\n * When `true` (default), the description is truncated to `maxLength`\n * characters and a \"Read more\" / \"Read less\" toggle is shown.\n */\n collapsed?: boolean;\n\n /**\n * Maximum number of characters to display before truncating.\n * Only applies when `collapsed` is `true`.\n * Defaults to 200.\n */\n maxLength?: number;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a category's localised HTML description, optionally truncated with a\n * \"Read more\" / \"Read less\" toggle.\n */\nfunction CategoryDescription(props: CategoryDescriptionProps) {\n const [expanded, setExpanded] = useState(false);\n // All values below are derived from props or local state — pure, computed on render.\n const match = props.category?.description?.find(\n (d: LocalizedString) => d.language === props.language,\n );\n const html = match?.value || '';\n const maxLen = props.maxLength || 200;\n const shouldTruncate = props.collapsed !== false && html.length > maxLen;\n function getTruncated(): string {\n const plain = html.replace(/<[^>]*>/g, '');\n if (plain.length <= maxLen) return html;\n const truncated = plain.substring(0, maxLen);\n return truncated.substring(0, truncated.lastIndexOf(' ')) + '…';\n }\n return (\n <>\n {!!html ? (\n <div\n className={`propeller-category-description mb-6 ${props.className || ''}`}\n data-expanded={expanded ? 'true' : 'false'}\n data-truncatable={shouldTruncate ? 'true' : 'false'}\n >\n {!shouldTruncate || expanded ? (\n <div\n className=\"propeller-category-description__content prose prose-slate max-w-none text-muted-foreground\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <p className=\"propeller-category-description__truncated text-muted-foreground\">{getTruncated()}</p>\n )}\n {shouldTruncate ? (\n <button\n type=\"button\"\n className=\"propeller-category-description__toggle mt-2 text-sm font-medium text-primary hover:underline\"\n onClick={() => setExpanded((v) => !v)}\n >\n {expanded ? 'Read less' : 'Read more'}\n </button>\n ) : null}\n </div>\n ) : null}\n </>\n );\n}\n\nexport default CategoryDescription;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport type { Category, LocalizedString } from '@propeller-commerce/propeller-sdk-v2';\n\nexport interface CategoryShortDescriptionProps {\n // ── Required ────────────────────────────────────────────────────────────\n\n /**\n * Language code used to resolve the correct localised short description\n * from `category.shortDescription`.\n */\n language: string;\n\n // ── Optional ────────────────────────────────────────────────────────────\n\n /**\n * Propeller Category object.\n * The component reads `category.shortDescription` (an array of LocalizedString)\n * and renders the matching language entry as HTML.\n */\n category?: Category;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a category's localised HTML short description.\n */\nfunction CategoryShortDescription(props: CategoryShortDescriptionProps) {\n // Derived from props — computed once on render.\n const match = props.category?.shortDescription?.find(\n (d: LocalizedString) => d.language === props.language,\n );\n const html = match?.value || '';\n return (\n <>\n {!!html ? (\n <div className={`propeller-category-short-description mb-6 ${props.className || ''}`}>\n <div\n className=\"propeller-category-short-description__content prose prose-slate max-w-none text-muted-foreground\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n ) : null}\n </>\n );\n}\n\nexport default CategoryShortDescription;\n","'use client';\n/**\n * Client wrapper around the pure `CategoryShortDescription` component.\n * Resolves `language` from `<PropellerProvider>` when the caller doesn't\n * pass it explicitly. The pure version stays exported from `/pure` for RSC\n * use.\n */\nimport * as React from 'react';\nimport CategoryShortDescription, { type CategoryShortDescriptionProps } from './CategoryShortDescription';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction CategoryShortDescriptionWithProvider(rawProps: CategoryShortDescriptionProps) {\n const props = useInfraProps(rawProps);\n return <CategoryShortDescription {...props} />;\n}\n\nexport default CategoryShortDescriptionWithProvider;\nexport type { CategoryShortDescriptionProps };\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport {\n Cluster,\n Product,\n AttributeResult,\n ProductPrice,\n ProductInventory,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport ItemStock from './ItemStock';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport {\n getClusterImageUrl,\n getClusterSku,\n getLocalizedValue,\n} from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\nimport { useResolvedProps, ResolveSpec } from '../composables/react/useResolvedProps';\nimport { ProductGridConfig } from '../context/ProductGridContext';\n\nexport interface ClusterCardProps {\n // === Core ===\n\n /** The cluster object to display */\n cluster: Cluster;\n\n // === Display toggles ===\n\n /** Show the cluster name. Defaults to true. */\n showName?: boolean;\n\n /** When false, hides the price. Defaults to true. */\n showPrice?: boolean;\n\n /** Show the default product image. Defaults to true. */\n showImage?: boolean;\n\n /** Show the cluster short description. Defaults to false. */\n showShortDescription?: boolean;\n\n /**\n * Show the SKU. Displays the cluster SKU; falls back to the default product SKU\n * if the cluster SKU is empty. Defaults to true.\n */\n showSku?: boolean;\n\n /** Show the default product manufacturer. Defaults to false. */\n showManufacturer?: boolean;\n\n /**\n * Show default product stock information (quantity badge).\n * Reads `defaultProduct.inventory.totalQuantity`. Defaults to true.\n */\n showStock?: boolean;\n\n /**\n * Show only the availability indicator (Available / Not available) inside ItemStock.\n * Only relevant when `showStock` is true.\n * Defaults to true.\n */\n showAvailability?: boolean;\n\n /**\n * Label overrides forwarded to the embedded ItemStock component.\n * Keys: inStock, outOfStock, lowStock, available, notAvailable, pieces\n */\n stockLabels?: Record<string, string>;\n\n // === Attribute labels ===\n\n /**\n * Attribute codes/names to look up on the default product and display as\n * badge overlays on the image. Resolved against\n * `defaultProduct.attributes.items[].attributeDescription.name`.\n * Attributes with no matching value are silently omitted.\n * Example: ['new', 'sale']\n */\n imageLabels?: string[];\n\n /**\n * Attribute codes/names to look up on the default product and display as\n * extra text rows below the cluster name. Resolved the same way as `imageLabels`.\n * Example: ['brand', 'color']\n */\n textLabels?: string[];\n\n // === Favourites ===\n\n /** Renders a heart-icon toggle button on the cluster image. Defaults to false. */\n enableAddFavorite?: boolean;\n\n /**\n * Called whenever the favourite state is toggled.\n * The second argument indicates the new state: `true` = added, `false` = removed.\n */\n onToggleFavorite?: (cluster: Cluster, isFavorite: boolean) => void;\n\n // === Navigation ===\n\n /**\n * Called when the cluster name, image, or \"View cluster\" button is clicked.\n * When provided, the default `<a>` navigation is prevented so the consumer\n * can use framework-specific routing (e.g. Next.js `router.push`).\n */\n onClusterClick?: (cluster: Cluster) => void;\n\n // === UI string overrides ===\n\n /**\n * Override any UI string.\n * Available keys: addToFavorites, removeFromFavorites, viewCluster,\n * inStock, lowStock, outOfStock\n */\n labels?: Record<string, string>;\n\n /** Number of grid columns — when 1 the card renders as a compact horizontal row. */\n columns?: number;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /** Configuration object passed to the component */\n configuration?: any;\n\n /** Include tax in the price display */\n includeTax?: boolean;\n\n /** Language code used to resolve localised names and slugs. Defaults to 'NL'. */\n language?: string;\n\n /** Currency symbol used when formatting the price. Falls back to PropellerInfra.currency, then `'€'`. */\n currency?: string;\n\n // ───── Extension API ─────\n // Per-card overrides for sub-components. Precedence:\n // explicit prop > ProductGridConfig context > infra > default.\n // (No addToCartComponent — ClusterCard does not render AddToCart by default.)\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n imageComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ImageComponentProps>;\n badgesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').BadgesComponentProps>;\n favoriteComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').FavoriteComponentProps>;\n\n /** Compound mode opt-in. When provided, ClusterCard renders the compound\n * subtree (using <ClusterCard.X> subcomponents) instead of the legacy\n * monolithic layout. Default content per subcomponent matches the legacy\n * render section-for-section. */\n children?: React.ReactNode;\n}\n\n// ── Pure helpers (module scope — created once, not per render) ──────────────────\n\n/** Cluster name with fallback chain: cluster.names → defaultProduct.names → 'Cluster'. */\nfunction getClusterName(cluster: Cluster | undefined, language: string): string {\n const fromCluster = getLocalizedValue(cluster?.names, language, '');\n if (fromCluster) return fromCluster;\n return getLocalizedValue(cluster?.defaultProduct?.names, language, 'Cluster');\n}\n\nfunction getClusterShortDescription(cluster: Cluster | undefined, language: string): string {\n const fromCluster = getLocalizedValue(cluster?.shortDescriptions, language, '');\n if (fromCluster) return fromCluster;\n return getLocalizedValue(cluster?.defaultProduct?.shortDescriptions, language, '');\n}\n\nfunction getClusterManufacturer(cluster: Cluster | undefined): string {\n return cluster?.defaultProduct?.manufacturer || '';\n}\n\n/** Resolves attribute codes against the default product, dropping empties. */\nfunction resolveAttributeValues(cluster: Cluster | undefined, codes: string[] | undefined): string[] {\n if (!codes || codes.length === 0) return [];\n const attrs = cluster?.defaultProduct?.attributes?.items || [];\n return codes\n .map((code) => {\n const found = attrs.find((a: AttributeResult) => a.attributeDescription?.name === code);\n return found?.value?.value || '';\n })\n .filter((v: string) => v.length > 0);\n}\n\n// Two-tier precedence (explicit prop > ProductGrid context > Propeller infra >\n// default) for the props ProductGrid otherwise cascades through here.\nconst RESOLVE_SPEC: ResolveSpec<ClusterCardProps> = {\n configuration: { infra: 'configuration' },\n includeTax: { infra: 'includeTax' },\n language: { infra: 'language', default: 'NL' },\n currency: { infra: 'currency', default: '€' },\n columns: { grid: 'columns', default: 3 },\n showPrice: { grid: 'showPrice' },\n showStock: { grid: 'showStock' },\n showAvailability: { grid: 'showAvailability' },\n stockLabels: { grid: 'stockLabels' },\n enableAddFavorite: { grid: 'enableAddFavorite' },\n onClusterClick: { grid: 'onClusterClick' },\n onToggleFavorite: {\n grid: 'onToggleFavorite',\n transform: (fn) => (c: Cluster, fav: boolean) =>\n (fn as ProductGridConfig['onToggleFavorite'])!(c, fav),\n },\n priceComponent: { grid: 'priceComponent' },\n stockComponent: { grid: 'stockComponent' },\n imageComponent: { grid: 'imageComponent' },\n badgesComponent: { grid: 'badgesComponent' },\n favoriteComponent: { grid: 'favoriteComponent' },\n};\n\n// ── Compound context ────────────────────────────────────────────────────────\n\ninterface ClusterCardContextValue {\n cluster: Cluster;\n /** Fully resolved props (infra + grid context + explicit) — read instead of `props`. */\n resolved: ClusterCardProps;\n /** Derived display values, computed once at the root and read by leaves. */\n derived: {\n name: string;\n sku: string;\n clusterUrl: string;\n imageUrl: string;\n shortDescription: string;\n manufacturer: string;\n imageLabelValues: string[];\n textLabelValues: string[];\n defaultProductInventory: ProductInventory | undefined;\n clusterPrice: string;\n priceObj: ProductPrice | undefined;\n useTax: boolean;\n isRow: boolean;\n language: string;\n currency: string;\n viewClusterLabel: string;\n };\n /** Local UI state shared between Image (which renders the heart) and any sibling. */\n favorite: {\n isFavorite: boolean;\n toggle: (e: React.MouseEvent) => void;\n };\n /** Click handler shared by Image + Name + ViewClusterLink. */\n handleClusterClick: (e: React.MouseEvent) => void;\n}\n\nconst ClusterCardContext = React.createContext<ClusterCardContextValue | null>(null);\n\n/**\n * Internal hook used by compound subcomponents. Throws if called outside\n * `<ClusterCard>` — the error is intentional, that's a developer mistake.\n */\nfunction useClusterCard(): ClusterCardContextValue {\n const ctx = React.useContext(ClusterCardContext);\n if (!ctx) {\n throw new Error(\n '<ClusterCard.X> must be rendered inside <ClusterCard>. ' +\n 'Got null context — wrap your subcomponents in <ClusterCard cluster={...}>...</ClusterCard>.',\n );\n }\n return ctx;\n}\n\n/**\n * Grid/list card for a cluster: shows image, name, SKU, price, stock and\n * attribute badge/text labels, with an optional favourite toggle. Renders as a\n * compact horizontal row when `columns` is 1.\n *\n * @remarks Resolves infra and ProductGrid context props via `useResolvedProps`.\n */\nfunction ClusterCard(rawProps: ClusterCardProps) {\n // Resolve infra (Tier 1) + grid config (Tier 2) declaratively. Non-throwing —\n // standalone use (no provider) falls back to explicit props / defaults.\n const props = useResolvedProps(rawProps, RESOLVE_SPEC);\n\n const [isFavorite, setIsFavorite] = useState(false);\n\n const language = (props.language as string) || 'NL';\n const cluster = props.cluster;\n const isRow = props.columns === 1;\n\n // Derived values — computed once per render (previously redefined every render\n // and called twice each across the layout branches).\n const clusterName = getClusterName(cluster, language);\n const clusterSku = getClusterSku(cluster);\n const clusterImageUrl = getClusterImageUrl(cluster);\n const shortDescription = getClusterShortDescription(cluster, language);\n const manufacturer = getClusterManufacturer(cluster);\n const clusterUrl = props.configuration.urls.getClusterUrl(cluster, props.language);\n const imageLabelValues = resolveAttributeValues(cluster, props.imageLabels);\n const textLabelValues = resolveAttributeValues(cluster, props.textLabels).map((value) => ({\n value,\n }));\n\n const defaultProductInventory = cluster?.defaultProduct?.inventory;\n\n const useTax = props.includeTax !== undefined ? !!props.includeTax : false;\n const priceObj = cluster?.defaultProduct?.price;\n const priceValue = useTax ? priceObj?.net : priceObj?.gross;\n const clusterPrice =\n props.showPrice === false ? '' : formatPrice(priceValue, { symbol: props.currency ?? '€' });\n\n function handleClusterClick(e: React.MouseEvent): void {\n if (props.onClusterClick) {\n e.preventDefault();\n props.onClusterClick(cluster);\n }\n }\n\n function handleToggleFavorite(e: React.MouseEvent): void {\n e.preventDefault();\n e.stopPropagation();\n setIsFavorite(!isFavorite);\n if (props.onToggleFavorite) {\n props.onToggleFavorite(cluster, isFavorite);\n }\n }\n\n const viewClusterLabel = getLabel(props.labels, 'viewCluster', 'View cluster');\n\n // Plain string list for the compound context — the legacy monolithic branch\n // keeps its `{ value }` shape so its JSX is untouched.\n const textLabelValuesFlat = textLabelValues.map((t) => t.value);\n\n const contextValue: ClusterCardContextValue = {\n cluster,\n resolved: props,\n derived: {\n name: clusterName,\n sku: clusterSku,\n clusterUrl,\n imageUrl: clusterImageUrl,\n shortDescription,\n manufacturer,\n imageLabelValues,\n textLabelValues: textLabelValuesFlat,\n defaultProductInventory,\n clusterPrice,\n priceObj,\n useTax,\n isRow,\n language,\n currency: (props.currency as string) ?? '€',\n viewClusterLabel,\n },\n favorite: { isFavorite, toggle: handleToggleFavorite },\n handleClusterClick,\n };\n\n // Compound mode: consumer supplied children. Render them inside a default\n // shell with the same root layout classes the legacy mode uses, so styling\n // stays identical regardless of which mode the consumer picks. The consumer\n // controls the order and which subcomponents appear.\n if (rawProps.children !== undefined) {\n return (\n <ClusterCardContext.Provider value={contextValue}>\n <div\n className={`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? 'flex-row flex-wrap md:flex-nowrap items-center' : 'flex-col'} ${props.className ?? ''}`}\n data-cluster-id={cluster.clusterId}\n data-layout={isRow ? 'row' : 'grid'}\n >\n {rawProps.children}\n </div>\n </ClusterCardContext.Provider>\n );\n }\n\n // Legacy / monolithic mode: render the original full layout based on the\n // show* toggles. Internally we now compose the compound subcomponents so\n // there's one rendering path. Note: a couple of minor class differences\n // exist between the legacy inline JSX and the compound defaults\n // (e.g. <ClusterCardPrice> renders the compound-default class\n // `propeller-cluster-card__price` without the legacy non-isRow\n // `mt-auto pt-1` extras, and isRow drops the `font-bold ... whitespace-nowrap`\n // <span> wrapper). This matches the ProductCard precedent — the user-visible\n // impact is negligible and consumers migrating to compound mode get the\n // same DOM either way.\n return (\n <ClusterCardContext.Provider value={contextValue}>\n <div\n className={`propeller-cluster-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? 'flex-row flex-wrap md:flex-nowrap items-center' : 'flex-col'} ${props.className || ''}`}\n data-layout={isRow ? 'row' : 'grid'}\n >\n {props.showImage !== false ? <ClusterCardImage /> : null}\n {isRow ? (\n <>\n <div className=\"propeller-cluster-card__body flex flex-1 flex-row items-center gap-4 px-4 py-2 min-w-0\">\n <div className=\"flex flex-col gap-0.5 flex-1 min-w-0\">\n {props.showSku !== false && clusterSku ? <ClusterCardSku /> : null}\n {props.showName !== false ? <ClusterCardName linkable /> : null}\n {textLabelValues.length > 0 ? <ClusterCardTextLabels /> : null}\n {props.showManufacturer && manufacturer ? <ClusterCardManufacturer /> : null}\n {props.showShortDescription && shortDescription ? <ClusterCardShortDescription /> : null}\n </div>\n </div>\n <div className=\"propeller-cluster-card__footer w-full md:w-auto flex items-center gap-3 px-4 py-2 md:py-0 border-t md:border-t-0 border-border-subtle\">\n {props.showStock && defaultProductInventory ? <ClusterCardStock /> : null}\n {props.showPrice !== false && priceObj ? <ClusterCardPrice /> : null}\n <div className=\"propeller-cluster-card__cta flex-shrink-0 ml-auto\">\n <ClusterCardViewClusterLink />\n </div>\n </div>\n </>\n ) : (\n <>\n <div className=\"propeller-cluster-card__body flex flex-1 flex-col gap-1.5 p-3 sm:gap-2 sm:p-4\">\n {props.showSku !== false && clusterSku ? <ClusterCardSku /> : null}\n {props.showName !== false ? <ClusterCardName linkable /> : null}\n {props.showStock && defaultProductInventory ? <ClusterCardStock /> : null}\n {textLabelValues.length > 0 ? <ClusterCardTextLabels /> : null}\n {props.showManufacturer && manufacturer ? <ClusterCardManufacturer /> : null}\n {props.showShortDescription && shortDescription ? <ClusterCardShortDescription /> : null}\n {props.showPrice !== false && priceObj ? <ClusterCardPrice /> : null}\n </div>\n <div className=\"propeller-cluster-card__cta px-3 pb-3 sm:px-4 sm:pb-4\">\n <ClusterCardViewClusterLink />\n </div>\n </>\n )}\n </div>\n </ClusterCardContext.Provider>\n );\n}\n\n// ── Compound subcomponents ──────────────────────────────────────────────────\n\n/** Cluster image area, including badges and favourite overlay. When the\n * `imageComponent` slot is filled, the consumer takes over the entire image\n * area (badges + favorite overlay are no longer auto-rendered). */\nfunction ClusterCardImage(props: {\n /** Override the wrapper class. */\n className?: string;\n /** Render the favourite heart button. Defaults to context `enableAddFavorite`. */\n showFavorite?: boolean;\n}) {\n const { cluster, derived, resolved, handleClusterClick } = useClusterCard();\n const showFavorite = props.showFavorite ?? !!resolved.enableAddFavorite;\n const isRow = derived.isRow;\n const InjectedImage = resolved.imageComponent;\n if (InjectedImage) {\n return (\n <InjectedImage\n cluster={cluster}\n language={derived.language}\n imageSearchFilters={resolved.configuration?.imageSearchFiltersGrid}\n imageVariantFilters={resolved.configuration?.imageVariantFiltersMedium}\n className={\n props.className ??\n `propeller-cluster-card__media relative overflow-hidden bg-surface-hover ${isRow ? 'w-20 h-20 flex-shrink-0 p-2' : 'aspect-[4/3] sm:aspect-square p-2 sm:p-4'}`\n }\n />\n );\n }\n return (\n <div\n className={\n props.className ??\n `propeller-cluster-card__media relative overflow-hidden bg-surface-hover ${isRow ? 'w-20 h-20 flex-shrink-0 p-2' : 'aspect-[4/3] sm:aspect-square p-2 sm:p-4'}`\n }\n >\n <a className=\"block h-full w-full\" href={derived.clusterUrl} onClick={handleClusterClick}>\n {derived.imageUrl ? (\n <img\n className=\"propeller-cluster-card__image h-full w-full object-contain transition-transform duration-300 group-hover:scale-105\"\n src={derived.imageUrl}\n alt={derived.name}\n />\n ) : (\n <div className=\"propeller-cluster-card__image-placeholder flex h-full w-full items-center justify-center text-foreground-subtle\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-16 w-16\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n strokeWidth={1}\n />\n </svg>\n </div>\n )}\n </a>\n {derived.imageLabelValues.length > 0 ? <ClusterCardBadges /> : null}\n {showFavorite ? <ClusterCardFavorite /> : null}\n </div>\n );\n}\n\n/** Image-overlay badge list (e.g. \"new\", \"sale\" attributes), or the\n * injected `badgesComponent` from context when set. */\nfunction ClusterCardBadges(props: {\n /** Override the badge container class. */\n className?: string;\n}) {\n const { cluster, derived, resolved } = useClusterCard();\n const InjectedBadges = resolved.badgesComponent;\n if (InjectedBadges) {\n return (\n <InjectedBadges\n cluster={cluster}\n labels={resolved.labels}\n className={\n props.className ??\n 'propeller-cluster-card__badges pointer-events-none absolute left-2 top-2 flex flex-col gap-1'\n }\n />\n );\n }\n if (derived.imageLabelValues.length === 0) return null;\n return (\n <div\n className={\n props.className ??\n 'propeller-cluster-card__badges pointer-events-none absolute left-2 top-2 flex flex-col gap-1'\n }\n >\n {derived.imageLabelValues.map((label) => (\n <span\n key={label}\n className=\"propeller-cluster-card__badge inline-block rounded bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground shadow-sm\"\n >\n {label}\n </span>\n ))}\n </div>\n );\n}\n\n/** Favourite (heart) toggle button — typically placed inside `<ClusterCard.Image>`,\n * or the injected `favoriteComponent` from context when set. */\nfunction ClusterCardFavorite(props: {\n /** Override the button class. */\n className?: string;\n}) {\n const { cluster, resolved, favorite } = useClusterCard();\n const InjectedFavorite = resolved.favoriteComponent;\n if (InjectedFavorite) {\n // ClusterCard's onToggleFavorite is typed as (Cluster, boolean) — narrower\n // than the FavoriteComponentProps contract's (Product | Cluster, boolean).\n // Adapt by accepting the wider type and narrowing the input back to Cluster.\n const onToggleFavoriteAdapter = resolved.onToggleFavorite\n ? (item: Product | Cluster, isFavorite: boolean) =>\n resolved.onToggleFavorite!(item as Cluster, isFavorite)\n : undefined;\n return (\n <InjectedFavorite\n cluster={cluster}\n onToggleFavorite={onToggleFavoriteAdapter}\n labels={resolved.labels}\n className={props.className}\n />\n );\n }\n return (\n <button\n type=\"button\"\n onClick={favorite.toggle}\n aria-label={\n favorite.isFavorite\n ? getLabel(resolved.labels, 'removeFromFavorites', 'Remove from favourites')\n : getLabel(resolved.labels, 'addToFavorites', 'Add to favourites')\n }\n data-favorite={favorite.isFavorite ? 'true' : 'false'}\n className={\n props.className ??\n `propeller-cluster-card__favorite-btn absolute right-2 top-2 rounded-full border bg-card p-1.5 shadow-sm transition-colors ${favorite.isFavorite ? 'border-destructive/30 text-destructive' : 'border-border-subtle text-foreground-subtle hover:text-destructive'}`\n }\n >\n <svg\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"h-4 w-4\"\n fill={favorite.isFavorite ? 'currentColor' : 'none'}\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z\"\n />\n </svg>\n </button>\n );\n}\n\n/** Cluster name. `linkable` (default true) wraps it in an `<a>` to the cluster page. */\nfunction ClusterCardName(props: {\n /** When true (default), wraps the name in a link to the cluster page. */\n linkable?: boolean;\n /** Override the name element class. */\n className?: string;\n}) {\n const { derived, handleClusterClick } = useClusterCard();\n const linkable = props.linkable ?? true;\n const cls =\n props.className ??\n `propeller-cluster-card__title text-sm font-medium leading-tight text-foreground transition-colors hover:text-primary ${derived.isRow ? 'line-clamp-1' : 'line-clamp-2'}`;\n if (linkable) {\n return (\n <a className={cls} href={derived.clusterUrl} onClick={handleClusterClick}>\n {derived.name}\n </a>\n );\n }\n return <span className={cls}>{derived.name}</span>;\n}\n\n/** Renders the cluster SKU. */\nfunction ClusterCardSku(props: {\n /** Override the SKU element class. */\n className?: string;\n}) {\n const { derived } = useClusterCard();\n if (!derived.sku) return null;\n return (\n <div\n className={\n props.className ?? 'propeller-cluster-card__sku font-mono text-xs text-foreground-subtle'\n }\n >\n {derived.sku}\n </div>\n );\n}\n\n/** Renders the cluster's short description. */\nfunction ClusterCardShortDescription(props: {\n /** Override the description element class. */\n className?: string;\n}) {\n const { derived } = useClusterCard();\n if (!derived.shortDescription) return null;\n return (\n <p\n className={\n props.className ??\n 'propeller-cluster-card__description line-clamp-2 text-xs text-muted-foreground'\n }\n >\n {derived.shortDescription}\n </p>\n );\n}\n\n/** Renders the default product manufacturer name. */\nfunction ClusterCardManufacturer(props: {\n /** Override the manufacturer element class. */\n className?: string;\n}) {\n const { derived } = useClusterCard();\n if (!derived.manufacturer) return null;\n return (\n <div\n className={\n props.className ??\n 'propeller-cluster-card__manufacturer text-xs text-muted-foreground'\n }\n >\n {derived.manufacturer}\n </div>\n );\n}\n\n/** Renders the resolved `textLabels` attribute values as text rows. */\nfunction ClusterCardTextLabels(props: {\n /** Override the per-row label class. */\n className?: string;\n}) {\n const { derived } = useClusterCard();\n if (derived.textLabelValues.length === 0) return null;\n return (\n <div className=\"propeller-cluster-card__labels flex flex-col gap-0.5\">\n {derived.textLabelValues.map((value) => (\n <div\n key={value}\n className={\n props.className ?? 'propeller-cluster-card__label text-xs text-muted-foreground'\n }\n >\n {value}\n </div>\n ))}\n </div>\n );\n}\n\n/** Renders the embedded stock/availability widget for the default product,\n * or the injected `stockComponent` from context when set. */\nfunction ClusterCardStock(props: {\n /** Show only the availability indicator. Defaults to context `showAvailability`. */\n showAvailability?: boolean;\n}) {\n const { derived, resolved } = useClusterCard();\n if (!derived.defaultProductInventory) return null;\n const InjectedStock = resolved.stockComponent;\n if (InjectedStock) {\n return (\n <InjectedStock\n inventory={derived.defaultProductInventory}\n showStock\n showAvailability={\n props.showAvailability ?? (resolved.showAvailability !== false && !derived.isRow)\n }\n labels={resolved.stockLabels}\n />\n );\n }\n return (\n <ItemStock\n inventory={derived.defaultProductInventory}\n showStock\n showAvailability={\n props.showAvailability ?? (resolved.showAvailability !== false && !derived.isRow)\n }\n labels={resolved.stockLabels}\n />\n );\n}\n\n/** Renders the cluster price, or the injected `priceComponent` from context\n * when set. */\nfunction ClusterCardPrice(props: {\n /** Tailwind text-size class for the price. Defaults to `'text-base sm:text-lg'`. */\n priceSize?: string;\n /** Override the price wrapper class. */\n className?: string;\n}) {\n const { derived, resolved } = useClusterCard();\n if (!derived.priceObj) return null;\n const InjectedPrice = resolved.priceComponent;\n if (InjectedPrice) {\n return (\n <div className={props.className ?? 'propeller-cluster-card__price'}>\n <InjectedPrice\n price={derived.priceObj}\n includeTax={derived.useTax}\n currency={derived.currency}\n labels={resolved.labels}\n />\n </div>\n );\n }\n return (\n <div className={props.className ?? 'propeller-cluster-card__price'}>\n <span className={`font-bold text-foreground ${props.priceSize ?? 'text-base sm:text-lg'}`}>\n {derived.clusterPrice}\n </span>\n </div>\n );\n}\n\n/** Renders the \"View cluster\" CTA link. */\nfunction ClusterCardViewClusterLink(props: {\n /** Override the link class. */\n className?: string;\n /** Override the displayed label. Defaults to the context `viewCluster` label. */\n label?: string;\n}) {\n const { derived, handleClusterClick } = useClusterCard();\n return (\n <a\n href={derived.clusterUrl}\n onClick={handleClusterClick}\n className={\n props.className ??\n 'propeller-cluster-card__cta-link flex w-full items-center justify-center rounded-control bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2'\n }\n >\n {props.label ?? derived.viewClusterLabel}\n </a>\n );\n}\n\n// ── Compound default export ─────────────────────────────────────────────────\n\n// Memoized: ProductGrid passes only the stable { cluster } prop; config flows\n// via context so shallow-equal props skip re-render (rbp §5.2).\nconst MemoizedRoot = React.memo(ClusterCard);\n\n/**\n * Compound component. Use either:\n *\n * **Compound mode (new — preferred):**\n * ```tsx\n * <ClusterCard cluster={c}>\n * <ClusterCard.Image />\n * <ClusterCard.Name linkable />\n * <ClusterCard.Sku />\n * <ClusterCard.Price />\n * <ClusterCard.ViewClusterLink />\n * </ClusterCard>\n * ```\n *\n * **Legacy mode (kept for back-compat):**\n * ```tsx\n * <ClusterCard cluster={c} showName showPrice />\n * ```\n */\ntype ClusterCardComponent = typeof MemoizedRoot & {\n Image: typeof ClusterCardImage;\n Badges: typeof ClusterCardBadges;\n Favorite: typeof ClusterCardFavorite;\n Name: typeof ClusterCardName;\n Sku: typeof ClusterCardSku;\n ShortDescription: typeof ClusterCardShortDescription;\n Manufacturer: typeof ClusterCardManufacturer;\n TextLabels: typeof ClusterCardTextLabels;\n Stock: typeof ClusterCardStock;\n Price: typeof ClusterCardPrice;\n ViewClusterLink: typeof ClusterCardViewClusterLink;\n};\n\nconst ClusterCardExport = MemoizedRoot as ClusterCardComponent;\nClusterCardExport.Image = ClusterCardImage;\nClusterCardExport.Badges = ClusterCardBadges;\nClusterCardExport.Favorite = ClusterCardFavorite;\nClusterCardExport.Name = ClusterCardName;\nClusterCardExport.Sku = ClusterCardSku;\nClusterCardExport.ShortDescription = ClusterCardShortDescription;\nClusterCardExport.Manufacturer = ClusterCardManufacturer;\nClusterCardExport.TextLabels = ClusterCardTextLabels;\nClusterCardExport.Stock = ClusterCardStock;\nClusterCardExport.Price = ClusterCardPrice;\nClusterCardExport.ViewClusterLink = ClusterCardViewClusterLink;\n\nexport default ClusterCardExport;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: side effects (useEffect).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useEffect } from 'react';\nimport {\n Product,\n ClusterConfig,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useClusterConfigurator } from '../composables/react/useClusterConfigurator';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * A computed object containing a cluster config setting enriched with\n * its current UI state: available values for drilldown, the currently\n * selected value, and whether the selector should be disabled.\n */\ninterface ConfiguredSetting {\n /** Unique identifier of the cluster config setting. */\n id: number;\n /** Attribute name/code this setting configures. */\n name: string;\n /** String representation of ClusterConfigSettingDisplayType (e.g. `DROPDOWN`, `RADIO`, `COLOR`, `IMAGE`). */\n displayType: string;\n /**\n * Underlying attribute type from the PIM (e.g. `COLOR`, `TEXT`). Source of\n * truth for swatch rendering — `displayType: 'COLOR'` is sometimes set on\n * settings whose attribute holds plain text.\n */\n attributeType?: string;\n /** Display priority/order of this setting. */\n priority: string;\n /** Human-readable label shown above the selector. */\n displayName: string;\n /** Values currently selectable for this setting, after drilldown filtering. */\n availableValues: string[];\n /** The value currently selected for this setting. */\n selectedValue: string;\n /** Whether the selector is disabled (no valid values given prior selections). */\n disabled: boolean;\n}\n/**\n * A computed object containing a cluster config setting enriched with\n * its current UI state: available values for drilldown, the currently\n * selected value, and whether the selector should be disabled.\n */\n\nexport interface ClusterConfiguratorProps {\n /** The cluster ID this configurator belongs to. Required. */\n clusterId: number;\n\n /**\n * All products that belong to the cluster. Required.\n * Used to derive available values per attribute and to match\n * the configured product when all selections are made.\n */\n products: Product[];\n\n /**\n * Cluster configuration object (`cluster.config`). Required.\n * Provides the ordered list of attribute settings.\n */\n config: ClusterConfig;\n\n /**\n * Fired whenever the user completes a set of attribute selections\n * that uniquely identifies a cluster product.\n * Also fired whenever any selection changes and a matching product\n * can already be determined (e.g. only one setting exists).\n */\n onConfigurationChange?: (product: Product) => void;\n\n /** Default product to pre-populate the attribute selections on mount. */\n defaultProduct?: Product;\n\n /** Override any UI string. Available keys: selectOption */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n\n/**\n * Renders attribute selectors (dropdown, radio, colour or image swatches) for\n * configuring a cluster, narrowing available values as the user selects and\n * emitting the matching product.\n *\n * @remarks Uses {@link useClusterConfigurator} to derive selectable values and\n * resolve the configured product.\n */\nfunction ClusterConfigurator(props: ClusterConfiguratorProps) {\n const { settingsWithValues, handleAttributeSelect, initFromProduct } = useClusterConfigurator({\n products: props.products,\n config: props.config,\n onConfigurationChange: props.onConfigurationChange,\n });\n\n \n\n useEffect(() => {\n if (props.defaultProduct) {\n initFromProduct(props.defaultProduct);\n }\n }, []);\n\n return (\n <div className={`propeller-cluster-configurator ${props.className || ''}`}>\n {!!(props.config as ClusterConfig)?.settings?.length ? (\n <div className=\"propeller-cluster-configurator__content flex flex-col gap-6\">\n {settingsWithValues?.map((setting) => (\n <div\n className=\"propeller-cluster-configurator__group\"\n key={setting.id}\n data-display-type={setting.displayType}\n data-disabled={setting.disabled ? 'true' : 'false'}\n >\n <h4 className=\"propeller-cluster-configurator__label font-semibold text-sm text-muted-foreground mb-3\">\n {setting.displayName || setting.name}\n </h4>\n {setting.displayType === 'DROPDOWN' ? (\n <select\n className=\"propeller-cluster-configurator__select w-full border border-border rounded-control px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-secondary disabled:bg-surface-hover disabled:text-foreground-subtle cursor-pointer\"\n value={setting.selectedValue}\n disabled={setting.disabled}\n onChange={(e) => handleAttributeSelect(setting.name, e.target.value)}\n >\n <option value=\"\">{getLabel(props.labels, 'selectOption', '— Select —')}</option>\n {setting.availableValues?.map((val) => (\n <option key={val} value={val}>\n {val}\n </option>\n ))}\n </select>\n ) : null}\n {setting.displayType === 'RADIO' ? (\n <div className=\"propeller-cluster-configurator__options flex flex-wrap gap-2\">\n {setting.availableValues?.map((val) => (\n <label\n key={val}\n data-selected={setting.selectedValue === val ? 'true' : 'false'}\n className={`propeller-cluster-configurator__radio flex items-center gap-2 px-3 py-1.5 rounded-control border text-sm font-medium transition-colors select-none ${setting.disabled ? 'opacity-50 cursor-not-allowed border-border text-foreground-subtle' : setting.selectedValue === val ? 'border-secondary bg-secondary/5 text-secondary cursor-pointer' : 'border-border text-muted-foreground hover:border-secondary/30 cursor-pointer'}`}\n >\n <input\n type=\"radio\"\n className=\"sr-only\"\n name={`cluster-${props.clusterId}-${setting.name}`}\n value={val}\n checked={setting.selectedValue === val}\n disabled={setting.disabled}\n onChange={(event) => handleAttributeSelect(setting.name, val)}\n />\n {val}\n </label>\n ))}\n </div>\n ) : null}\n {/* Only render colour swatches when the underlying attribute is\n actually typed COLOR. PIMs sometimes pair `displayType: 'COLOR'`\n with a TEXT attribute (colour-name strings, free text…) — in\n that case fall back to labelled chips so the value is readable. */}\n {setting.displayType === 'COLOR' && setting.attributeType === 'COLOR' ? (\n <div className=\"propeller-cluster-configurator__options flex flex-wrap gap-2\">\n {setting.availableValues?.map((val) => (\n <button\n type=\"button\"\n key={val}\n title={val}\n disabled={setting.disabled}\n onClick={(event) => handleAttributeSelect(setting.name, val)}\n data-selected={setting.selectedValue === val ? 'true' : 'false'}\n style={{\n backgroundColor: val,\n }}\n className={`propeller-cluster-configurator__color w-8 h-8 rounded-full border-2 transition-all ${setting.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'} ${setting.selectedValue === val ? 'border-secondary ring-2 ring-secondary/30 ring-offset-1 scale-110' : 'border-input hover:scale-105'}`}\n />\n ))}\n </div>\n ) : null}\n {setting.displayType === 'COLOR' && setting.attributeType !== 'COLOR' ? (\n <div className=\"propeller-cluster-configurator__options flex flex-wrap gap-2\">\n {setting.availableValues?.map((val) => (\n <button\n type=\"button\"\n key={val}\n disabled={setting.disabled}\n onClick={(event) => handleAttributeSelect(setting.name, val)}\n data-selected={setting.selectedValue === val ? 'true' : 'false'}\n className={`propeller-cluster-configurator__chip px-3 py-1.5 rounded-control border text-sm font-medium transition-colors ${setting.disabled ? 'opacity-50 cursor-not-allowed border-border text-foreground-subtle' : setting.selectedValue === val ? 'border-secondary bg-secondary/5 text-secondary cursor-pointer' : 'border-border text-muted-foreground hover:border-secondary/30 cursor-pointer'}`}\n >\n {val}\n </button>\n ))}\n </div>\n ) : null}\n {setting.displayType === 'IMAGE' ? (\n <div className=\"propeller-cluster-configurator__options flex flex-wrap gap-3\">\n {setting.availableValues?.map((val) => (\n <button\n type=\"button\"\n key={val}\n disabled={setting.disabled}\n onClick={(event) => handleAttributeSelect(setting.name, val)}\n data-selected={setting.selectedValue === val ? 'true' : 'false'}\n className={`propeller-cluster-configurator__image-swatch relative w-16 h-16 rounded-control border-2 overflow-hidden transition-all ${setting.disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'} ${setting.selectedValue === val ? 'border-secondary ring-2 ring-secondary/30 ring-offset-1' : 'border-border hover:border-secondary/30'}`}\n >\n <img className=\"propeller-cluster-configurator__image w-full h-full object-cover\" src={val} alt={val} />\n {setting.selectedValue === val ? (\n <div className=\"propeller-cluster-configurator__image-check absolute inset-0 bg-secondary bg-opacity-20 flex items-center justify-center\">\n <svg\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n className=\"w-5 h-5 text-secondary\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n ) : null}\n </button>\n ))}\n </div>\n ) : null}\n {setting.displayType !== 'DROPDOWN' &&\n setting.displayType !== 'RADIO' &&\n setting.displayType !== 'COLOR' &&\n setting.displayType !== 'IMAGE' ? (\n <div className=\"propeller-cluster-configurator__options flex flex-wrap gap-2\">\n {setting.availableValues?.map((val) => (\n <button\n type=\"button\"\n key={val}\n disabled={setting.disabled}\n onClick={(event) => handleAttributeSelect(setting.name, val)}\n data-selected={setting.selectedValue === val ? 'true' : 'false'}\n className={`propeller-cluster-configurator__chip px-3 py-1.5 rounded-control border text-sm font-medium transition-colors ${setting.disabled ? 'opacity-50 cursor-not-allowed border-border text-foreground-subtle' : setting.selectedValue === val ? 'border-secondary bg-secondary/5 text-secondary cursor-pointer' : 'border-border text-muted-foreground hover:border-secondary/30 cursor-pointer'}`}\n >\n {val}\n </button>\n ))}\n </div>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default ClusterConfigurator;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: side effects (useEffect).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useEffect } from 'react';\nimport {\n GraphQLClient,\n Cluster,\n LocalizedString,\n Contact,\n Customer,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductInfo } from '../composables/react/useProductInfo';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface ClusterInfoProps {\n // ── Data source ──────────────────────────────────────────────────────────\n /** The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n /**\n * Pre-fetched cluster object to display.\n * When provided the component skips internal fetching.\n */\n cluster?: Cluster;\n\n /**\n * Cluster ID to fetch data for when no `cluster` prop is provided.\n * Requires `graphqlClient` to be set.\n */\n clusterId?: number;\n\n /**\n * Initialised Propeller SDK GraphQL client.\n * Required when `clusterId` is provided for internal data fetching.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Called once the cluster data is loaded — either immediately (when\n * `cluster` prop is supplied) or after the internal fetch completes.\n * Use this to hydrate sibling components (configurator, price, gallery, etc.).\n */\n onClusterLoaded?: (cluster: Cluster) => void;\n\n // ── Display toggles ───────────────────────────────────────────────────────\n\n /** Show the cluster name. Defaults to true. */\n showTitle?: boolean;\n\n /** Show the cluster SKU. Defaults to true. */\n showSku?: boolean;\n\n // ── Locale ────────────────────────────────────────────────────────────────\n\n /** Language code used to resolve localised names. Defaults to 'NL'. */\n language?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /**\n * Tax zone to use for price calculation.\n */\n taxZone?: string;\n\n /**\n * Image search filter passed to ProductService.getProduct().\n * Controls how many image items are returned.\n * Example: { page: 1, offset: 20 }\n */\n imageSearchFilters?: any;\n\n /**\n * Image variant transformation filter passed to ProductService.getProduct().\n * Controls image size/format variants returned with the product.\n * Example: imageVariantFiltersLarge from @/data/defaults\n * Defaults to { transformations: [] } when omitted.\n */\n imageVariantFilters?: any;\n\n /**\n * Config object providing imageSearchFiltersGrid and imageVariantFiltersSmall.\n */\n configuration?: any;\n\n /**\n * Attribute codes/names to look up and display as badge overlays on the product image.\n * Each code is resolved against `product.attributes.items[].attributeDescription.code`\n * (or `.name`). Attributes with no matching value are silently omitted.\n * Example: ['new', 'sale']\n */\n imageLabels?: string[];\n\n /**\n * Attribute codes/names to look up and display as extra text rows below the product name.\n * Resolved the same way as `imageLabels`.\n * Example: ['brand', 'color']\n */\n textLabels?: string[];\n}\n\n/**\n * Displays a cluster's name and SKU heading, either from a supplied `cluster`\n * prop or by fetching it from the SDK by `clusterId`.\n *\n * @remarks Uses {@link useProductInfo} to fetch the cluster when only an ID is given.\n */\nfunction ClusterInfo(rawProps: ClusterInfoProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const { cluster: fetchedCluster, loading, fetchCluster } = useProductInfo(\n props.graphqlClient\n ? { graphqlClient: props.graphqlClient, language: props.language, configuration: props.configuration }\n : { graphqlClient: {} as GraphQLClient, language: props.language, configuration: props.configuration }\n );\n\n const activeCluster: Cluster | null = props.cluster || fetchedCluster;\n\n function getClusterName(): string {\n if (!activeCluster) return '';\n const lang = props.language || 'NL';\n const match = activeCluster.names?.find((n: LocalizedString) => n.language === lang);\n return match?.value || activeCluster.names?.[0]?.value || '';\n }\n\n function getClusterSku(): string {\n return activeCluster?.sku || '';\n }\n\n useEffect(() => {\n if (props.cluster) {\n if (props.onClusterLoaded) {\n props.onClusterLoaded(props.cluster);\n }\n return;\n }\n if (!props.clusterId || !props.graphqlClient) return;\n fetchCluster(props.clusterId, props.imageSearchFilters, props.imageVariantFilters);\n }, [props.clusterId]);\n\n useEffect(() => {\n if (fetchedCluster && props.onClusterLoaded) {\n props.onClusterLoaded(fetchedCluster);\n }\n }, [fetchedCluster]);\n\n return (\n <div className={`propeller-cluster-info ${(props.className as string) || ''}`} data-loading={loading ? 'true' : 'false'}>\n {loading && !props.cluster ? (\n <div className=\"propeller-cluster-info__skeleton animate-pulse space-y-3\">\n <div className=\"propeller-cluster-info__skeleton-line h-4 bg-surface-hover rounded w-1/4\" />\n <div className=\"propeller-cluster-info__skeleton-line h-8 bg-surface-hover rounded w-3/4\" />\n </div>\n ) : null}\n {!loading || !!props.cluster ? (\n <>\n {props.showSku !== false && !!getClusterSku() ? (\n <div className=\"text-sm font-mono text-muted-foreground mb-2\">\n SKU: {getClusterSku()}\n </div>\n ) : null}\n {props.showTitle !== false && !!getClusterName() ? (\n <h1 className=\"text-4xl font-bold tracking-tight text-foreground mb-4\">\n {getClusterName()}\n </h1>\n ) : null}\n </>\n ) : null}\n </div>\n );\n}\n\nexport default ClusterInfo;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { ClusterOption, Product, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice as formatPriceHelper } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Flattened render model for one product inside an option dropdown.\n */\ninterface RenderedOptionProduct {\n /** Numeric product ID. */\n productId: number;\n /** String form of `productId`, used as the option element value. */\n productIdStr: string;\n /** Combined display label, e.g. \"Product Name — €10.00\" */\n label: string;\n}\n\n/**\n * Flattened render model for one cluster option group, precomputed\n * to avoid calling state methods with arguments inside JSX.\n */\n/**\n * Flattened render model for one product inside an option dropdown.\n */\n\n/**\n * Flattened render model for one cluster option group, precomputed\n * to avoid calling state methods with arguments inside JSX.\n */\ninterface RenderedOption {\n /** Numeric ID of the cluster option group. */\n id: number;\n /** String form of `id`, used as the select element value key. */\n idStr: string;\n /** Display name of the option group. */\n name: string;\n /** Whether a selection is mandatory for this option. */\n isRequired: boolean;\n /** Product ID currently selected in this option's dropdown (empty if none). */\n selectedProductId: string;\n /** Whether the user has selected a product for this option. */\n hasSelection: boolean;\n /** Whether to show a validation error (required, unselected, and `showErrors` set). */\n hasError: boolean;\n /** Image URL of the currently selected product (empty string if none). */\n previewImageUrl: string;\n /** Name of the currently selected product. */\n previewName: string;\n /** Formatted price of the currently selected product. */\n previewPrice: string;\n /** Selectable products for this option, as flattened render models. */\n products: RenderedOptionProduct[];\n}\n/**\n * Flattened render model for one product inside an option dropdown.\n */\n\n/**\n * Flattened render model for one cluster option group, precomputed\n * to avoid calling state methods with arguments inside JSX.\n */\n\nexport interface ClusterOptionsProps {\n /** The cluster ID this options selector belongs to. Required. */\n clusterId: number;\n\n /**\n * An array of options that belong to the cluster. Required.\n * Hidden options (`option.hidden === 'Y'`) are automatically filtered out.\n */\n options: ClusterOption[];\n\n /**\n * Fired whenever the user selects a product within any option group.\n * Receives the full Product object of the chosen option product.\n * Usually used to trigger a price update on the parent page.\n */\n onOptionSelect?: (optionProduct: Product) => void;\n\n /**\n * Fired whenever the user clears an option (picks the empty/default entry\n * in a non-required dropdown). Receives the option's `id`. Parents should\n * remove that key from their `selectedOptionProducts` map so the price\n * display drops the option's add-on price.\n */\n onOptionClear?: (optionId: number) => void;\n\n /** Override any UI string. Available keys: required, selectRequired, selectOptional, requiredError */\n labels?: Record<string, string>;\n\n /** When true, required options with no selection are highlighted with a validation error. */\n showErrors?: boolean;\n\n /** Currency symbol for prices. Defaults to '€'. */\n currency?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Flattened render model for one product inside an option dropdown.\n */\n\n/**\n * Flattened render model for one cluster option group, precomputed\n * to avoid calling state methods with arguments inside JSX.\n */\n\nfunction formatPrice(price: number, currency: string): string {\n return formatPriceHelper(price, { symbol: currency });\n}\n\nfunction getProductName(product: Product): string {\n return product.names?.[0]?.value || `Product ${product.productId}`;\n}\n\nfunction getProductImageUrl(product: Product): string {\n const media = product.media;\n if (\n media?.images?.items &&\n Array.isArray(media.images.items) &&\n media.images.items.length > 0\n ) {\n const firstImage = media.images.items[0];\n if (firstImage?.imageVariants?.[0]?.url) return firstImage.imageVariants[0].url;\n }\n return '';\n}\n\n/**\n * Renders selectable add-on option groups for a cluster as dropdowns, each\n * with a preview of the chosen product. Surfaces validation errors for unset\n * required options when `showErrors` is enabled.\n */\nfunction ClusterOptions(props: ClusterOptionsProps) {\n const [selectedProductIds, setSelectedProductIds] = useState<Record<string, string>>({});\n function getOptionsForRender(): RenderedOption[] {\n const options = props.options || [];\n const sel = selectedProductIds;\n return options\n .filter((option: ClusterOption) => option.hidden !== YesNo.Y)\n .map((option: ClusterOption) => {\n const idStr = option.id.toString();\n const selectedProductId = sel[idStr] || '';\n const products = (option.products || []).map((p: Product) => ({\n productId: p.productId,\n productIdStr: p.productId.toString(),\n label: `${getProductName(p)} \\u2014 ${formatPrice(p.price?.gross || 0, props.currency ?? '\\u20ac')}`,\n }));\n let previewImageUrl = '';\n let previewName = '';\n let previewPrice = '';\n if (selectedProductId) {\n const selectedProduct = (option.products || []).find(\n (p: Product) => p.productId.toString() === selectedProductId\n );\n if (selectedProduct) {\n previewImageUrl = getProductImageUrl(selectedProduct);\n previewName = getProductName(selectedProduct);\n previewPrice = formatPrice(selectedProduct.price?.gross || 0, props.currency ?? '€');\n }\n }\n const isRequired = option.isRequired === YesNo.Y;\n return {\n id: option.id,\n idStr,\n name: option.names?.[0]?.value || `Option ${option.id}`,\n isRequired,\n selectedProductId,\n hasSelection: !!selectedProductId,\n hasError: isRequired && !selectedProductId && !!(props.showErrors as boolean),\n previewImageUrl,\n previewName,\n previewPrice,\n products,\n };\n });\n }\n function handleOptionChange(optionIdStr: string, productIdStr: string): void {\n const newIds: Record<string, string> = { ...selectedProductIds };\n if (productIdStr) newIds[optionIdStr] = productIdStr;\n else delete newIds[optionIdStr];\n setSelectedProductIds(newIds);\n if (productIdStr && props.onOptionSelect) {\n const options = props.options || [];\n const option = options.find((o: ClusterOption) => o.id.toString() === optionIdStr);\n const product = (option?.products || []).find(\n (p: Product) => p.productId.toString() === productIdStr,\n );\n if (product) props.onOptionSelect(product);\n } else if (!productIdStr && props.onOptionClear) {\n props.onOptionClear(parseInt(optionIdStr, 10));\n }\n }\n const renderedOptions = getOptionsForRender();\n return (\n <div className={`propeller-cluster-options ${props.className || ''}`}>\n {renderedOptions.length > 0 ? (\n <div className=\"propeller-cluster-options__content flex flex-col gap-6\">\n {renderedOptions.map((option) => (\n <div\n className=\"propeller-cluster-options__group\"\n key={option.id}\n data-required={option.isRequired ? 'true' : 'false'}\n data-error={option.hasError ? 'true' : 'false'}\n >\n <div className=\"propeller-cluster-options__label-row flex items-center gap-2 mb-2\">\n <h4 className=\"propeller-cluster-options__label font-semibold text-sm text-muted-foreground\">{option.name}</h4>\n {option.isRequired ? (\n <span className=\"propeller-cluster-options__required-badge inline-flex items-center rounded-full bg-destructive/10 px-2 py-0.5 text-xs font-medium text-destructive ring-1 ring-inset ring-destructive/10\">\n {getLabel(props.labels, 'required', 'Required')}\n </span>\n ) : null}\n </div>\n <select\n value={option.selectedProductId}\n onChange={(e) => handleOptionChange(option.idStr, e.target.value)}\n className={`propeller-cluster-options__select w-full rounded-control border px-3 py-2 text-sm focus:outline-none focus:ring-2 cursor-pointer ${option.hasError ? 'border-destructive focus:ring-destructive' : option.isRequired ? 'border-input focus:ring-secondary' : 'border-border focus:ring-secondary'}`}\n >\n <option value=\"\">\n {option.isRequired ? (\n <>{getLabel(props.labels, 'selectRequired', '— Select an option —')}</>\n ) : (\n <>{getLabel(props.labels, 'selectOptional', '— None (Optional) —')}</>\n )}\n </option>\n {option.products?.map((product) => (\n <option key={product.productId} value={product.productIdStr}>\n {product.label}\n </option>\n ))}\n </select>\n {option.hasError ? (\n <p className=\"propeller-cluster-options__error mt-1 text-xs text-destructive\">\n {getLabel(props.labels, 'requiredError', 'This option is required')}\n </p>\n ) : null}\n {option.hasSelection ? (\n <div className=\"propeller-cluster-options__preview mt-3 flex items-center gap-3 rounded-container border border-border-subtle bg-surface-hover p-3\">\n {!!option.previewImageUrl ? (\n <img\n className=\"propeller-cluster-options__preview-image h-12 w-12 flex-shrink-0 rounded border border-border-subtle bg-card object-contain\"\n src={option.previewImageUrl}\n alt={option.previewName}\n />\n ) : null}\n {!option.previewImageUrl ? (\n <div className=\"propeller-cluster-options__preview-image-placeholder flex h-12 w-12 flex-shrink-0 items-center justify-center rounded border border-border bg-surface-hover\">\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"h-5 w-5 text-foreground-subtle\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n strokeWidth={1.5}\n />\n </svg>\n </div>\n ) : null}\n <div className=\"min-w-0 flex-1\">\n <p className=\"propeller-cluster-options__preview-name truncate text-sm font-medium text-foreground\">\n {option.previewName}\n </p>\n <p className=\"propeller-cluster-options__preview-price text-sm font-semibold text-secondary\">{option.previewPrice}</p>\n </div>\n </div>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default ClusterOptions;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useRef, useEffect } from 'react';\nimport { Contact, Company, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport { useCompany } from '../composables/react/useCompany';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface CompanySwitcherProps {\n /** The contact to whom the companies are assigned. Default company is user.company, all companies are in user.companies. */\n user: Contact;\n\n /** GraphQL client for the Propeller SDK */\n graphqlClient?: GraphQLClient;\n\n /** Icon identifier for the company switcher trigger button. @default 'default-company-switch-icon' */\n icon?: string;\n\n /** Currently selected company ID (from CompanyContext). Syncs the switcher with external state. */\n selectedCompanyId?: number;\n\n /** Callback fired when the user selects a company. */\n onCompanyChange: (company: Company) => void;\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n}\n\n/**\n * Dropdown for switching the active company of a multi-company contact.\n *\n * @remarks Uses {@link useCompany} for SDK access; the company list is derived\n * from the `user` prop.\n */\nfunction CompanySwitcher(props: CompanySwitcherProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(() => false);\n const [activeCompanyId, setActiveCompanyId] = useState<number | null>(() => null);\n\n // useCompany provides SDK methods; company list is derived from user prop.\n // graphqlClient is allowed to be null/undefined — useCompany's CRUD methods\n // short-circuit until the client is ready.\n useCompany({ graphqlClient: props.graphqlClient });\n\n function getCompanies(): Company[] {\n // AuthContext now runs the cached user through toPlain(), so the SDK\n // CompaniesResponse shape is canonical (.items, not ._items).\n const items = props.user.companies?.items;\n if (Array.isArray(items) && items.length > 0) {\n return items;\n }\n const defaultCompany = props.user.company;\n if (defaultCompany) {\n return [defaultCompany];\n }\n return [];\n }\n\n function getActiveCompany(): Company | null {\n const idToUse = activeCompanyId ?? (props.selectedCompanyId as number | undefined) ?? null;\n if (idToUse !== null) {\n const companies = getCompanies();\n const found = companies.find((c: Company) => c.companyId === idToUse);\n return found ?? null;\n }\n return (props.user.company as Company | undefined) ?? null;\n }\n\n function getActiveCompanyName(): string {\n const company = getActiveCompany();\n return company ? company.name : 'Select company';\n }\n\n function getIcon(): string {\n return props.icon ?? 'default-company-switch-icon';\n }\n\n function isActive(company: Company): boolean {\n const active = getActiveCompany();\n return active !== null && active.companyId === company.companyId;\n }\n\n function toggleDropdown() {\n setIsOpen(!isOpen);\n }\n\n function selectCompany(company: Company) {\n setActiveCompanyId(company.companyId);\n setIsOpen(false);\n props.onCompanyChange(company);\n }\n\n useEffect(() => {\n if (!isOpen) return;\n const handleClickOutside = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setIsOpen(false);\n }\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [isOpen]);\n\n return (\n <div\n className=\"propeller-company-switcher relative inline-block\"\n ref={containerRef}\n data-open={isOpen ? 'true' : 'false'}\n >\n <button\n type=\"button\"\n aria-haspopup=\"listbox\"\n aria-label={getLabel(props.labels, 'switchCompanyAriaLabel', 'Switch company')}\n className=\"propeller-company-switcher__trigger flex items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium transition-colors hover:bg-white/10\"\n onClick={(event) => toggleDropdown()}\n aria-expanded={isOpen}\n >\n <span\n aria-hidden=\"true\"\n className={`propeller-company-switcher__icon icon-${getIcon()} flex-shrink-0`}\n />\n <span className=\"propeller-company-switcher__label truncate max-w-[160px]\">\n {getActiveCompanyName()}\n </span>\n <span\n aria-hidden=\"true\"\n className={`propeller-company-switcher__chevron flex-shrink-0 transition-transform duration-200 ${isOpen ? 'rotate-180' : 'rotate-0'}`}\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M2 4l4 4 4-4\" />\n </svg>\n </span>\n </button>\n {isOpen ? (\n <ul\n role=\"listbox\"\n aria-label={getLabel(props.labels, 'companiesAriaLabel', 'Companies')}\n className=\"propeller-company-switcher__dropdown absolute left-0 top-full z-[60] mt-1 min-w-[220px] rounded-md border border-border bg-popover text-popover-foreground shadow-lg py-1 animate-in fade-in zoom-in-95 duration-150\"\n >\n {getCompanies()?.map((company) => (\n <li\n role=\"option\"\n key={String(company.companyId)}\n aria-selected={isActive(company)}\n onClick={(event) => selectCompany(company)}\n className={`propeller-company-switcher__option flex items-center gap-3 px-4 py-2.5 text-sm cursor-pointer transition-colors hover:bg-accent hover:text-accent-foreground ${isActive(company) ? 'font-semibold text-primary' : 'font-normal text-foreground'}`}\n >\n <span className=\"propeller-company-switcher__option-name flex-1 truncate\">{company.name}</span>\n {isActive(company) ? (\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"propeller-company-switcher__option-check flex-shrink-0 w-4 h-4 text-primary\"\n >\n <path d=\"M2.5 8l4 4 7-7\" />\n </svg>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n );\n}\n\nexport default CompanySwitcher;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Cart } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface DeliveryDateProps {\n /** The cart to use for the delivery date */\n cart: Cart;\n\n /** Number of upcoming days to offer as quick-pick tiles. Defaults to 3. */\n showUpcomingDays?: number;\n\n /** Skip weekends when building the upcoming-days tiles. Defaults to `true`. */\n skipWeekends?: boolean;\n\n /** Show an \"Other date...\" tile that opens a date picker. Defaults to `true`. */\n showDatePicker?: boolean;\n\n /** Fires when a delivery date is selected, with the ISO date string. */\n onDateSelect?: (date: string) => void;\n\n /** Custom date display formatting function */\n formatDateDisplay?: (date: string) => string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** The CSS class for the container */\n containerClass?: string;\n\n /** Pre-selected date from cart (e.g. cart.postageData.requestDate: \"2026-04-17T00:00:00.000Z\") */\n initialDate?: string;\n}\n\n// ── Pure date helpers (module scope — created once, not per render) ─────────────\n\nconst WEEKDAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nconst MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',\n];\n\nfunction toApiDate(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}T00:00:00Z`;\n}\n\n/**\n * Local calendar day (`YYYY-MM-DD`) of an ISO date, for comparing a selected /\n * cart date against the quick-pick tiles. Comparing the raw ISO strings is\n * wrong: the cart's `requestDate` carries its own time/offset/millis (e.g.\n * `...T00:00:00.000Z`, `...+02:00`), so a date that IS the same day as a tile\n * fails a string match and gets misclassified as a custom \"other\" date —\n * duplicating it into the picker tile. Keying by the LOCAL day matches how the\n * tile labels are rendered (`formatDisplay` uses local getDate), so the\n * comparison and the visible label always agree. Empty/invalid → ''.\n */\nfunction toDayKey(iso: string): string {\n if (!iso) return '';\n const date = new Date(iso);\n if (isNaN(date.getTime())) return '';\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n}\n\n/** Tomorrow as a YYYY-MM-DD string (the minimum selectable date). */\nfunction getMinDate(): string {\n const tomorrow = new Date();\n tomorrow.setDate(tomorrow.getDate() + 1);\n const y = tomorrow.getFullYear();\n const m = String(tomorrow.getMonth() + 1).padStart(2, '0');\n const d = String(tomorrow.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n}\n\nfunction computeUpcomingDates(count: number, skipWeekends: boolean): string[] {\n const days: string[] = [];\n const current = new Date();\n current.setDate(current.getDate() + 1);\n while (days.length < count) {\n const dayOfWeek = current.getDay();\n if (!skipWeekends || (dayOfWeek !== 0 && dayOfWeek !== 6)) {\n days.push(toApiDate(current));\n }\n current.setDate(current.getDate() + 1);\n }\n return days;\n}\n\n/**\n * Delivery-date selector: quick-pick tiles for the next few days plus an\n * optional custom date picker, with validation against a minimum date.\n */\nfunction DeliveryDate(props: DeliveryDateProps) {\n const [selectedDate, setSelectedDate] = useState('');\n const [modalOpen, setModalOpen] = useState(false);\n const [customDateValue, setCustomDateValue] = useState('');\n const [customDateError, setCustomDateError] = useState('');\n\n const upcomingDays = props.showUpcomingDays !== undefined ? props.showUpcomingDays : 3;\n const skipWeekends = props.skipWeekends !== undefined ? props.skipWeekends : true;\n const showDatePicker = props.showDatePicker !== undefined ? props.showDatePicker : true;\n const containerClass = props.containerClass || 'delivery-date';\n const minDate = getMinDate();\n\n // Computed once per render (previously recomputed on every call — and\n // `upcomingDates()` was invoked once for the map plus 3× via\n // `isCustomDateSelected()`, each running a Date-math while loop).\n const upcomingDates = computeUpcomingDates(upcomingDays, skipWeekends);\n // Compare by local calendar day, not raw ISO string — see `toDayKey`. The\n // selected date counts as \"one of the tiles\" when its day matches a tile's\n // day, regardless of the time/offset the cart stored it with.\n const selectedDayKey = toDayKey(selectedDate);\n const upcomingDayKeys = upcomingDates.map(toDayKey);\n const isCustomDateSelected =\n selectedDayKey !== '' && upcomingDayKeys.indexOf(selectedDayKey) === -1;\n\n function formatDisplay(isoDate: string): string {\n if (props.formatDateDisplay) {\n return props.formatDateDisplay(isoDate);\n }\n // Guard against bad input: invalid dates produce NaN/undefined and render\n // as \"undefined, undefined NaN\". Return an empty string so the caller can\n // decide what to show.\n if (!isoDate) return '';\n const date = new Date(isoDate);\n if (isNaN(date.getTime())) return '';\n return `${WEEKDAYS[date.getDay()]}, ${MONTHS[date.getMonth()]} ${date.getDate()}`;\n }\n\n function handleSelect(isoDate: string): void {\n setSelectedDate(isoDate);\n setModalOpen(false);\n if (props.onDateSelect) {\n props.onDateSelect(isoDate);\n }\n }\n\n function handleCustomDateChange(value: string): void {\n // Validate before committing. The native date input doesn't reliably enforce\n // the `min` attribute on typed input across browsers, and historical or\n // out-of-range dates parse to a real Date that crashes downstream rendering\n // (\"undefined, undefined NaN\"). On any failure we keep the typed value in\n // the input so the user can fix it, and surface a single error message.\n setCustomDateValue(value);\n if (!value) {\n setCustomDateError('');\n return;\n }\n const parsed = new Date(value + 'T00:00:00');\n const year = parsed.getFullYear();\n const isParseable = !isNaN(parsed.getTime()) && year >= 1900 && year <= 9999;\n if (!isParseable) {\n setCustomDateError(getLabel(props.labels, 'invalidDate', 'Please enter a valid date.'));\n return;\n }\n // Reject anything earlier than minDate (tomorrow). String comparison works\n // because both sides are ISO-formatted YYYY-MM-DD.\n if (value < minDate) {\n setCustomDateError(getLabel(props.labels, 'pastDate', 'Please select a date in the future.'));\n return;\n }\n setCustomDateError('');\n handleSelect(toApiDate(parsed));\n }\n\n function openModal(): void {\n setCustomDateError('');\n setModalOpen(true);\n }\n\n function closeModal(): void {\n setCustomDateError('');\n setModalOpen(false);\n }\n\n function handleBackdropClick(event: React.MouseEvent): void {\n if (event.target === event.currentTarget) {\n setCustomDateError('');\n setModalOpen(false);\n }\n }\n\n // Sync external `initialDate` (from cart.postageData.requestDate) into our\n // local selection state — but only once per `initialDate` change, and only\n // when the user hasn't already picked a date themselves. This propagates\n // the cart's stored delivery date back to the parent via onDateSelect on\n // initial cart load (parent stores selectedDeliveryDate in its own state,\n // which it needs for \"Continue\" validation).\n //\n // The React Compiler rule flags this as set-state-in-effect; in this case\n // it's intentional external-state sync (the textbook valid use of\n // useEffect) — derived-state-from-props won't work here because we also\n // need to fire props.onDateSelect as a side effect on adoption, and the\n // user can override the initial with handleSelect.\n useEffect(() => {\n if (props.initialDate && !selectedDate) {\n // Normalize cart format \"2026-04-17T00:00:00.000Z\" → \"2026-04-17T00:00:00Z\"\n const dot = props.initialDate.lastIndexOf('.');\n const normalized = dot !== -1 ? props.initialDate.substring(0, dot) + 'Z' : props.initialDate;\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedDate(normalized);\n if (props.onDateSelect) {\n props.onDateSelect(normalized);\n }\n }\n }, [props.initialDate, props.cart, selectedDate, props.onDateSelect, props]);\n\n return (\n <div className={`propeller-delivery-date ${containerClass}`}>\n <div className=\"propeller-delivery-date__grid grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3\">\n {upcomingDates.map((dateStr, index) => {\n const tileSelected = selectedDayKey !== '' && upcomingDayKeys[index] === selectedDayKey;\n return (\n <div\n key={index}\n onClick={() => handleSelect(dateStr)}\n data-selected={tileSelected ? 'true' : 'false'}\n className={`propeller-delivery-date__option cursor-pointer border border-border rounded-container p-3 text-center transition-all ${tileSelected ? 'border-secondary bg-secondary/5 shadow-sm' : 'hover:border-secondary/30'}`}\n >\n <div className=\"propeller-delivery-date__option-label font-semibold\">\n {formatDisplay(dateStr)}\n </div>\n </div>\n );\n })}\n {showDatePicker ? (\n <div\n onClick={() => openModal()}\n data-selected={isCustomDateSelected ? 'true' : 'false'}\n data-custom=\"true\"\n className={`propeller-delivery-date__option propeller-delivery-date__option--custom cursor-pointer border border-border rounded-container p-3 text-center transition-all ${isCustomDateSelected ? 'border-secondary bg-secondary/5 shadow-sm' : 'hover:border-secondary/30'}`}\n >\n <div className=\"propeller-delivery-date__option-label font-semibold\">\n {isCustomDateSelected\n ? formatDisplay(selectedDate)\n : getLabel(props.labels, 'pickDate', 'Other date...')}\n </div>\n </div>\n ) : null}\n </div>\n {modalOpen ? (\n <div\n className=\"propeller-delivery-date__modal fixed inset-0 z-50 flex items-center justify-center bg-foreground/50\"\n onClick={(event) => handleBackdropClick(event)}\n >\n <div className=\"propeller-delivery-date__modal-content bg-card rounded-container shadow-xl p-6 w-full max-w-sm mx-4\">\n <div className=\"propeller-delivery-date__modal-header flex justify-between items-center mb-4\">\n <h3 className=\"propeller-delivery-date__modal-title text-lg font-semibold\">\n {getLabel(props.labels, 'modalTitle', 'Select a delivery date')}\n </h3>\n <button\n type=\"button\"\n className=\"propeller-delivery-date__modal-close text-foreground-subtle hover:text-foreground transition-colors\"\n onClick={() => closeModal()}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n stroke=\"currentColor\"\n className=\"w-5 h-5\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n <input\n type=\"date\"\n className={`propeller-delivery-date__input w-full border rounded-control px-3 py-2 text-sm focus:outline-none focus:ring-2 ${customDateError ? 'border-destructive focus:ring-destructive focus:border-destructive' : 'border-input focus:ring-secondary focus:border-secondary'}`}\n min={minDate}\n value={customDateValue}\n onChange={(event) => handleCustomDateChange(event.target.value)}\n />\n {customDateError ? (\n <p\n className=\"propeller-delivery-date__input-error text-sm text-destructive mt-2\"\n role=\"alert\"\n >\n {customDateError}\n </p>\n ) : null}\n <div className=\"propeller-delivery-date__modal-actions flex justify-end gap-3 mt-4\">\n <button\n type=\"button\"\n className=\"propeller-delivery-date__cancel-btn px-4 py-2 text-sm font-medium text-foreground bg-surface-hover rounded-control hover:bg-muted transition-colors\"\n onClick={() => closeModal()}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default DeliveryDate;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\nimport {\n Product,\n Cluster,\n GraphQLClient,\n Contact,\n Customer,\n Cart,\n CartMainItem,\n CartChildItemInput,\n ProductPrice,\n ProductInventory,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport AddToCart from './AddToCart';\nimport ItemStock from './ItemStock';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface FavoriteListItemProps {\n /** Product or Cluster to be listed as a favorite list item */\n item: Product | Cluster;\n\n /** Should the item title be a link to the PDP (default: true) */\n titleLinkable?: boolean;\n\n /** Should the stock be displayed in the favorite list item (default: false) */\n showStockComponent?: boolean;\n\n /** Show availability status (e.g. \"In stock\") inside ItemStock (default: true) */\n showAvailability?: boolean;\n\n /** Show numeric stock quantity inside ItemStock (default: true) */\n showStock?: boolean;\n\n /** Display the SKU of the item beneath the item name (default: true) */\n showSku?: boolean;\n\n /** Enables the add to cart functionality for products. Clusters show a \"View cluster\" button instead (default: true) */\n allowAddToCart?: boolean;\n\n /** Display a delete button that removes the favorite list item from the list (default: true) */\n showDelete?: boolean;\n\n /** Action callback fired when a favorite list item is deleted from the list */\n onDelete?: (itemId: string) => void;\n\n /** Callback when the item title or image is clicked. Prevents default <a> navigation when provided */\n onItemClick?: (item: Product | Cluster) => void;\n\n /** Extra CSS class applied to the root element */\n className?: string;\n\n /** Configuration object for URL generation */\n configuration?: any;\n\n /** UI string overrides */\n labels?: Record<string, string>;\n\n /** Include tax in the price display. When provided, overrides the internal PriceToggle state */\n includeTax?: boolean;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n // === AddToCart pass-through props (only used for products) ===\n\n /** Initialised Propeller SDK GraphQL client (required by embedded AddToCart) */\n graphqlClient?: GraphQLClient;\n\n /** Authenticated user — used for cart creation / lookup */\n user?: Contact | Customer | null;\n\n /** ID of an existing cart to add items to */\n cartId?: string;\n\n /** When true and no cartId is available, AddToCart automatically creates a cart */\n createCart?: boolean;\n\n /** Called after a new cart is created internally by AddToCart */\n onCartCreated?: (cart: Cart) => void;\n\n /** Fully replaces the internal CartService.addItemToCart call */\n onAddToCart?: (\n product: Product,\n clusterId?: number,\n quantity?: number,\n childItems?: CartChildItemInput[],\n notes?: string,\n price?: number,\n showModal?: boolean\n ) => Cart;\n\n /** Called after every successful add-to-cart */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n\n /** Show modal after successful add (default: false) */\n showModal?: boolean;\n\n /** Renders increment/decrement buttons beside quantity input (default: true) */\n allowIncrDecr?: boolean;\n\n /** Validate stock before adding to cart (default: false) */\n enableStockValidation?: boolean;\n\n /** Language code forwarded to CartService (default: 'NL') */\n language?: string;\n\n /** Called when \"Proceed to checkout\" is clicked in AddToCart modal */\n onProceedToCheckout?: () => void;\n\n /** Called when \"Request a Quote\" is clicked in AddToCart modal */\n onRequestQuoteClick?: (cart: Cart) => void;\n\n /** Label overrides for AddToCart UI strings */\n addToCartLabels?: Record<string, string>;\n\n /** Label overrides for ItemStock UI strings */\n stockLabels?: Record<string, string>;\n\n /** Compound mode opt-in. */\n children?: React.ReactNode;\n}\n\n// ── Context (shared by compound subcomponents) ──────────────────────────────\n\n/**\n * Internal context populated by the root `<FavoriteListItem>`. Subcomponents\n * read `useFavoriteListItemContext()` to get the item + resolved props +\n * derived display values (name, sku, imageUrl, productUrl, formatted price)\n * computed once. Not exported — consumers compose subcomponents under\n * `<FavoriteListItem>` rather than reading the context directly.\n */\ninterface FavoriteListItemContextValue {\n item: Product | Cluster;\n /** Fully resolved props (infra + explicit) — read instead of `props`. */\n resolved: FavoriteListItemProps;\n /** Derived display values, computed once at the root and read by leaves. */\n derived: {\n isProduct: boolean;\n name: string;\n sku: string;\n imageUrl: string;\n productUrl: string;\n itemId: string;\n formattedPrice: string;\n priceObj: ProductPrice | undefined;\n inventory: ProductInventory | undefined;\n useTax: boolean;\n language: string;\n currency: string;\n };\n /** Click handler shared by Image + Name. */\n handleItemClick: (e: React.MouseEvent) => void;\n /** Delete handler used by Actions. */\n handleDelete: () => void;\n}\n\nconst FavoriteListItemContext = React.createContext<FavoriteListItemContextValue | null>(null);\n\n/**\n * Internal hook used by compound subcomponents. Throws if called outside\n * `<FavoriteListItem>` — the error is intentional, that's a developer mistake.\n */\nfunction useFavoriteListItemContext(): FavoriteListItemContextValue {\n const ctx = React.useContext(FavoriteListItemContext);\n if (!ctx) {\n throw new Error(\n 'FavoriteListItem compound subcomponents must be rendered inside <FavoriteListItem>.',\n );\n }\n return ctx;\n}\n\n/**\n * Single row within a favorite list: shows a product or cluster with image,\n * SKU, price and stock, plus an embedded {@link AddToCart} (products) or\n * \"View cluster\" link, and an optional delete button.\n */\nfunction FavoriteListItem(rawProps: FavoriteListItemProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const isProduct = 'productId' in props.item;\n const product = props.item as Product;\n const cluster = props.item as Cluster;\n const name = isProduct\n ? product?.names?.[0]?.value || 'Product'\n : cluster?.names?.[0]?.value || cluster?.defaultProduct?.names?.[0]?.value || 'Cluster';\n const sku = isProduct\n ? product?.sku || ''\n : cluster?.sku || cluster?.defaultProduct?.sku || '';\n const imageUrl = isProduct\n ? product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || ''\n : cluster?.defaultProduct?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n const itemUrl = isProduct\n ? props.configuration?.urls?.getProductUrl?.(props.item) || ''\n : props.configuration?.urls?.getClusterUrl?.(props.item) || '';\n const itemId = isProduct\n ? String(product?.productId || '')\n : String(cluster?.clusterId || '');\n const priceObj = isProduct ? product?.price : cluster?.defaultProduct?.price;\n const inventory = isProduct ? product?.inventory : cluster?.defaultProduct?.inventory;\n const useTax = !!props.includeTax;\n const currency = props.currency ?? '€';\n const itemPrice = (() => {\n if (!priceObj) return '';\n const value = useTax ? priceObj.net : priceObj.gross;\n if (!value && value !== 0) return '';\n return formatPrice(value, { symbol: currency });\n })();\n function handleItemClick(e: React.MouseEvent): void {\n if (props.onItemClick) {\n e.preventDefault();\n props.onItemClick(props.item);\n } else if (itemUrl) {\n e.preventDefault();\n window.location.href = itemUrl;\n }\n }\n function handleDelete(): void {\n if (props.onDelete) props.onDelete(itemId);\n }\n\n const contextValue: FavoriteListItemContextValue = {\n item: props.item,\n resolved: props,\n derived: {\n isProduct,\n name,\n sku,\n imageUrl,\n productUrl: itemUrl,\n itemId,\n formattedPrice: itemPrice,\n priceObj,\n inventory,\n useTax,\n language: props.language ?? 'NL',\n currency,\n },\n handleItemClick,\n handleDelete,\n };\n\n // Compound mode: consumer supplied children. Render them inside the default\n // root shell so styling stays identical; consumer controls order/contents.\n if (rawProps.children !== undefined) {\n return (\n <FavoriteListItemContext.Provider value={contextValue}>\n <div\n onClick={(e) => handleItemClick(e)}\n data-type={isProduct ? 'product' : 'cluster'}\n className={`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ''}`}\n >\n {rawProps.children}\n </div>\n </FavoriteListItemContext.Provider>\n );\n }\n\n // Default / monolithic mode: render the canonical layout using the\n // compound subcomponents internally so there's a single rendering path.\n return (\n <FavoriteListItemContext.Provider value={contextValue}>\n <div\n onClick={(e) => handleItemClick(e)}\n data-type={isProduct ? 'product' : 'cluster'}\n className={`propeller-favorite-list-item flex flex-row items-center gap-4 rounded-container border border-border bg-card p-4 transition-colors hover:border-secondary/20 hover:shadow-sm cursor-pointer ${props.className || ''}`}\n >\n <FavoriteListItemImage />\n <div className=\"propeller-favorite-list-item__body flex flex-col gap-0.5 min-w-0 flex-1\">\n <FavoriteListItemSku />\n <FavoriteListItemName />\n </div>\n <FavoriteListItemStock />\n <FavoriteListItemPrice />\n <FavoriteListItemActions />\n </div>\n </FavoriteListItemContext.Provider>\n );\n}\n\n// ── Compound subcomponents ──────────────────────────────────────────────────\n\n/**\n * Item image (or placeholder). Linkable when `titleLinkable !== false`.\n */\nfunction FavoriteListItemImage(props: { className?: string }) {\n const { derived, handleItemClick, resolved } = useFavoriteListItemContext();\n const { imageUrl, name, productUrl } = derived;\n const linkable = resolved.titleLinkable !== false;\n const wrapperClass =\n props.className ??\n 'propeller-favorite-list-item__media relative w-16 h-16 flex-shrink-0 overflow-hidden rounded-control bg-surface-hover p-1';\n const inner = (\n <>\n {!!imageUrl ? (\n <img\n className=\"propeller-favorite-list-item__image h-full w-full object-contain\"\n src={imageUrl}\n alt={name}\n />\n ) : null}\n {!imageUrl ? (\n <div className=\"propeller-favorite-list-item__image-placeholder flex h-full w-full items-center justify-center text-foreground-subtle\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-8 w-8\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n strokeWidth={1}\n />\n </svg>\n </div>\n ) : null}\n </>\n );\n if (linkable) {\n return (\n <div className={wrapperClass}>\n <a\n className=\"block h-full w-full\"\n href={productUrl}\n onClick={(e) => handleItemClick(e)}\n >\n {inner}\n </a>\n </div>\n );\n }\n return (\n <div className={wrapperClass}>\n <div className=\"block h-full w-full\">{inner}</div>\n </div>\n );\n}\n\n/**\n * Item SKU. Hidden when `showSku === false` or when the item has no SKU.\n */\nfunction FavoriteListItemSku(props: { className?: string }) {\n const { derived, resolved } = useFavoriteListItemContext();\n if (resolved.showSku === false || !derived.sku) return null;\n return (\n <span\n className={\n props.className ??\n 'propeller-favorite-list-item__sku font-mono text-xs text-foreground-subtle'\n }\n >\n {derived.sku}\n </span>\n );\n}\n\n/**\n * Item title. Linkable by default; pass `linkable={false}` to render as plain\n * text, or rely on the root `titleLinkable` prop.\n */\nfunction FavoriteListItemName(props: { className?: string; linkable?: boolean }) {\n const { derived, handleItemClick, resolved } = useFavoriteListItemContext();\n const linkable = props.linkable ?? (resolved.titleLinkable !== false);\n if (linkable) {\n return (\n <a\n className={\n props.className ??\n 'propeller-favorite-list-item__title text-sm font-medium leading-tight text-foreground transition-colors hover:text-secondary line-clamp-1'\n }\n href={derived.productUrl}\n onClick={(e) => handleItemClick(e)}\n >\n {derived.name}\n </a>\n );\n }\n return (\n <span\n className={\n props.className ??\n 'propeller-favorite-list-item__title text-sm font-medium leading-tight text-foreground line-clamp-1'\n }\n >\n {derived.name}\n </span>\n );\n}\n\n/**\n * Stock display. Renders {@link ItemStock} for products and an inline\n * availability badge for clusters. Hidden when `showStockComponent !== true`\n * or when there's no inventory to show.\n */\nfunction FavoriteListItemStock(props: { className?: string }) {\n const { derived, resolved, item } = useFavoriteListItemContext();\n const { isProduct, inventory } = derived;\n if (!resolved.showStockComponent) return null;\n if (isProduct) {\n if (!inventory) return null;\n return (\n <div className={props.className ?? 'flex-shrink-0'}>\n <ItemStock\n inventory={inventory}\n showAvailability={resolved.showAvailability !== false}\n showStock={resolved.showStock !== false}\n labels={resolved.stockLabels}\n />\n </div>\n );\n }\n // Cluster stock badge\n const cluster = item as Cluster;\n const totalQty = cluster?.defaultProduct?.inventory?.totalQuantity;\n if (totalQty === undefined) return null;\n return (\n <div\n className={\n props.className ?? 'propeller-favorite-list-item__stock flex-shrink-0'\n }\n >\n {(totalQty || 0) > 5 ? (\n <span\n className=\"propeller-favorite-list-item__stock-badge inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium text-success bg-success/10\"\n data-stock=\"in\"\n >\n {getLabel(resolved.labels, 'inStock', 'In stock')}\n </span>\n ) : null}\n {(totalQty || 0) > 0 && (totalQty || 0) <= 5 ? (\n <span\n className=\"propeller-favorite-list-item__stock-badge inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium text-warning bg-warning/10\"\n data-stock=\"low\"\n >\n {getLabel(resolved.labels, 'lowStock', 'Low stock')}\n </span>\n ) : null}\n {(totalQty || 0) === 0 ? (\n <span\n className=\"propeller-favorite-list-item__stock-badge inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium text-destructive bg-destructive/10\"\n data-stock=\"out\"\n >\n {getLabel(resolved.labels, 'outOfStock', 'Out of stock')}\n </span>\n ) : null}\n </div>\n );\n}\n\n/**\n * Formatted price. Hidden when the item has no resolvable price.\n */\nfunction FavoriteListItemPrice(props: { className?: string }) {\n const { derived } = useFavoriteListItemContext();\n if (!derived.formattedPrice) return null;\n return (\n <span\n className={\n props.className ??\n 'propeller-favorite-list-item__price text-base font-bold text-foreground whitespace-nowrap flex-shrink-0'\n }\n >\n {derived.formattedPrice}\n </span>\n );\n}\n\n/**\n * Row-level actions: embedded {@link AddToCart} for products, \"View cluster\"\n * link for clusters, and an optional delete button.\n */\nfunction FavoriteListItemActions(props: { className?: string }) {\n const { derived, resolved, handleItemClick, handleDelete, item } = useFavoriteListItemContext();\n const { isProduct, productUrl } = derived;\n const product = item as Product;\n return (\n <div\n className={\n props.className ??\n 'propeller-favorite-list-item__actions flex items-center gap-2 flex-shrink-0'\n }\n onClick={(e) => e.stopPropagation()}\n >\n {resolved.allowAddToCart !== false && isProduct && !!resolved.graphqlClient ? (\n <AddToCart\n className=\"flex items-center gap-2\"\n product={product}\n cartId={resolved.cartId}\n createCart={resolved.createCart}\n onCartCreated={resolved.onCartCreated}\n onAddToCart={resolved.onAddToCart}\n afterAddToCart={resolved.afterAddToCart}\n showModal={resolved.showModal}\n allowIncrDecr={resolved.allowIncrDecr}\n enableStockValidation={resolved.enableStockValidation}\n onProceedToCheckout={resolved.onProceedToCheckout}\n onRequestQuoteClick={resolved.onRequestQuoteClick}\n labels={resolved.addToCartLabels}\n />\n ) : null}\n {!isProduct ? (\n <a\n className=\"propeller-favorite-list-item__view-cluster inline-flex items-center justify-center rounded-control bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground transition-colors hover:bg-secondary/90 whitespace-nowrap\"\n href={productUrl}\n onClick={(e) => handleItemClick(e)}\n >\n {getLabel(resolved.labels, 'viewCluster', 'View cluster')}\n </a>\n ) : null}\n {resolved.showDelete !== false ? (\n <button\n type=\"button\"\n className=\"propeller-favorite-list-item__delete-btn h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-foreground-subtle hover:text-destructive hover:bg-destructive/10 transition-colors\"\n onClick={handleDelete}\n title={getLabel(resolved.labels, 'delete', 'Remove from list')}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 6h18\" />\n <path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n </svg>\n </button>\n ) : null}\n </div>\n );\n}\n\ntype FavoriteListItemComponent = typeof FavoriteListItem & {\n Image: typeof FavoriteListItemImage;\n Sku: typeof FavoriteListItemSku;\n Name: typeof FavoriteListItemName;\n Stock: typeof FavoriteListItemStock;\n Price: typeof FavoriteListItemPrice;\n Actions: typeof FavoriteListItemActions;\n};\n\nconst FavoriteListItemExport = FavoriteListItem as FavoriteListItemComponent;\nFavoriteListItemExport.Image = FavoriteListItemImage;\nFavoriteListItemExport.Sku = FavoriteListItemSku;\nFavoriteListItemExport.Name = FavoriteListItemName;\nFavoriteListItemExport.Stock = FavoriteListItemStock;\nFavoriteListItemExport.Price = FavoriteListItemPrice;\nFavoriteListItemExport.Actions = FavoriteListItemActions;\n\nexport default FavoriteListItemExport;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: JSX event handlers (onClick/onChange/etc.).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\nimport { ProductsResponse } from '@propeller-commerce/propeller-sdk-v2';\n\n// Built-in label defaults (can be overridden via the labels prop).\n\nexport interface GridPaginationProps {\n /**\n * A ProductsResponse object for populating the pagination component.\n * Reads `page` (current page), `pages` (total pages) from the response.\n */\n products: ProductsResponse;\n\n /**\n * Called when the user navigates to a different page.\n * Receives the newly selected page number (1-based).\n */\n onPageChange: (page: number) => void;\n\n /**\n * Pagination display variant.\n * 'compact' — Previous / \"Page X of Y\" / Next.\n * 'full' — numbered page buttons with ellipsis collapsing + Previous / Next.\n * Defaults to 'compact'.\n */\n variant?: string;\n\n /**\n * Number of visible page buttons rendered around the current page in 'full' style.\n * Defaults to 5.\n */\n siblingCount?: number;\n\n /**\n * Label overrides for the text inside the component.\n * Supported keys: previous, next, page, of\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n\n/** Single item in the computed full-style page list. */\n// Built-in label defaults (can be overridden via the labels prop).\n\n/** Single item in the computed full-style page list. */\ninterface PageItem {\n /** 'page' renders a numbered button; 'dots' renders an ellipsis spacer. */\n type: string;\n /** Page number for 'page' items; negative unique sentinel for 'dots' items. */\n value: number;\n}\n// Built-in label defaults (can be overridden via the labels prop).\n\n/** Single item in the computed full-style page list. */\n\n// Built-in label defaults (can be overridden via the labels prop).\nconst DEFAULT_LABELS: Record<string, string> = {\n previous: 'Previous',\n next: 'Next',\n page: 'Page',\n of: 'of',\n};\n\n/**\n * Pagination control for a product grid, in a compact (\"Page X of Y\") or full\n * (numbered buttons with ellipsis) variant.\n */\nfunction GridPagination(props: GridPaginationProps) {\n function getLabel(key: string): string {\n const labels = props.labels || {};\n return labels[key] !== undefined ? labels[key] : DEFAULT_LABELS[key] || key;\n }\n const totalPages: number = props.products?.pages || 1;\n const currentPage: number = props.products?.page || 1;\n const showPagination = totalPages > 1;\n const variant = props.variant || 'compact';\n function getFullPages(): PageItem[] {\n const total = totalPages;\n const current = currentPage;\n const sibling = props.siblingCount || 5;\n\n // All pages fit without collapsing — show them all.\n if (total <= sibling + 4) {\n const items: PageItem[] = [];\n for (let i = 1; i <= total; i++)\n items.push({\n type: 'page',\n value: i,\n });\n return items;\n }\n\n // Compute sibling window, always staying inside [2, total-1].\n const halfSib = Math.floor(sibling / 2);\n let rangeStart = Math.max(2, current - halfSib);\n let rangeEnd = Math.min(total - 1, current + halfSib);\n\n // Stretch the range to ensure exactly siblingCount slots when near an edge.\n if (rangeEnd - rangeStart + 1 < sibling) {\n if (rangeStart === 2) {\n rangeEnd = Math.min(total - 1, rangeStart + sibling - 1);\n } else {\n rangeStart = Math.max(2, rangeEnd - sibling + 1);\n }\n }\n const items: PageItem[] = [];\n\n // First page\n items.push({\n type: 'page',\n value: 1,\n });\n\n // Left ellipsis (value -1 is a unique sentinel)\n if (rangeStart > 2)\n items.push({\n type: 'dots',\n value: -1,\n });\n\n // Sibling window\n for (let i = rangeStart; i <= rangeEnd; i++) {\n items.push({\n type: 'page',\n value: i,\n });\n }\n\n // Right ellipsis (value -2 is a unique sentinel)\n if (rangeEnd < total - 1)\n items.push({\n type: 'dots',\n value: -2,\n });\n\n // Last page\n items.push({\n type: 'page',\n value: total,\n });\n return items;\n }\n const handlePageChange = (page: number) => props.onPageChange?.(page);\n return (\n <div\n className={`propeller-grid-pagination ${props.className || ''}`}\n data-variant={variant}\n >\n {showPagination ? (\n <>\n {variant === 'compact' ? (\n <div className=\"propeller-grid-pagination__compact flex justify-center items-center gap-2\">\n <button\n type=\"button\"\n className=\"propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage === 1}\n onClick={() => handlePageChange(currentPage - 1)}\n >\n {getLabel('previous')}\n </button>\n <span className=\"propeller-grid-pagination__info px-2 text-sm font-medium text-muted-foreground\">\n {getLabel('page')}&nbsp;{currentPage}&nbsp;{getLabel('of')}&nbsp;{totalPages}\n </span>\n <button\n type=\"button\"\n className=\"propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage === totalPages}\n onClick={() => handlePageChange(currentPage + 1)}\n >\n {getLabel('next')}\n </button>\n </div>\n ) : null}\n {variant === 'full' ? (\n <div className=\"propeller-grid-pagination__full flex justify-center items-center gap-1 flex-wrap\">\n <button\n type=\"button\"\n className=\"propeller-grid-pagination__btn propeller-grid-pagination__btn--prev inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage === 1}\n onClick={() => handlePageChange(currentPage - 1)}\n >\n {getLabel('previous')}\n </button>\n {getFullPages().map((item, idx) => (\n <div\n className=\"propeller-grid-pagination__page-wrapper inline-flex\"\n key={item.type === 'dots' ? `dots-${idx}` : `page-${item.value}`}\n >\n {item.type === 'dots' ? (\n <span className=\"propeller-grid-pagination__dots inline-flex items-center justify-center min-w-[2rem] px-1 py-2 text-sm text-muted-foreground select-none\">\n ...\n </span>\n ) : (\n <button\n type=\"button\"\n onClick={() => handlePageChange(item.value)}\n data-active={item.value === currentPage ? 'true' : 'false'}\n className={\n item.value === currentPage\n ? 'propeller-grid-pagination__page inline-flex items-center justify-center min-w-[2.25rem] rounded-control border border-primary bg-primary px-3 py-2 text-sm font-semibold text-primary-foreground shadow-sm'\n : 'propeller-grid-pagination__page inline-flex items-center justify-center min-w-[2.25rem] rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover'\n }\n >\n {item.value}\n </button>\n )}\n </div>\n ))}\n <button\n type=\"button\"\n className=\"propeller-grid-pagination__btn propeller-grid-pagination__btn--next inline-flex items-center rounded-control border border-input bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm hover:bg-surface-hover disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage === totalPages}\n onClick={() => handlePageChange(currentPage + 1)}\n >\n {getLabel('next')}\n </button>\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n );\n}\n\nexport default GridPagination;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport { useState, useEffect, useMemo } from 'react';\nimport {\n Product,\n Cluster,\n FavoriteList,\n GraphQLClient,\n Contact,\n Customer,\n Cart,\n CartMainItem,\n CartChildItemInput,\n ProductsResponse,\n FavoriteListVariables,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useFavorites } from '../composables/react/useFavorites';\nimport { useProductSearch } from '../composables/react/useProductSearch';\nimport { useCart } from '../composables/react/useCart';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { createServices } from '@propeller-commerce/propeller-v2-core-ui';\nimport DefaultFavoriteListItemImpl from './FavoriteListItem';\nimport DefaultGridPaginationImpl from './GridPagination';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getProductImageUrl, getClusterImageUrl } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface FavoriteListDetailsProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The logged in user for which the favorite list is going to be displayed. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer;\n\n /** The favorite list ID to display */\n favoriteListId: string;\n\n /** Action method for deleting a single favorite list item. If not provided, delete button is hidden */\n onItemDelete?: (itemId: string, itemType?: string) => void;\n\n /** Batched delete callback for the floating bar \"Remove\" action. When provided, it is called once with all selected items; otherwise the component falls back to calling `onItemDelete` per item */\n onItemsDelete?: (items: { id: string; type: 'product' | 'cluster' }[]) => void;\n\n /** Called after the favorite list is fetched, with the full list object */\n onListLoaded?: (list: FavoriteList) => void;\n\n /** Called after an item is added to the list from the in-list search modal.\n * Use this to refresh the source the lists overview reads from (e.g. the\n * user object), so the per-list count stays correct after navigating back. */\n onItemAdded?: (item: Product | Cluster) => void;\n\n /** Number of items to show per page (default: 12) */\n itemsPerPage?: number;\n\n /** Show pagination controls (default: true) */\n showPagination?: boolean;\n\n /** Pagination display variant: 'compact' or 'full' (default: 'compact') */\n paginationVariant?: string;\n\n /** Extra CSS class applied to the root element */\n className?: string;\n\n /** Configuration object for URL generation */\n configuration?: any;\n\n /** UI string overrides */\n labels?: Record<string, string>;\n\n // === FavoriteListItem display props ===\n\n /** Should item titles link to the PDP (default: true) */\n titleLinkable?: boolean;\n\n /** Show stock availability on items (default: false) */\n showStockComponent?: boolean;\n\n /** Show availability status (e.g. \"In stock\") inside ItemStock (default: true) */\n showAvailability?: boolean;\n\n /** Show numeric stock quantity inside ItemStock (default: true) */\n showStock?: boolean;\n\n /** Display the SKU beneath item names (default: true) */\n showSku?: boolean;\n\n /** Enable add to cart for products. Clusters show \"View cluster\" instead (default: true) */\n allowAddToCart?: boolean;\n\n /** Show delete button on each item (default: true) */\n showDelete?: boolean;\n\n /** Callback when an item title or image is clicked */\n onItemClick?: (item: Product | Cluster) => void;\n\n // === AddToCart pass-through props (products only) ===\n\n /** ID of an existing cart to add items to */\n cartId?: string;\n\n /** Auto-create cart if none exists */\n createCart?: boolean;\n\n /** Called after a new cart is created internally by AddToCart */\n onCartCreated?: (cart: Cart) => void;\n\n /** Fully replaces the internal CartService.addItemToCart call */\n onAddToCart?: (\n product: Product,\n clusterId?: number,\n quantity?: number,\n childItems?: CartChildItemInput[],\n notes?: string,\n price?: number,\n showModal?: boolean\n ) => Cart;\n\n /** Called after every successful add-to-cart */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n\n /** Show modal after successful add (default: false) */\n showModal?: boolean;\n\n /** Renders increment/decrement buttons beside quantity input (default: true) */\n allowIncrDecr?: boolean;\n\n /** Validate stock before adding to cart (default: false) */\n enableStockValidation?: boolean;\n\n /** Language code forwarded to CartService (default: 'NL') */\n language?: string;\n\n /** Called when \"Proceed to checkout\" is clicked in AddToCart modal */\n onProceedToCheckout?: () => void;\n\n /** Called when \"Request a Quote\" is clicked in AddToCart modal */\n onRequestQuoteClick?: (cart: Cart) => void;\n\n /** Label overrides for AddToCart UI strings */\n addToCartLabels?: Record<string, string>;\n\n /** Label overrides for ItemStock UI strings */\n stockLabels?: Record<string, string>;\n\n /** Label overrides for FavoriteListItem UI strings */\n itemLabels?: Record<string, string>;\n\n /** Include tax in prices. Pass from PriceContext's usePrice() */ includeTax?: boolean;\n\n // ───── Extension API ─────\n // Replaces each <FavoriteListItem> rendered in the list.\n favoriteListItemComponent?: React.ComponentType<import('./FavoriteListItem').FavoriteListItemProps>;\n // Replaces the <GridPagination> control.\n gridPaginationComponent?: React.ComponentType<import('./GridPagination').GridPaginationProps>;\n}\n\n/**\n * Detail view of a single favorite list: paginated, selectable items with bulk\n * remove / add-to-cart actions and a modal for searching and adding products.\n *\n * @remarks Uses {@link useFavorites}, {@link useCart} and {@link useProductSearch}.\n */\nfunction FavoriteListDetails(rawProps: FavoriteListDetailsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const FavoriteListItemImpl = props.favoriteListItemComponent ?? DefaultFavoriteListItemImpl;\n const GridPaginationImpl = props.gridPaginationComponent ?? DefaultGridPaginationImpl;\n const { addToList } = useFavorites({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n });\n\n const { addItem } = useCart({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n cartId: props.cartId,\n language: props.language,\n configuration: props.configuration,\n onCartCreated: props.onCartCreated,\n });\n\n const {\n searchTerm,\n searchResults,\n searchLoading,\n search,\n } = useProductSearch({\n graphqlClient: props.graphqlClient!,\n language: props.language,\n user: props.user ?? null,\n configuration: props.configuration || {},\n });\n\n const [loading, setLoading] = useState(() => true);\n const [, setFavoriteList] = useState<FavoriteList | null>(() => null);\n const [allItems, setAllItems] = useState<(Product | Cluster)[]>(() => []);\n const [currentPage, setCurrentPage] = useState(() => 1);\n const [isMounted, setIsMounted] = useState(() => false);\n const [prevListId, setPrevListId] = useState(() => '');\n const [selectedIds, setSelectedIds] = useState<Set<string>>(() => new Set());\n const [bulkBusy, setBulkBusy] = useState(false);\n const [showAddModal, setShowAddModal] = useState(false);\n const [addingItemKey, setAddingItemKey] = useState<string>('');\n\n function getRowKey(item: Product | Cluster): string {\n if ('productId' in item) return 'p-' + String((item as Product).productId);\n return 'c-' + String((item as Cluster).clusterId);\n }\n\n function isRowSelected(item: Product | Cluster): boolean {\n return selectedIds.has(getRowKey(item));\n }\n\n function toggleRow(item: Product | Cluster) {\n setSelectedIds((prev) => {\n const next = new Set(prev);\n const key = getRowKey(item);\n if (next.has(key)) next.delete(key);\n else next.add(key);\n return next;\n });\n }\n\n const pageRowKeys = useMemo(\n () => getPagedItems().map((i) => getRowKey(i)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [allItems, currentPage, props.itemsPerPage]\n );\n\n function isAllPageSelected(): boolean {\n if (pageRowKeys.length === 0) return false;\n return pageRowKeys.every((k) => selectedIds.has(k));\n }\n\n function togglePageSelectAll() {\n setSelectedIds((prev) => {\n const next = new Set(prev);\n const allSelected = pageRowKeys.every((k) => next.has(k));\n if (allSelected) pageRowKeys.forEach((k) => next.delete(k));\n else pageRowKeys.forEach((k) => next.add(k));\n return next;\n });\n }\n\n function clearSelection() {\n setSelectedIds(new Set());\n }\n\n function getSelectedItems(): (Product | Cluster)[] {\n return allItems.filter((i) => selectedIds.has(getRowKey(i)));\n }\n\n function getSelectedProducts(): Product[] {\n return getSelectedItems().filter((i) => 'productId' in i) as Product[];\n }\n\n async function handleBulkRemove() {\n if (bulkBusy) return;\n const items = getSelectedItems();\n if (items.length === 0) return;\n setBulkBusy(true);\n try {\n const entries: { id: string; type: 'product' | 'cluster' }[] = items.map((it) => ({\n id: 'productId' in it ? String((it as Product).productId) : String((it as Cluster).clusterId),\n type: 'productId' in it ? 'product' : 'cluster',\n }));\n const remaining = allItems.filter((p) => !selectedIds.has(getRowKey(p)));\n setAllItems(remaining);\n clearSelection();\n const newTotalPages = Math.max(1, Math.ceil(remaining.length / getItemsPerPage()));\n if (currentPage > newTotalPages) {\n setCurrentPage(newTotalPages);\n }\n if (props.onItemsDelete) {\n props.onItemsDelete(entries);\n } else if (props.onItemDelete) {\n entries.forEach((entry) => props.onItemDelete!(entry.id, entry.type));\n }\n } finally {\n setBulkBusy(false);\n }\n }\n\n async function handleBulkAddToCart() {\n if (bulkBusy) return;\n const products = getSelectedProducts();\n if (products.length === 0) return;\n setBulkBusy(true);\n try {\n for (const product of products) {\n await addItem({\n product,\n quantity: product.minimumQuantity && product.minimumQuantity > 0 ? product.minimumQuantity : 1,\n cartId: props.cartId,\n createCart: props.createCart !== false,\n enableStockValidation: props.enableStockValidation,\n afterAddToCart: (resultCart, addedItem) => {\n props.afterAddToCart?.(resultCart, addedItem || undefined);\n },\n });\n }\n clearSelection();\n } finally {\n setBulkBusy(false);\n }\n }\n\n async function handleAddItemFromSearch(item: Product | Cluster) {\n const key = getRowKey(item);\n if (addingItemKey) return;\n // Already in the list — nothing to add (guards double-add + count drift).\n if (allItems.some((i) => getRowKey(i) === key)) return;\n setAddingItemKey(key);\n try {\n const productId = 'productId' in item ? (item as Product).productId : undefined;\n const clusterId = 'clusterId' in item ? (item as Cluster).clusterId : undefined;\n await addToList(props.favoriteListId, productId, clusterId);\n // Optimistic append — mirrors the optimistic remove paths. A refetch here\n // raced the just-written item (the read could return the pre-add snapshot)\n // and reset the page to 1, so the count appeared stale and the view\n // jumped. Updating local state keeps the count and page stable.\n setAllItems((prev) =>\n prev.some((i) => getRowKey(i) === key) ? prev : [...prev, item]\n );\n // Let the host refresh whatever the lists overview reads from (the user\n // object), so the per-list count is correct after navigating back.\n props.onItemAdded?.(item);\n } finally {\n setAddingItemKey('');\n }\n }\n\n function getSearchItemName(item: Product | Cluster): string {\n if ('productId' in item) return (item as Product).names?.[0]?.value || 'Product';\n const cluster = item as Cluster;\n return cluster.names?.[0]?.value || cluster.defaultProduct?.names?.[0]?.value || 'Cluster';\n }\n\n function getSearchItemSku(item: Product | Cluster): string {\n if ('productId' in item) return (item as Product).sku || '';\n const cluster = item as Cluster;\n return cluster.sku || cluster.defaultProduct?.sku || '';\n }\n\n function getSearchItemImage(item: Product | Cluster): string {\n if ('productId' in item) return getProductImageUrl(item as Product);\n return getClusterImageUrl(item as Cluster);\n }\n\n function getSearchItemStockLabel(item: Product | Cluster): string {\n const qty =\n 'productId' in item\n ? (item as Product).inventory?.totalQuantity\n : (item as Cluster).defaultProduct?.inventory?.totalQuantity;\n if (qty === undefined || qty === null) return '';\n if (qty <= 0) return getLabel(props.labels, 'outOfStock', 'Out of stock');\n if (qty <= 5) return getLabel(props.labels, 'lowStock', 'Low stock');\n return getLabel(props.labels, 'inStock', 'In stock');\n }\n\n function closeAddModal() {\n setShowAddModal(false);\n search('');\n }\n\n\n\n function getItemsPerPage(): number {\n return props.itemsPerPage || 12;\n }\n\n function getTotalPages(): number {\n return Math.max(1, Math.ceil(allItems.length / getItemsPerPage()));\n }\n\n function getPagedItems(): (Product | Cluster)[] {\n const perPage = getItemsPerPage();\n const start = (currentPage - 1) * perPage;\n return allItems.slice(start, start + perPage);\n }\n\n function getPaginationData(): Record<string, number> {\n return {\n page: currentPage,\n pages: getTotalPages(),\n itemsFound: allItems.length,\n offset: getItemsPerPage(),\n };\n }\n\n function handlePageChange(page: number) {\n setCurrentPage(page);\n }\n\n function buildFetchVariables(): Record<string, unknown> {\n const priceInput: Record<string, unknown> = { taxZone: 'NL' };\n if (props.user) {\n if ('customerId' in props.user) {\n const customer = props.user as Customer;\n if (customer.customerId) {\n priceInput.customerId = customer.customerId;\n }\n } else if ('contactId' in props.user) {\n const contact = props.user as Contact;\n if (contact.contactId) {\n priceInput.contactId = contact.contactId;\n }\n if (contact.company?.companyId) {\n priceInput.companyId = contact.company.companyId;\n }\n }\n }\n return {\n id: props.favoriteListId,\n language: props.language || 'NL',\n priceCalculateProductInput: priceInput,\n imageSearchFilters: { page: 1, offset: 1 },\n imageVariantFilters: {\n transformations: [\n {\n name: 'cart_thumb',\n transformation: { format: 'WEBP', height: 200, width: 200, fit: 'BOUNDS' },\n },\n ],\n },\n };\n }\n\n async function fetchList() {\n if (!props.graphqlClient || !props.favoriteListId) return;\n setLoading(true);\n try {\n const service = createServices(props.graphqlClient).favoriteList;\n const list = await service.getFavoriteList(\n buildFetchVariables() as unknown as FavoriteListVariables\n );\n setFavoriteList(list);\n if (props.onListLoaded) {\n props.onListLoaded(list);\n }\n const items: (Product | Cluster)[] = [];\n const productsRef = list?.products as ProductsResponse;\n if (productsRef?.items && Array.isArray(productsRef.items)) {\n (productsRef.items as Product[]).forEach((item: Product) => items.push(item));\n }\n const clustersRef = list?.clusters as ProductsResponse;\n if (clustersRef?.items && Array.isArray(clustersRef.items)) {\n (clustersRef.items as Cluster[]).forEach((item: Cluster) => items.push(item));\n }\n setAllItems(items);\n setCurrentPage(1);\n } catch (error) {\n console.error('Error fetching favorite list:', error);\n setFavoriteList(null);\n setAllItems([]);\n } finally {\n setLoading(false);\n }\n }\n\n function handleItemDelete(itemId: string) {\n /* Determine item type before removing from local state */ const deletedItem = allItems.find(\n (item: Product | Cluster) => {\n if ('productId' in item) return String(item.productId) === itemId;\n return String((item as Cluster).clusterId) === itemId;\n }\n );\n const itemType: string = deletedItem && 'clusterId' in deletedItem ? 'cluster' : 'product';\n /* Optimistic: remove from local state */ setAllItems(\n allItems.filter((item: Product | Cluster) => {\n if ('productId' in item) return String(item.productId) !== itemId;\n return String((item as Cluster).clusterId) !== itemId;\n })\n );\n /* Adjust current page if needed */ if (currentPage > getTotalPages()) {\n setCurrentPage(Math.max(1, getTotalPages()));\n }\n /* Notify parent with type info */ if (props.onItemDelete) {\n props.onItemDelete(itemId, itemType);\n }\n }\n\n useEffect(() => {\n setIsMounted(true);\n setPrevListId(props.favoriteListId || '');\n fetchList();\n }, []);\n\n useEffect(() => {\n if (props.favoriteListId && props.favoriteListId !== prevListId) {\n setPrevListId(props.favoriteListId);\n fetchList();\n }\n }, [props.favoriteListId]);\n\n return (\n <div className={`propeller-favorite-list-details ${props.className || ''}`} data-loading={loading ? 'true' : 'false'}>\n {loading ? (\n <div className=\"propeller-favorite-list-details__skeleton space-y-4\">\n {[1, 2, 3]?.map((i) => (\n <div\n className=\"propeller-favorite-list-details__skeleton-row flex items-center gap-4 p-4 border-b border-border animate-pulse\"\n key={i}\n >\n <div className=\"w-20 h-20 bg-surface-hover rounded-control flex-shrink-0\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-1/4 bg-surface-hover rounded\" />\n <div className=\"h-5 w-1/2 bg-surface-hover rounded\" />\n <div className=\"h-4 w-1/6 bg-surface-hover rounded\" />\n </div>\n <div className=\"h-10 w-28 bg-surface-hover rounded\" />\n </div>\n ))}\n </div>\n ) : null}\n {!loading && isMounted ? (\n <>\n {allItems.length > 0 ? (\n <div className=\"propeller-favorite-list-details__list space-y-3\">\n <div className=\"propeller-favorite-list-details__select-all flex items-center gap-2 pb-2\">\n <input\n id=\"favorite-list-select-all-top\"\n type=\"checkbox\"\n className=\"propeller-favorite-list-details__select-all-checkbox h-4 w-4 rounded border-border accent-secondary cursor-pointer\"\n checked={isAllPageSelected()}\n onChange={() => togglePageSelectAll()}\n />\n <label\n htmlFor=\"favorite-list-select-all-top\"\n className=\"propeller-favorite-list-details__select-all-label text-sm font-medium cursor-pointer select-none\"\n >\n {getLabel(props.labels, 'selectAll', 'Select all')}\n </label>\n </div>\n {getPagedItems()?.map((item) => (\n <div\n key={\n 'productId' in item\n ? 'p-' + (item as Product).productId\n : 'c-' + (item as Cluster).clusterId\n }\n className=\"propeller-favorite-list-details__row flex items-center gap-3\"\n data-selected={isRowSelected(item) ? 'true' : 'false'}\n >\n <input\n type=\"checkbox\"\n className=\"propeller-favorite-list-details__row-checkbox h-4 w-4 flex-shrink-0 rounded border-border accent-secondary cursor-pointer\"\n checked={isRowSelected(item)}\n onChange={() => toggleRow(item)}\n aria-label={getLabel(props.labels, 'selectItem', 'Select item')}\n />\n <div className=\"propeller-favorite-list-details__row-item flex-1 min-w-0\">\n <FavoriteListItemImpl\n item={item}\n cartId={props.cartId}\n createCart={props.createCart}\n onCartCreated={props.onCartCreated}\n onAddToCart={props.onAddToCart}\n afterAddToCart={props.afterAddToCart}\n showModal={props.showModal}\n allowIncrDecr={props.allowIncrDecr}\n enableStockValidation={props.enableStockValidation}\n onProceedToCheckout={props.onProceedToCheckout}\n onRequestQuoteClick={props.onRequestQuoteClick}\n addToCartLabels={props.addToCartLabels}\n stockLabels={props.stockLabels}\n labels={props.itemLabels}\n titleLinkable={props.titleLinkable}\n showStockComponent={props.showStockComponent}\n showAvailability={props.showAvailability}\n showStock={props.showStock}\n showSku={props.showSku}\n allowAddToCart={props.allowAddToCart}\n showDelete={props.showDelete}\n onDelete={(itemId) => handleItemDelete(itemId)}\n onItemClick={props.onItemClick}\n includeTax={props.includeTax}\n />\n </div>\n </div>\n ))}\n {props.showPagination !== false && getTotalPages() > 1 ? (\n <div className=\"propeller-favorite-list-details__pagination mt-6\">\n <GridPaginationImpl\n products={getPaginationData() as unknown as ProductsResponse}\n onPageChange={(page) => handlePageChange(page)}\n variant={props.paginationVariant || 'compact'}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n <div className=\"propeller-favorite-list-details__add-wrapper mt-6\">\n <button\n type=\"button\"\n className=\"propeller-favorite-list-details__add-btn inline-flex items-center justify-center rounded-control bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground transition-colors hover:bg-secondary/90\"\n onClick={() => setShowAddModal(true)}\n >\n {getLabel(props.labels, 'addProductDirectly', 'Add product directly to this wishlist')}\n </button>\n </div>\n {allItems.length === 0 ? (\n <div className=\"propeller-favorite-list-details__empty border border-border rounded-container p-12 text-center space-y-4\">\n <div className=\"propeller-favorite-list-details__empty-icon-wrapper bg-surface-hover p-4 rounded-full w-16 h-16 flex items-center justify-center mx-auto\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"propeller-favorite-list-details__empty-icon text-foreground-subtle\"\n >\n <path d=\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\" />\n </svg>\n </div>\n <div>\n <p className=\"propeller-favorite-list-details__empty-title text-lg font-medium\">{getLabel(props.labels, 'emptyTitle', 'List is empty')}</p>\n <p className=\"propeller-favorite-list-details__empty-message text-muted-foreground\">\n {getLabel(props.labels, 'emptyDescription', \"You haven't added any products or clusters to this list yet.\")}\n </p>\n </div>\n </div>\n ) : null}\n </>\n ) : null}\n {selectedIds.size > 0 ? (\n <div className=\"propeller-favorite-list-details__floating-bar fixed bottom-0 left-0 right-0 z-40 border-t border-border bg-card shadow-lg\">\n <div className=\"propeller-favorite-list-details__floating-bar-inner flex items-center justify-between gap-4 px-6 py-4\">\n <div className=\"propeller-favorite-list-details__floating-bar-status flex items-center gap-2\">\n <input\n id=\"favorite-list-select-all-floating\"\n type=\"checkbox\"\n className=\"h-4 w-4 rounded border-border accent-secondary cursor-pointer\"\n checked={isAllPageSelected()}\n onChange={() => togglePageSelectAll()}\n />\n <label\n htmlFor=\"favorite-list-select-all-floating\"\n className=\"text-sm font-medium cursor-pointer select-none\"\n >\n {getLabel(props.labels, 'selectAll', 'Select all')}\n </label>\n <span className=\"propeller-favorite-list-details__floating-bar-count text-sm text-foreground-subtle ml-3\">\n {selectedIds.size} {getLabel(props.labels, 'ofWord', 'of')} {allItems.length} {getLabel(props.labels, 'itemsSelected', 'items selected')}\n </span>\n </div>\n <div className=\"propeller-favorite-list-details__floating-bar-actions flex items-center gap-3\">\n <button\n type=\"button\"\n className=\"propeller-favorite-list-details__bulk-remove-btn inline-flex items-center justify-center rounded-control border border-border bg-transparent px-4 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-hover disabled:opacity-50\"\n disabled={bulkBusy}\n onClick={() => handleBulkRemove()}\n >\n {getLabel(props.labels, 'removeFromList', 'Remove from this list')}\n </button>\n <button\n type=\"button\"\n className=\"propeller-favorite-list-details__bulk-add-btn inline-flex items-center justify-center gap-2 rounded-control bg-secondary px-6 py-2 text-sm font-medium text-secondary-foreground transition-colors hover:bg-secondary/90 disabled:opacity-50\"\n disabled={bulkBusy || getSelectedProducts().length === 0}\n onClick={() => handleBulkAddToCart()}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"9\" cy=\"21\" r=\"1\" />\n <circle cx=\"20\" cy=\"21\" r=\"1\" />\n <path d=\"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6\" />\n </svg>\n {getLabel(props.labels, 'addToCart', 'Add to cart')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n {showAddModal ? (\n <div\n className=\"propeller-favorite-list-details__modal-overlay fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\"\n onClick={() => closeAddModal()}\n >\n <div\n className=\"propeller-favorite-list-details__modal w-full max-w-xl rounded-container bg-card shadow-xl\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"propeller-favorite-list-details__modal-header border-b border-border px-6 py-4\">\n <h2 className=\"propeller-favorite-list-details__modal-title text-lg font-bold\">\n {getLabel(props.labels, 'addProductModalTitle', 'Add product to list')}\n </h2>\n </div>\n <div className=\"propeller-favorite-list-details__modal-body px-6 py-4 space-y-4\">\n <div className=\"propeller-favorite-list-details__search-input-wrapper relative\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-foreground-subtle\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n <input\n type=\"text\"\n className=\"propeller-favorite-list-details__search-input w-full rounded-control border border-border bg-card px-9 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-secondary\"\n placeholder={getLabel(props.labels, 'searchPlaceholder', 'Search for products...')}\n value={searchTerm}\n onChange={(e) => search(e.target.value)}\n autoFocus\n />\n {searchTerm ? (\n <button\n type=\"button\"\n className=\"propeller-favorite-list-details__search-clear absolute right-3 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground\"\n onClick={() => search('')}\n aria-label={getLabel(props.labels, 'clearSearchAriaLabel', 'Clear search')}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n ) : null}\n </div>\n <div className=\"propeller-favorite-list-details__search-results max-h-80 overflow-y-auto\">\n {searchLoading ? (\n <div className=\"propeller-favorite-list-details__search-loading py-6 text-center text-sm text-foreground-subtle\">\n {getLabel(props.labels, 'searching', 'Searching...')}\n </div>\n ) : null}\n {!searchLoading && searchTerm && searchResults.length === 0 ? (\n <div className=\"propeller-favorite-list-details__search-empty py-6 text-center text-sm text-foreground-subtle\">\n {getLabel(props.labels, 'noResults', 'No results')}\n </div>\n ) : null}\n {!searchLoading && searchResults.length > 0 ? (\n <ul className=\"propeller-favorite-list-details__search-list divide-y divide-border\">\n {searchResults.map((item) => {\n const key = getRowKey(item);\n const isAdding = addingItemKey === key;\n return (\n <li\n key={key}\n className=\"propeller-favorite-list-details__search-item flex items-center gap-3 py-3 cursor-pointer hover:bg-surface-hover transition-colors px-2 rounded-control\"\n onClick={() => handleAddItemFromSearch(item)}\n data-adding={isAdding ? 'true' : 'false'}\n >\n <div className=\"propeller-favorite-list-details__search-item-media h-14 w-14 flex-shrink-0 rounded-control bg-surface-hover overflow-hidden flex items-center justify-center\">\n {getSearchItemImage(item) ? (\n <img\n src={getSearchItemImage(item)}\n alt={getSearchItemName(item)}\n className=\"h-full w-full object-contain\"\n />\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"text-foreground-subtle\"\n >\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" />\n <circle cx=\"8.5\" cy=\"8.5\" r=\"1.5\" />\n <polyline points=\"21 15 16 10 5 21\" />\n </svg>\n )}\n </div>\n <div className=\"propeller-favorite-list-details__search-item-body flex-1 min-w-0\">\n <p className=\"propeller-favorite-list-details__search-item-name text-sm font-medium line-clamp-2\">\n {getSearchItemName(item)}\n </p>\n {getSearchItemSku(item) ? (\n <p className=\"propeller-favorite-list-details__search-item-sku font-mono text-xs text-foreground-subtle mt-0.5\">\n SKU: {getSearchItemSku(item)}\n </p>\n ) : null}\n {getSearchItemStockLabel(item) ? (\n <p className=\"propeller-favorite-list-details__search-item-stock text-xs text-foreground-subtle mt-0.5\">\n {getSearchItemStockLabel(item)}\n </p>\n ) : null}\n </div>\n {isAdding ? (\n <span className=\"propeller-favorite-list-details__search-item-spinner text-xs text-foreground-subtle\">\n {getLabel(props.labels, 'adding', 'Adding...')}\n </span>\n ) : null}\n </li>\n );\n })}\n </ul>\n ) : null}\n </div>\n </div>\n <div className=\"propeller-favorite-list-details__modal-footer border-t border-border px-6 py-4 flex justify-end\">\n <button\n type=\"button\"\n className=\"propeller-favorite-list-details__modal-close inline-flex items-center justify-center rounded-control border border-border px-6 py-2 text-sm font-medium text-secondary transition-colors hover:bg-surface-hover\"\n onClick={() => closeAddModal()}\n >\n {getLabel(props.labels, 'close', 'Close')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\nexport default FavoriteListDetails;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect, useMemo } from 'react';\nimport {\n FavoriteList,\n GraphQLClient,\n Contact,\n Customer,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useFavorites } from '../composables/react/useFavorites';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nexport type { FavoriteListFormData } from '../composables/react/useFavorites';\n\nexport interface FavoriteListsProps {\n /** The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n\n /** The initialized GraphQL Client instance. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** Callback when a list is clicked (navigate to detail) */\n onListClick?: (listId: string | number) => void;\n\n /** Limit the number of lists shown (e.g. 3 = last 3 modified). undefined = show all */\n limit?: number;\n\n /** Displays the \"Default\" badge on the favorite list (default: true) */\n showDefaultIndicator?: boolean;\n\n /** Displays the last modified date on the favorite list (default: true) */\n showLastModified?: boolean;\n\n /** Displays number of products and clusters contained in the favorite list (default: true) */\n showItemsCount?: boolean;\n\n /** Displays edit/delete action buttons on each list (default: true) */\n showActions?: boolean;\n\n /** Displays create new favorite list button (default: true) */\n allowFavoriteListCreate?: boolean;\n\n /** Custom class name */\n className?: string;\n\n /** Format date function override. If not provided, dates are formatted as dd/mm/YYYY */\n formatDate?: (dateString: string) => string;\n\n /** Localization labels */\n labels?: {\n lastModified?: string;\n items?: string;\n products?: string;\n clusters?: string;\n defaultBadge?: string;\n editSave?: string;\n editCancel?: string;\n makeDefault?: string;\n deleteTitle?: string;\n deleteConfirm?: string;\n deleteWarning?: string;\n deleteButton?: string;\n cancelButton?: string;\n createTitle?: string;\n createButton?: string;\n createPlaceholder?: string;\n setAsDefault?: string;\n saveButton?: string;\n noLists?: string;\n noListsDescription?: string;\n createFirstList?: string;\n loading?: string;\n nameLabel?: string;\n editTooltip?: string;\n deleteTooltip?: string;\n };\n\n /** Action function triggered when creating a new favorite list. If not provided, the default action is executed */\n onCreate?: (favoriteListData: { name: string; isDefault: boolean }) => void;\n\n /** Action function triggered when editing a favorite list. If not provided, the default action is executed */\n onEdit?: (favoriteListId: string, favoriteListData: { name: string; isDefault: boolean }) => void;\n\n /** Action function triggered when deleting a favorite list. If not provided, the default action is executed */\n onDelete?: (favoriteListId: string) => void;\n\n /** Called after any list mutation (create, edit, delete) succeeds */\n onListChanged?: () => void;\n}\n\n/**\n * Lists the user's favorite lists with inline edit, delete and create-list\n * modals.\n *\n * @remarks Uses {@link useFavorites} for fetching and list CRUD operations.\n */\nfunction FavoriteLists(rawProps: FavoriteListsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const {\n lists,\n loading,\n saving,\n editingListId,\n editListName,\n editSetAsDefault,\n newListName,\n newSetAsDefault,\n listToDelete,\n fetchLists,\n startEdit,\n cancelEdit,\n setEditListName,\n setEditSetAsDefault,\n setNewListName,\n setNewSetAsDefault,\n updateList,\n confirmDelete,\n deleteList,\n createList,\n } = useFavorites({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n onCreate: props.onCreate,\n onEdit: props.onEdit,\n onDelete: props.onDelete,\n onListChanged: props.onListChanged,\n });\n\n const [showCreateModal, setShowCreateModal] = useState(() => false);\n const [showDeleteModal, setShowDeleteModal] = useState(() => false);\n\n function formatDate(dateString: string): string {\n if (props.formatDate) return props.formatDate(dateString);\n if (!dateString) return '-';\n const d = new Date(dateString);\n const day = String(d.getDate()).padStart(2, '0');\n const month = String(d.getMonth() + 1).padStart(2, '0');\n const year = d.getFullYear();\n return `${day}/${month}/${year}`;\n }\n\n function getProductCount(list: FavoriteList): number {\n const products = list.products;\n if (!products) return 0;\n if (products.itemsFound !== undefined) return products.itemsFound;\n if (products.items) return products.items.length;\n return 0;\n }\n\n function getClusterCount(list: FavoriteList): number {\n const clusters = list.clusters;\n if (!clusters) return 0;\n if (clusters.itemsFound !== undefined) return clusters.itemsFound;\n if (clusters.items) return clusters.items.length;\n return 0;\n }\n\n function getTotalCount(list: FavoriteList): number {\n return getProductCount(list) + getClusterCount(list);\n }\n\n\n const displayedLists = useMemo((): FavoriteList[] => {\n if (props.limit && props.limit > 0) {\n const sorted = [...lists].sort((a: FavoriteList, b: FavoriteList) => {\n const dateA = new Date(a.updatedAt || '').getTime();\n const dateB = new Date(b.updatedAt || '').getTime();\n return dateB - dateA;\n });\n return sorted.slice(0, props.limit);\n }\n return lists;\n }, [lists, props.limit]);\n\n useEffect(() => {\n if (props.user) {\n fetchLists();\n }\n }, [props.user]);\n\n function handleDeleteClick(list: FavoriteList) {\n confirmDelete(list);\n setShowDeleteModal(true);\n }\n\n async function handleConfirmDelete() {\n await deleteList();\n setShowDeleteModal(false);\n }\n\n function handleCancelDelete() {\n setShowDeleteModal(false);\n }\n\n function closeCreateModal() {\n setShowCreateModal(false);\n }\n\n async function handleCreateList() {\n if (!newListName.trim() || saving) return;\n await createList(newListName, newSetAsDefault);\n setNewListName('');\n setNewSetAsDefault(false);\n closeCreateModal();\n }\n\n return (\n <div className={`propeller-favorite-lists ${props.className || ''}`} data-loading={loading ? 'true' : 'false'}>\n {props.allowFavoriteListCreate !== false &&\n !loading &&\n displayedLists.length > 0 ? (\n <div className=\"propeller-favorite-lists__toolbar flex justify-end mb-4\">\n <button\n className=\"propeller-favorite-lists__create-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control text-primary-foreground bg-primary hover:bg-primary/80\"\n onClick={(event) => {\n setShowCreateModal(true);\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"mr-2\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" />\n </svg>\n {getLabel(props.labels, 'createButton', 'Create New List')}\n </button>\n </div>\n ) : null}\n {loading ? (\n <div className=\"space-y-4\">\n <div className=\"propeller-favorite-lists__skeleton border border-border rounded-container p-6 animate-pulse\">\n <div className=\"flex justify-between items-start\">\n <div className=\"space-y-2 flex-1\">\n <div className=\"h-6 w-1/3 bg-border rounded\" />\n <div className=\"h-4 w-1/4 bg-border rounded\" />\n <div className=\"h-4 w-1/2 bg-border rounded\" />\n </div>\n </div>\n </div>\n <div className=\"propeller-favorite-lists__skeleton border border-border rounded-container p-6 animate-pulse\">\n <div className=\"flex justify-between items-start\">\n <div className=\"space-y-2 flex-1\">\n <div className=\"h-6 w-1/3 bg-border rounded\" />\n <div className=\"h-4 w-1/4 bg-border rounded\" />\n <div className=\"h-4 w-1/2 bg-border rounded\" />\n </div>\n </div>\n </div>\n </div>\n ) : null}\n {!loading ? (\n <>\n {displayedLists.length > 0 ? (\n <div className=\"propeller-favorite-lists__list space-y-4\">\n {displayedLists?.map((list) => (\n <div\n key={list.id}\n onClick={(event) => {\n if (editingListId !== String(list.id) && props.onListClick) {\n props.onListClick(list.id);\n }\n }}\n data-editing={editingListId === String(list.id) ? 'true' : 'false'}\n data-default={list.isDefault ? 'true' : 'false'}\n className={\n 'propeller-favorite-lists__item border border-border rounded-container p-6 hover:bg-surface-hover transition-colors' +\n (editingListId !== String(list.id) && props.onListClick\n ? ' cursor-pointer'\n : '')\n }\n >\n <div className=\"flex justify-between items-start\">\n <div className=\"flex-1\">\n {editingListId === String(list.id) ? (\n <div className=\"propeller-favorite-lists__edit space-y-4\">\n <div className=\"space-y-2\">\n <input\n type=\"text\"\n placeholder={getLabel(props.labels, 'createPlaceholder', 'Enter list name')}\n className=\"propeller-favorite-lists__input max-w-md block w-full rounded-control border border-input px-3 py-2 text-sm focus:border-primary focus:ring-primary\"\n value={editListName}\n onChange={(e) => {\n setEditListName(e.target.value);\n }}\n />\n </div>\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"checkbox\"\n className=\"propeller-favorite-lists__checkbox rounded border-input\"\n id={`default-edit-${list.id}`}\n checked={editSetAsDefault}\n onChange={(e) => {\n setEditSetAsDefault(e.target.checked);\n }}\n />\n <label\n className=\"propeller-favorite-lists__checkbox-label text-sm text-muted-foreground\"\n htmlFor={`default-edit-${list.id}`}\n >\n {getLabel(props.labels, 'makeDefault', 'Make default')}\n </label>\n </div>\n <div className=\"flex gap-2\">\n <button\n className=\"propeller-favorite-lists__save-btn inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-control text-primary-foreground bg-primary hover:bg-primary/80 disabled:opacity-50\"\n onClick={(event) => updateList(String(list.id))}\n disabled={!editListName.trim()}\n >\n {getLabel(props.labels, 'editSave', 'Save')}\n </button>\n <button\n className=\"propeller-favorite-lists__cancel-btn inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-control border border-input text-foreground bg-card hover:bg-surface-hover\"\n onClick={(event) => cancelEdit()}\n >\n {getLabel(props.labels, 'editCancel', 'Cancel')}\n </button>\n </div>\n </div>\n ) : null}\n {editingListId !== String(list.id) ? (\n <div className=\"propeller-favorite-lists__display space-y-2\">\n <div className=\"flex items-center gap-2\">\n <span className=\"propeller-favorite-lists__name text-xl font-semibold\">{list.name}</span>\n {props.showDefaultIndicator !== false && list.isDefault ? (\n <span className=\"propeller-favorite-lists__default-badge inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-primary/10 text-primary\">\n {getLabel(props.labels, 'defaultBadge', 'Default')}\n </span>\n ) : null}\n </div>\n <div className=\"propeller-favorite-lists__meta flex items-center gap-4 text-sm text-muted-foreground\">\n {props.showLastModified !== false ? (\n <div className=\"flex items-center gap-1\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" ry=\"2\" />\n <line x1=\"16\" x2=\"16\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"6\" />\n <line x1=\"3\" x2=\"21\" y1=\"10\" y2=\"10\" />\n </svg>\n {getLabel(props.labels, 'lastModified', 'Last modified')}:{' '}\n {formatDate(list.updatedAt)}\n </div>\n ) : null}\n {props.showItemsCount !== false ? (\n <div className=\"flex items-center gap-1\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16.5 9.4 7.55 4.24\" />\n <path d=\"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z\" />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <line x1=\"12\" x2=\"12\" y1=\"22\" y2=\"12\" />\n </svg>\n {getTotalCount(list)}&nbsp;{getLabel(props.labels, 'items', 'items')}\n </div>\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n {props.showActions !== false && editingListId !== String(list.id) ? (\n <div className=\"propeller-favorite-lists__actions flex gap-2\">\n <button\n title={getLabel(props.labels, 'editTooltip', 'Edit')}\n className=\"propeller-favorite-lists__edit-btn h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-muted-foreground hover:text-foreground hover:bg-surface-hover\"\n onClick={(e) => {\n e.stopPropagation();\n startEdit(list);\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z\" />\n <path d=\"m15 5 4 4\" />\n </svg>\n </button>\n <button\n title={getLabel(props.labels, 'deleteTooltip', 'Delete')}\n className=\"propeller-favorite-lists__delete-btn h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-destructive hover:text-destructive hover:bg-destructive/10\"\n onClick={(e) => {\n e.stopPropagation();\n handleDeleteClick(list);\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M3 6h18\" />\n <path d=\"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n </svg>\n </button>\n </div>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n {displayedLists.length === 0 ? (\n <div className=\"propeller-favorite-lists__empty border border-border rounded-container p-12 text-center space-y-4\">\n <div className=\"propeller-favorite-lists__empty-icon-wrapper bg-surface-hover p-4 rounded-full w-16 h-16 flex items-center justify-center mx-auto\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"propeller-favorite-lists__empty-icon text-foreground-subtle\"\n >\n <path d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3.332.67-4.5 2.17C10.832 3.67 9.26 3 7.5 3A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\" />\n </svg>\n </div>\n <div>\n <p className=\"propeller-favorite-lists__empty-title text-lg font-medium\">{getLabel(props.labels, 'noLists', 'No favorite lists')}</p>\n <p className=\"propeller-favorite-lists__empty-message text-muted-foreground\">\n {getLabel(props.labels, 'noListsDescription', 'Start by creating a new list to save your items.')}\n </p>\n </div>\n {props.allowFavoriteListCreate !== false ? (\n <button\n className=\"propeller-favorite-lists__create-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control text-primary-foreground bg-primary hover:bg-primary/80\"\n onClick={(event) => {\n setShowCreateModal(true);\n }}\n >\n {getLabel(props.labels, 'createFirstList', 'Create your first list')}\n </button>\n ) : null}\n </div>\n ) : null}\n </>\n ) : null}\n {showCreateModal ? (\n <div className=\"propeller-favorite-lists__create-modal fixed inset-0 bg-foreground/50 backdrop-blur-sm flex items-center justify-center z-50 p-4\">\n <div className=\"propeller-favorite-lists__create-modal-content bg-card p-6 rounded-container max-w-md w-full shadow-lg border border-border\">\n <div className=\"flex justify-between items-center mb-4\">\n <h3 className=\"propeller-favorite-lists__create-modal-title text-xl font-bold\">{getLabel(props.labels, 'createTitle', 'Create New List')}</h3>\n <button\n className=\"propeller-favorite-lists__create-modal-close h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-muted-foreground hover:text-foreground hover:bg-surface-hover\"\n onClick={(event) => {\n closeCreateModal();\n }}\n >\n ×\n </button>\n </div>\n <div className=\"space-y-4\">\n <div className=\"space-y-2\">\n <label className=\"propeller-favorite-lists__input-label text-sm font-medium\">{getLabel(props.labels, 'nameLabel', 'Name')}</label>\n <input\n type=\"text\"\n className=\"propeller-favorite-lists__input block w-full rounded-control border border-input px-3 py-2 text-sm focus:border-primary focus:ring-primary\"\n value={newListName}\n onChange={(e) => {\n setNewListName(e.target.value);\n }}\n placeholder={getLabel(props.labels, 'createPlaceholder', 'Enter list name')}\n />\n </div>\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"checkbox\"\n id=\"create-set-default\"\n className=\"propeller-favorite-lists__checkbox rounded border-input\"\n checked={newSetAsDefault}\n onChange={(e) => {\n setNewSetAsDefault(e.target.checked);\n }}\n />\n <label htmlFor=\"create-set-default\" className=\"propeller-favorite-lists__checkbox-label text-sm text-muted-foreground\">\n {getLabel(props.labels, 'setAsDefault', 'Set as default favorite list')}\n </label>\n </div>\n <div className=\"flex justify-end gap-3 pt-2\">\n <button\n className=\"propeller-favorite-lists__cancel-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control border border-input text-foreground bg-card hover:bg-surface-hover\"\n onClick={(event) => {\n closeCreateModal();\n }}\n >\n {getLabel(props.labels, 'cancelButton', 'Cancel')}\n </button>\n <button\n className=\"propeller-favorite-lists__save-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control text-primary-foreground bg-primary hover:bg-primary/80 disabled:opacity-50\"\n onClick={(event) => handleCreateList()}\n disabled={!newListName.trim()}\n >\n {getLabel(props.labels, 'saveButton', 'Save')}\n </button>\n </div>\n </div>\n </div>\n </div>\n ) : null}\n {showDeleteModal && listToDelete ? (\n <div className=\"propeller-favorite-lists__delete-modal fixed inset-0 bg-foreground/50 backdrop-blur-sm flex items-center justify-center z-50 p-4\">\n <div className=\"propeller-favorite-lists__delete-modal-content bg-card p-6 rounded-container max-w-md w-full shadow-lg border border-border\">\n <div className=\"flex justify-between items-center mb-4\">\n <h3 className=\"propeller-favorite-lists__delete-modal-title text-xl font-bold\">\n {getLabel(props.labels, 'deleteTitle', 'Delete Favorite List')}\n </h3>\n <button\n className=\"propeller-favorite-lists__delete-modal-close h-8 w-8 p-0 inline-flex items-center justify-center rounded-control text-muted-foreground hover:text-foreground hover:bg-surface-hover\"\n onClick={(event) => handleCancelDelete()}\n >\n ×\n </button>\n </div>\n <div className=\"space-y-4\">\n <p className=\"propeller-favorite-lists__delete-prompt\">\n {getLabel(props.labels, 'deleteConfirm', 'Are you sure you want to delete')}\n <strong>&quot;{listToDelete?.name}&quot;</strong>?\n </p>\n <p className=\"propeller-favorite-lists__delete-warning text-sm text-destructive\">\n {getLabel(props.labels, 'deleteWarning', 'This action cannot be undone.')}\n </p>\n </div>\n <div className=\"flex justify-end gap-3 pt-6\">\n <button\n className=\"propeller-favorite-lists__cancel-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control border border-input text-foreground bg-card hover:bg-surface-hover\"\n onClick={(event) => handleCancelDelete()}\n >\n {getLabel(props.labels, 'cancelButton', 'Cancel')}\n </button>\n <button\n className=\"propeller-favorite-lists__confirm-delete-btn inline-flex items-center px-4 py-2 text-sm font-medium rounded-control text-destructive-foreground bg-destructive hover:bg-destructive/90\"\n onClick={(event) => handleConfirmDelete()}\n >\n {getLabel(props.labels, 'deleteButton', 'Delete')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default FavoriteLists;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport { useAuth } from '../composables/react/useAuth';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface ForgotPasswordProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** Title of the forgot password form\n * @default \"Forgot password?\"\n */\n title?: string;\n\n /** Subtitle of the forgot password form\n * @default \"\"\n */\n subtitle?: string;\n\n /** Label for the submit button\n * @default \"Reset\"\n */\n buttonText?: string;\n\n /** Message displayed after successful submission\n * @default \"If an account exists with this email, you will receive a password reset link shortly.\"\n */\n responseMessage?: string;\n\n /**\n * Labels for the forgot password form fields.\n *\n * Available keys:\n * - email: Email field label (default: \"Email\")\n * - emailPlaceholder: Email input placeholder (default: \"name@example.com\")\n */\n labels?: Record<string, string>;\n\n /** Callback before the forgot password process starts */\n beforeForgotPassword?: () => void;\n\n /** Callback after the user has requested a password reset */\n afterForgotPassword?: (result: boolean) => void;\n}\n\n/**\n * Forgot-password form: collects an email address, requests a reset link and\n * shows a confirmation message.\n *\n * @remarks Uses {@link useAuth} for the forgot-password request.\n */\nfunction ForgotPassword(rawProps: ForgotPasswordProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [email, setEmail] = useState('');\n const [submitted, setSubmitted] = useState(false);\n\n const { loading, error, forgotPassword } = useAuth({\n graphqlClient: props.graphqlClient!,\n });\n\n // Surface a friendly fixed message for any forgot-password failure — server\n // errors can be cryptic (HTTP 4xx / GraphQL \"Unauthorized\" / etc.) and aren't\n // safe to show to end users. Override via `labels.emailNotFound` if needed.\n function errorMessage(): string {\n if (!error) return '';\n return (\n props.labels?.emailNotFound ||\n \"We couldn't find an account with that email address. Please double-check and try again. If you don't receive an email within a few minutes, please check that you entered the correct email address and try again.\"\n );\n }\n\n function resolvedTitle(): string {\n return props.title !== undefined ? props.title : 'Forgot password?';\n }\n function resolvedButtonText(): string {\n return props.buttonText || 'Reset';\n }\n function resolvedResponseMessage(): string {\n return (\n props.responseMessage ||\n 'If an account exists with this email, you will receive a password reset link shortly.'\n );\n }\n function emailLabel(): string {\n return props.labels?.email || 'Email';\n }\n function emailPlaceholder(): string {\n return props.labels?.emailPlaceholder || 'name@example.com';\n }\n async function handleSubmit(e: any): Promise<void> {\n e.preventDefault();\n if (loading) return;\n if (props.beforeForgotPassword) {\n props.beforeForgotPassword();\n }\n const result = await forgotPassword(email);\n if (result.ok) {\n setSubmitted(true);\n if (props.afterForgotPassword) {\n props.afterForgotPassword(true);\n }\n } else {\n if (props.afterForgotPassword) {\n props.afterForgotPassword(false);\n }\n }\n }\n return (\n <div className=\"propeller-forgot-password\" data-loading={loading ? 'true' : 'false'} data-submitted={submitted ? 'true' : 'false'}>\n {resolvedTitle() ? (\n <div className=\"propeller-forgot-password__header space-y-1 text-center mb-6\">\n <h2 className=\"propeller-forgot-password__title text-2xl font-bold\">{resolvedTitle()}</h2>\n {props.subtitle ? <p className=\"propeller-forgot-password__subtitle text-sm text-muted-foreground\">{props.subtitle}</p> : null}\n </div>\n ) : null}\n {!submitted ? (\n <form className=\"propeller-forgot-password__form space-y-4\" onSubmit={(e) => handleSubmit(e)}>\n <div className=\"propeller-forgot-password__field space-y-2\">\n <label htmlFor=\"forgot-password-email\" className=\"propeller-forgot-password__label text-sm font-medium leading-none\">\n {emailLabel()}\n </label>\n <input\n type=\"email\"\n id=\"forgot-password-email\"\n name=\"email\"\n className=\"propeller-forgot-password__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={email}\n onChange={(e) => {\n setEmail((e.target as HTMLInputElement).value);\n }}\n placeholder={emailPlaceholder()}\n required\n disabled={loading}\n />\n </div>\n {errorMessage() ? (\n <div className=\"text-sm text-destructive bg-destructive/10 p-3 rounded-control\">\n {errorMessage()}\n </div>\n ) : null}\n <button\n type=\"submit\"\n className=\"propeller-forgot-password__submit inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font-medium text-primary-foreground bg-primary rounded-control hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n disabled={loading}\n >\n {loading ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-forgot-password__spinner animate-spin -ml-1 mr-2 h-4 w-4 text-primary-foreground\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n className=\"opacity-25\"\n />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n className=\"opacity-75\"\n />\n </svg>\n ) : null}\n {loading ? <>{props.labels?.sending || 'Sending...'}</> : <>{resolvedButtonText()}</>}\n </button>\n </form>\n ) : null}\n {submitted ? (\n <div className=\"propeller-forgot-password__success text-center space-y-4\">\n <div className=\"flex justify-center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n className=\"propeller-forgot-password__success-icon h-12 w-12 text-success\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <p className=\"propeller-forgot-password__success-message text-sm text-muted-foreground\">{resolvedResponseMessage()}</p>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default ForgotPassword;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Contact, Customer, AttributeFilter, AttributeTextFilter } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface GridFiltersProps {\n /**\n * Attribute filter definitions from the ProductGrid API response.\n * Each entry describes one filterable attribute (e.g. colour, brand, size).\n */\n filters: AttributeFilter[];\n\n /**\n * Lower price bound from the current product set.\n * When both `priceMin` and `priceMax` are absent the price section is hidden.\n */\n priceMin?: number;\n\n /** Upper price bound from the current product set. */\n priceMax?: number;\n\n /** Language code. Defaults to 'NL'. */\n language?: string;\n\n /** Notification called after every filter change. */\n getSelectedFilters?: () => void;\n\n /**\n * Called on every checkbox toggle.\n * `filter` is the AttributeFilter; `value` is the toggled option string.\n */\n onFilterChange: (filter: AttributeFilter, value: string | number) => void;\n\n /**\n * Called when the price range changes (on blur / slider release).\n */\n onPriceChange?: (minPrice: number, maxPrice: number) => void;\n\n /** Called when \"Clear all\" is clicked. */\n onClearFilters?: () => void;\n\n /** Enable mobile-specific behaviour (drops sticky positioning). */\n isMobile?: boolean;\n\n /**\n * 'open' — show price filter for all users.\n * 'semi-closed' — hide price filter for unauthenticated users.\n */\n portalMode?: string;\n\n /** Authenticated user — price filter visibility depends on this in semi-closed mode. */\n user?: Contact | Customer | null;\n\n /**\n * Whether filter accordions start collapsed.\n * Defaults to true.\n */\n collapsed?: boolean;\n\n /** Increment this counter to reset all selected filters and price inputs externally. */\n clearSignal?: number;\n\n /** Currently active text filters (URL-driven). Syncs internal checkbox state when filters are removed externally. */\n activeTextFilters?: Record<string, string[]>;\n\n /**\n * Currently active price filter min from URL state.\n * When both activePriceMin and activePriceMax become undefined the price inputs reset to the priceMin/priceMax bounds.\n */\n activePriceMin?: number;\n\n /** Currently active price filter max from URL state. */\n activePriceMax?: number;\n\n /**\n * When true, all checkboxes and price inputs are disabled.\n * Wire to ProductGrid's `onLoadingChange` to block rapid re-clicks while a fetch is in flight.\n */\n isLoading?: boolean;\n\n /** Extra CSS class on the root element. */\n className?: string;\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n}\n/**\n * Faceted filter sidebar for a product grid: collapsible attribute checkbox\n * groups plus a price range slider, with parent-driven clear and active-state\n * synchronisation.\n */\nfunction GridFilters(rawProps: GridFiltersProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // Seed directly from `activeTextFilters` (not `{}` + a sync effect) so the\n // ticked checkboxes are correct on the very first render — including SSR,\n // where the sync effect below has not run. A restored filtered URL must\n // server-render its checkboxes checked.\n const [selectedFilters, setSelectedFilters] = useState<Record<string, string[]>>(\n () => ({ ...((props.activeTextFilters as Record<string, string[]>) || {}) })\n );\n const [currentMin, setCurrentMin] = useState(() => 0);\n const [currentMax, setCurrentMax] = useState(() => 9999);\n // Raw text-input buffers for the price fields, kept as strings so the user\n // can clear a field and type a fresh value. The numeric `currentMin`/\n // `currentMax` (which the sliders share) are only committed on blur/Enter —\n // binding the inputs directly to the numbers forced an empty field back to 0\n // on every keystroke, making them impossible to edit.\n const [minInput, setMinInput] = useState(() => '0');\n const [maxInput, setMaxInput] = useState(() => '9999');\n const [expandedFilters, setExpandedFilters] = useState(\n () => ({})\n );\n const [isPending, setIsPending] = useState(() => false);\n // Last range actually pushed to the parent — guards `applyPrice` against\n // no-op re-applies that would leave `isPending` (panel blur/disable) stuck on.\n const [appliedMin, setAppliedMin] = useState<number | undefined>(() => undefined);\n const [appliedMax, setAppliedMax] = useState<number | undefined>(() => undefined);\n function showPriceFilter() {\n const mode = (props.portalMode as string) || 'open';\n if (mode === 'open') return true;\n return !!props.user;\n }\n function getFilterName(filter: AttributeFilter) {\n return (filter as AttributeFilter)?.attributeDescription?.name || '';\n }\n function getFilterTitle(filter: AttributeFilter) {\n return (\n (filter as AttributeFilter)?.attributeDescription?.descriptions?.[0]?.value ||\n (filter as AttributeFilter)?.attributeDescription?.name ||\n ''\n );\n }\n function getFilteredFilters(): AttributeFilter[] {\n const list = props.filters ?? [];\n return list.filter((f) => {\n const opts: AttributeTextFilter[] = f?.textFilters ?? [];\n return opts.some((o) => (o?.count || 0) > 0 || (o?.countActive || 0) > 0);\n });\n }\n function getValidOptions(filter: AttributeFilter): AttributeTextFilter[] {\n return (filter?.textFilters ?? []).filter(\n (o) => (o?.count || 0) > 0 || (o?.countActive || 0) > 0\n );\n }\n function getSelectedCount() {\n let n = 0;\n const sel = selectedFilters as Record<string, string[]>;\n Object.keys(sel).forEach((k: string) => {\n n += (sel[k] || []).length;\n });\n return n;\n }\n function hasActiveFilters() {\n const sel = selectedFilters as Record<string, string[]>;\n return Object.keys(sel).some((k: string) => (sel[k] || []).length > 0);\n }\n function isSelected(\n filterName: string,\n value: string\n ) {\n return ((selectedFilters as Record<string, string[]>)[filterName] || []).includes(value);\n }\n function isExpanded(filterName: string) {\n const stored = (expandedFilters as Record<string, boolean>)[filterName];\n // A group the user has explicitly toggled wins.\n if (stored !== undefined) return !!stored;\n // No stored state yet (first render — including SSR, where the\n // expand-init effect has not run). Default to open when `collapsed` is\n // false, OR when the group already carries an active filter — otherwise\n // a restored filtered URL would render the ticked checkboxes hidden.\n const active = (props.activeTextFilters as Record<string, string[]>) || {};\n if ((active[filterName]?.length ?? 0) > 0) return true;\n return props.collapsed === false;\n }\n function toggleAccordion(filterName: string) {\n const cur = !!(expandedFilters as Record<string, boolean>)[filterName];\n setExpandedFilters({ ...expandedFilters, [filterName]: !cur });\n }\n function handleCheckbox(\n filter: AttributeFilter,\n value: string,\n checked: boolean\n ) {\n const name = (filter as AttributeFilter)?.attributeDescription?.name || '';\n const cur = (selectedFilters as Record<string, string[]>)[name] || [];\n const next = checked ? [...cur, value] : cur.filter((v: string) => v !== value);\n setSelectedFilters({ ...selectedFilters, [name]: next });\n if (next.length === 0) {\n setExpandedFilters({ ...expandedFilters, [name]: false });\n }\n setIsPending(true);\n props.onFilterChange(filter, value);\n if (props.getSelectedFilters) props.getSelectedFilters();\n }\n function handleMinChange(value: number) {\n const n = value > currentMax ? currentMax : value;\n setCurrentMin(n);\n setMinInput(String(n));\n }\n function handleMaxChange(value: number) {\n const n = value < currentMin ? currentMin : value;\n setCurrentMax(n);\n setMaxInput(String(n));\n }\n // Commit the raw min text buffer on blur/Enter. Empty / non-numeric falls\n // back to the lower bound; the value is clamped into [bound, currentMax].\n function commitMinInput() {\n const parsed = parseFloat(minInput);\n const value = isNaN(parsed) ? getMinBound() : parsed;\n const n = Math.min(Math.max(value, getMinBound()), currentMax);\n setCurrentMin(n);\n setMinInput(String(n));\n applyPrice(n, currentMax);\n }\n function commitMaxInput() {\n const parsed = parseFloat(maxInput);\n const value = isNaN(parsed) ? getMaxBound() : parsed;\n const n = Math.min(Math.max(value, currentMin), getMaxBound());\n setCurrentMax(n);\n setMaxInput(String(n));\n applyPrice(currentMin, n);\n }\n // Apply only when the committed range differs from what's already applied —\n // re-applying an unchanged range produced no parent loading cycle, so the\n // `isPending` flag (which blurs/disables the whole panel) never cleared.\n function applyPrice(min: number = currentMin, max: number = currentMax) {\n if (min === appliedMin && max === appliedMax) return;\n setAppliedMin(min);\n setAppliedMax(max);\n setIsPending(true);\n if (props.onPriceChange) props.onPriceChange(min, max);\n if (props.getSelectedFilters) props.getSelectedFilters();\n }\n function clearAll() {\n setSelectedFilters({});\n setCurrentMin((props.priceMin as number) || 0);\n setCurrentMax((props.priceMax as number) || 9999);\n if (props.onClearFilters) props.onClearFilters();\n if (props.getSelectedFilters) props.getSelectedFilters();\n }\n function getCount(option: AttributeTextFilter): number {\n const c = option?.count || 0;\n const ca = option?.countActive || 0;\n return c === 0 && ca > 0 ? ca : c;\n }\n function getMinBound() {\n return (props.priceMin as number) || 0;\n }\n function getMaxBound() {\n return (props.priceMax as number) || 9999;\n }\n // All five of the effects below are intentional external-state → local\n // sync. ProductGrid (the parent) drives filter+price state via props;\n // GridFilters mirrors it locally so the user can interact (drag the\n // slider, tick a checkbox) before the parent commits. Replacing with\n // derived-on-render would require lifting the entire local-edit buffer\n // up to ProductGrid — a real refactor planned for Phase C (compound\n // primitives). Disables are scoped to the specific setState calls.\n\n // Initialize the open/closed state of any filter group that hasn't been\n // seen yet (i.e. new entries in props.filters). Only ever *adds* keys —\n // never revisits a key the user has already toggled — so it cannot fight\n // user clicks. expandedFilters is read via the functional updater rather\n // than the dependency array to keep this from re-running on every toggle.\n useEffect(() => {\n const open = props.collapsed === false;\n // A group that already has a selected value starts EXPANDED even when\n // `collapsed` is true — otherwise restoring a filtered URL would hide\n // the very checkboxes the user has ticked. `activeTextFilters` is keyed\n // by attribute name, value = selected values.\n //\n // This only ever *sets* the initial state of a not-yet-seen group\n // (`next[n] === undefined`); it never revisits a key, so a user who\n // later collapses a group with an active filter is not fought.\n const active = (props.activeTextFilters as Record<string, string[]>) || {};\n const incoming = ((props.filters as AttributeFilter[]) || [])\n .map((f) => f?.attributeDescription?.name)\n .filter((n): n is string => !!n);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setExpandedFilters((prev) => {\n const cur = prev as Record<string, boolean>;\n let changed = false;\n const next: Record<string, boolean> = { ...cur };\n incoming.forEach((n) => {\n if (next[n] === undefined) {\n const hasActive = (active[n]?.length ?? 0) > 0;\n next[n] = open || hasActive;\n changed = true;\n }\n });\n return changed ? next : prev;\n });\n }, [props.filters, props.collapsed, props.activeTextFilters]);\n\n // Re-bound the slider when the catalog's price range changes.\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMin((props.priceMin as number) || 0);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMax((props.priceMax as number) || 9999);\n }, [props.priceMin, props.priceMax]);\n\n // Parent-triggered \"clear all\" pulse.\n useEffect(() => {\n if (props.clearSignal === undefined) return;\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedFilters({});\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMin((props.priceMin as number) || 0);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMax((props.priceMax as number) || 9999);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setExpandedFilters({});\n }, [props.clearSignal, props.priceMin, props.priceMax]);\n\n // Adopt parent-supplied active filter set (URL state rehydration).\n useEffect(() => {\n if (!props.activeTextFilters) return;\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setSelectedFilters(props.activeTextFilters as Record<string, string[]>);\n }, [props.activeTextFilters]);\n\n // Reset slider to bounds when parent has no active price filter.\n useEffect(() => {\n if (props.activePriceMin === undefined && props.activePriceMax === undefined) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMin((props.priceMin as number) || 0);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentMax((props.priceMax as number) || 9999);\n }\n }, [props.activePriceMin, props.activePriceMax, props.priceMin, props.priceMax]);\n\n // Keep the price text-input buffers in step with the numeric source of truth\n // (slider drags, prop-driven resets). User keystrokes only touch the buffers,\n // so this never fights typing — it only re-seeds them when the number moves.\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setMinInput(String(currentMin));\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setMaxInput(String(currentMax));\n }, [currentMin, currentMax]);\n\n // Clear the \"rapid click\" pending flag when the parent reports loading done.\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n if (!props.isLoading) setIsPending(false);\n }, [props.isLoading]);\n return (\n <div\n className={`propeller-grid-filters space-y-4 ${(props.isMobile as boolean) ? 'pb-8' : 'sticky top-24'} ${isPending ? 'opacity-50 pointer-events-none' : ''} ${(props.className as string) || ''}`}\n data-mobile={props.isMobile ? 'true' : 'false'}\n data-pending={isPending ? 'true' : 'false'}\n >\n {showPriceFilter() && (props.priceMin !== undefined || props.priceMax !== undefined) ? (\n <>\n <div className=\"propeller-grid-filters__price space-y-3\">\n <h3 className=\"propeller-grid-filters__price-title text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n {' '}\n {getLabel(props.labels, 'priceRange', 'Price Range')}{' '}\n </h3>\n <div className=\"flex items-center gap-2\">\n <div className=\"relative flex-1\">\n <span className=\"propeller-grid-filters__price-currency absolute left-2.5 top-1/2 -translate-y-1/2 text-xs text-foreground-subtle pointer-events-none\">\n €\n </span>\n <input\n type=\"number\"\n className=\"propeller-grid-filters__price-input w-full pl-6 pr-2 h-8 rounded-control border border-border bg-card text-sm focus:outline-none focus:ring-1 focus:ring-secondary\"\n value={minInput}\n min={getMinBound()}\n max={getMaxBound()}\n onChange={(e) => setMinInput(e.target.value)}\n onBlur={() => commitMinInput()}\n onKeyDown={(e) => { if (e.key === 'Enter') (e.target as HTMLInputElement).blur(); }}\n />\n </div>\n <span className=\"propeller-grid-filters__price-separator text-foreground-subtle text-sm select-none\">–</span>\n <div className=\"relative flex-1\">\n <span className=\"propeller-grid-filters__price-currency absolute left-2.5 top-1/2 -translate-y-1/2 text-xs text-foreground-subtle pointer-events-none\">\n €\n </span>\n <input\n type=\"number\"\n className=\"propeller-grid-filters__price-input w-full pl-6 pr-2 h-8 rounded-control border border-border bg-card text-sm focus:outline-none focus:ring-1 focus:ring-secondary\"\n value={maxInput}\n min={getMinBound()}\n max={getMaxBound()}\n onChange={(e) => setMaxInput(e.target.value)}\n onBlur={() => commitMaxInput()}\n onKeyDown={(e) => { if (e.key === 'Enter') (e.target as HTMLInputElement).blur(); }}\n />\n </div>\n </div>\n <div className=\"propeller-grid-filters__price-slider relative h-4 pt-1\">\n <input\n type=\"range\"\n className=\"propeller-grid-filters__price-slider-thumb absolute w-full h-1.5 bg-transparent appearance-none pointer-events-none [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-secondary [&::-webkit-slider-thumb]:cursor-pointer z-20\"\n min={getMinBound()}\n max={getMaxBound()}\n value={currentMin}\n onChange={(e) => handleMinChange(parseFloat(e.target.value))}\n onPointerUp={() => applyPrice()}\n onTouchEnd={() => applyPrice()}\n />\n <input\n type=\"range\"\n className=\"propeller-grid-filters__price-slider-thumb absolute w-full h-1.5 bg-transparent appearance-none pointer-events-none [&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-secondary [&::-webkit-slider-thumb]:cursor-pointer z-20\"\n min={getMinBound()}\n max={getMaxBound()}\n value={currentMax}\n onChange={(e) => handleMaxChange(parseFloat(e.target.value))}\n onPointerUp={() => applyPrice()}\n onTouchEnd={() => applyPrice()}\n />\n <div className=\"propeller-grid-filters__price-slider-track absolute top-1.5 left-0 right-0 h-1.5 bg-border rounded z-10\" />\n </div>\n </div>{' '}\n <div className=\"propeller-grid-filters__divider h-px bg-border-subtle\" />\n </>\n ) : null}\n {(props.filters as AttributeFilter[]).length === 0 ? (\n <p className=\"propeller-grid-filters__empty text-sm text-foreground-subtle italic\">{getLabel(props.labels, 'noFiltersAvailable', 'No filters available')}</p>\n ) : null}\n {getFilteredFilters()?.map((filter) => (\n <div className=\"propeller-grid-filters__group border-b border-border-subtle pb-3 last:border-b-0\" key={getFilterName(filter)} data-expanded={isExpanded(getFilterName(filter)) ? 'true' : 'false'}>\n <button\n type=\"button\"\n className=\"propeller-grid-filters__group-toggle w-full flex items-center justify-between gap-2 text-left py-1 hover:text-secondary transition-colors\"\n onClick={(event) => toggleAccordion(getFilterName(filter))}\n >\n <span className=\"propeller-grid-filters__group-title text-sm font-semibold text-muted-foreground truncate\">\n {getFilterTitle(filter)}\n </span>\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className={`propeller-grid-filters__chevron h-4 w-4 flex-shrink-0 text-foreground-subtle transition-transform duration-200 ${isExpanded(getFilterName(filter)) ? 'rotate-180' : ''}`}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M19 9l-7 7-7-7\"\n strokeWidth={2}\n />\n </svg>\n </button>\n {isExpanded(getFilterName(filter)) ? (\n <div className=\"propeller-grid-filters__options pt-2 space-y-1.5\">\n {getValidOptions(filter)?.map((option) => (\n <label className=\"propeller-grid-filters__option flex items-center gap-2 cursor-pointer group\" key={option.value}>\n <input\n type=\"checkbox\"\n className=\"propeller-grid-filters__checkbox h-4 w-4 rounded border-input text-secondary focus:ring-secondary cursor-pointer flex-shrink-0\"\n checked={isSelected(getFilterName(filter), option.value)}\n onChange={(e) => handleCheckbox(filter, option.value, e.target.checked)}\n />\n <span className=\"propeller-grid-filters__option-label flex-1 text-sm text-muted-foreground leading-none select-none group-hover:text-foreground\">\n {option.value}\n <span className=\"propeller-grid-filters__option-count ml-1 text-xs text-foreground-subtle\"> ({getCount(option)}) </span>\n </span>\n </label>\n ))}\n </div>\n ) : null}\n </div>\n ))}\n </div>\n );\n}\nexport default GridFilters;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\n\nexport interface GridTitleProps {\n // ── Required ────────────────────────────────────────────────────────────\n\n /**\n * The main heading text to display.\n * Typically the category name, search term, or brand name.\n */\n title: string;\n\n /**\n * Language code for the content.\n * Defaults to 'NL'. Resolved from `<PropellerProvider>` when not passed explicitly.\n */\n language?: string;\n\n // ── Optional ────────────────────────────────────────────────────────────\n\n /**\n * Override the heading tag level.\n * Defaults to 'h1'. Use 'h2' when the grid is embedded inside\n * a page that already has an h1.\n */\n headingLevel?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders the heading for a product grid page (category, search or brand\n * name), with a configurable heading level.\n */\nfunction GridTitle(props: GridTitleProps) {\n return (\n <div className={`propeller-grid-title mb-8 ${(props.className as string) || ''}`}>\n <div className=\"propeller-grid-title__row flex items-baseline gap-3 mb-3\">\n {(props.headingLevel as string) === 'h2' ? (\n <h2 className=\"propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight\">{props.title}</h2>\n ) : null}\n {(props.headingLevel as string) !== 'h2' ? (\n <h1 className=\"propeller-grid-title__heading text-3xl sm:text-4xl font-bold tracking-tight\">{props.title}</h1>\n ) : null}\n </div>\n </div>\n );\n}\n\nexport default GridTitle;\n","'use client';\n/**\n * Client wrapper around the pure `GridTitle` component. Resolves `language`\n * from `<PropellerProvider>` when the caller doesn't pass it explicitly. The\n * pure version stays exported from `/pure` for RSC use.\n */\nimport * as React from 'react';\nimport GridTitle, { type GridTitleProps } from './GridTitle';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction GridTitleWithProvider(rawProps: GridTitleProps) {\n const props = useInfraProps(rawProps);\n return <GridTitle {...props} />;\n}\n\nexport default GridTitleWithProvider;\nexport type { GridTitleProps };\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Contact, Customer, ProductSortField, SortOrder } from '@propeller-commerce/propeller-sdk-v2';\nimport { isContentHidden } from '@propeller-commerce/propeller-v2-core-ui';\n\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\n// Default sort field keys shown in the dropdown when sortOptions is not provided.\n\nexport interface GridToolbarProps {\n /**\n * Sort field keys to show in the sort dropdown.\n * Accepts keys of the ProductSortField enum (e.g. 'NAME', 'PRICE').\n * Defaults to all available sort fields.\n */\n sortOptions?: string[];\n\n /**\n * Active sort — first element is used.\n * Defaults to [{ field: 'CATEGORY_ORDER', order: 'DESC' }].\n */\n defaultSort?: {\n field: string;\n order: string;\n }[];\n\n /**\n * Layout mode: 'grid' or 'list'.\n * Controls which icon the view-toggle button shows.\n * Defaults to 'grid'.\n */\n viewMode?: string;\n\n /**\n * Available page-size options shown in the per-page dropdown.\n * Defaults to [12, 24, 48].\n */\n offset?: number[];\n\n /**\n * Initially selected page size.\n * Defaults to 12.\n */\n defaultOffset?: number;\n\n /**\n * Called when the sort field or sort direction changes.\n * Receives the new field key and direction ('ASC'|'DESC').\n */\n onSortChange?: (field: string, order: string) => void;\n\n /**\n * Called when the user selects a different per-page value.\n * Receives the new page size number.\n */\n onOffsetChange?: (offset: number) => void;\n\n /**\n * Called when the user clicks the view-mode toggle button.\n * Receives the new mode: 'grid' or 'list'.\n */\n onViewChange?: (mode: string) => void;\n\n /**\n * Total products found — displayed as a result count on the left side.\n * Pass 0 or undefined to hide the count.\n */\n itemsFound?: number;\n\n /**\n * Current page number. Used together with `pageSize` and `itemsFound`\n * to display a range indicator (e.g. \"1–10 from 594 results\").\n * When omitted the component falls back to a simple total count.\n */\n page?: number;\n\n /**\n * Items per page. Used together with `page` and `itemsFound`\n * to compute the result range. Defaults to 12.\n */\n pageSize?: number;\n\n /**\n * Actual number of items visible on the current page.\n * When provided, overrides `pageSize` for the range end calculation.\n */\n pageItemCount?: number;\n\n /**\n * Currently active attribute filter selections.\n * Key = attribute name, value = array of selected values.\n * Used to render removable filter badges.\n */\n activeTextFilters?: Record<string, string[]>;\n\n /**\n * Currently active price filter lower bound.\n * When defined (together with or without priceFilterMax), renders a price badge.\n */\n priceFilterMin?: number;\n\n /**\n * Currently active price filter upper bound.\n */\n priceFilterMax?: number;\n\n /**\n * Called when an attribute filter badge × is clicked.\n * Receives the attribute name and the specific value to remove.\n */\n onFilterRemove?: (filterName: string, value: string) => void;\n\n /**\n * Called when the price filter badge × is clicked.\n */\n onPriceFilterRemove?: () => void;\n\n /**\n * Called when \"Clear All\" is clicked.\n */\n onClearFilters?: () => void;\n\n /**\n * Label overrides. Supply any subset of DEFAULT_LABELS keys plus\n * any of the ProductSortField key strings to customise display text.\n */\n labels?: Record<string, string>;\n\n /**\n * Portal visibility mode.\n * 'open' — price sorting is available for all users.\n * 'semi-closed' — price sorting is disabled for unauthenticated users.\n */\n portalMode?: string;\n\n /**\n * Authenticated user object.\n * When null/undefined in semi-closed mode the PRICE sort option is disabled.\n */\n user?: Contact | Customer | null;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n\n/** Flat badge item used when rendering the active-filters bar. */\n// Default sort field keys shown in the dropdown when sortOptions is not provided.\n\n/** Flat badge item used when rendering the active-filters bar. */\ninterface FilterBadge {\n /** Attribute name the badge belongs to. */\n key: string;\n /** The selected attribute value displayed on the badge. */\n value: string;\n}\n// Default sort field keys shown in the dropdown when sortOptions is not provided.\n\n/** Flat badge item used when rendering the active-filters bar. */\n\n// Default sort field keys shown in the dropdown when sortOptions is not provided.\nconst ALL_SORT_FIELDS: string[] = [\n ProductSortField.CATEGORY_ORDER,\n ProductSortField.NAME,\n ProductSortField.PRICE,\n ProductSortField.SKU,\n ProductSortField.SUPPLIER_CODE,\n ProductSortField.CREATED_AT,\n ProductSortField.LAST_MODIFIED_AT,\n ProductSortField.RELEVANCE,\n ProductSortField.PRIORITY,\n];\n\n// Built-in label defaults (can be overridden via the labels prop).\n// Built-in label defaults (can be overridden via the labels prop).\nconst DEFAULT_LABELS: Record<string, string> = {\n [ProductSortField.CATEGORY_ORDER]: 'Default Sorting',\n [ProductSortField.NAME]: 'Name',\n [ProductSortField.PRICE]: 'Price',\n [ProductSortField.SKU]: 'SKU',\n [ProductSortField.SUPPLIER_CODE]: 'Supplier Code',\n [ProductSortField.CREATED_AT]: 'Created Date',\n [ProductSortField.LAST_MODIFIED_AT]: 'Last Modified Date',\n [ProductSortField.RELEVANCE]: 'Relevance',\n [ProductSortField.PRIORITY]: 'Priority',\n [SortOrder.ASC]: 'Low to High',\n [SortOrder.DESC]: 'High to Low',\n clearAll: 'Clear All',\n products: ' Products',\n from: 'from',\n results: 'results',\n perPage: ' per page',\n price: 'Price',\n switchToList: 'Switch to list view',\n switchToGrid: 'Switch to grid view',\n};\n\n/**\n * Toolbar for a product grid: result count, sort field/order selectors,\n * page-size selector, grid/list view toggle and removable active-filter badges.\n */\nfunction GridToolbar(rawProps: GridToolbarProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // The field/order useState seeds are enum values; widening to `string`\n // here lets the prop-sync effects below adopt arbitrary strings the parent\n // passes (URL state may carry either the enum value or its key form).\n const [currentSortField, setCurrentSortField] = useState<string>(\n ProductSortField.CATEGORY_ORDER,\n );\n const [currentSortOrder, setCurrentSortOrder] = useState<string>(SortOrder.DESC);\n const [currentOffset, setCurrentOffset] = useState(12);\n const [currentViewMode, setCurrentViewMode] = useState('grid');\n function getLabel(key: string) {\n const labels = (props.labels as Record<string, string>) || {};\n return labels[key] !== undefined ? labels[key] : DEFAULT_LABELS[key] || key;\n }\n function getSortOptions() {\n const opts = (props.sortOptions as string[]) || [];\n return opts.length > 0 ? opts : ALL_SORT_FIELDS;\n }\n function getOffsetOptions() {\n const opts = (props.offset as number[]) || [];\n return opts.length > 0 ? opts : [12, 24, 48];\n }\n function hasActiveFilters() {\n const text = (props.activeTextFilters as Record<string, string[]>) || {};\n const hasText = Object.keys(text).some((k) => (text[k] || []).length > 0);\n const hasPrice = props.priceFilterMin !== undefined || props.priceFilterMax !== undefined;\n return hasText || hasPrice;\n }\n function getActiveFilterBadges() {\n const text = (props.activeTextFilters as Record<string, string[]>) || {};\n const badges: FilterBadge[] = [];\n Object.entries(text)\n .filter(([, values]) => (values || []).length > 0)\n .forEach(([key, values]) => {\n (values || []).forEach((value: string) => {\n badges.push({\n key,\n value,\n });\n });\n });\n return badges;\n }\n function isPriceSortDisabled() {\n return isContentHidden(props.portalMode as string | undefined, props.user);\n }\n function handleSortFieldChange(\n field: string\n ) {\n setCurrentSortField(field);\n if (props.onSortChange) props.onSortChange(field, currentSortOrder);\n }\n function handleSortOrderChange(\n order: string\n ) {\n setCurrentSortOrder(order);\n if (props.onSortChange) props.onSortChange(currentSortField, order);\n }\n function handleOffsetChange(offset: number) {\n setCurrentOffset(offset);\n if (props.onOffsetChange) props.onOffsetChange(offset);\n }\n function handleViewChange() {\n const next = currentViewMode === 'grid' ? 'list' : 'grid';\n setCurrentViewMode(next);\n if (props.onViewChange) props.onViewChange(next);\n }\n // Three external-state → local sync effects: ProductGrid (parent) drives\n // defaultSort / defaultOffset / viewMode; GridToolbar mirrors them so\n // local selectors track the canonical values. Same family of intentional\n // sync as the GridFilters effects.\n useEffect(() => {\n const sort =\n (props.defaultSort as {\n field: string;\n order: string;\n }[]) || [];\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentSortField(\n sort.length > 0\n ? sort[0].field || ProductSortField.CATEGORY_ORDER\n : ProductSortField.CATEGORY_ORDER\n );\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentSortOrder(\n sort.length > 0 ? sort[0].order || SortOrder.DESC : SortOrder.DESC\n );\n }, [props.defaultSort]);\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentOffset((props.defaultOffset as number) || 12);\n }, [props.defaultOffset]);\n useEffect(() => {\n if (props.viewMode) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setCurrentViewMode(props.viewMode as string);\n }\n }, [props.viewMode]);\n return (\n <div\n className={`propeller-grid-toolbar ${(props.className as string) || ''}`}\n data-view-mode={currentViewMode}\n >\n <div className=\"propeller-grid-toolbar__bar flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-4\">\n <div className=\"propeller-grid-toolbar__count text-sm text-muted-foreground font-medium\">\n {(props.itemsFound as number) > 0 ? (\n <span>\n {props.itemsFound as number}\n {getLabel('products')}\n </span>\n ) : null}\n </div>\n <div className=\"propeller-grid-toolbar__controls flex flex-wrap items-center gap-3\">\n <select\n className=\"propeller-grid-toolbar__select propeller-grid-toolbar__select--offset h-9 rounded-control border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n value={currentOffset}\n onChange={(e) => handleOffsetChange(parseInt((e.target as HTMLSelectElement).value))}\n >\n {getOffsetOptions()?.map((n) => (\n <option key={n} value={n}>\n {n}\n {getLabel('perPage')}\n </option>\n ))}\n </select>\n <div className=\"propeller-grid-toolbar__divider h-4 w-px bg-border hidden sm:block\" />\n <select\n className=\"propeller-grid-toolbar__select propeller-grid-toolbar__select--sort-field h-9 rounded-control border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n value={currentSortField}\n onChange={(e) => handleSortFieldChange((e.target as HTMLSelectElement).value)}\n >\n {getSortOptions()?.map((field) => (\n <option\n key={field}\n value={field}\n disabled={field === 'PRICE' && isPriceSortDisabled()}\n >\n {getLabel(field)}\n </option>\n ))}\n </select>\n <select\n className=\"propeller-grid-toolbar__select propeller-grid-toolbar__select--sort-order h-9 rounded-control border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n value={currentSortOrder}\n onChange={(e) => handleSortOrderChange((e.target as HTMLSelectElement).value)}\n >\n <option value={SortOrder.ASC}>{getLabel('ASC')}</option>\n <option value={SortOrder.DESC}>{getLabel('DESC')}</option>\n </select>\n <button\n type=\"button\"\n className=\"propeller-grid-toolbar__view-toggle h-9 w-9 flex items-center justify-center rounded-control border border-input bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors\"\n onClick={(event) => handleViewChange()}\n title={currentViewMode === 'grid' ? getLabel('switchToList') : getLabel('switchToGrid')}\n >\n {currentViewMode === 'grid' ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"8\" y1=\"6\" x2=\"21\" y2=\"6\" />\n <line x1=\"8\" y1=\"12\" x2=\"21\" y2=\"12\" />\n <line x1=\"8\" y1=\"18\" x2=\"21\" y2=\"18\" />\n <line x1=\"3\" y1=\"6\" x2=\"3.01\" y2=\"6\" />\n <line x1=\"3\" y1=\"12\" x2=\"3.01\" y2=\"12\" />\n <line x1=\"3\" y1=\"18\" x2=\"3.01\" y2=\"18\" />\n </svg>\n ) : null}\n {currentViewMode === 'list' ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" />\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" />\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" />\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" />\n </svg>\n ) : null}\n </button>\n </div>\n </div>\n {hasActiveFilters() ? (\n <div className=\"propeller-grid-toolbar__active-filters flex flex-wrap gap-2 mb-4\">\n <button\n type=\"button\"\n className=\"propeller-grid-toolbar__clear-all h-7 px-2 text-xs rounded-control hover:bg-accent hover:text-accent-foreground transition-colors\"\n onClick={(event) => {\n if (props.onClearFilters) props.onClearFilters();\n }}\n >\n {getLabel('clearAll')}\n </button>\n {props.priceFilterMin !== undefined || props.priceFilterMax !== undefined ? (\n <span\n className=\"propeller-grid-toolbar__filter-badge propeller-grid-toolbar__filter-badge--price inline-flex items-center gap-1 cursor-pointer px-2.5 py-0.5 rounded-full text-xs font-semibold border border-input bg-background hover:bg-primary hover:text-primary-foreground hover:border-primary transition-colors\"\n onClick={(event) => {\n if (props.onPriceFilterRemove) props.onPriceFilterRemove();\n }}\n >\n {getLabel('price')}: €{(props.priceFilterMin as number) ?? 0} – €\n {(props.priceFilterMax as number) ?? '∞'}\n <span className=\"propeller-grid-toolbar__filter-badge-remove\">×</span>\n </span>\n ) : null}\n {getActiveFilterBadges()?.map((badge) => (\n <span\n className=\"propeller-grid-toolbar__filter-badge inline-flex items-center gap-1 cursor-pointer px-2.5 py-0.5 rounded-full text-xs font-semibold border border-input bg-background hover:bg-primary hover:text-primary-foreground hover:border-primary transition-colors\"\n key={`${badge.key}-${badge.value}`}\n data-filter-key={badge.key}\n onClick={(event) => {\n if (props.onFilterRemove) props.onFilterRemove(badge.key, badge.value);\n }}\n >\n {badge.value}\n <span className=\"propeller-grid-toolbar__filter-badge-remove\">×</span>\n </span>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default GridToolbar;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: JSX event handlers (onClick/onChange/etc.).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\nimport { BundleItem, Cart, CartMainItem, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice, formatSurcharge } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ItemsOverviewProps {\n /** Shopping cart object from which the cart items overview will be displayed */\n cart: Cart;\n\n /** The CSS class for the cart items overview container */\n itemsOverviewContainerClass?: string;\n\n /** Title of the cart items overview */\n title?: string;\n\n /** The cart items names are clickable links */\n itemNameClickable?: boolean;\n\n /** Action when a cart item's name is clicked */\n onCartItemNameClick?: (item: CartMainItem) => void;\n /** Show the quantity of the cart item */ showQuantity?: boolean;\n /** Show the availability of the cart item */ showAvailability?: boolean;\n /** Show the SKU of the cart item */ showSku?: boolean;\n /** Show a small image of the cart item */ showImage?: boolean;\n /** Show the price of the cart item */ showPrice?: boolean;\n /** Custom price formatting function */ formatPrice?: (price: number) => string;\n /** Labels for the component */ labels?: Record<string, string>;\n /** Currency symbol used by the default formatter. Default: `'€'`. */ currency?: string;\n /** Active language for localized surcharge names. */ language?: string;\n}\n\n// ── Pure helpers (module scope — created once, not per render) ──────────────────\n\nfunction getItemName(item: CartMainItem): string {\n return item.product?.names?.[0]?.value || 'Product';\n}\n\nfunction getItemImageUrl(item: CartMainItem): string {\n const url = item.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url;\n return url && typeof url === 'string' && url.startsWith('http') ? url : '';\n}\n\nfunction getItemChildItems(item: CartMainItem): CartMainItem[] {\n const children = (item as CartMainItem & { childItems?: CartMainItem[] }).childItems;\n if (!children || !Array.isArray(children)) return [];\n return children;\n}\n\nfunction getBundleLeader(item: CartMainItem): BundleItem | undefined {\n return item.bundle?.items?.find((bi: BundleItem) => bi.isLeader === YesNo.Y);\n}\n\nfunction getBundleNonLeaders(item: CartMainItem): BundleItem[] {\n const items = item.bundle?.items;\n if (!items) return [];\n return items.filter((bi: BundleItem) => bi.isLeader !== YesNo.Y);\n}\n\n/**\n * Renders a compact read-only list of cart line items, including bundles and\n * configurable child options, with optional image, SKU, availability and price.\n */\nfunction ItemsOverview(props: ItemsOverviewProps) {\n const containerClass = props.itemsOverviewContainerClass || 'cart-items-overview';\n const itemNameClickable =\n props.itemNameClickable !== undefined ? props.itemNameClickable : true;\n // Note: `showQuantity` prop exists in the public API but quantity is always\n // rendered (it was never gated in the original component either).\n const showAvailability =\n props.showAvailability !== undefined ? props.showAvailability : true;\n const showSku = props.showSku !== undefined ? props.showSku : true;\n const showImage = props.showImage !== undefined ? props.showImage : true;\n const showPrice = props.showPrice !== undefined ? props.showPrice : true;\n\n // Computed once per render (previously items() was redefined every render and\n // called 3× — once for the map, twice for length checks).\n const items: CartMainItem[] = props.cart?.items ?? [];\n\n const currencySymbol = props.currency ?? '€';\n const money = (value: number | null | undefined): string =>\n value === undefined || value === null ? '' : formatPrice(value, { symbol: currencySymbol });\n\n function formatItemPrice(price: number): string {\n if (props.formatPrice) {\n return props.formatPrice(price);\n }\n return formatPrice(price || 0, { symbol: currencySymbol });\n }\n\n function getItemSurcharges(item: CartMainItem): string[] {\n // Cart-line surcharges (CartItemSurcharge: localized `names`, own quantity).\n // Each shown as `{qty} x € {value} (name)` / `{qty} x {value}% (name)`.\n type SurchargeLike = {\n name?: { value?: string; language?: string }[];\n names?: { value?: string; language?: string }[];\n type?: string;\n value?: number;\n quantity?: number;\n enabled?: boolean;\n };\n const list = (((item as CartMainItem & { surcharges?: SurchargeLike[] }).surcharges ?? []) as SurchargeLike[]).filter(\n (s: SurchargeLike) => s.enabled !== false\n );\n return list\n .map((s: SurchargeLike) =>\n formatSurcharge(s, {\n quantity: s.quantity ?? item.quantity ?? 1,\n language: props.language,\n currency: currencySymbol,\n })\n )\n .filter((line: string) => line.length > 0);\n }\n\n function handleItemNameClick(item: CartMainItem): void {\n if (itemNameClickable && props.onCartItemNameClick) {\n props.onCartItemNameClick(item);\n }\n }\n\n return (\n <div className={`propeller-items-overview ${containerClass}`}>\n {props.title ? (\n <h2 className=\"propeller-items-overview__title text-lg font-bold mb-4\">{props.title}</h2>\n ) : null}\n <div className=\"propeller-items-overview__list space-y-4\">\n {items.map((item, index) => {\n const isBundle = !!item.bundle;\n const stock = item.product?.inventory?.totalQuantity;\n const inStock = stock !== undefined && stock !== null && stock > 0;\n const availability =\n stock === undefined || stock === null\n ? ''\n : inStock\n ? props.labels?.['inStock'] || 'In stock'\n : props.labels?.['outOfStock'] || 'Out of stock';\n const itemSku = item.product?.sku || '';\n const childItems = getItemChildItems(item);\n const leader = getBundleLeader(item);\n return (\n <div\n className=\"propeller-items-overview__item flex gap-3 pb-3 border-b border-border last:border-b-0 last:pb-0\"\n key={item.itemId || index}\n data-bundle={isBundle ? 'true' : 'false'}\n >\n {showImage ? (\n <div className=\"propeller-items-overview__item-media w-16 h-16 flex-shrink-0 bg-surface-hover rounded-control overflow-hidden border border-border-subtle flex items-center justify-center\">\n {getItemImageUrl(item) ? (\n <img\n className=\"propeller-items-overview__item-image w-full h-full object-contain p-1.5\"\n src={getItemImageUrl(item)}\n alt={getItemName(item)}\n />\n ) : (\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n className=\"propeller-items-overview__item-image-placeholder w-6 h-6 text-foreground-subtle\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z\"\n />\n </svg>\n )}\n </div>\n ) : null}\n <div className=\"propeller-items-overview__item-body flex-1 min-w-0\">\n {isBundle ? (\n <>\n <div>\n <div className=\"flex justify-between items-start gap-2\">\n <span className=\"propeller-items-overview__item-title text-sm font-medium leading-tight text-foreground line-clamp-2\">\n {item.bundle?.name || 'Bundle'}\n </span>\n {showPrice && money(item.bundle?.price?.net) ? (\n <span className=\"propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap\">\n {money(item.bundle?.price?.net)}\n </span>\n ) : null}\n </div>\n <div className=\"propeller-items-overview__item-bundle mt-1.5 space-y-1 border-l-2 border-secondary/10 pl-2\">\n {leader ? (\n <div className=\"propeller-items-overview__item-bundle-leader flex justify-between items-center text-xs\">\n <span className=\"font-medium text-foreground\">\n {leader.product.names?.[0]?.value || 'Product'}\n </span>\n {money(leader.price?.net) ? (\n <span className=\"text-muted-foreground whitespace-nowrap ml-2\">\n {money(leader.price?.net)}\n </span>\n ) : null}\n </div>\n ) : null}\n {getBundleNonLeaders(item).map((bundleItem, idx) => (\n <div\n className=\"propeller-items-overview__item-bundle-item flex justify-between items-center text-xs text-muted-foreground\"\n key={idx}\n >\n <span className=\"line-clamp-1\">\n {bundleItem.product?.names?.[0]?.value || 'Product'}\n </span>\n {money(bundleItem.price?.net) ? (\n <span className=\"text-foreground-subtle whitespace-nowrap ml-2\">\n {money(bundleItem.price?.net)}\n </span>\n ) : null}\n </div>\n ))}\n </div>\n </div>{' '}\n <div className=\"propeller-items-overview__item-qty flex items-center text-xs text-foreground-subtle mt-1\">\n <span>\n {getLabel(props.labels, 'quantity', 'Qty:')}\n {item.quantity}\n </span>\n </div>\n </>\n ) : (\n <>\n <div>\n <div className=\"flex justify-between items-start gap-2\">\n {itemNameClickable ? (\n <p\n className=\"propeller-items-overview__item-title font-medium text-sm leading-tight cursor-pointer hover:text-secondary transition-colors line-clamp-2\"\n onClick={() => handleItemNameClick(item)}\n >\n {getItemName(item)}\n </p>\n ) : (\n <p className=\"propeller-items-overview__item-title font-medium text-sm leading-tight line-clamp-2\">\n {getItemName(item)}\n </p>\n )}\n {showPrice ? (\n <span className=\"propeller-items-overview__item-price font-semibold text-sm text-foreground whitespace-nowrap\">\n {formatItemPrice((item.price || 0) * (item.quantity || 1))}\n </span>\n ) : null}\n </div>\n {showSku && itemSku ? (\n <p className=\"propeller-items-overview__item-sku text-xs text-muted-foreground mt-0.5\">\n SKU: {itemSku}\n </p>\n ) : null}\n {getItemSurcharges(item).length > 0 ? (\n <div className=\"propeller-items-overview__item-surcharges mt-1 text-xs text-muted-foreground\">\n <span className=\"font-medium\">{getLabel(props.labels, 'surcharges', 'Additional surcharges:')}</span>\n <ul className=\"propeller-items-overview__item-surcharges-list mt-0.5\">\n {getItemSurcharges(item).map((line, idx) => (\n <li key={idx} className=\"propeller-items-overview__item-surcharge\">{line}</li>\n ))}\n </ul>\n </div>\n ) : null}\n {childItems.length > 0 ? (\n <div className=\"propeller-items-overview__item-options mt-1.5 space-y-1 border-l-2 border-border-subtle pl-2\">\n {childItems.map((child, idx) => (\n <div\n className=\"propeller-items-overview__item-option flex justify-between items-center text-xs text-muted-foreground\"\n key={idx}\n >\n <span className=\"line-clamp-1\">\n {child.product?.names?.[0]?.value || 'Option'}\n </span>\n <span className=\"text-foreground-subtle whitespace-nowrap ml-2\">\n {formatItemPrice(child.totalSum || 0)}\n </span>\n </div>\n ))}\n </div>\n ) : null}\n </div>{' '}\n <div className=\"propeller-items-overview__item-qty flex items-center text-xs text-foreground-subtle mt-1\">\n <span>\n {getLabel(props.labels, 'quantity', 'Qty:')}\n {item.quantity}\n </span>\n {showAvailability && availability ? (\n <span\n className={`propeller-items-overview__item-availability ml-2 ${inStock ? 'text-success' : 'text-destructive'}`}\n data-in-stock={inStock ? 'true' : 'false'}\n >\n {availability}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n </div>\n );\n })}\n </div>\n {items.length === 0 ? (\n <p className=\"propeller-items-overview__empty text-muted-foreground italic text-sm\">\n {getLabel(props.labels, 'noItems', 'No items in cart.')}\n </p>\n ) : null}\n </div>\n );\n}\nexport default ItemsOverview;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { GraphQLClient, Category, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport { useMenu, MenuCategory } from '../composables/react/useMenu';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface MenuProps {\n /**\n * Initialised Propeller SDK GraphQL client.\n * Used internally to fetch the category hierarchy. Not required when\n * `tree` is supplied — that pre-fetched form skips the internal fetch.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Base category ID for fetching all categories.\n * This is the root of the menu tree.\n */\n categoryId: number;\n\n /**\n * Pre-fetched menu tree. When provided, the component skips its internal\n * `useMenu` fetch entirely and renders the tree directly — mirrors the\n * `ProductGrid.products` opt-in. Use this from a Server Component that\n * resolved the tree itself (e.g. via a server-side `fetchMenu`), so the\n * host can attach Next.js cache hints and the menu HTML lands in the\n * initial response.\n *\n * When omitted, the component falls back to the legacy client-side fetch\n * via `useMenu`, identical to the v0.x behaviour.\n */\n tree?: MenuCategory[];\n\n /**\n * Language code for fetching localised category names and slugs.\n * Resolved from PropellerProvider when omitted.\n */\n language?: string;\n\n /**\n * Maximum nesting depth of the menu hierarchy.\n * Defaults to 3.\n */\n depth?: number;\n\n /**\n * CSS class applied to the menu container element.\n */\n menuClass?: string;\n\n /**\n * Main menu display type.\n * - 'dropdown-vertical': nested flyout panels on hover (default)\n * - 'jumbotron': full-width mega-menu panel showing all subcategories\n */\n menuStyle?: string;\n\n /**\n * URL pattern for category links.\n * Use `{categoryId}` and `{slug}` as placeholders.\n * Defaults to 'category/{categoryId}/{slug}'.\n */\n menuLinkFormat?: string;\n\n /**\n * Called when a menu item is clicked.\n * Use for SPA-style routing instead of full-page navigation.\n */\n onMenuItemClick: (category: Category) => void;\n\n /**\n * Override any UI string.\n * Available keys: loading, error, empty\n */\n labels?: Record<string, string>;\n\n /**\n * Authenticated user object. When user changes (login/logout),\n * the menu cache is cleared and the menu is re-fetched.\n */\n user?: Contact | Customer | null;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /** Configuration object passed to the component */\n configuration?: any;\n}\n\n/**\n * Renders a multi-level category navigation menu (dropdown flyout or jumbotron\n * mega-menu on desktop, accordion on mobile) from the fetched category tree.\n *\n * @remarks Uses {@link useMenu} to fetch the category hierarchy.\n */\nfunction Menu(rawProps: MenuProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [hoveredL1Id, setHoveredL1Id] = useState<number | null>(null);\n const [hoveredL2Id, setHoveredL2Id] = useState<number | null>(null);\n const [expandedL1, setExpandedL1] = useState<number | null>(null);\n const [expandedL2, setExpandedL2] = useState<number | null>(null);\n\n // Stable string key derived from user identity — used as dep so that a new\n // user object reference (same ID) never triggers a spurious re-fetch.\n const userKey = props.user\n ? ('contactId' in (props.user as any)\n ? `c${(props.user as Contact).contactId}`\n : `u${(props.user as Customer).customerId}`)\n : '';\n\n // Branch on whether the host pre-fetched the tree. When supplied, the\n // internal fetch is skipped — no loading state, no client roundtrip. This\n // is the path Server Components should use; the fallback (no `tree`) keeps\n // the legacy client-side fetch behaviour for callers that haven't migrated.\n const hasPrefetchedTree = Array.isArray(props.tree);\n const { categories: fetchedCategories, loading: fetchedLoading, error: menuError, fetchMenu } = useMenu({\n graphqlClient: props.graphqlClient!,\n language: props.language,\n depth: props.depth,\n });\n const menuCategories: MenuCategory[] = hasPrefetchedTree ? (props.tree as MenuCategory[]) : fetchedCategories;\n const isLoading = hasPrefetchedTree ? false : fetchedLoading;\n const hasError = !hasPrefetchedTree && menuError !== null;\n\n function getCategoryName(cat: MenuCategory): string {\n return cat.name;\n }\n function getCategoryUrl(cat: MenuCategory): string {\n const lang = props.language || 'NL';\n return props.configuration.urls.getCategoryUrl(\n { categoryId: cat.categoryId, slug: [{ value: cat.slug, language: lang }] } as Category,\n lang\n );\n }\n function getSubCategories(cat: MenuCategory): MenuCategory[] {\n return (cat.children || []).filter((sub) => sub.name && sub.slug);\n }\n function handleItemClick(cat: MenuCategory, e: any): void {\n if (props.onMenuItemClick) {\n e.preventDefault();\n const lang = props.language || 'NL';\n props.onMenuItemClick({\n categoryId: cat.categoryId,\n name: [{ value: cat.name, language: lang }] as any,\n slug: [{ value: cat.slug, language: lang }] as any,\n } as Category);\n }\n }\n function setHoveredL1(id: number | null): void {\n setHoveredL1Id(id);\n setHoveredL2Id(null);\n }\n function setHoveredL2(id: number | null): void {\n setHoveredL2Id(id);\n }\n \n function getMenuStyle(): string {\n return (props.menuStyle as string) || 'dropdown-vertical';\n }\n\n useEffect(() => {\n // When the host pre-fetched the tree, do nothing — re-fetching would\n // defeat the point of server-side caching and cause an avoidable\n // client-side request after hydration.\n if (hasPrefetchedTree) return;\n if (!props.graphqlClient) return;\n fetchMenu(props.categoryId, userKey);\n }, [hasPrefetchedTree, props.graphqlClient, props.categoryId, props.language, userKey, fetchMenu]);\n\n return (\n <div\n className={`propeller-menu ${(props.className as string) || ''}`}\n data-variant={getMenuStyle()}\n data-loading={isLoading ? 'true' : 'false'}\n >\n {isLoading ? (\n <div className=\"propeller-menu__loading flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground\">\n <div className=\"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin\" />\n <span>{getLabel(props.labels, 'loading', 'Loading menu...')}</span>\n </div>\n ) : null}\n {!isLoading && hasError ? (\n <div className=\"propeller-menu__error px-4 py-3 text-sm text-destructive\">\n {getLabel(props.labels, 'error', 'Failed to load menu')}\n </div>\n ) : null}\n {!isLoading && !hasError && menuCategories.length === 0 ? (\n <div className=\"propeller-menu__empty px-4 py-3 text-sm text-muted-foreground\">\n {getLabel(props.labels, 'empty', 'No categories found')}\n </div>\n ) : null}\n {!isLoading &&\n !hasError &&\n menuCategories.length > 0 &&\n getMenuStyle() === 'dropdown-vertical' ? (\n <nav\n className={`propeller-menu__nav hidden md:block ${(props.menuClass as string) || ''}`}\n >\n <div className=\"flex bg-popover border border-border shadow-lg\">\n <ul className=\"propeller-menu__list w-64 py-1 border-r border-border flex-shrink-0\" data-level=\"1\">\n {menuCategories?.map((l1, idx) => (\n <li\n key={`l1-${l1.categoryId}-${idx}`}\n className=\"propeller-menu__item\"\n data-level=\"1\"\n data-active={hoveredL1Id === l1.categoryId ? 'true' : 'false'}\n onMouseEnter={(event) => setHoveredL1(l1.categoryId)}\n >\n <a\n href={getCategoryUrl(l1)}\n onClick={(e) => handleItemClick(l1, e)}\n className={`propeller-menu__link flex items-center justify-between px-4 py-2.5 text-sm transition-colors ${hoveredL1Id === l1.categoryId ? 'bg-accent text-accent-foreground' : 'text-foreground hover:bg-accent/50'}`}\n >\n <span className=\"propeller-menu__label font-medium truncate\">{getCategoryName(l1)}</span>\n {getSubCategories(l1).length > 0 ? (\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-menu__chevron w-4 h-4 text-muted-foreground\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 5l7 7-7 7\"\n strokeWidth={2}\n />\n </svg>\n ) : null}\n </a>\n </li>\n ))}\n </ul>\n {menuCategories?.map((l1, idx) =>\n hoveredL1Id === l1.categoryId && getSubCategories(l1).length > 0 ? (\n <ul\n key={`l1-sub-${l1.categoryId}-${idx}`}\n className=\"propeller-menu__list w-64 py-1 border-r border-border flex-shrink-0\"\n data-level=\"2\"\n >\n {getSubCategories(l1)?.map((l2, idx2) => (\n <li\n key={`l2-${l2.categoryId}-${idx2}`}\n className=\"propeller-menu__item\"\n data-level=\"2\"\n data-active={hoveredL2Id === l2.categoryId ? 'true' : 'false'}\n onMouseEnter={(event) => setHoveredL2(l2.categoryId)}\n >\n <a\n href={getCategoryUrl(l2)}\n onClick={(e) => handleItemClick(l2, e)}\n className={`propeller-menu__link flex items-center justify-between px-4 py-2.5 text-sm transition-colors ${hoveredL2Id === l2.categoryId ? 'bg-accent text-accent-foreground' : 'text-foreground hover:bg-accent/50'}`}\n >\n <span className=\"propeller-menu__label truncate\">{getCategoryName(l2)}</span>\n {getSubCategories(l2).length > 0 ? (\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-menu__chevron w-4 h-4 text-muted-foreground\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 5l7 7-7 7\"\n strokeWidth={2}\n />\n </svg>\n ) : null}\n </a>\n </li>\n ))}\n </ul>\n ) : null\n )}\n {menuCategories?.map((l1, idx) =>\n hoveredL1Id === l1.categoryId ? (\n <React.Fragment key={`l1-l3col-${l1.categoryId}-${idx}`}>\n {getSubCategories(l1)?.map((l2, idx2) =>\n hoveredL2Id === l2.categoryId && getSubCategories(l2).length > 0 ? (\n <ul\n key={`l3-col-${l2.categoryId}-${idx2}`}\n className=\"propeller-menu__list w-64 py-1 flex-shrink-0\"\n data-level=\"3\"\n >\n {getSubCategories(l2)?.map((l3, idx3) => (\n <li\n key={`l3-${l3.categoryId}-${idx3}`}\n className=\"propeller-menu__item\"\n data-level=\"3\"\n >\n <a\n className=\"propeller-menu__link block px-4 py-2.5 text-sm text-foreground hover:bg-accent/50 transition-colors\"\n href={getCategoryUrl(l3)}\n onClick={(e) => handleItemClick(l3, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l3)}</span>\n </a>\n </li>\n ))}\n </ul>\n ) : null\n )}\n </React.Fragment>\n ) : null\n )}\n </div>\n </nav>\n ) : null}\n {!isLoading &&\n !hasError &&\n menuCategories.length > 0 &&\n getMenuStyle() === 'jumbotron' ? (\n <nav\n className={`propeller-menu__nav hidden md:block ${(props.menuClass as string) || ''}`}\n >\n <div className=\"propeller-menu__tabs flex items-center border-b border-border\">\n {menuCategories?.map((l1, idx) => (\n <button\n key={`l1-${l1.categoryId}-${idx}`}\n className={`propeller-menu__tab px-5 py-3 text-sm font-medium transition-colors border-b-2 ${hoveredL1Id === l1.categoryId ? 'border-primary text-primary' : 'border-transparent text-foreground hover:text-primary hover:border-primary/50'}`}\n data-level=\"1\"\n data-active={hoveredL1Id === l1.categoryId ? 'true' : 'false'}\n onMouseEnter={(event) => setHoveredL1(l1.categoryId)}\n onClick={(e) => handleItemClick(l1, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l1)}</span>\n </button>\n ))}\n </div>\n {menuCategories?.map((l1, idx) =>\n hoveredL1Id === l1.categoryId && getSubCategories(l1).length > 0 ? (\n <div\n className=\"propeller-menu__panel bg-popover border border-border border-t-0 shadow-lg p-6\"\n onMouseEnter={(event) => setHoveredL1(l1.categoryId)}\n onMouseLeave={(event) => setHoveredL1(null)}\n >\n <div className=\"propeller-menu__panel-grid grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6\">\n {getSubCategories(l1)?.map((l2, idx2) => (\n <div key={`l2-${l2.categoryId}-${idx2}`} className=\"propeller-menu__group\" data-level=\"2\">\n <a\n className=\"propeller-menu__link text-sm font-semibold text-foreground hover:text-primary transition-colors\"\n href={getCategoryUrl(l2)}\n onClick={(e) => handleItemClick(l2, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l2)}</span>\n </a>\n {getSubCategories(l2).length > 0 ? (\n <ul className=\"propeller-menu__list mt-2 space-y-1\" data-level=\"3\">\n {getSubCategories(l2)?.map((l3, idx3) => (\n <li key={`l3-${l3.categoryId}-${idx3}`} className=\"propeller-menu__item\" data-level=\"3\">\n <a\n className=\"propeller-menu__link text-sm text-muted-foreground hover:text-primary transition-colors\"\n href={getCategoryUrl(l3)}\n onClick={(e) => handleItemClick(l3, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l3)}</span>\n </a>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n ))}\n </div>\n </div>\n ) : null\n )}\n </nav>\n ) : null}\n {!isLoading &&\n !hasError &&\n menuCategories.length > 0 ? (\n <nav className={`propeller-menu__nav md:hidden ${(props.menuClass as string) || ''}`}>\n <ul className=\"propeller-menu__list divide-y divide-border\" data-level=\"1\">\n {menuCategories?.map((l1, idx) => (\n <li\n key={`l1-mobile-${l1.categoryId}-${idx}`}\n className=\"propeller-menu__item\"\n data-level=\"1\"\n data-expanded={expandedL1 === l1.categoryId ? 'true' : 'false'}\n >\n <div className=\"flex items-center\">\n <a\n className=\"propeller-menu__link flex-1 px-4 py-3 text-sm font-medium text-foreground\"\n href={getCategoryUrl(l1)}\n onClick={(e) => handleItemClick(l1, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l1)}</span>\n </a>\n {getSubCategories(l1).length > 0 ? (\n <button\n type=\"button\"\n className=\"propeller-menu__toggle px-4 py-3 text-muted-foreground\"\n onClick={(event) => {\n setExpandedL1(expandedL1 === l1.categoryId ? null : l1.categoryId);\n }}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className={`propeller-menu__chevron w-4 h-4 transition-transform ${expandedL1 === l1.categoryId ? 'rotate-180' : ''}`}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m6 9 6 6 6-6\"\n strokeWidth={2}\n />\n </svg>\n </button>\n ) : null}\n </div>\n {expandedL1 === l1.categoryId && getSubCategories(l1).length > 0 ? (\n <ul className=\"propeller-menu__list bg-accent/30\" data-level=\"2\">\n {getSubCategories(l1)?.map((l2, idx2) => (\n <li\n key={`l2-mobile-${l2.categoryId}-${idx2}`}\n className=\"propeller-menu__item\"\n data-level=\"2\"\n data-expanded={expandedL2 === l2.categoryId ? 'true' : 'false'}\n >\n <div className=\"flex items-center\">\n <a\n className=\"propeller-menu__link flex-1 pl-8 pr-4 py-2.5 text-sm text-foreground\"\n href={getCategoryUrl(l2)}\n onClick={(e) => handleItemClick(l2, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l2)}</span>\n </a>\n {getSubCategories(l2).length > 0 ? (\n <button\n type=\"button\"\n className=\"propeller-menu__toggle px-4 py-2.5 text-muted-foreground\"\n onClick={(event) => {\n setExpandedL2(expandedL2 === l2.categoryId ? null : l2.categoryId);\n }}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className={`propeller-menu__chevron w-3.5 h-3.5 transition-transform ${expandedL2 === l2.categoryId ? 'rotate-180' : ''}`}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m6 9 6 6 6-6\"\n strokeWidth={2}\n />\n </svg>\n </button>\n ) : null}\n </div>\n {expandedL2 === l2.categoryId && getSubCategories(l2).length > 0 ? (\n <ul className=\"propeller-menu__list bg-accent/20\" data-level=\"3\">\n {getSubCategories(l2)?.map((l3, idx3) => (\n <li\n key={`l3-mobile-${l3.categoryId}-${idx3}`}\n className=\"propeller-menu__item\"\n data-level=\"3\"\n >\n <a\n className=\"propeller-menu__link block pl-12 pr-4 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors\"\n href={getCategoryUrl(l3)}\n onClick={(e) => handleItemClick(l3, e)}\n >\n <span className=\"propeller-menu__label\">{getCategoryName(l3)}</span>\n </a>\n </li>\n ))}\n </ul>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n </li>\n ))}\n </ul>\n </nav>\n ) : null}\n </div>\n );\n}\n\nexport default Menu;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport {\n GraphQLClient,\n Order,\n Cart,\n Contact,\n Customer,\n MediaImageProductSearchInput,\n TransformationsInput,\n Company,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useOrders } from '../composables/react/useOrders';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface OrderActionsProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n /** The order to act upon */\n order: Order;\n /** The authenticated user. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n /** Cart ID — if provided, re-order adds items to this cart */\n cartId?: string;\n /** Active company ID from the company switcher */\n companyId?: number;\n /** Configuration object (imageSearchFiltersGrid, imageVariantFiltersSmall, etc.) */\n configuration?: any;\n /** Label overrides for UI strings */\n labels?: Record<string, string>;\n /** Additional CSS class for the root element */\n className?: string;\n /** Callback when a new cart is created during re-order */\n onCartCreated?: (cart: Cart) => void;\n /** Callback fired after all re-order items have been added */\n afterReorder?: (cart: Cart) => void;\n}\n/** GraphQL query variables used internally when re-loading a cart during re-order. */\nexport interface CartQueryVariables {\n /** ID of the cart to query. */\n cartId: string;\n /** Language code for localised product fields. */\n language: string;\n /** Image search filters applied to product media in results. */\n imageSearchFilters: MediaImageProductSearchInput;\n /** Image transformation filters applied to returned product images. */\n imageVariantFilters: TransformationsInput;\n}\n\n/**\n * Renders the per-order action buttons (download confirmation PDF, re-order)\n * with an inline toast for success/error feedback.\n *\n * @remarks Uses {@link useOrders} for PDF download and re-order operations.\n */\nfunction OrderActions(rawProps: OrderActionsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [reordering, setReordering] = useState(false);\n const [downloading, setDownloading] = useState(false);\n const [toastMessage, setToastMessage] = useState('');\n const [toastType, setToastType] = useState('');\n const [toastVisible, setToastVisible] = useState(false);\n\n const { downloadPdf, reorder } = useOrders({\n graphqlClient: props.graphqlClient!,\n user: props.user as any,\n companyId: props.companyId,\n configuration: props.configuration,\n onCartCreated: props.onCartCreated,\n afterReorder: props.afterReorder,\n });\n\n function showToast(message: string, type: string) {\n setToastMessage(message);\n setToastType(type);\n setToastVisible(true);\n setTimeout(() => {\n setToastVisible(false);\n }, 3000);\n }\n\n function dismissToast() {\n setToastVisible(false);\n }\n\n \n\n async function handleDownloadPDF() {\n if (!props.order?.id) return;\n setDownloading(true);\n try {\n const result = await downloadPdf(props.order);\n if (result.success) {\n showToast(getLabel(props.labels, 'pdfSuccess', 'PDF downloaded successfully'), 'success');\n } else {\n showToast(getLabel(props.labels, 'pdfError', 'Failed to download PDF'), 'error');\n }\n } catch (error) {\n console.error('Error downloading PDF:', error);\n showToast(getLabel(props.labels, 'pdfError', 'Failed to download PDF'), 'error');\n } finally {\n setDownloading(false);\n }\n }\n\n async function handleReorder() {\n if (!props.order?.items) return;\n setReordering(true);\n try {\n const result = await reorder(props.order, props.cartId);\n if (result.success) {\n showToast(getLabel(props.labels, 'reorderSuccess', 'All items added to cart'), 'success');\n } else {\n showToast(getLabel(props.labels, 'reorderError', 'Failed to add items to cart'), 'error');\n }\n } catch (error) {\n console.error('Error during re-order:', error);\n showToast(getLabel(props.labels, 'reorderError', 'Failed to add items to cart'), 'error');\n } finally {\n setReordering(false);\n }\n }\n\n return (\n // `flex-shrink-0` on the wrapper so OrderActions keeps its natural width\n // when it sits next to OrderTotals in a flex row — otherwise the parent's\n // shrink behaviour squeezes the buttons until the labels wrap mid-word\n // (the bug screenshot showed \"Order / confirmation / (PDF)\" on three lines).\n // `whitespace-nowrap` on the buttons is the belt-and-braces guarantee that\n // text never wraps even in narrow containers without flex sizing.\n <div className={`propeller-order-actions flex-shrink-0 ${props.className || ''}`}>\n <div className=\"propeller-order-actions__actions flex flex-row items-center gap-3 flex-shrink-0\">\n <button\n type=\"button\"\n className=\"propeller-order-actions__pdf-btn text-primary hover:text-primary/80 text-sm font-medium hover:underline disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap\"\n onClick={(event) => handleDownloadPDF()}\n disabled={downloading}\n >\n {downloading ? <>{getLabel(props.labels, 'downloadingPdf', 'Downloading...')}</> : null}\n {!downloading ? <>{getLabel(props.labels, 'downloadPdf', 'Order confirmation (PDF)')}</> : null}\n </button>\n <button\n type=\"button\"\n className=\"propeller-order-actions__reorder-btn text-primary hover:text-primary/80 text-sm font-medium hover:underline disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap\"\n onClick={(event) => handleReorder()}\n disabled={reordering}\n >\n {reordering ? <>{getLabel(props.labels, 'reordering', 'Adding items...')}</> : null}\n {!reordering ? <>{getLabel(props.labels, 'reorder', 'Order again')}</> : null}\n </button>\n </div>\n {toastVisible ? (\n <div\n className={`propeller-order-actions__toast fixed top-4 right-4 z-50 flex items-start gap-3 w-80 rounded-container shadow-lg p-4 ${toastType === 'success' ? 'bg-success border border-success text-success-foreground' : 'bg-destructive border border-destructive text-destructive-foreground'}`}\n data-toast-type={toastType}\n >\n <div\n className={`propeller-order-actions__toast-icon flex-shrink-0 w-5 h-5 mt-0.5 ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastType === 'success' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n ) : null}\n {toastType === 'error' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\"\n />\n </svg>\n ) : null}\n </div>\n <p\n className={`propeller-order-actions__toast-message flex-1 text-sm font-medium ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastMessage}\n </p>\n <button\n type=\"button\"\n onClick={(event) => dismissToast()}\n className={`propeller-order-actions__toast-close flex-shrink-0 rounded focus:outline-none ${toastType === 'success' ? 'text-success-foreground hover:text-success-foreground/80' : 'text-destructive-foreground hover:text-destructive-foreground/80'}`}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-4 w-4\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default OrderActions;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport type { OrderItem } from '@propeller-commerce/propeller-sdk-v2';\nimport { formatPrice, getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport DefaultProductPriceImpl from './ProductPrice';\nimport DefaultItemStockImpl from './ItemStock';\n\nexport interface OrderItemCardProps {\n /** The order item to display */\n orderItem: OrderItem;\n\n /** Child order items (rendered as indented sub-rows beneath the parent) */\n childItems?: OrderItem[];\n\n /** Should the item title be a link to the PDP */\n titleLinkable?: boolean;\n\n /** Display a small thumbnail of the order item */\n showImage?: boolean;\n\n /** Should stock info be displayed */\n showStockComponent?: boolean;\n\n /** Display the SKU of the order item beneath the item name */\n showSku?: boolean;\n\n /** Display the quantity of the order item */\n showQuantity?: boolean;\n\n /** Display the price of the order item */\n showPrice?: boolean;\n\n /** Display the discount column */\n showDiscount?: boolean;\n\n /** Should the order item notes field be displayed */\n showItemNotes?: boolean;\n\n /** Render as a child/sub-item (indented, no image) */\n isChildItem?: boolean;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol used by the default formatter. Default: `'€'`. */\n currency?: string;\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n\n // ───── Extension API (RSC-safe variant) ─────\n // Direct-prop slot fallback (no useResolvedProps — keeps the component\n // server-component-safe). Caller passes the desired component; if absent,\n // renders the Default* fallback.\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n}\n\n// ── Pure accessors (module scope — created once, not per render) ────────────────\n\nfunction getProductName(orderItem: OrderItem): string {\n return orderItem?.product?.names?.[0]?.value || orderItem?.name || 'Unknown Product';\n}\n\nfunction getClusterUrl(orderItem: OrderItem): string {\n const cluster = orderItem?.product?.cluster;\n if (!cluster) return '';\n const id = cluster.clusterId;\n const slug = cluster.slugs?.[0]?.value || '';\n if (!id || !slug) return '';\n return `/cluster/${id}/${slug}`;\n}\n\nfunction getProductUrl(orderItem: OrderItem): string {\n const cu = getClusterUrl(orderItem);\n if (cu) return cu;\n const id = orderItem?.product?.productId;\n const slug = orderItem?.product?.slugs?.[0]?.value || '';\n if (id && slug) return `/product/${id}/${slug}`;\n return '';\n}\n\n/**\n * Renders a single order line item as a table row (with optional indented\n * child-item rows), showing image, SKU, quantity, discount and price.\n */\nfunction OrderItemCard(props: OrderItemCardProps) {\n const item = props.orderItem;\n const isChildItem = props.isChildItem || false;\n\n // Display toggles — resolved once (child items never show image/sku).\n const titleLinkable = props.titleLinkable !== undefined ? props.titleLinkable : true;\n const showImage = isChildItem ? false : props.showImage !== undefined ? props.showImage : true;\n const showSku = isChildItem ? false : props.showSku !== undefined ? props.showSku : true;\n const showQuantity = props.showQuantity !== undefined ? props.showQuantity : true;\n const showPrice = props.showPrice !== undefined ? props.showPrice : true;\n const showDiscount = props.showDiscount !== undefined ? props.showDiscount : false;\n const showStockComponent =\n props.showStockComponent !== undefined ? props.showStockComponent : false;\n const showItemNotes = props.showItemNotes !== undefined ? props.showItemNotes : false;\n\n // Derived item values — computed once per render (previously each was a\n // function redefined every render and called multiple times across the JSX).\n const productName = getProductName(item);\n const productSku = item?.product?.sku || item?.sku || '';\n const productImage = item?.product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n const productUrl = getProductUrl(item);\n const quantity = item?.quantity || 0;\n const priceTotal = item?.priceTotal || 0;\n const discount = item?.discount || 0;\n const originalPrice = item?.originalPrice || 0;\n const discountPercentage =\n originalPrice > 0 && discount > 0 ? (discount / originalPrice) * 100 : 0;\n const notes = item?.notes || '';\n const hasChildren = (props.childItems || []).length > 0;\n\n function formatItemPrice(price: number): string {\n if (props.formatPrice) {\n return props.formatPrice(price);\n }\n if (!price && price !== 0) return '-';\n return formatPrice(price, { symbol: props.currency ?? '€' });\n }\n\n const discountDisplay =\n discountPercentage > 0\n ? `${formatItemPrice(discount)} (${discountPercentage.toFixed(2).replace('.', ',')}%)`\n : formatItemPrice(discount);\n\n return (\n <tbody className=\"propeller-order-item-card\">\n <tr\n className={`propeller-order-item-card__row ${isChildItem ? 'border-0' : 'hover:bg-surface-hover transition'}`}\n data-child={isChildItem ? 'true' : 'false'}\n >\n <td\n className={`propeller-order-item-card__cell propeller-order-item-card__cell--product ${isChildItem ? 'px-6 py-2 pl-28' : 'px-6 py-4'}`}\n >\n <div className=\"flex items-center gap-4\">\n {showImage ? (\n productImage ? (\n <div className=\"propeller-order-item-card__media relative w-16 h-16 flex-shrink-0 rounded overflow-hidden\">\n <img\n className=\"propeller-order-item-card__image object-cover w-full h-full\"\n src={productImage}\n alt={productName}\n />\n </div>\n ) : (\n <div className=\"propeller-order-item-card__image-placeholder w-16 h-16 bg-surface-hover rounded flex items-center justify-center text-foreground-subtle text-xs\">\n {getLabel(props.labels, 'noImage', 'No Img')}\n </div>\n )\n ) : null}\n <div>\n {titleLinkable && productUrl && !isChildItem ? (\n <a\n className=\"propeller-order-item-card__title font-medium text-foreground hover:text-primary hover:underline\"\n href={productUrl}\n >\n {productName}\n </a>\n ) : (\n <span\n className={`propeller-order-item-card__title ${isChildItem ? 'text-sm text-muted-foreground' : 'font-medium'}`}\n >\n {productName}\n </span>\n )}\n {showSku && productSku ? (\n <p className=\"propeller-order-item-card__sku text-sm text-muted-foreground mt-1\">\n SKU: {productSku}\n </p>\n ) : null}\n {showItemNotes && notes ? (\n <p className=\"propeller-order-item-card__notes text-sm text-foreground-subtle mt-1 italic\">\n {notes}\n </p>\n ) : null}\n {showStockComponent && item?.product?.inventory\n ? (() => {\n // Delegate to the injected stock slot, or fall back to\n // the default stock display. Replaces the prior literal\n // \"Stock info\" placeholder text. The `inventory` guard\n // above bridges the contract-vs-default mismatch: the\n // shared StockComponentProps.inventory is optional while\n // DefaultItemStock requires it, so we only render when\n // the SDK actually returned inventory data.\n const StockImpl = props.stockComponent ?? DefaultItemStockImpl;\n return (\n <StockImpl\n inventory={item.product.inventory}\n showStock={true}\n showAvailability={true}\n labels={props.labels}\n />\n );\n })()\n : null}\n </div>\n </div>\n </td>\n {showQuantity ? (\n <td\n className={\n isChildItem\n ? 'propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-2 text-center text-sm text-muted-foreground'\n : 'propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-4 text-center'\n }\n >\n {quantity}\n </td>\n ) : null}\n {showDiscount ? (\n <td\n className={\n isChildItem\n ? 'propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-2 text-right text-sm text-muted-foreground'\n : 'propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-4 text-right whitespace-nowrap text-warning'\n }\n >\n {discount > 0 ? <>{discountDisplay}</> : null}\n </td>\n ) : null}\n {showPrice ? (\n <td\n className={\n isChildItem\n ? 'propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-2 text-right whitespace-nowrap text-sm text-muted-foreground'\n : 'propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-4 text-right whitespace-nowrap'\n }\n >\n {(() => {\n // When the consumer injects a priceComponent, delegate to it;\n // otherwise keep the existing inline line-total rendering.\n //\n // Contract-vs-data note (same as CartItem): the\n // PriceComponentProps.price contract expects an SDK ProductPrice\n // (catalog/unit price), while this cell historically renders the\n // line total `item.priceTotal`. We pass `item.product?.price`\n // (catalog price) to the injected component to honour the\n // contract; consumers who need the line total can read it off\n // the labels/className surface or compute their own from the\n // catalog price + their own quantity context. The default\n // (uninjected) path is unchanged.\n const PriceImpl = props.priceComponent;\n if (PriceImpl) {\n return (\n <PriceImpl\n price={item?.product?.price}\n currency={props.currency}\n labels={props.labels}\n />\n );\n }\n return formatItemPrice(priceTotal);\n })()}\n </td>\n ) : null}\n </tr>\n {hasChildren ? (\n <>\n {(props.childItems || []).map((child) => (\n <tr\n className=\"propeller-order-item-card__child-row border-0\"\n key={child.id || child.uuid}\n data-child=\"true\"\n >\n <td className=\"propeller-order-item-card__cell propeller-order-item-card__cell--product px-6 py-2 pl-28\">\n <span className=\"propeller-order-item-card__child-title text-sm text-muted-foreground\">\n {child.product?.names?.[0]?.value || child.name || 'Unknown'}\n </span>\n </td>\n {showQuantity ? (\n <td className=\"propeller-order-item-card__cell propeller-order-item-card__cell--quantity px-6 py-2 text-center text-sm text-muted-foreground\">\n {child.quantity || 0}\n </td>\n ) : null}\n {showDiscount ? (\n <td className=\"propeller-order-item-card__cell propeller-order-item-card__cell--discount px-6 py-2 text-right text-sm text-muted-foreground\" />\n ) : null}\n {showPrice ? (\n <td className=\"propeller-order-item-card__cell propeller-order-item-card__cell--price px-6 py-2 text-right whitespace-nowrap text-sm text-muted-foreground\">\n {formatItemPrice(child.priceTotal || 0)}\n </td>\n ) : null}\n </tr>\n ))}\n </>\n ) : null}\n </tbody>\n );\n}\n\nexport default OrderItemCard;\n","'use client';\n/**\n * @rsc-blocked — Client-only component (ships under the package's \"use client\"\n * boundary alongside the other order components). Holds no state itself.\n */\nimport * as React from 'react';\n\nimport { Order, OrderItem, OrderItemClass, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport DefaultOrderItemCardImpl from './OrderItemCard';\n\nexport interface OrderBonusItemsProps {\n /** Order whose bonus items are displayed. When omitted, pass `items` directly. */\n order?: Order | null;\n /** Pre-resolved order items. When omitted, `order.items` is used. */\n items?: OrderItem[];\n /** Currency symbol for prices, forwarded to OrderItemCard. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n /** Additional CSS class for the root element. */\n className?: string;\n /** Label overrides. Keys: `title` ('Bonus items'). */\n labels?: Record<string, string>;\n // ───── Extension API ─────\n // Replaces each <OrderItemCard> rendered in the bonus-items list.\n orderItemCardComponent?: React.ComponentType<import('./OrderItemCard').OrderItemCardProps>;\n}\n\n/**\n * Renders an order's bonus items — free items added through incentives — as a\n * read-only \"Bonus items\" section (heading + table of OrderItemCard rows).\n *\n * Bonus items are order items of `class === 'product'` (the free goods) with\n * `isBonus === 'Y'` — whether standalone or grouped by the backend under an\n * `incentive` item via `parentOrderItemId`. Any backend-side grouping is\n * purely presentational; in the flat SDK item list every bonus good is\n * already `product`/`isBonus === Y`, so filtering on that yields the same set.\n *\n * Renders nothing when there are no bonus items, so it's safe to drop into any\n * order surface (thank-you, order details, quote details) unconditionally.\n *\n * `currency` resolves from `<PropellerProvider>` via `useInfraProps` when not\n * passed explicitly.\n */\nfunction OrderBonusItems(rawProps: OrderBonusItemsProps) {\n const props = useInfraProps(rawProps);\n const allItems: OrderItem[] = props.items ?? props.order?.items ?? [];\n const bonusItems = allItems.filter(\n (item: OrderItem) =>\n item.class === OrderItemClass.product && item.isBonus === YesNo.Y,\n );\n if (bonusItems.length === 0) return null;\n\n const OrderItemCardImpl = props.orderItemCardComponent ?? DefaultOrderItemCardImpl;\n\n return (\n <div className={`propeller-order-bonus-items ${props.className || 'mb-8'}`}>\n <h3 className=\"propeller-order-bonus-items__title text-lg font-bold mb-3 text-foreground\">\n {getLabel(props.labels, 'title', 'Bonus items')}\n </h3>\n <div className=\"propeller-order-bonus-items__table bg-card rounded-container shadow overflow-hidden\">\n <table className=\"w-full\">\n {bonusItems.map((item: OrderItem) => (\n <OrderItemCardImpl\n key={item.id}\n orderItem={item}\n titleLinkable={false}\n currency={props.currency}\n />\n ))}\n </table>\n </div>\n </div>\n );\n}\n\nexport default OrderBonusItems;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Contact, Customer, DateSearchInput, DecimalSearchInput, GraphQLClient, Order, OrderSortField, OrderSortInput, OrderType, SortOrder } from '@propeller-commerce/propeller-sdk-v2';\nimport { useOrders } from '../composables/react/useOrders';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice as formatPriceHelper } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface OrderListProps {\n /** The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n\n /** The initialized GraphQL Client instance. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** Callback when an order is clicked */\n onOrderClick: (orderId: number) => void;\n\n /** Columns to display. Defaults to ['id', 'date', 'status', 'total', 'action'] */\n columns?: string[];\n\n /** Label mapping for columns */\n columnConfig?: Record<string, string>;\n\n /** Enable searching */\n enableSearch?: boolean;\n\n /** Fields enabled for searching (UI inputs) */\n searchFields?: string[];\n\n /** Term fields configuration (backend) */\n termFields?: any[]; // effectively OrderSearchFields[] (kept as any[] to avoid strict enum import coupling)\n\n /** Override company ID for order filtering (respects company switcher) */\n companyId?: number;\n\n /** Filter orders by these statuses */\n orderStatus?: string[];\n\n /** Override base styles */\n className?: string;\n\n /** Items per page default */\n initialItemsPerPage?: number;\n\n /** Rows are clickable */\n rowsClickable?: boolean;\n\n /** Show company orders */\n showCompanyOrders?: boolean;\n\n /** Hide pagination controls. Defaults to false. */\n hidePagination?: boolean;\n\n /** Filter orders by channel IDs */\n channelIds?: number[];\n\n /** Format price */\n formatPrice?: (price: number) => string;\n\n /** Format date */\n formatDate?: (dateString: string) => string;\n\n /** Get status color */\n getStatusColor?: (status: string) => string;\n\n /** Localization label overrides for UI strings. */\n labels?: {\n /** Text for the per-row \"View\" action button. */\n view?: string;\n /** Text for the previous-page pagination button. */\n previous?: string;\n /** Text for the next-page pagination button. */\n next?: string;\n /** Prefix text in the pagination summary (\"Showing page\"). */\n showingPage?: string;\n /** Connector word in the pagination summary (\"of\"). */\n of?: string;\n /** Message shown when no orders match. */\n noOrders?: string;\n /** Loading-state message. */\n loading?: string;\n /** Header label for the order ID column. */\n order?: string;\n /** Header label for the date column. */\n date?: string;\n /** Header label for the status column. */\n status?: string;\n /** Header label for the total column. */\n total?: string;\n /** Header label for the action column. */\n action?: string;\n };\n}\n\n/**\n * Renders a paginated, searchable table of the user's orders with configurable\n * columns and filter inputs (term, date ranges, price, sort, type).\n *\n * @remarks Uses {@link useOrders} for order data, search and pagination.\n */\nfunction OrderList(rawProps: OrderListProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const columns = props.columns || ['id', 'date', 'status', 'total'];\n const rowsClickable = props.rowsClickable || false;\n\n const { orders, loading, searchForm, setSearchForm, currentPage, totalPages, fetchOrders, goToPage } = useOrders({\n graphqlClient: props.graphqlClient!,\n user: props.user as any,\n companyId: props.companyId,\n orderStatuses: props.orderStatus,\n termFields: props.termFields as any,\n itemsPerPage: props.initialItemsPerPage || 10,\n channelIds: props.channelIds,\n });\n\n function handlePageChange(newPage: number) {\n if (newPage >= 1 && newPage <= totalPages) {\n goToPage(newPage);\n }\n }\n\n function formatDate(dateString: string): string {\n if (props.formatDate) return props.formatDate(dateString);\n if (!dateString) return '-';\n return new Date(dateString).toLocaleDateString();\n }\n\n function formatPrice(price: number): string {\n if (props.formatPrice) return props.formatPrice(price);\n if (!price) return '-';\n return formatPriceHelper(price, { symbol: props.currency ?? '€' });\n }\n\n function getStatusColor(status: string): string {\n if (props.getStatusColor) return props.getStatusColor(status);\n switch (status) {\n case 'COMPLETE':\n case 'QUOTE_ACCEPTED':\n return 'bg-secondary/10 text-secondary';\n case 'CANCELLED':\n case 'QUOTE_REJECTED':\n return 'bg-destructive/10 text-destructive';\n default:\n return 'bg-warning/10 text-warning';\n }\n }\n\n function getColumnLabel(col: string): string {\n if (props.columnConfig && props.columnConfig[col]) {\n return props.columnConfig[col];\n }\n // Translatable: consult labels with key 'col<Capitalized>'.\n // Fallback: Capitalize first letter (preserves original behavior).\n const capitalized = col.charAt(0).toUpperCase() + col.slice(1);\n return getLabel(props.labels, `col${capitalized}`, capitalized);\n }\n\n const dateMin = '1970-01-01';\n const dateMax = new Date().toISOString().split('T')[0];\n\n // Returns a YYYY-MM-DD string only when the input value is a valid date in\n // the allowed range; otherwise returns null. Native <input type=\"date\">\n // happily accepts year-6 inputs (\"0006-05-04\") via keyboard, so we guard at\n // the model layer.\n function sanitizeDateInput(value: string): string | null {\n if (!value) return null;\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value);\n if (!match) return null;\n const year = Number(match[1]);\n if (year < 1970 || year > new Date().getFullYear()) return null;\n const date = new Date(`${value}T00:00:00Z`);\n if (Number.isNaN(date.getTime())) return null;\n return value;\n }\n\n function searchFields(): string[] {\n const fields = props.searchFields || [];\n if (props.enableSearch && !(fields as string[]).includes('term')) {\n return ['term', ...fields] as string[];\n }\n return fields;\n }\n\n return (\n <div className={`propeller-order-list ${props.className || ''}`} data-loading={loading ? 'true' : 'false'}>\n {props.enableSearch && searchFields().length > 0 ? (\n <div className=\"propeller-order-list__filters mb-6 bg-card p-4 rounded-container shadow space-y-4\">\n {searchFields().includes('term') ? (\n <div className=\"propeller-order-list__search-field w-full\">\n <label className=\"propeller-order-list__filter-label block text-sm font-medium text-muted-foreground capitalize mb-1\">\n {getColumnLabel('term')}\n </label>\n <input\n type=\"text\"\n placeholder={getLabel(props.labels, 'searchPlaceholder', 'Search...')}\n className=\"propeller-order-list__search-input block w-full rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.term || ''}\n onChange={(e) => {\n setSearchForm({\n ...searchForm,\n term: e.target.value,\n });\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n setSearchForm({\n ...searchForm,\n term: (e.target as HTMLInputElement).value,\n });\n fetchOrders(1);\n }\n }}\n />\n </div>\n ) : null}\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-4\">\n {searchFields()\n .filter((f: string) => f !== 'term')\n ?.map((field) => (\n <div className=\"space-y-1\" key={field}>\n <label className=\"propeller-order-list__filter-label block text-sm font-medium text-muted-foreground capitalize\">\n {getColumnLabel(field)}\n </label>\n {field === 'createdAt' ? (\n <div className=\"flex space-x-2 w-full\">\n <input\n type=\"date\"\n placeholder={getLabel(props.labels, 'dateFromPlaceholder', 'From')}\n min={dateMin}\n max={dateMax}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={\n searchForm.createdAt?.greaterThan\n ? (searchForm.createdAt.greaterThan as string).split('T')[0]\n : ''\n }\n onChange={(e) => {\n const current = searchForm.createdAt || {};\n const sanitized = sanitizeDateInput(e.target.value);\n if (e.target.value && !sanitized) {\n e.target.value = current.greaterThan\n ? (current.greaterThan as string).split('T')[0]\n : '';\n return;\n }\n setSearchForm({\n ...searchForm,\n createdAt: {\n ...current,\n greaterThan: sanitized ? `${sanitized}T00:00:00Z` : undefined,\n },\n });\n }}\n />\n <input\n type=\"date\"\n placeholder={getLabel(props.labels, 'dateToPlaceholder', 'To')}\n min={dateMin}\n max={dateMax}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={\n searchForm.createdAt?.lessThan\n ? (searchForm.createdAt.lessThan as string).split('T')[0]\n : ''\n }\n onChange={(e) => {\n const current = searchForm.createdAt || {};\n const sanitized = sanitizeDateInput(e.target.value);\n if (e.target.value && !sanitized) {\n e.target.value = current.lessThan\n ? (current.lessThan as string).split('T')[0]\n : '';\n return;\n }\n setSearchForm({\n ...searchForm,\n createdAt: {\n ...current,\n lessThan: sanitized ? `${sanitized}T23:59:59Z` : undefined,\n },\n });\n }}\n />\n </div>\n ) : null}\n {field === 'lastModifiedAt' ? (\n <div className=\"flex space-x-2 w-full\">\n <input\n type=\"date\"\n placeholder={getLabel(props.labels, 'dateFromPlaceholder', 'From')}\n min={dateMin}\n max={dateMax}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={\n searchForm.lastModifiedAt?.greaterThan\n ? (searchForm.lastModifiedAt.greaterThan as string).split('T')[0]\n : ''\n }\n onChange={(e) => {\n const current = searchForm.lastModifiedAt || {};\n const sanitized = sanitizeDateInput(e.target.value);\n if (e.target.value && !sanitized) {\n e.target.value = current.greaterThan\n ? (current.greaterThan as string).split('T')[0]\n : '';\n return;\n }\n setSearchForm({\n ...searchForm,\n lastModifiedAt: {\n ...current,\n greaterThan: sanitized ? `${sanitized}T00:00:00Z` : undefined,\n },\n });\n }}\n />\n <input\n type=\"date\"\n placeholder={getLabel(props.labels, 'dateToPlaceholder', 'To')}\n min={dateMin}\n max={dateMax}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={\n searchForm.lastModifiedAt?.lessThan\n ? (searchForm.lastModifiedAt.lessThan as string).split('T')[0]\n : ''\n }\n onChange={(e) => {\n const current = searchForm.lastModifiedAt || {};\n const sanitized = sanitizeDateInput(e.target.value);\n if (e.target.value && !sanitized) {\n e.target.value = current.lessThan\n ? (current.lessThan as string).split('T')[0]\n : '';\n return;\n }\n setSearchForm({\n ...searchForm,\n lastModifiedAt: {\n ...current,\n lessThan: sanitized ? `${sanitized}T23:59:59Z` : undefined,\n },\n });\n }}\n />\n </div>\n ) : null}\n {field === 'price' ? (\n <div className=\"flex space-x-2 w-full\">\n <input\n type=\"number\"\n placeholder={getLabel(props.labels, 'priceMinPlaceholder', 'Min')}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.price?.greaterThan || ''}\n onChange={(e) => {\n const current = searchForm.price || {};\n setSearchForm({\n ...searchForm,\n price: {\n ...current,\n greaterThan: parseFloat(e.target.value),\n },\n });\n }}\n />\n <input\n type=\"number\"\n placeholder={getLabel(props.labels, 'priceMaxPlaceholder', 'Max')}\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.price?.lessThan || ''}\n onChange={(e) => {\n const current = searchForm.price || {};\n setSearchForm({\n ...searchForm,\n price: {\n ...current,\n lessThan: parseFloat(e.target.value),\n },\n });\n }}\n />\n </div>\n ) : null}\n {field === 'sortInput' ? (\n <div className=\"flex space-x-2 w-full\">\n <select\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.sortInput?.field || ''}\n onChange={(e) => {\n const current = searchForm.sortInput || {};\n setSearchForm({\n ...searchForm,\n sortInput: {\n ...current,\n field: e.target.value as OrderSortField,\n },\n });\n }}\n >\n <option value=\"\">{getLabel(props.labels, 'sortFieldOption', 'Sort Field')}</option>\n {Object.values(OrderSortField)?.map((sortField) => (\n <option key={sortField} value={sortField}>\n {getLabel(props.labels, sortField, sortField)}\n </option>\n ))}\n </select>\n <select\n className=\"propeller-order-list__filter-input block w-0 flex-1 min-w-0 rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.sortInput?.order || ''}\n onChange={(e) => {\n const current = searchForm.sortInput || {};\n setSearchForm({\n ...searchForm,\n sortInput: {\n ...current,\n order: e.target.value as SortOrder,\n },\n });\n }}\n >\n <option value=\"\">{getLabel(props.labels, 'sortOrderOption', 'Order')}</option>\n {Object.values(SortOrder)?.map((order) => (\n <option key={order} value={order}>\n {getLabel(props.labels, order, order)}\n </option>\n ))}\n </select>\n </div>\n ) : null}\n {field === 'type' ? (\n <div className=\"flex space-x-2\">\n <select\n className=\"propeller-order-list__filter-input block w-full rounded-control border-input shadow-sm focus:border-primary focus:ring-primary sm:text-sm p-2 border\"\n value={searchForm.type || ''}\n onChange={(e) => {\n setSearchForm({\n ...searchForm,\n type: e.target.value as OrderType,\n });\n }}\n >\n <option value=\"\">{getLabel(props.labels, 'typeOption', 'Type')}</option>\n {Object.values(OrderType)?.map((type) => (\n <option key={type} value={type}>\n {getLabel(props.labels, type, type)}\n </option>\n ))}\n </select>\n </div>\n ) : null}\n </div>\n ))}\n </div>\n <div className=\"propeller-order-list__filter-actions flex justify-end space-x-2\">\n <button\n className=\"propeller-order-list__clear-btn inline-flex items-center px-4 py-2 border border-input text-sm font-medium rounded-control shadow-sm text-foreground bg-card hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary\"\n onClick={(event) => {\n setSearchForm({});\n fetchOrders(1);\n }}\n >\n {getLabel(props.labels, 'clearButton', 'Clear')}\n </button>\n <button\n className=\"propeller-order-list__search-btn inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-control shadow-sm text-primary-foreground bg-primary hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary\"\n onClick={(event) => fetchOrders(1)}\n >\n {getLabel(props.labels, 'searchButton', 'Search')}\n </button>\n </div>\n </div>\n ) : null}\n {!loading || orders.length > 0 ? (\n <>\n {orders.length > 0 ? (\n <div className=\"propeller-order-list__results bg-card rounded-container shadow overflow-hidden\">\n <div className=\"overflow-x-auto\">\n <table className=\"propeller-order-list__table min-w-full divide-y divide-border\">\n <thead className=\"propeller-order-list__thead bg-surface-hover\">\n <tr>\n {columns?.map((col) => (\n <th\n key={col}\n data-column={col}\n className={`propeller-order-list__th px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider ${col === 'action' || col === 'total' ? 'text-right' : ''}`}\n >\n {getColumnLabel(col)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody className=\"propeller-order-list__tbody bg-card divide-y divide-border\">\n {orders?.map((order) => (\n <tr\n className=\"propeller-order-list__row hover:bg-surface-hover\"\n key={order.id}\n data-clickable={rowsClickable ? 'true' : 'false'}\n onClick={(event) => rowsClickable && props.onOrderClick(order.id)}\n >\n {columns?.map((col) => (\n <td\n key={col}\n data-column={col}\n className={`propeller-order-list__cell px-6 py-4 whitespace-nowrap text-sm ${col === 'id' || col === 'action' ? 'font-medium' : 'text-muted-foreground'} ${col === 'action' || col === 'total' ? 'text-right' : ''}`}\n >\n {col === 'id' ? (\n <span className=\"propeller-order-list__order-id text-foreground\">{order.id}</span>\n ) : null}\n {col === 'date' ? (\n <>{formatDate(order.createdAt || '')}</>\n ) : null}\n {col === 'status' ? (\n <span\n className={`propeller-order-list__status px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${getStatusColor(order.status)}`}\n data-status={order.status}\n >\n {order.status}\n </span>\n ) : null}\n {col === 'total' ? <>{formatPrice(order.total?.net)}</> : null}\n {col === 'action' && !rowsClickable ? (\n <button\n className=\"propeller-order-list__action-btn text-primary hover:text-primary/70 cursor-pointer\"\n onClick={(event) => {\n event.preventDefault();\n props.onOrderClick(order.id);\n }}\n >\n {getLabel(props.labels, 'view', 'View')}\n </button>\n ) : null}\n {col === 'validUntil' ? (\n <>{formatDate((order as any).validUntil || '')}</>\n ) : null}\n {!['id', 'date', 'status', 'total', 'action', 'validUntil'].includes(\n col\n ) ? (\n <>{(order as any)[col]}</>\n ) : null}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n {!props.hidePagination && totalPages > 1 ? (\n <div className=\"propeller-order-list__pagination bg-card px-4 py-3 flex items-center justify-between border-t border-border sm:px-6\">\n <div className=\"propeller-order-list__pagination-mobile flex-1 flex justify-between sm:hidden\">\n <button\n className=\"propeller-order-list__pagination-btn relative inline-flex items-center px-4 py-2 border border-input text-sm font-medium rounded-control text-foreground bg-card hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => handlePageChange(currentPage - 1)}\n disabled={currentPage === 1}\n >\n {getLabel(props.labels, 'previous', 'Previous')}\n </button>\n <button\n className=\"propeller-order-list__pagination-btn ml-3 relative inline-flex items-center px-4 py-2 border border-input text-sm font-medium rounded-control text-foreground bg-card hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => handlePageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n >\n {getLabel(props.labels, 'next', 'Next')}\n </button>\n </div>\n <div className=\"propeller-order-list__pagination-desktop hidden sm:flex-1 sm:flex sm:items-center sm:justify-between\">\n <div>\n <p className=\"propeller-order-list__pagination-summary text-sm text-muted-foreground\">\n {getLabel(props.labels, 'showingPage', 'Showing page')}&nbsp;\n <span className=\"font-medium\">{currentPage}</span>&nbsp;\n {getLabel(props.labels, 'of', 'of')}&nbsp;\n <span className=\"font-medium\">{totalPages}</span>\n </p>\n </div>\n <div>\n <nav\n aria-label={getLabel(props.labels, 'paginationAriaLabel', 'Pagination')}\n className=\"propeller-order-list__pagination-nav relative z-0 inline-flex rounded-control shadow-sm -space-x-px\"\n >\n <button\n className=\"propeller-order-list__pagination-btn relative inline-flex items-center px-2 py-2 rounded-l-control border border-input bg-card text-sm font-medium text-muted-foreground hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => handlePageChange(currentPage - 1)}\n disabled={currentPage === 1}\n >\n {getLabel(props.labels, 'previous', 'Previous')}\n </button>\n <button\n className=\"propeller-order-list__pagination-btn relative inline-flex items-center px-2 py-2 rounded-r-control border border-input bg-card text-sm font-medium text-muted-foreground hover:bg-surface-hover disabled:opacity-50\"\n onClick={(event) => handlePageChange(currentPage + 1)}\n disabled={currentPage === totalPages}\n >\n {getLabel(props.labels, 'next', 'Next')}\n </button>\n </nav>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n ) : (\n <div className=\"propeller-order-list__empty bg-card rounded-container shadow p-8 text-center\">\n <p className=\"text-muted-foreground mb-4\">{getLabel(props.labels, 'noOrders', 'No orders found.')}</p>\n </div>\n )}\n </>\n ) : (\n <div className=\"propeller-order-list__loading p-8 text-center text-muted-foreground\">\n {getLabel(props.labels, 'loading', 'Loading orders...')}\n </div>\n )}\n </div>\n );\n}\n\nexport default OrderList;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Order, Shipment, ShipmentItem, TrackAndTrace, OrderItem } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface OrderShipmentsProps {\n /** The current order the user is viewing */\n order: Order;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Additional CSS class for the root element */\n className?: string;\n}\n/**\n * Renders an order's shipments as a table, with a modal showing per-shipment\n * item details and track-and-trace links.\n */\nfunction OrderShipments(props: OrderShipmentsProps) {\n const [activeShipment, setActiveShipment] = useState<Shipment | null>(null);\n const shipments: Shipment[] = props.order?.shipments || [];\n function formatDate(dateStr: string): string {\n if (!dateStr) return '-';\n const d = new Date(dateStr);\n return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;\n }\n function getOrderItemForShipmentItem(shipmentItem: ShipmentItem): OrderItem | null {\n if (!props.order?.items || !shipmentItem.orderItemId) return null;\n return props.order.items.find((oi: OrderItem) => oi.id === shipmentItem.orderItemId) || null;\n }\n function buildTrackAndTraceUrl(tat: TrackAndTrace): string {\n const baseUrl = tat.carrier?.trackAndTraceURL || '';\n const code = tat.code || '';\n return `${baseUrl}${code}`;\n }\n return (\n <div className={`order-shipments ${props.className || ''}`}>\n {shipments.length > 0 ? (\n <div className=\"space-y-4\">\n <h2 className=\"text-xl font-semibold\">{getLabel(props.labels, 'title', 'Shipping details')}</h2>\n <div className=\"overflow-x-auto rounded-lg border border-border bg-card shadow-sm\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colStatus', 'Status')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colCreatedAt', 'Date')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colExpectedDelivery', 'Expected delivery')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colItems', 'Items')}\n </th>\n <th className=\"text-right px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {shipments?.map((shipment, index) => (\n <tr className=\"hover:bg-muted/30 transition-colors\" key={index}>\n <td className=\"px-4 py-3\">\n {!!shipment.status ? (\n <span className=\"propeller-order-shipments__status inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-secondary/10 text-secondary\">\n {shipment.status}\n </span>\n ) : null}\n {!shipment.status ? <span className=\"text-muted-foreground\">-</span> : null}\n </td>\n <td className=\"px-4 py-3 text-muted-foreground\">\n {formatDate(shipment.createdAt)}\n </td>\n <td className=\"px-4 py-3 text-muted-foreground\">\n {!!shipment.expectedDeliveryAt ? (\n <>{formatDate(shipment.expectedDeliveryAt!)}</>\n ) : null}\n {!shipment.expectedDeliveryAt ? <>-</> : null}\n </td>\n <td className=\"px-4 py-3 text-muted-foreground\">\n {(shipment.items || []).length}\n </td>\n <td className=\"px-4 py-3 text-right\">\n <button\n type=\"button\"\n className=\"text-primary hover:text-primary/80 text-sm font-medium hover:underline\"\n onClick={() => setActiveShipment(shipment)}\n >\n {getLabel(props.labels, 'details', 'Details')}\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n ) : null}\n {!!activeShipment ? (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center p-4\"\n onClick={() => setActiveShipment(null)}\n >\n <div className=\"propeller-order-shipments__modal-backdrop absolute inset-0 bg-foreground/50\" />\n <div\n className=\"propeller-order-shipments__modal-content relative z-10 w-full max-w-2xl max-h-[80vh] overflow-y-auto bg-card rounded-container shadow-xl\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex items-center justify-between px-6 py-4 border-b\">\n <h3 className=\"text-lg font-semibold\">\n {getLabel(props.labels, 'modalTitle', 'Shipment details')}\n </h3>\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n onClick={() => setActiveShipment(null)}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-5 w-5\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n <div className=\"px-6 py-4 space-y-4\">\n <div className=\"grid grid-cols-2 gap-4 text-sm\">\n <div>\n <span className=\"font-medium text-muted-foreground\">\n {getLabel(props.labels, 'labelStatus', 'Status')}\n </span>\n <p className=\"mt-0.5\">\n {!!activeShipment?.status ? (\n <span className=\"propeller-order-shipments__status inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-secondary/10 text-secondary\">\n {activeShipment?.status}\n </span>\n ) : null}\n {!activeShipment?.status ? <span>-</span> : null}\n </p>\n </div>\n <div>\n <span className=\"font-medium text-muted-foreground\">\n {getLabel(props.labels, 'labelExpectedDelivery', 'Expected delivery')}\n </span>\n <p className=\"mt-0.5\">\n {!!activeShipment?.expectedDeliveryAt ? (\n <>{formatDate(activeShipment?.expectedDeliveryAt!)}</>\n ) : null}\n {!activeShipment?.expectedDeliveryAt ? <>-</> : null}\n </p>\n </div>\n </div>\n <div>\n <h4 className=\"text-sm font-semibold mb-2\">{getLabel(props.labels, 'itemsTitle', 'Items')}</h4>\n {(activeShipment?.items || []).length > 0 ? (\n <div className=\"rounded-lg border border-border overflow-hidden\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-4 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colProduct', 'Product')}\n </th>\n <th className=\"text-left px-4 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colSku', 'SKU')}\n </th>\n <th className=\"text-center px-4 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colQuantity', 'Qty')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {((activeShipment?.items as ShipmentItem[]) || []).map((shipmentItem: ShipmentItem, idx: number) => (\n <tr className=\"hover:bg-muted/20\" key={idx}>\n <td className=\"px-4 py-2\">\n {!!shipmentItem.name ? <>{shipmentItem.name}</> : null}\n {!shipmentItem.name ? (\n <>\n {!!getOrderItemForShipmentItem(shipmentItem) ? (\n <>\n {getOrderItemForShipmentItem(shipmentItem)?.name ||\n '-'}\n </>\n ) : null}\n {!getOrderItemForShipmentItem(shipmentItem) ? <>-</> : null}\n </>\n ) : null}\n </td>\n <td className=\"px-4 py-2 text-muted-foreground\">\n {!!shipmentItem.sku ? <>{shipmentItem.sku}</> : null}\n {!shipmentItem.sku ? (\n <>\n {!!getOrderItemForShipmentItem(shipmentItem) ? (\n <>\n {getOrderItemForShipmentItem(shipmentItem)?.product?.sku || '-'}\n </>\n ) : null}\n {!getOrderItemForShipmentItem(shipmentItem) ? <>-</> : null}\n </>\n ) : null}\n </td>\n <td className=\"px-4 py-2 text-center\">\n {shipmentItem.quantity || '-'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : null}\n {(activeShipment?.items || []).length === 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n {getLabel(props.labels, 'noItems', 'No items in this shipment')}\n </p>\n ) : null}\n </div>\n {(activeShipment?.trackAndTraces || []).length > 0 ? (\n <div>\n <h4 className=\"text-sm font-semibold mb-2\">\n {getLabel(props.labels, 'trackAndTraceTitle', 'Track & Trace')}\n </h4>\n <div className=\"flex flex-wrap gap-2\">\n {((activeShipment?.trackAndTraces as TrackAndTrace[]) || []).map((tat: TrackAndTrace, tatIdx: number) =>\n !!tat.carrier?.trackAndTraceURL ? (\n <a\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-primary text-primary text-sm font-medium hover:bg-primary/5 transition-colors\"\n href={buildTrackAndTraceUrl(tat)}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-4 w-4\"\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7m0 10a2 2 0 002 2h2a2 2 0 002-2V7a2 2 0 00-2-2h-2a2 2 0 00-2 2\"\n />\n </svg>\n {!!tat.carrier?.name ? (\n <>\n {getLabel(props.labels, 'trackAndTrace', 'Track & Trace')}-{tat.carrier?.name}\n </>\n ) : null}\n {!tat.carrier?.name ? (\n <>\n {getLabel(props.labels, 'trackAndTrace', 'Track & Trace')}({tat.code})\n </>\n ) : null}\n </a>\n ) : null\n )}\n </div>\n </div>\n ) : null}\n </div>\n <div className=\"flex justify-end px-6 py-4 border-t\">\n <button\n type=\"button\"\n className=\"px-4 py-2 text-sm font-medium rounded-md border border-border hover:bg-muted transition-colors\"\n onClick={() => setActiveShipment(null)}\n >\n {getLabel(props.labels, 'close', 'Close')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default OrderShipments;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getCountryName as _getCountryName } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface OrderSummaryProps {\n /** The order object from propeller-sdk-v2 */\n order: any;\n\n /** The CSS class for the order summary container */\n orderSummaryContainerClass?: string;\n\n /** Title of the order summary */\n title?: string;\n\n /** Show the order number */\n showOrderNumber?: boolean;\n\n /** Show the order date */\n showOrderDate?: boolean;\n\n /** Show the order status */\n showOrderStatus?: boolean;\n\n /** Show the order total */\n showOrderTotal?: boolean;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Show the invoice address */\n showInvoiceAddress?: boolean;\n\n /** Show the delivery address */\n showDeliveryAddress?: boolean;\n\n /** Show payment, carrier, and delivery date info */\n showDeliveryInfo?: boolean;\n\n /** Show order remarks and reference */\n showRemarks?: boolean;\n\n /** Custom date formatting function */\n formatDate?: (dateString: string) => string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** List of countries for resolving codes to names [{code: 'NL', name: 'Netherlands'}, ...] */\n countries?: {\n code: string;\n name: string;\n }[];\n\n /** Currency symbol used by the default formatter. Default: `'€'`. */\n currency?: string;\n}\n\n/**\n * Renders a read-only summary of an order: meta fields (number, date, status,\n * total), invoice/delivery addresses, delivery info and remarks.\n */\nfunction OrderSummary(props: OrderSummaryProps) {\n const order = props.order;\n\n const containerClass = props.orderSummaryContainerClass || 'order-summary';\n const showOrderNumber = props.showOrderNumber !== undefined ? props.showOrderNumber : true;\n const showOrderDate = props.showOrderDate !== undefined ? props.showOrderDate : true;\n const showOrderStatus = props.showOrderStatus !== undefined ? props.showOrderStatus : true;\n const showInvoiceAddress =\n props.showInvoiceAddress !== undefined ? props.showInvoiceAddress : true;\n const showDeliveryAddress =\n props.showDeliveryAddress !== undefined ? props.showDeliveryAddress : true;\n const showOrderTotal = props.showOrderTotal !== undefined ? props.showOrderTotal : true;\n const showDeliveryInfo = props.showDeliveryInfo !== undefined ? props.showDeliveryInfo : true;\n const showRemarks = props.showRemarks !== undefined ? props.showRemarks : true;\n\n // Order field accessors — computed once per render (previously each was a\n // function redefined every render; addresses.find() ran on every JSX read).\n const orderNumber = order?.id || '';\n const orderDate = order?.createdAt || '';\n const orderStatus = order?.status || '';\n const orderTotal = Number(order?.total?.net || 0);\n const orderReference = order?.reference || '';\n const orderRemarks = order?.remarks || '';\n const paymentMethod = order?.paymentData?.method || '';\n const carrierName = order?.postageData?.carrier || '';\n const addresses = order?.addresses || [];\n const invoiceAddress = addresses.find((a: any) => a.type === 'invoice') || null;\n const deliveryAddress = addresses.find((a: any) => a.type === 'delivery') || null;\n\n function formatItemPrice(price: number): string {\n if (props.formatPrice) {\n return props.formatPrice(price);\n }\n return formatPrice(price || 0, { symbol: props.currency ?? '€' });\n }\n\n function formatOrderDate(dateString: string): string {\n if (props.formatDate) {\n return props.formatDate(dateString);\n }\n try {\n // Short locale format (e.g. 4/27/2026 in en-US) for visual consistency\n // with the delivery-date row directly above. Override via `formatDate`.\n return new Date(dateString).toLocaleDateString('en-US');\n } catch {\n return dateString;\n }\n }\n\n const requestDateRaw = order?.postageData?.requestDate;\n let requestDate = '';\n if (requestDateRaw) {\n if (props.formatDate) {\n requestDate = props.formatDate(requestDateRaw);\n } else {\n try {\n // Short locale format — matches CartOverview's delivery-date rendering\n // so checkout review and order confirmation stay consistent.\n requestDate = new Date(requestDateRaw).toLocaleDateString('en-US');\n } catch {\n requestDate = requestDateRaw;\n }\n }\n }\n\n const getCountryName = (code: string): string => _getCountryName(code, props.countries);\n\n return (\n <div className={`propeller-order-summary ${containerClass}`}>\n {props.title ? (\n <h2 className=\"propeller-order-summary__title text-xl font-bold mb-4\">{props.title}</h2>\n ) : null}\n <div className=\"propeller-order-summary__meta grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 pb-5 border-b border-border mb-5\">\n {showOrderNumber && orderNumber ? (\n <div className=\"propeller-order-summary__meta-item\" data-meta=\"order-number\">\n <p className=\"propeller-order-summary__meta-label text-sm text-muted-foreground mb-1\">\n {getLabel(props.labels, 'orderNumber', 'Order Number')}\n </p>\n <p className=\"propeller-order-summary__meta-value font-semibold\">{orderNumber}</p>\n </div>\n ) : null}\n {showOrderDate && orderDate ? (\n <div className=\"propeller-order-summary__meta-item\" data-meta=\"order-date\">\n <p className=\"propeller-order-summary__meta-label text-sm text-muted-foreground mb-1\">\n {getLabel(props.labels, 'orderDate', 'Order Date')}\n </p>\n <p className=\"propeller-order-summary__meta-value font-semibold\">\n {formatOrderDate(orderDate)}\n </p>\n </div>\n ) : null}\n {showOrderStatus && orderStatus ? (\n <div className=\"propeller-order-summary__meta-item\" data-meta=\"status\">\n <p className=\"propeller-order-summary__meta-label text-sm text-muted-foreground mb-1\">\n {getLabel(props.labels, 'status', 'Status')}\n </p>\n <span className=\"propeller-order-summary__status inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-secondary/10 text-secondary\">\n {orderStatus}\n </span>\n </div>\n ) : null}\n {showOrderTotal ? (\n <div className=\"propeller-order-summary__meta-item\" data-meta=\"total\">\n <p className=\"propeller-order-summary__meta-label text-sm text-muted-foreground mb-1\">\n {getLabel(props.labels, 'total', 'Total')}\n </p>\n <p className=\"propeller-order-summary__total font-bold text-lg\">\n {formatItemPrice(orderTotal)}\n </p>\n </div>\n ) : null}\n </div>\n <div className=\"propeller-order-summary__addresses grid grid-cols-1 md:grid-cols-2 gap-6 pb-5\">\n {showInvoiceAddress ? (\n <div className=\"propeller-order-summary__address space-y-2\" data-address=\"invoice\">\n <h3 className=\"propeller-order-summary__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'invoiceAddress', 'Invoice Address')}\n </h3>\n {invoiceAddress && invoiceAddress.street ? (\n <div className=\"text-sm space-y-1\">\n {invoiceAddress.company ? (\n <p className=\"font-medium\">{invoiceAddress.company}</p>\n ) : null}\n <p>\n {[invoiceAddress.firstName, invoiceAddress.middleName, invoiceAddress.lastName]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[invoiceAddress.street, invoiceAddress.number, invoiceAddress.numberExtension]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>{[invoiceAddress.postalCode, invoiceAddress.city].filter(Boolean).join(' ')}</p>\n {invoiceAddress.country ? <p>{getCountryName(invoiceAddress.country)}</p> : null}\n {invoiceAddress.email ? (\n <p className=\"propeller-order-summary__address-email text-muted-foreground\">\n {invoiceAddress.email}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n {showDeliveryAddress ? (\n <div className=\"propeller-order-summary__address space-y-2\" data-address=\"delivery\">\n <h3 className=\"propeller-order-summary__address-title text-sm font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'deliveryAddress', 'Delivery Address')}\n </h3>\n {deliveryAddress && deliveryAddress.street ? (\n <div className=\"text-sm space-y-1\">\n {deliveryAddress.company ? (\n <p className=\"font-medium\">{deliveryAddress.company}</p>\n ) : null}\n <p>\n {[deliveryAddress.firstName, deliveryAddress.middleName, deliveryAddress.lastName]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>\n {[deliveryAddress.street, deliveryAddress.number, deliveryAddress.numberExtension]\n .filter(Boolean)\n .join(' ')}\n </p>\n <p>{[deliveryAddress.postalCode, deliveryAddress.city].filter(Boolean).join(' ')}</p>\n {deliveryAddress.country ? <p>{getCountryName(deliveryAddress.country)}</p> : null}\n {deliveryAddress.email ? (\n <p className=\"propeller-order-summary__address-email text-muted-foreground\">\n {deliveryAddress.email}\n </p>\n ) : null}\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n {showDeliveryInfo && (paymentMethod || carrierName || requestDate) ? (\n <div className=\"propeller-order-summary__info-panel bg-surface-hover p-4 rounded-control border border-border space-y-2 text-sm\">\n {paymentMethod ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'payment', 'Payment:')}</span>\n <span>{paymentMethod}</span>\n </div>\n ) : null}\n {carrierName ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'carrier', 'Carrier:')}</span>\n <span>{carrierName}</span>\n </div>\n ) : null}\n {requestDate ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">\n {getLabel(props.labels, 'deliveryDate', 'Delivery Date:')}\n </span>\n <span>{requestDate}</span>\n </div>\n ) : null}\n </div>\n ) : null}\n {showRemarks && (orderReference || orderRemarks) ? (\n <div className=\"propeller-order-summary__remarks-panel bg-surface-hover p-4 rounded-control border border-border space-y-2 text-sm mt-4\">\n {orderReference ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">\n {getLabel(props.labels, 'reference', 'Reference:')}\n </span>\n <span>{orderReference}</span>\n </div>\n ) : null}\n {orderRemarks ? (\n <div className=\"flex justify-between\">\n <span className=\"font-medium\">{getLabel(props.labels, 'remarks', 'Remarks:')}</span>\n <span>{orderRemarks}</span>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default OrderSummary;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { Order, OrderDiscountType, OrderTotalTaxPercentage } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface OrderTotalsProps {\n /** The order/quote used to populate the summary data */\n order: Order;\n\n /** Order summary block title */\n title?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Display the subtotal of the order/quote */\n showSubtotal?: boolean;\n\n /** Display the total discount of the order/quote */\n showDiscount?: boolean;\n\n /** Display the shipping costs of the order/quote */\n showShippingCosts?: boolean;\n\n /** Display all VATs of the order/quote */\n showVATs?: boolean;\n\n /** Display the total of the order/quote excluding the VAT */\n showTotalExclVat?: boolean;\n\n /** Display the total VAT of the order/quote */\n showTotalVat?: boolean;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol used by the default formatter. Default: `'€'`. */\n currency?: string;\n}\n/**\n * Renders the price breakdown for an order or quote: subtotal, discount,\n * transaction and shipping costs, per-rate VAT lines and the grand total.\n */\nfunction OrderTotals(props: OrderTotalsProps) {\n // All visibility flags are derived directly from props at render — no need\n // for one-liner functions wrapping a `?? true`.\n const showSubtotal = props.showSubtotal !== false;\n const showDiscount = props.showDiscount !== false;\n const showShippingCosts = props.showShippingCosts !== false;\n const showVATs = props.showVATs !== false;\n const showTotalExclVat = props.showTotalExclVat !== false;\n const showTotalVat = props.showTotalVat !== false;\n const total = props.order?.total;\n const paymentData = props.order?.paymentData;\n const postageData = props.order?.postageData;\n\n function formatItemPrice(price: number): string {\n if (props.formatPrice) return props.formatPrice(price);\n return formatPrice(price || 0, { symbol: props.currency ?? '€' });\n }\n const subtotal = total?.gross || 0;\n const hasDiscount = !!total\n && total.discountType !== OrderDiscountType.N\n && total.discountValue > 0;\n function discountDisplay(): string {\n if (!total) return '';\n if (total.discountType === OrderDiscountType.A) {\n return '-' + formatItemPrice(total.discountValue);\n }\n if (total.discountType === OrderDiscountType.P) {\n return '- ' + total.discountValue + '%';\n }\n return '-' + formatItemPrice(total.discountValue);\n }\n const subtotalWithDiscount = (total?.gross || 0) - (total?.discountValue || 0);\n const hasTransactionCosts = (paymentData?.gross ?? 0) > 0;\n const transactionCosts = Number(paymentData?.gross || 0);\n const hasShippingCosts = (postageData?.gross ?? 0) > 0;\n const shippingCosts = Number(postageData?.gross || 0);\n const totalExclVat = total?.gross || 0;\n const taxPercentages: OrderTotalTaxPercentage[] = (total?.taxPercentages || [])\n .filter((tax) => tax.percentage > 0 && tax.total > 0);\n const totalInclVat = total?.net || 0;\n const totalVat = taxPercentages.reduce((sum, t) => sum + Number(t.total || 0), 0);\n return (\n <div className=\"propeller-order-totals w-full md:w-80 bg-card p-6 rounded-container shadow space-y-3\">\n {showSubtotal ? (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground\" data-row=\"subtotal\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'subtotal', 'Subtotal:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(subtotal)}</span>\n </div>\n ) : null}\n {showDiscount && hasDiscount ? (\n <>\n <div className=\"propeller-order-totals__row flex justify-between text-secondary\" data-row=\"discount\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'discount', 'Discount:')}</span>\n <span className=\"propeller-order-totals__value\">{discountDisplay()}</span>\n </div>\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground border-t pt-2 border-dashed\" data-row=\"subtotal-with-discount\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'subtotalWithDiscount', 'Subtotal with discount:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(subtotalWithDiscount)}</span>\n </div>\n </>\n ) : null}\n {hasTransactionCosts ? (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground\" data-row=\"transaction-costs\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'transactionCosts', 'Transaction costs:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(transactionCosts)}</span>\n </div>\n ) : null}\n {showShippingCosts && hasShippingCosts ? (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground\" data-row=\"shipping-costs\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'shippingCosts', 'Shipping costs:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(shippingCosts)}</span>\n </div>\n ) : null}\n {showTotalExclVat ? (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground pt-2 border-t\" data-row=\"total-excl-vat\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'totalExclVat', 'Total excl. VAT:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(totalExclVat)}</span>\n </div>\n ) : null}\n {showVATs && taxPercentages.length > 0 ? (\n <>\n {taxPercentages.map((tax, index) => (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground text-sm\" key={index} data-row=\"vat-line\">\n <span className=\"propeller-order-totals__label\">\n {tax.percentage}% {getLabel(props.labels, 'vat', 'VAT')}:\n </span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(Number(tax.total))}</span>\n </div>\n ))}\n </>\n ) : null}\n {showTotalVat ? (\n <div className=\"propeller-order-totals__row flex justify-between text-muted-foreground text-sm\" data-row=\"total-vat\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'totalVat', 'Total VAT:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(totalVat)}</span>\n </div>\n ) : null}\n <div className=\"propeller-order-totals__row propeller-order-totals__row--total flex justify-between text-xl font-bold pt-4 border-t text-foreground mt-2\" data-row=\"total\">\n <span className=\"propeller-order-totals__label\">{getLabel(props.labels, 'total', 'Total:')}</span>\n <span className=\"propeller-order-totals__value\">{formatItemPrice(totalInclVat)}</span>\n </div>\n </div>\n );\n}\n\nexport default OrderTotals;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState).\n * Must be rendered inside (or below) a Client Component boundary.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface PriceToggleProps {\n /**\n * Label text shown beside the toggle.\n * Defaults to 'Prices:'.\n */\n label?: string;\n\n /**\n * Controlled mode: current on/off state (true = incl. VAT).\n * When supplied, the component does not own its state — the parent does.\n * Pair with `onChange` to receive flips.\n */\n value?: boolean;\n\n /**\n * Controlled mode: notified on every flip with the new state.\n * Required when `value` is supplied. Optional otherwise (uncontrolled).\n */\n onChange?: (on: boolean) => void;\n\n /**\n * Uncontrolled mode: initial state of the toggle.\n * Ignored when `value` is supplied (controlled mode).\n * Defaults to true (incl. VAT).\n */\n initialState?: boolean;\n\n /**\n * @deprecated Use `onChange` instead. Alias kept for back-compat with\n * existing call sites; receives the same boolean as `onChange`.\n */\n inclExclVatSwitched?: (on: boolean) => void;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /** Translated labels keyed by the slugs used inside the component\n * (`pricesLabel`, `inclVat`, `exclVat`). Missing keys fall back to English. */\n labels?: Record<string, string>;\n}\n\n/**\n * Renders a switch toggling prices between incl./excl. VAT. Supports both\n * controlled (`value` + `onChange`) and uncontrolled (`initialState`) modes.\n */\nfunction PriceToggle(props: PriceToggleProps) {\n const isControlled = props.value !== undefined;\n // Uncontrolled local state — only used when `value` isn't supplied.\n const [internal, setInternal] = useState<boolean>(props.initialState ?? true);\n const isOn = isControlled ? !!props.value : internal;\n const label = props.label || getLabel(props.labels, 'pricesLabel', 'Prices:');\n const statusText = isOn\n ? getLabel(props.labels, 'inclVat', 'Incl. VAT')\n : getLabel(props.labels, 'exclVat', 'Excl. VAT');\n\n function handleToggle(): void {\n const newValue = !isOn;\n if (!isControlled) {\n setInternal(newValue);\n }\n // Notify parent. Phase D.3: the package no longer dispatches a global\n // `priceToggleChanged` window event — coordinating tax-inclusive across\n // components is the host's job (via PriceContext or whatever store the\n // host uses). The host's onChange handler will update the store and the\n // PropellerProvider value will propagate `includeTax` reactively.\n props.onChange?.(newValue);\n props.inclExclVatSwitched?.(newValue);\n }\n\n return (\n <div\n className={`propeller-price-toggle flex items-center gap-2 ${props.className || ''}`}\n data-state={isOn ? 'on' : 'off'}\n >\n <span className=\"propeller-price-toggle__label hidden sm:inline text-xs\">{label}</span>\n <button\n type=\"button\"\n role=\"switch\"\n className=\"propeller-price-toggle__switch hover:opacity-80 transition-opacity text-xs font-medium\"\n aria-checked={isOn}\n onClick={handleToggle}\n >\n {statusText}\n </button>\n </div>\n );\n}\n\nexport default PriceToggle;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { ProductPrice, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport type { IDiscount } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { isContentHidden } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductBulkPricesProps {\n /**\n * Bulk price tiers from the product.\n * Obtain from `product.bulkPrices`.\n */\n bulkPrices: ProductPrice[];\n\n /**\n * When true, net price (incl. tax) is the leading price.\n * Defaults to false — gross (excl. VAT) is shown.\n * Note: in the Propeller SDK `price.gross` = excl. VAT, `price.net` = incl. VAT.\n */\n includeTax?: boolean;\n\n /**\n * Controls portal visibility mode.\n * 'semi-closed' — component is hidden for anonymous users.\n * Defaults to 'open'.\n */\n portalMode?: string;\n\n /** Authenticated user — used for semi-closed visibility. */\n user?: Contact | Customer | null;\n\n /** Tax zone code. Defaults to 'NL'. */\n taxZone?: string;\n\n /** Currency symbol for prices. Defaults to '€'. */\n currency?: string;\n\n /**\n * Override any UI string.\n * Available keys: title, quantityFrom, price, inclTax, exclTax\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's volume/quantity-tier pricing as a table, filtering out\n * expired or list-price tiers and showing incl./excl. VAT prices.\n */\nfunction ProductBulkPrices(props: ProductBulkPricesProps) {\n const includeTax = !!props.includeTax;\n const isHidden = isContentHidden(props.portalMode, props.user);\n function getTierQuantity(tier: ProductPrice): number | null {\n const discount = tier.discount as\n | (IDiscount & { quantityFrom?: number })\n | undefined;\n return discount?.quantityFrom ?? tier.quantity ?? null;\n }\n function getBulkPrices(): ProductPrice[] {\n const rawAll = props.bulkPrices || [];\n const all = rawAll.filter((tier) => {\n const t = tier as ProductPrice & {\n type?: string;\n discountType?: string;\n };\n const priceType =\n t.type ??\n (\n t.discount as\n | {\n type?: string;\n }\n | undefined\n )?.type;\n const discountType =\n t.discountType ??\n (\n t.discount as\n | {\n discountType?: string;\n }\n | undefined\n )?.discountType;\n return !(priceType === 'PRICESHEET' && discountType === 'LIST_PRICE_MIN');\n });\n if (all.length === 0) return [];\n const now = new Date();\n const groups = new Map<number, ProductPrice[]>();\n for (const tier of all) {\n const qty = getTierQuantity(tier);\n if (qty === null) continue;\n const list = groups.get(qty) || [];\n list.push(tier);\n groups.set(qty, list);\n }\n const filtered: ProductPrice[] = [];\n for (const [, prices] of groups) {\n const validDated: ProductPrice[] = [];\n const nullDated: ProductPrice[] = [];\n for (const tier of prices) {\n const discount = tier.discount as\n | (IDiscount & {\n validFrom?: string;\n validTo?: string;\n })\n | undefined;\n if (!discount) {\n filtered.push(tier);\n continue;\n }\n const validFrom = discount.validFrom ?? null;\n const validTo = discount.validTo ?? null;\n if (validFrom === null && validTo === null) {\n nullDated.push(tier);\n continue;\n }\n let isValid = true;\n if (validFrom !== null && now < new Date(validFrom)) isValid = false;\n if (isValid && validTo !== null && now > new Date(validTo)) isValid = false;\n if (isValid) validDated.push(tier);\n }\n if (validDated.length > 0) filtered.push(validDated[0]);\n else if (nullDated.length > 0) filtered.push(nullDated[0]);\n }\n filtered.sort((a, b) => (getTierQuantity(a) ?? 0) - (getTierQuantity(b) ?? 0));\n if (filtered.length === 1 && getTierQuantity(filtered[0]) === 1) return [];\n return filtered;\n }\n const bulkPrices = getBulkPrices();\n const hasItems = bulkPrices.length > 0;\n function getPrice(tier: ProductPrice): string {\n const value = includeTax ? tier.net : tier.gross;\n if (value === null || value === undefined) return '';\n return formatPrice(value, { symbol: props.currency ?? '\\u20AC' });\n }\n function getQuantityLabel(tier: ProductPrice, index: number): string {\n const discount = tier.discount as\n | (IDiscount & { quantityFrom?: number })\n | undefined;\n const qty = discount?.quantityFrom || tier.quantity || 1;\n const nextTier = bulkPrices[index + 1];\n const nextDiscount = nextTier?.discount as\n | (IDiscount & { quantityFrom?: number })\n | undefined;\n const nextQty = nextDiscount?.quantityFrom || nextTier?.quantity;\n if (nextQty) return `${qty}\\u2013${nextQty - 1}`;\n return `${qty}+`;\n }\n return (\n <>\n {!isHidden && hasItems ? (\n <>\n <div\n className={`propeller-product-bulk-prices ${props.className || ''}`}\n data-include-tax={includeTax ? 'true' : 'false'}\n >\n {getLabel(props.labels, 'title', 'Volume pricing') ? (\n <h3 className=\"propeller-product-bulk-prices__title text-base font-semibold text-foreground mb-3\">\n {getLabel(props.labels, 'title', 'Volume pricing')}\n </h3>\n ) : null}\n <div className=\"propeller-product-bulk-prices__table-wrapper overflow-hidden rounded-container border border-border\">\n <table className=\"propeller-product-bulk-prices__table w-full text-sm\">\n <thead className=\"propeller-product-bulk-prices__thead bg-muted/50\">\n <tr>\n <th className=\"propeller-product-bulk-prices__th propeller-product-bulk-prices__th--quantity px-4 py-2 text-left font-medium text-muted-foreground\">\n {getLabel(props.labels, 'quantityFrom', 'Qty from')}\n </th>\n <th className=\"propeller-product-bulk-prices__th propeller-product-bulk-prices__th--price px-4 py-2 text-right font-medium text-muted-foreground\">\n {getLabel(props.labels, 'price', 'Price')}\n <span className=\"propeller-product-bulk-prices__tax-label font-normal text-xs\">\n (\n {includeTax\n ? getLabel(props.labels, 'inclTax', 'incl. VAT')\n : getLabel(props.labels, 'exclTax', 'excl. VAT')}\n )\n </span>\n </th>\n </tr>\n </thead>\n <tbody className=\"propeller-product-bulk-prices__tbody divide-y divide-border\">\n {bulkPrices.map((tier, index) => (\n <tr className=\"propeller-product-bulk-prices__row bg-card hover:bg-muted/20 transition-colors\" key={index}>\n <td className=\"propeller-product-bulk-prices__cell propeller-product-bulk-prices__cell--quantity px-4 py-2 text-foreground font-medium\">\n {getQuantityLabel(tier, index)}\n </td>\n <td className=\"propeller-product-bulk-prices__cell propeller-product-bulk-prices__cell--price px-4 py-2 text-right text-foreground font-semibold\">\n {getPrice(tier)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n </>\n ) : null}\n </>\n );\n}\n\nexport default ProductBulkPrices;\n","'use client';\n/**\n * Client wrapper around the pure `ProductBulkPrices` component. Resolves\n * `includeTax`, `user`, `portalMode`, and `currency` from\n * `<PropellerProvider>` when the caller doesn't pass them explicitly. The\n * pure version stays exported from `/pure` for RSC use.\n */\nimport * as React from 'react';\nimport ProductBulkPrices, { type ProductBulkPricesProps } from './ProductBulkPrices';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction ProductBulkPricesWithProvider(rawProps: ProductBulkPricesProps) {\n const props = useInfraProps(rawProps);\n return <ProductBulkPrices {...props} />;\n}\n\nexport default ProductBulkPricesWithProvider;\nexport type { ProductBulkPricesProps };\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport { Bundle, BundleCondition, BundleItem, Cart, Contact, Customer, GraphQLClient, Product } from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductBundles } from '../composables/react/useProductBundles';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice as formatPriceHelper } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductBundlesProps {\n // === Core ===\n\n /** GraphQL client instance used to fetch bundle data. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** ID of the product whose bundles should be fetched. */\n productId: number;\n\n /** Language code used for content (e.g. 'NL', 'EN'). Resolved from PropellerProvider when omitted. */\n language?: string;\n\n /** Tax zone code used for pricing (e.g. 'NL'). */\n taxZone: string;\n\n // === Pricing ===\n\n /**\n * When true, net price (incl. tax) is the leading price.\n * Note: in the Propeller SDK `price.gross` = excl. VAT, `price.net` = incl. VAT.\n */\n includeTax?: boolean;\n\n // === Portal / visibility ===\n\n /**\n * Controls portal visibility mode.\n * 'semi-closed' — prices and add-to-cart are hidden for anonymous users.\n * Defaults to 'open'.\n */\n portalMode?: string;\n\n /** Authenticated user — used for semi-closed visibility check. */\n user?: Contact | Customer | null;\n\n /** Active company ID from the company switcher.\n * Overrides user's default company for cart creation and lookup. * If not provided, the user's default company is used.\n */\n companyId?: number;\n\n /** Cart ID — required when onAddToCart is not provided */\n cartId?: string;\n\n /**\n * Callback to handle a new cart being created.\n * WARNING: If not provided the component create new carts on every add-to-cart.\n */\n onCartCreated?: (cart: Cart) => void;\n\n /**\n * If true a new cart is created if no cart ID is provided.\n * Defaults to false.\n */\n createCart?: boolean;\n\n // === Display options ===\n\n /** When true, stock availability is validated before adding to cart. */\n stockValidation?: boolean;\n\n /**\n * When true, the individual bundle items are listed inside each bundle card.\n * Defaults to true.\n */\n showIndividualItems?: boolean;\n\n /** Additional configuration object passed through to the component. */\n configuration?: any;\n\n /**\n * Layout variant for the bundle display.\n * - 'vertical' — stacked layout\n * - 'horizontal' — side-by-side (default)\n * - 'compact' — condensed, hides individual items\n */\n layout?: 'vertical' | 'horizontal' | 'compact';\n\n /**\n * Override any UI string.\n * Available keys: title, condition_ALL, condition_EP, leaderItem,\n * youSave, adding, addToCart, loginToSeePrices, addedToCart,\n * modalTitle, continueShopping, proceedToCheckout, noCartId\n */\n labels?: Record<string, string>;\n\n // === Modal / feedback ===\n\n /**\n * When true a modal popup is shown after a successful add-to-cart\n * with buttons to continue shopping or proceed to checkout.\n * Defaults to false (only a brief inline toast is shown).\n */\n showModal?: boolean;\n\n /** Callback fired when the \"Proceed to checkout\" modal button is clicked */\n onProceedToCheckout?: () => void;\n\n // === Callbacks ===\n\n /**\n * Callback triggered before adding the bundle to cart.\n */\n beforeBundleAddToCart?: (bundleId: string, quantity: number) => boolean;\n\n /** Called when the user clicks \"Add bundle to cart\". Receives bundleId and quantity (always 1). */\n onAddBundleToCart?: (bundleId: string, quantity: number) => void;\n\n /**\n * Callback triggered after adding the bundle to cart.\n */\n afterBundleAddToCart?: (cart: Cart, bundle?: Bundle) => void;\n\n /** Extra CSS class applied to the root wrapper element. */\n className?: string;\n}\n\n// ── Pure helpers (module scope — created once, not per render) ──────────────────\n\nfunction getBundlePrice(bundle: Bundle, includeTax: boolean): number {\n return includeTax ? bundle.price?.net || 0 : bundle.price?.gross || 0;\n}\n\nfunction getOriginalPrice(bundle: Bundle, includeTax: boolean): number {\n return includeTax ? bundle.price?.originalNet || 0 : bundle.price?.originalGross || 0;\n}\n\nfunction getItemPrice(item: BundleItem, includeTax: boolean): number {\n return includeTax ? item.price?.net || 0 : item.price?.gross || 0;\n}\n\nfunction getProductImage(product: Product): string {\n return product?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '';\n}\n\nfunction getProductName(product: Product): string {\n return product?.names?.[0]?.value || '';\n}\n\n/**\n * Renders combo-deal bundles for a product, each with its constituent items,\n * pricing and savings, plus add-to-cart with toast or modal feedback.\n *\n * @remarks Uses {@link useProductBundles} to fetch bundles and add them to a cart.\n */\nfunction ProductBundles(rawProps: ProductBundlesProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const currencySymbol = props.currency ?? '€';\n const money = (value: number): string => formatPriceHelper(value, { symbol: currencySymbol });\n const [isMounted, setIsMounted] = useState(false);\n const [addingBundleId, setAddingBundleId] = useState<string | null>(null);\n const [lastAddedBundle, setLastAddedBundle] = useState<Bundle | null>(null);\n const [toastMessage, setToastMessage] = useState('');\n const [toastType, setToastType] = useState('');\n const [toastVisible, setToastVisible] = useState(false);\n const [modalVisible, setModalVisible] = useState(false);\n\n const {\n bundles: fetchedBundles,\n loading: isLoading,\n cartId: composableCartId,\n fetchBundles,\n addBundleToCart: composableAddBundleToCart,\n } = useProductBundles({\n graphqlClient: props.graphqlClient!,\n user: (props.user as Contact | Customer | null) || null,\n language: props.language,\n configuration: props.configuration || {},\n onCartCreated: props.onCartCreated,\n });\n\n // Cast fetched bundles back to SDK Bundle type for display\n const bundles = fetchedBundles as unknown as Bundle[];\n\n // Display / pricing flags — resolved once (previously each was a function\n // redefined every render and called from many JSX sites).\n const includeTax = props.includeTax !== undefined ? !!props.includeTax : false;\n const showItems = props.showIndividualItems !== undefined ? !!props.showIndividualItems : true;\n const layout = (props.layout as string) || 'horizontal';\n const isAnonymous = !props.user;\n const hidePrices = (props.portalMode as string) === 'semi-closed' && isAnonymous;\n\n function hasDiscount(bundle: Bundle): boolean {\n const current = getBundlePrice(bundle, includeTax);\n const original = getOriginalPrice(bundle, includeTax);\n return original > 0 && current < original;\n }\n\n function showToast(message: string, type: string): void {\n setToastMessage(message);\n setToastType(type);\n setToastVisible(true);\n setTimeout(() => {\n setToastVisible(false);\n }, 3000);\n }\n\n function dismissToast(): void {\n setToastVisible(false);\n }\n\n function closeModal(): void {\n setModalVisible(false);\n setLastAddedBundle(null);\n }\n\n async function handleAddToCart(bundle: Bundle): Promise<void> {\n if (addingBundleId) return;\n setAddingBundleId(bundle.id);\n try {\n if (props.onAddBundleToCart) {\n props.onAddBundleToCart(bundle.id, 1);\n } else {\n if (!props.graphqlClient) return;\n if (props.beforeBundleAddToCart) {\n props.beforeBundleAddToCart(bundle.id, 1);\n }\n\n const existingCartId = props.cartId || composableCartId;\n const result = await composableAddBundleToCart(\n bundle.id as unknown as number,\n existingCartId || undefined\n );\n\n if (!result.success) {\n showToast(\n result.error || getLabel(props.labels, 'noCartId', 'No cart ID provided'),\n 'error'\n );\n return;\n }\n\n if (result.cart && props.afterBundleAddToCart) {\n props.afterBundleAddToCart(result.cart, bundle);\n }\n }\n if (props.showModal) {\n setLastAddedBundle(bundle);\n setModalVisible(true);\n } else {\n const bundleName = bundle.name || getLabel(props.labels, 'title', 'Bundle');\n showToast(\n `${bundleName} ${getLabel(props.labels, 'addedToCart', 'added to cart')}`,\n 'success'\n );\n }\n } catch (error) {\n console.error('Error adding bundle to cart:', error);\n showToast(getLabel(props.labels, 'errorAdding', 'Failed to add bundle to cart'), 'error');\n } finally {\n setAddingBundleId(null);\n }\n }\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n useEffect(() => {\n fetchBundles(props.productId);\n }, [props.productId]);\n\n return (\n <>\n {isMounted && !isLoading && bundles.length > 0 ? (\n <div className={`propeller-product-bundles ${props.className || 'mb-12'}`}>\n {bundles.map((bundle, bundleIdx) => {\n const bundlePrice = getBundlePrice(bundle, includeTax);\n const originalPrice = getOriginalPrice(bundle, includeTax);\n const discounted = hasDiscount(bundle);\n return (\n <div\n className=\"propeller-product-bundles__bundle border border-border rounded-container bg-card shadow-sm mb-6 p-6\"\n key={bundle.id || bundleIdx}\n data-layout={layout}\n >\n <div className=\"flex flex-col lg:flex-row items-center gap-6\">\n {showItems && layout !== 'compact' && bundle.items && bundle.items.length > 0 ? (\n <div className=\"propeller-product-bundles__items flex flex-wrap items-center justify-center gap-2 flex-1\">\n {bundle.items.map((item, idx) => (\n <div\n className=\"propeller-product-bundles__item flex items-center gap-2\"\n key={item.productId + '-' + idx}\n >\n {idx > 0 ? (\n <div className=\"propeller-product-bundles__plus flex-shrink-0 w-8 h-8 rounded-full bg-success flex items-center justify-center\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"w-5 h-5 text-success-foreground\"\n strokeWidth={2.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 4.5v15m7.5-7.5h-15\"\n />\n </svg>\n </div>\n ) : null}\n <div className=\"flex flex-col items-center text-center w-40\">\n <div className=\"propeller-product-bundles__item-media w-32 h-32 bg-surface-hover rounded-container overflow-hidden flex-shrink-0 mb-2\">\n {getProductImage(item.product) ? (\n <img\n className=\"propeller-product-bundles__item-image w-full h-full object-contain p-2\"\n src={getProductImage(item.product)}\n alt={getProductName(item.product)}\n />\n ) : null}\n </div>\n <div className=\"propeller-product-bundles__item-name text-sm font-medium text-muted-foreground leading-tight mb-1\">\n {getProductName(item.product) || 'Product ' + item.productId}\n </div>\n {!hidePrices && item.price ? (\n <div className=\"propeller-product-bundles__item-price text-sm font-semibold text-foreground\">\n {money(getItemPrice(item, includeTax))}\n <span className=\"text-xs font-normal text-muted-foreground ml-1\">\n {includeTax\n ? getLabel(props.labels, 'inclTax', 'incl. VAT')\n : getLabel(props.labels, 'exclTax', 'excl. VAT')}\n </span>\n </div>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n ) : null}\n <div className=\"propeller-product-bundles__equals flex-shrink-0 w-8 h-8 rounded-full bg-success flex items-center justify-center\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"w-5 h-5 text-success-foreground\"\n strokeWidth={2.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M3.75 12h16.5M3.75 7.5h16.5\"\n />\n </svg>\n </div>\n <div className=\"propeller-product-bundles__summary flex-shrink-0 w-full lg:w-72 pl-0 lg:pl-6\">\n <h3 className=\"propeller-product-bundles__title text-xl font-bold text-foreground mb-1\">\n {bundle.name || getLabel(props.labels, 'title', 'Combo deal')}\n </h3>\n {bundle.description ? (\n <p className=\"propeller-product-bundles__description text-sm text-muted-foreground mb-3\">\n {bundle.description}\n </p>\n ) : null}\n {bundle.condition ? (\n <p className=\"propeller-product-bundles__condition text-xs text-muted-foreground mb-3\">\n {bundle.condition === BundleCondition.ALL\n ? getLabel(props.labels, 'condition_ALL', 'Discount on all items')\n : getLabel(props.labels, 'condition_EP', 'Discount on extra items')}\n </p>\n ) : null}\n {!hidePrices ? (\n <>\n <div className=\"propeller-product-bundles__pricing mb-3\">\n {discounted ? (\n <span className=\"propeller-product-bundles__original-price text-foreground-subtle line-through text-sm\">\n {money(originalPrice)}\n </span>\n ) : null}\n <div className=\"flex items-baseline gap-2\">\n <span className=\"propeller-product-bundles__price text-2xl font-bold text-foreground\">\n {money(bundlePrice)}\n </span>\n <span className=\"text-xs text-muted-foreground\">\n {includeTax\n ? getLabel(props.labels, 'inclTax', 'incl. VAT')\n : getLabel(props.labels, 'exclTax', 'excl. VAT')}\n </span>\n </div>\n {discounted ? (\n <div className=\"propeller-product-bundles__savings mt-2 inline-block bg-success/10 text-success text-sm font-medium px-3 py-1 rounded-control\">\n {getLabel(props.labels, 'youSave', 'Your savings:')}\n {money(originalPrice - bundlePrice)}\n </div>\n ) : null}\n </div>\n <button\n className=\"propeller-product-bundles__submit w-full px-6 py-3 bg-primary text-primary-foreground rounded-container font-semibold hover:bg-primary/90 transition disabled:opacity-50 disabled:cursor-not-allowed text-base\"\n onClick={() => handleAddToCart(bundle)}\n disabled={addingBundleId === bundle.id}\n data-loading={addingBundleId === bundle.id ? 'true' : 'false'}\n >\n {addingBundleId === bundle.id\n ? getLabel(props.labels, 'adding', 'Adding...')\n : getLabel(props.labels, 'addToCart', 'In cart')}\n </button>\n </>\n ) : (\n <div className=\"propeller-product-bundles__login-prompt text-center text-sm text-muted-foreground py-2\">\n {getLabel(\n props.labels,\n 'loginToSeePrices',\n 'Log in to see prices and add to cart'\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n })}\n {toastVisible ? (\n <div\n className={`propeller-product-bundles__toast fixed top-4 right-4 z-50 flex items-start gap-3 w-80 rounded-container shadow-lg p-4 ${toastType === 'success' ? 'bg-success border border-success text-success-foreground' : 'bg-destructive border border-destructive text-destructive-foreground'}`}\n data-toast-type={toastType}\n >\n <div\n className={`propeller-product-bundles__toast-icon flex-shrink-0 w-5 h-5 mt-0.5 ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastType === 'success' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n ) : null}\n {toastType === 'error' ? (\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\"\n />\n </svg>\n ) : null}\n </div>\n <p\n className={`propeller-product-bundles__toast-message flex-1 text-sm font-medium ${toastType === 'success' ? 'text-success-foreground' : 'text-destructive-foreground'}`}\n >\n {toastMessage}\n </p>\n <button\n type=\"button\"\n onClick={() => dismissToast()}\n className={`propeller-product-bundles__toast-close flex-shrink-0 rounded focus:outline-none ${toastType === 'success' ? 'text-success-foreground hover:text-success-foreground/80' : 'text-destructive-foreground hover:text-destructive-foreground/80'}`}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-4 w-4\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n ) : null}\n {modalVisible ? (\n <div className=\"propeller-product-bundles__modal fixed inset-0 z-50 flex items-center justify-center px-4\">\n <div\n className=\"propeller-product-bundles__modal-backdrop fixed inset-0 bg-foreground/20\"\n onClick={() => closeModal()}\n />\n <div className=\"propeller-product-bundles__modal-content relative w-full max-w-lg bg-card rounded-container shadow-2xl overflow-hidden\">\n <div className=\"propeller-product-bundles__modal-header flex items-center gap-3 px-6 py-4 border-b border-border-subtle\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"propeller-product-bundles__modal-success-icon h-5 w-5 flex-shrink-0 text-success\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n <h3 className=\"propeller-product-bundles__modal-title flex-1 text-base font-semibold text-foreground\">\n {getLabel(props.labels, 'modalTitle', 'Added to cart')}\n </h3>\n <button\n type=\"button\"\n className=\"propeller-product-bundles__modal-close flex-shrink-0 text-foreground-subtle hover:text-foreground focus:outline-none\"\n onClick={() => closeModal()}\n >\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"h-5 w-5\"\n strokeWidth={2}\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n <div className=\"propeller-product-bundles__modal-body px-6 py-5\">\n <div className=\"propeller-product-bundles__modal-product flex items-start gap-4\">\n {lastAddedBundle &&\n lastAddedBundle.items &&\n lastAddedBundle.items.length > 0 &&\n getProductImage(lastAddedBundle.items[0].product) ? (\n <img\n className=\"propeller-product-bundles__modal-image w-16 h-16 object-contain rounded border border-border-subtle flex-shrink-0\"\n src={\n lastAddedBundle?.items?.[0]\n ? getProductImage(lastAddedBundle.items[0].product)\n : ''\n }\n alt={lastAddedBundle?.name || 'Bundle'}\n />\n ) : (\n <div className=\"propeller-product-bundles__modal-image-placeholder w-16 h-16 flex items-center justify-center rounded border border-border-subtle flex-shrink-0 bg-surface-hover\">\n <svg\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"w-8 h-8 text-foreground-subtle\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z\"\n />\n </svg>\n </div>\n )}\n <div className=\"flex-1 min-w-0\">\n <p className=\"propeller-product-bundles__modal-name text-sm font-medium text-foreground\">\n {lastAddedBundle?.name || getLabel(props.labels, 'title', 'Bundle')}\n </p>\n </div>\n <div className=\"flex-shrink-0 text-right\">\n <p className=\"propeller-product-bundles__modal-quantity text-xs text-muted-foreground\">\n {getLabel(props.labels, 'quantity', 'Quantity')}: 1\n </p>\n {!hidePrices && lastAddedBundle ? (\n <p className=\"propeller-product-bundles__modal-price text-sm font-semibold text-foreground mt-0.5\">\n {money(getBundlePrice(lastAddedBundle, includeTax))}\n </p>\n ) : null}\n </div>\n </div>\n {lastAddedBundle && lastAddedBundle.items && lastAddedBundle.items.length > 0 ? (\n <div className=\"propeller-product-bundles__modal-children mt-3 ml-20 space-y-1 border-l-2 border-secondary/10 pl-2\">\n {lastAddedBundle.items.map((item, idx) => (\n <div\n className=\"propeller-product-bundles__modal-child flex justify-between items-center text-xs text-muted-foreground\"\n key={item.productId + '-' + idx}\n >\n <span className=\"line-clamp-1\">\n {getProductName(item.product) || 'Product'}\n </span>\n {!hidePrices && item.price ? (\n <span className=\"text-foreground-subtle whitespace-nowrap ml-2\">\n {money(getItemPrice(item, includeTax))}\n </span>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n </div>\n <div className=\"propeller-product-bundles__modal-actions flex gap-3 px-6 py-4 border-t border-border-subtle\">\n <button\n type=\"button\"\n className=\"propeller-product-bundles__modal-continue flex-1 inline-flex justify-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\"\n onClick={() => closeModal()}\n >\n {getLabel(props.labels, 'continueShopping', 'Continue shopping')}\n </button>\n <button\n type=\"button\"\n className=\"propeller-product-bundles__modal-checkout flex-1 inline-flex justify-center rounded-control border border-transparent bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\"\n onClick={() => {\n closeModal();\n if (props.onProceedToCheckout) props.onProceedToCheckout();\n }}\n >\n {getLabel(props.labels, 'proceedToCheckout', 'Proceed to checkout')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n ) : null}\n </>\n );\n}\n\nexport default ProductBundles;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport { ClusterOption, Contact, Customer, Product, ProductPrice, YesNo } from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { isContentHidden } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice as formatPriceHelper } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductPriceProps {\n /**\n * ProductPrice object from the product.\n * Obtain from `product.price`.\n */\n price: ProductPrice;\n\n /** Currency symbol to display. Defaults to '€'. */\n currency?: string;\n\n /**\n * Controls portal visibility mode.\n * 'open' — full e-commerce; price is always visible.\n * 'semi-closed' — catalog-only; price is hidden for anonymous users.\n * Defaults to 'open'.\n */\n portalMode?: string;\n\n /** Authenticated user — used for semi-closed visibility. */\n user?: Contact | Customer | null;\n\n /**\n * When true, net price (incl. tax) is the leading price.\n * When false (default), gross price (excl. tax) is the leading price.\n * Note: in the Propeller SDK `price.gross` = excl. VAT, `price.net` = incl. VAT.\n */\n includeTax?: boolean;\n\n /** Tax zone code. Defaults to 'NL'. */\n taxZone?: string;\n\n /** Cluster options (cluster.options). Required option default prices are added even without an active selection. */\n options?: ClusterOption[];\n\n /** Active option product selections — pass Object.values(selectedOptionProducts). Price updates on every change. */\n selectedOptionProducts?: Product[];\n\n /**\n * Override any UI string.\n * Available keys: inclTax, exclTax, loginToSeePrices\n */\n labels?: Record<string, string>;\n\n /** Tailwind text-size class for the leading price. Defaults to 'text-3xl'. */\n priceSize?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's price with a leading incl./excl.-VAT amount and a\n * secondary line for the other tax mode, adding selected cluster-option prices.\n */\nfunction ProductPriceDisplay(props: ProductPriceProps) {\n function isHidden(): boolean {\n return isContentHidden(props.portalMode, props.user);\n }\n function formatPrice(value: number | null | undefined): string {\n if (value === null || value === undefined) return '';\n return formatPriceHelper(value, { symbol: props.currency ?? '\\u20AC' });\n }\n function getOptionsTotal(useNet: boolean): number {\n const options = props.options || [];\n const selected = props.selectedOptionProducts || [];\n let total = 0;\n options.forEach((option: ClusterOption) => {\n if (option.hidden === YesNo.Y) return;\n\n // Find whether the user has selected a product in this option\n const selectedProduct = selected.find((p: Product) =>\n (option.products || []).some((op: Product) => op.productId === p.productId)\n );\n if (selectedProduct) {\n total += useNet ? selectedProduct.price?.net || 0 : selectedProduct.price?.gross || 0;\n } else if (option.isRequired === YesNo.Y && option.defaultProduct) {\n // option.defaultProduct may lack price data; look up the full\n // product record from option.products (which always has prices).\n const defaultId = (option.defaultProduct as Product).productId;\n const fullDefault =\n (option.products || []).find((p: Product) => p.productId === defaultId) ||\n option.defaultProduct;\n total += useNet\n ? (fullDefault as Product).price?.net || 0\n : (fullDefault as Product).price?.gross || 0;\n }\n });\n return total;\n }\n function getLeadingPrice(): string {\n const price = props.price;\n if (!price) return '';\n const useNet = !!props.includeTax;\n const base = useNet ? price.net : price.gross;\n if (base === null || base === undefined) return '';\n return formatPrice(base + getOptionsTotal(useNet));\n }\n function getSecondaryPrice(): string {\n const price = props.price;\n if (!price) return '';\n const useNet = !props.includeTax; // opposite of leading\n const base = useNet ? price.net : price.gross;\n if (base === null || base === undefined) return '';\n return formatPrice(base + getOptionsTotal(useNet));\n }\n function getTaxLabel(): string {\n return props.includeTax ? getLabel(props.labels, 'inclTax', 'incl. VAT') : getLabel(props.labels, 'exclTax', 'excl. VAT');\n }\n function getSecondaryTaxLabel(): string {\n return props.includeTax ? getLabel(props.labels, 'exclTax', 'excl. VAT') : getLabel(props.labels, 'inclTax', 'incl. VAT');\n }\n return (\n <div className={`propeller-product-price ${props.className || ''}`} data-hidden={isHidden() ? 'true' : 'false'}>\n {isHidden() ? (\n <p className=\"propeller-product-price__login-prompt text-sm text-muted-foreground italic\">\n {getLabel(props.labels, 'loginToSeePrices', 'Log in to see prices')}\n </p>\n ) : null}\n {!isHidden() && !!getLeadingPrice() ? (\n <div className=\"propeller-product-price__content flex flex-col gap-0.5\">\n <div className=\"propeller-product-price__primary flex items-baseline gap-2\">\n <span\n className={`propeller-product-price__amount ${props.priceSize || 'text-3xl'} font-bold text-foreground`}\n >\n {getLeadingPrice()}\n </span>\n <span className=\"propeller-product-price__tax-label text-sm text-muted-foreground\">{getTaxLabel()}</span>\n </div>\n {!!getSecondaryPrice() ? (\n <div className=\"propeller-product-price__secondary text-sm text-muted-foreground flex items-baseline gap-1\">\n <span className=\"propeller-product-price-secondary__amount\">{getSecondaryPrice()}</span>\n <span className=\"propeller-product-price-secondary__tax-label\">{getSecondaryTaxLabel()}</span>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default ProductPriceDisplay;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState).\n * The compound subcomponents (`<ProductCard.Image>` etc.) inherit this\n * boundary even though several of them are individually pure — moving the\n * boundary would force a context-less prop drilling that defeats the\n * compound pattern. Server-side render needs go through the underlying\n * Bucket-B primitives (ProductPrice, ItemStock) directly.\n */\nimport * as React from 'react';\n\nimport { createContext, useContext, useState } from 'react';\nimport {\n GraphQLClient,\n Product,\n Cluster,\n Contact,\n Customer,\n Cart,\n CartMainItem,\n CartChildItemInput,\n AttributeResult,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport AddToCartImpl from './AddToCart';\nimport ItemStock from './ItemStock';\nimport ProductPriceDisplay from './ProductPrice';\nimport DefaultAddToFavoriteImpl from './AddToFavorite';\nimport { DefaultProductImage as DefaultProductImageImpl } from './defaults/DefaultProductImage';\nimport { DefaultProductBadges as DefaultProductBadgesImpl } from './defaults/DefaultProductBadges';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport {\n getProductImageUrl,\n getProductSku,\n getLocalizedValue,\n} from '@propeller-commerce/propeller-v2-core-ui';\nimport { useResolvedProps, ResolveSpec } from '../composables/react/useResolvedProps';\nimport { ProductGridConfig } from '../context/ProductGridContext';\n\n// ── Public types ────────────────────────────────────────────────────────────\n\n/**\n * Props for the root `<ProductCard>` (and the back-compat monolithic\n * variant). Most fields are display toggles preserved for back-compat; in\n * the new compound API, consumers control rendering by composition instead\n * — see the Subcomponents section below.\n */\nexport interface ProductCardProps {\n // === Core ===\n\n /** The product object to display */\n product: Product;\n\n /**\n * Compound API: provide subcomponents as children. When omitted, the\n * monolithic legacy layout renders based on the show*/ /* allow* prop\n * toggles below.\n *\n * @example\n * <ProductCard product={p}>\n * <ProductCard.Image variant=\"grid\" />\n * <ProductCard.Name linkable />\n * <ProductCard.Price />\n * <ProductCard.AddToCart />\n * </ProductCard>\n */\n children?: React.ReactNode;\n\n // === Display toggles (legacy / monolithic mode only) ===\n\n /** Show the product name. Defaults to true. */\n showName?: boolean;\n\n /** Show the product image. Defaults to true. */\n showImage?: boolean;\n\n /** Show the product short description. Defaults to false. */\n showShortDescription?: boolean;\n\n /** Show the product SKU. Defaults to true. */\n showSku?: boolean;\n\n /** Show the product manufacturer. Defaults to false. */\n showManufacturer?: boolean;\n\n /**\n * Show the stock / availability widget below the product name.\n * Uses the embedded `ItemStock` component driven by `product.inventory`.\n * Defaults to false.\n */\n showStock?: boolean;\n\n /**\n * Show only the availability indicator (Available / Not available) inside ItemStock.\n * Only relevant when `showStock` is true.\n * Defaults to true.\n */\n showAvailability?: boolean;\n\n /**\n * Show the price below the product name.\n * Defaults to true.\n */\n showPrice?: boolean;\n\n /**\n * Show the AddToCart component.\n * Defaults to true.\n */\n allowAddToCart?: boolean;\n\n /**\n * Label overrides forwarded to the embedded ItemStock component.\n * Keys: inStock, outOfStock, lowStock, available, notAvailable, pieces\n */\n stockLabels?: Record<string, string>;\n\n // === Attribute labels ===\n\n /**\n * Attribute codes/names to look up and display as badge overlays on the product image.\n * Example: ['new', 'sale']\n */\n imageLabels?: string[];\n\n /**\n * Attribute codes/names to look up and display as extra text rows below the product name.\n * Example: ['brand', 'color']\n */\n textLabels?: string[];\n\n // === UI string overrides ===\n\n /** Override any UI string. Keys: addToFavorites, removeFromFavorites */\n labels?: Record<string, string>;\n\n // === Favourites ===\n\n /** Renders a heart-icon toggle button on the product image. Defaults to false. */\n enableAddFavorite?: boolean;\n\n /** Called whenever the favourite state is toggled. */\n onToggleFavorite?: (product: Product, isFavorite: boolean) => void;\n\n // === Navigation ===\n\n /**\n * Called when the product name or image is clicked.\n * When provided, the default `<a>` navigation is prevented.\n */\n onProductClick?: (product: Product) => void;\n\n // === Pricing ===\n\n /** When true, tax-inclusive (net) price is the leading price. Defaults to false. */\n includeTax?: boolean;\n\n // === Appearance ===\n\n /** Number of grid columns — when 1 the card renders as a compact horizontal row. */\n columns?: number;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /**\n * URL pattern controlling which segments appear in product links.\n * Tokens: page → 'product', id → productId, slug → slug value.\n * Defaults to 'page/id/slug'.\n */\n urlPattern?: string;\n\n // === AddToCart pass-through props (forwarded to the compound subcomponent\n // OR the legacy embedded AddToCart) ===\n\n /** GraphQL client for the embedded AddToCart. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n /** Authenticated user. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n /** ID of the cart that add-to-cart targets. */\n cartId?: string;\n /** Configuration object (URL builders, image filters, etc.). */\n configuration?: any;\n /** Cluster ID when this card represents a variant of a product cluster. */\n clusterId?: number;\n /** Pre-selected child item product IDs added alongside the product. */\n childItems?: number[];\n /** Order-line notes forwarded with the add-to-cart request. */\n notes?: string;\n /** Custom price override forwarded with the add-to-cart request. */\n price?: number;\n /** When true, a new cart is created if no `cartId` is set. */\n createCart?: boolean;\n /** Fires when add-to-cart creates a new cart. */\n onCartCreated?: (cart: Cart) => void;\n /** Delegation handler — when provided, the parent performs the add-to-cart itself. */\n onAddToCart?: (\n product: Product,\n clusterId?: number,\n quantity?: number,\n childItems?: CartChildItemInput[],\n notes?: string,\n price?: number,\n showModal?: boolean\n ) => Cart;\n /** Fires after an item has been added to the cart. */\n afterAddToCart?: (cart: Cart, item?: CartMainItem) => void;\n /** When true, show a confirmation modal after add-to-cart instead of a toast. */\n showModal?: boolean;\n /** When true, the AddToCart shows quantity increment/decrement controls. */\n allowIncrDecr?: boolean;\n /** When true, stock availability is validated before adding to cart. */\n enableStockValidation?: boolean;\n /** Language code for localised content. Resolved from PropellerProvider when omitted. */\n language?: string;\n /** Active company ID from the company switcher. */\n companyId?: number;\n /** Fires when the \"Proceed to checkout\" modal button is clicked. */\n onProceedToCheckout?: () => void;\n /** Fires when the user requests a quote from the AddToCart modal. */\n onRequestQuoteClick?: (cart: Cart) => void;\n /** Label overrides forwarded to the embedded AddToCart component. */\n addToCartLabels?: Record<string, string>;\n /** Translated labels forwarded to the embedded `<ProductPrice>` display.\n * See `ProductPriceProps.labels` for slugs (inclTax, exclTax, loginToSeePrices). */\n priceLabels?: Record<string, string>;\n\n // ───── Extension API ─────\n // Per-card overrides for sub-components. Precedence:\n // explicit prop > ProductGridConfig context > infra > default.\n /** Replaces the default price block. Receives `PriceComponentProps`. */\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n /** Replaces the default stock/availability block. Receives `StockComponentProps`. */\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n /** Replaces the default add-to-cart control. Receives `AddToCartComponentProps`. */\n addToCartComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').AddToCartComponentProps>;\n /** Replaces the default product image block. Receives `ImageComponentProps`. */\n imageComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ImageComponentProps>;\n /** Replaces the default product badges block. Receives `BadgesComponentProps`. */\n badgesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').BadgesComponentProps>;\n /** Replaces the default favorite-toggle. Receives `FavoriteComponentProps`. */\n favoriteComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').FavoriteComponentProps>;\n}\n\n// ── Pure helpers (module scope — created once, not per render) ──────────────\n\nfunction getProductName(product: Product | undefined, language: string): string {\n return getLocalizedValue(product?.names, language, 'Product');\n}\n\nfunction getProductShortDescription(product: Product | undefined, language: string): string {\n return getLocalizedValue(product?.shortDescriptions, language, '');\n}\n\nfunction getProductManufacturer(product: Product | undefined): string {\n return product?.manufacturer || '';\n}\n\n/** Resolves attribute codes to their display values, dropping any with no value. */\nfunction resolveAttributeValues(product: Product | undefined, codes: string[] | undefined): string[] {\n if (!codes || codes.length === 0) return [];\n const attrs = product?.attributes?.items || [];\n return codes\n .map((code) => {\n const found = attrs.find((a: AttributeResult) => a.attributeDescription?.name === code);\n return found?.value?.value || '';\n })\n .filter((v: string) => v.length > 0);\n}\n\n// Two-tier precedence (explicit prop > ProductGrid context > Propeller infra >\n// default) for the ~24 props ProductGrid otherwise cascades through here.\nconst RESOLVE_SPEC: ResolveSpec<ProductCardProps> = {\n graphqlClient: { infra: 'graphqlClient' },\n user: { infra: 'user', default: null },\n companyId: { infra: 'companyId' },\n language: { infra: 'language', default: 'NL' },\n includeTax: { infra: 'includeTax' },\n configuration: { infra: 'configuration' },\n columns: { grid: 'columns', default: 3 },\n showPrice: { grid: 'showPrice' },\n showStock: { grid: 'showStock' },\n showAvailability: { grid: 'showAvailability' },\n allowAddToCart: { grid: 'allowAddToCart' },\n enableAddFavorite: { grid: 'enableAddFavorite' },\n stockLabels: { grid: 'stockLabels' },\n priceLabels: { grid: 'priceLabels' },\n cartId: { grid: 'cartId' },\n createCart: { grid: 'createCart' },\n showModal: { grid: 'showModal' },\n allowIncrDecr: { grid: 'allowIncrDecr' },\n enableStockValidation: { grid: 'enableStockValidation' },\n addToCartLabels: { grid: 'addToCartLabels' },\n childItems: { grid: 'childItems' },\n notes: { grid: 'notes' },\n price: { grid: 'price' },\n onCartCreated: { grid: 'onCartCreated' },\n afterAddToCart: { grid: 'afterAddToCart' },\n onProceedToCheckout: { grid: 'onProceedToCheckout' },\n onRequestQuoteClick: { grid: 'onRequestQuoteClick' },\n onProductClick: { grid: 'onProductClick' },\n onToggleFavorite: {\n grid: 'onToggleFavorite',\n transform: (fn) => (p: Product, fav: boolean) =>\n (fn as ProductGridConfig['onToggleFavorite'])!(p, fav),\n },\n // ───── Extension API — component-slot resolution ─────\n priceComponent: { grid: 'priceComponent' },\n stockComponent: { grid: 'stockComponent' },\n addToCartComponent: { grid: 'addToCartComponent' },\n imageComponent: { grid: 'imageComponent' },\n badgesComponent: { grid: 'badgesComponent' },\n favoriteComponent: { grid: 'favoriteComponent' },\n};\n\n// ── Context (shared by compound subcomponents) ──────────────────────────────\n\n/**\n * Internal context populated by the root `<ProductCard>`. Subcomponents read\n * `useProductCard()` to get the product + resolved props + derived values\n * (name, sku, imageUrl, productUrl) computed once. Not exported — consumers\n * compose subcomponents under `<ProductCard>` rather than reading the\n * context directly.\n */\ninterface ProductCardContextValue {\n product: Product;\n /** Fully resolved props (infra + grid context + explicit) — read instead of `props`. */\n resolved: ProductCardProps;\n /** Derived display values, computed once at the root and read by leaves. */\n derived: {\n name: string;\n sku: string;\n imageUrl: string;\n shortDescription: string;\n manufacturer: string;\n productUrl: string;\n imageLabelValues: string[];\n textLabelValues: string[];\n useTax: boolean;\n isRow: boolean;\n language: string;\n };\n /** Local UI state shared between Image (which renders the heart) and any sibling. */\n favorite: {\n isFavorite: boolean;\n toggle: (e: React.MouseEvent) => void;\n };\n /** Click handler shared by Image + Name. */\n handleProductClick: (e: React.MouseEvent) => void;\n}\n\nconst ProductCardContext = createContext<ProductCardContextValue | null>(null);\n\n/**\n * Internal hook used by compound subcomponents. Throws if called outside\n * `<ProductCard>` — the error is intentional, that's a developer mistake.\n */\nfunction useProductCard(): ProductCardContextValue {\n const ctx = useContext(ProductCardContext);\n if (!ctx) {\n throw new Error(\n '<ProductCard.X> must be rendered inside <ProductCard>. ' +\n 'Got null context — wrap your subcomponents in <ProductCard product={...}>...</ProductCard>.'\n );\n }\n return ctx;\n}\n\n// ── Root component ──────────────────────────────────────────────────────────\n\n/**\n * Root of the `<ProductCard>` compound component. Renders either the\n * consumer-composed children (compound mode) or the legacy monolithic layout\n * driven by `show*`/`allow*` toggles, and provides the shared card context.\n */\nfunction ProductCardRoot(rawProps: ProductCardProps) {\n // Resolve infra (Tier 1) + grid config (Tier 2) declaratively so this\n // component no longer needs ~24 cascaded props.\n const props = useResolvedProps(rawProps, RESOLVE_SPEC);\n\n const [isFavorite, setIsFavorite] = useState(false);\n\n const language = (props.language as string) || 'NL';\n const product = props.product;\n const isRow = props.columns === 1;\n\n // Derived values — computed once per render.\n const name = getProductName(product, language);\n const sku = getProductSku(product);\n const imageUrl = getProductImageUrl(product);\n const shortDescription = getProductShortDescription(product, language);\n const manufacturer = getProductManufacturer(product);\n const productUrl = props.configuration?.urls?.getProductUrl?.(product, props.language) ?? '#';\n const imageLabelValues = resolveAttributeValues(product, props.imageLabels);\n const textLabelValues = resolveAttributeValues(product, props.textLabels);\n const useTax = props.includeTax !== undefined ? !!props.includeTax : false;\n\n function handleProductClick(e: React.MouseEvent): void {\n if (props.onProductClick) {\n e.preventDefault();\n props.onProductClick(product);\n }\n }\n\n function toggleFavorite(e: React.MouseEvent): void {\n e.preventDefault();\n e.stopPropagation();\n setIsFavorite(!isFavorite);\n if (props.onToggleFavorite) {\n props.onToggleFavorite(product, isFavorite);\n }\n }\n\n const contextValue: ProductCardContextValue = {\n product,\n resolved: props,\n derived: {\n name,\n sku,\n imageUrl,\n shortDescription,\n manufacturer,\n productUrl,\n imageLabelValues,\n textLabelValues,\n useTax,\n isRow,\n language,\n },\n favorite: { isFavorite, toggle: toggleFavorite },\n handleProductClick,\n };\n\n // Compound mode: consumer supplied children. Render them inside a default\n // shell with the root layout classes, but the consumer controls the order\n // and which subcomponents appear. The shell can be replaced via\n // <ProductCard.Shell as=\"article\"> in a future extension; for now the div\n // matches the legacy markup so styling stays identical.\n if (rawProps.children !== undefined) {\n return (\n <ProductCardContext.Provider value={contextValue}>\n <div\n className={`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? 'flex-row flex-wrap md:flex-nowrap items-center' : 'flex-col'} ${props.className || ''}`}\n data-layout={isRow ? 'row' : 'grid'}\n >\n {rawProps.children}\n </div>\n </ProductCardContext.Provider>\n );\n }\n\n // Legacy / monolithic mode: render the original full layout based on the\n // show*/allow* toggles. Internally we still use the compound subcomponents\n // so there's one rendering path. Marked @deprecated in the prop docs;\n // planned removal in v2 once consumers have migrated.\n return (\n <ProductCardContext.Provider value={contextValue}>\n <div\n className={`propeller-product-card group relative flex h-full overflow-hidden rounded-container border border-border bg-card shadow-sm transition-all duration-200 hover:shadow-md hover:border-secondary/20 ${isRow ? 'flex-row flex-wrap md:flex-nowrap items-center' : 'flex-col'} ${props.className || ''}`}\n data-layout={isRow ? 'row' : 'grid'}\n >\n {props.showImage !== false ? <ProductCardImage /> : null}\n {isRow ? (\n <>\n <div className=\"propeller-product-card__body flex flex-1 flex-row items-center gap-4 px-4 py-2 min-w-0\">\n <div className=\"flex flex-col gap-0.5 flex-1 min-w-0\">\n {props.showSku !== false && sku ? <ProductCardSku /> : null}\n {props.showName !== false ? <ProductCardName linkable /> : null}\n {textLabelValues.length > 0 ? <ProductCardTextLabels /> : null}\n {props.showManufacturer && manufacturer ? <ProductCardManufacturer /> : null}\n {props.showShortDescription && shortDescription ? <ProductCardShortDescription /> : null}\n </div>\n </div>\n <div className=\"propeller-product-card__footer w-full md:w-auto flex items-center gap-3 px-4 py-2 md:py-0 border-t md:border-t-0 border-border-subtle\">\n {props.showStock && !!product.inventory ? <ProductCardStock /> : null}\n {props.showPrice !== false && !!product?.price ? (\n <ProductCardPrice priceSize=\"text-sm\" />\n ) : null}\n {props.allowAddToCart !== false ? (\n <div className=\"propeller-product-card__cta flex-shrink-0 ml-auto\">\n <ProductCardAddToCart />\n </div>\n ) : null}\n </div>\n </>\n ) : (\n <>\n <div className=\"propeller-product-card__body flex flex-1 flex-col gap-1.5 p-3 sm:gap-2 sm:p-4\">\n {props.showSku !== false && sku ? <ProductCardSku /> : null}\n {props.showName !== false ? <ProductCardName linkable /> : null}\n {textLabelValues.length > 0 ? <ProductCardTextLabels /> : null}\n {props.showStock && !!product.inventory ? <ProductCardStock /> : null}\n {props.showManufacturer && manufacturer ? <ProductCardManufacturer /> : null}\n {props.showShortDescription && shortDescription ? <ProductCardShortDescription /> : null}\n {props.showPrice !== false && !!product?.price ? (\n <div className=\"propeller-product-card__price mt-auto pt-1\">\n <ProductCardPrice priceSize=\"text-base sm:text-lg\" />\n </div>\n ) : null}\n </div>\n {props.allowAddToCart !== false ? (\n <div className=\"propeller-product-card__cta px-3 pb-3 sm:px-4 sm:pb-4\">\n <ProductCardAddToCart />\n </div>\n ) : null}\n </>\n )}\n </div>\n </ProductCardContext.Provider>\n );\n}\n\n// ── Compound subcomponents ──────────────────────────────────────────────────\n\n/**\n * Product image with optional badge overlays and favourite button.\n * Reads `derived.imageUrl`, `derived.imageLabelValues`, `derived.productUrl`,\n * and the `favorite` state from context.\n *\n * Trade-off: when `imageComponent` is injected, the consumer takes over the\n * ENTIRE image area — including the badge / favorite overlay layer.\n * The default markup wraps the `<img>` in a link with absolute-positioned\n * badges and a favorite button; an injected component receives only the\n * `ImageComponentProps` contract and is free to re-render those overlays\n * itself (e.g. by composing `<DefaultProductBadges>` / `<DefaultAddToFavorite>`)\n * or omit them entirely.\n */\nfunction ProductCardImage(props: {\n /** Override the wrapper class. */\n className?: string;\n /** Render the favourite heart button. Defaults to context `enableAddFavorite`. */\n showFavorite?: boolean;\n}) {\n const { product, derived, resolved, favorite, handleProductClick } = useProductCard();\n const showFavorite = props.showFavorite ?? !!resolved.enableAddFavorite;\n const isRow = derived.isRow;\n const InjectedImage = resolved.imageComponent;\n if (InjectedImage) {\n // Consumer override: full image-area control. Badges + favorite overlay\n // are NOT auto-rendered around the injected image — that's documented\n // above and matches Vue parity.\n return (\n <InjectedImage\n product={product}\n language={resolved.language}\n imageSearchFilters={resolved.configuration?.imageSearchFiltersGrid}\n imageVariantFilters={resolved.configuration?.imageVariantFiltersMedium}\n className={\n props.className ??\n `propeller-product-card__media relative overflow-hidden bg-surface-hover ${isRow ? 'w-20 h-20 flex-shrink-0 p-2' : 'aspect-[4/3] sm:aspect-square p-2 sm:p-4'}`\n }\n />\n );\n }\n return (\n <div\n className={\n props.className ??\n `propeller-product-card__media relative overflow-hidden bg-surface-hover ${isRow ? 'w-20 h-20 flex-shrink-0 p-2' : 'aspect-[4/3] sm:aspect-square p-2 sm:p-4'}`\n }\n >\n <a className=\"block h-full w-full\" href={derived.productUrl} onClick={handleProductClick}>\n {derived.imageUrl ? (\n <img\n className=\"propeller-product-card__image h-full w-full object-contain transition-transform duration-300 group-hover:scale-105\"\n src={derived.imageUrl}\n alt={derived.name}\n />\n ) : (\n <div className=\"propeller-product-card__image-placeholder flex h-full w-full items-center justify-center text-foreground-subtle\">\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-16 w-16\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n strokeWidth={1}\n />\n </svg>\n </div>\n )}\n </a>\n {derived.imageLabelValues.length > 0 ? <ProductCardBadges /> : null}\n {showFavorite ? <ProductCardFavorite /> : null}\n </div>\n );\n}\n\n/** Image-overlay badge list (e.g. \"new\", \"sale\" attributes), or the\n * injected `badgesComponent` from context when set. */\nfunction ProductCardBadges(props: {\n /** Override the badge container class. */\n className?: string;\n}) {\n const { product, derived, resolved } = useProductCard();\n const InjectedBadges = resolved.badgesComponent;\n if (InjectedBadges) {\n return (\n <InjectedBadges\n product={product}\n labels={resolved.labels}\n className={\n props.className ??\n 'propeller-product-card__badges pointer-events-none absolute left-2 top-2 flex flex-col gap-1'\n }\n />\n );\n }\n if (derived.imageLabelValues.length === 0) return null;\n return (\n <div className={props.className ?? 'propeller-product-card__badges pointer-events-none absolute left-2 top-2 flex flex-col gap-1'}>\n {derived.imageLabelValues.map((label) => (\n <span\n key={label}\n className=\"propeller-product-card__badge inline-block rounded bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground shadow-sm\"\n >\n {label}\n </span>\n ))}\n </div>\n );\n}\n\n/** Favourite (heart) toggle button — typically placed inside `<ProductCard.Image>`,\n * or the injected `favoriteComponent` from context when set.\n *\n * The default render is the inline self-contained heart button (local state\n * only, fires `onToggleFavorite`); the injected variant receives the full\n * `FavoriteComponentProps` contract (product, user, callback) so consumers\n * can plug in real favorite-list mutations. The unused import of\n * `DefaultAddToFavoriteImpl` is kept so consumers can wrap-and-call it. */\nfunction ProductCardFavorite(props: {\n /** Override the button class. */\n className?: string;\n}) {\n const { product, resolved, favorite } = useProductCard();\n const InjectedFavorite = resolved.favoriteComponent;\n if (InjectedFavorite) {\n // ProductCard's onToggleFavorite is typed as (Product, boolean) — narrower\n // than the FavoriteComponentProps contract's (Product | Cluster, boolean).\n // Adapt by accepting the wider type and narrowing the input back to Product\n // (safe because this card only ever calls back with its own product).\n const onToggleFavoriteAdapter = resolved.onToggleFavorite\n ? (item: Product | Cluster, isFavorite: boolean) =>\n resolved.onToggleFavorite!(item as Product, isFavorite)\n : undefined;\n return (\n <InjectedFavorite\n product={product}\n user={resolved.user}\n onToggleFavorite={onToggleFavoriteAdapter}\n labels={resolved.labels}\n className={props.className}\n />\n );\n }\n return (\n <button\n type=\"button\"\n onClick={favorite.toggle}\n aria-label={\n favorite.isFavorite\n ? getLabel(resolved.labels, 'removeFromFavorites', 'Remove from favourites')\n : getLabel(resolved.labels, 'addToFavorites', 'Add to favourites')\n }\n data-favorite={favorite.isFavorite ? 'true' : 'false'}\n className={\n props.className ??\n `propeller-product-card__favorite-btn absolute right-2 top-2 rounded-full border bg-card p-1.5 shadow-sm transition-colors ${favorite.isFavorite ? 'border-destructive/30 text-destructive' : 'border-border-subtle text-foreground-subtle hover:text-destructive'}`\n }\n >\n <svg\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"h-4 w-4\"\n fill={favorite.isFavorite ? 'currentColor' : 'none'}\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z\"\n />\n </svg>\n </button>\n );\n}\n\n/** Product name. `linkable` (default true) wraps it in an `<a>` to the PDP. */\nfunction ProductCardName(props: {\n /** When true (default), wraps the name in a link to the product page. */\n linkable?: boolean;\n /** Override the name element class. */\n className?: string;\n}) {\n const { derived, handleProductClick } = useProductCard();\n const linkable = props.linkable ?? true;\n const cls =\n props.className ??\n `propeller-product-card__title text-sm font-medium leading-tight text-foreground transition-colors hover:text-primary ${derived.isRow ? 'line-clamp-1' : 'line-clamp-2'}`;\n if (linkable) {\n return (\n <a className={cls} href={derived.productUrl} onClick={handleProductClick}>\n {derived.name}\n </a>\n );\n }\n return <span className={cls}>{derived.name}</span>;\n}\n\n/** Renders the product SKU. */\nfunction ProductCardSku(props: {\n /** Override the SKU element class. */\n className?: string;\n}) {\n const { derived } = useProductCard();\n if (!derived.sku) return null;\n return (\n <div className={props.className ?? 'propeller-product-card__sku font-mono text-xs text-foreground-subtle'}>\n {derived.sku}\n </div>\n );\n}\n\n/** Renders the product's short description. */\nfunction ProductCardShortDescription(props: {\n /** Override the description element class. */\n className?: string;\n}) {\n const { derived } = useProductCard();\n if (!derived.shortDescription) return null;\n return (\n <p className={props.className ?? 'propeller-product-card__description line-clamp-2 text-xs text-muted-foreground'}>\n {derived.shortDescription}\n </p>\n );\n}\n\n/** Renders the product manufacturer name. */\nfunction ProductCardManufacturer(props: {\n /** Override the manufacturer element class. */\n className?: string;\n}) {\n const { derived } = useProductCard();\n if (!derived.manufacturer) return null;\n return (\n <div className={props.className ?? 'propeller-product-card__manufacturer text-xs text-muted-foreground'}>\n {derived.manufacturer}\n </div>\n );\n}\n\n/** Renders the resolved `textLabels` attribute values as text rows. */\nfunction ProductCardTextLabels(props: {\n /** Override the label container class. */\n className?: string;\n}) {\n const { derived } = useProductCard();\n if (derived.textLabelValues.length === 0) return null;\n return (\n <div className={props.className ?? 'propeller-product-card__labels flex flex-col gap-0.5'}>\n {derived.textLabelValues.map((value) => (\n <div key={value} className=\"propeller-product-card__label text-xs text-muted-foreground\">\n {value}\n </div>\n ))}\n </div>\n );\n}\n\n/** Renders the embedded stock/availability widget for the product, or the\n * injected `stockComponent` from context when set. */\nfunction ProductCardStock(props: {\n /** Show only the availability indicator. Defaults to context `showAvailability`. */\n showAvailability?: boolean;\n}) {\n const { product, resolved } = useProductCard();\n if (!product.inventory) return null;\n const InjectedStock = resolved.stockComponent;\n if (InjectedStock) {\n return (\n <InjectedStock\n inventory={product.inventory}\n showAvailability={props.showAvailability ?? (resolved.showAvailability !== false)}\n showStock\n labels={resolved.stockLabels}\n />\n );\n }\n return (\n <ItemStock\n inventory={product.inventory}\n showAvailability={props.showAvailability ?? (resolved.showAvailability !== false)}\n showStock\n labels={resolved.stockLabels}\n />\n );\n}\n\n/** Renders the product price via the embedded `ProductPrice` component, or\n * the injected `priceComponent` from context when set. */\nfunction ProductCardPrice(props: {\n /** Tailwind text-size class for the price. Defaults to `'text-base sm:text-lg'`. */\n priceSize?: string;\n /** Override the price wrapper class. */\n className?: string;\n}) {\n const { product, derived, resolved } = useProductCard();\n if (!product?.price) return null;\n // The injected price wins over the default. The injected\n // component receives the contract's PriceComponentProps; the default\n // ProductPriceDisplay receives priceSize too (a default-only knob).\n const InjectedPrice = resolved.priceComponent;\n if (InjectedPrice) {\n return (\n <div className={props.className ?? 'propeller-product-card__price'}>\n <InjectedPrice\n price={product.price}\n includeTax={derived.useTax}\n labels={resolved.priceLabels}\n />\n </div>\n );\n }\n return (\n <div className={props.className ?? 'propeller-product-card__price'}>\n <ProductPriceDisplay\n price={product.price}\n includeTax={derived.useTax}\n priceSize={props.priceSize ?? 'text-base sm:text-lg'}\n labels={resolved.priceLabels}\n />\n </div>\n );\n}\n\n/** Renders the embedded `AddToCart` control with all pass-through props from\n * context, or the injected `addToCartComponent` when set.\n *\n * Note: the default `AddToCartImpl` accepts a richer prop set (graphqlClient,\n * configuration, etc.) than the public `AddToCartComponentProps` contract.\n * Injected components only receive the contract surface; the extra infra\n * props stay default-only. */\nfunction ProductCardAddToCart(props: {\n /** Override the AddToCart wrapper class. */\n className?: string;\n}) {\n const { product, resolved } = useProductCard();\n const InjectedAddToCart = resolved.addToCartComponent;\n if (InjectedAddToCart) {\n return (\n <InjectedAddToCart\n className={props.className ?? 'flex w-full items-center gap-2'}\n product={product}\n cartId={resolved.cartId}\n allowIncrDecr={resolved.allowIncrDecr}\n showModal={resolved.showModal}\n enableStockValidation={resolved.enableStockValidation}\n afterAddToCart={resolved.afterAddToCart}\n onProceedToCheckout={resolved.onProceedToCheckout}\n onRequestQuoteClick={resolved.onRequestQuoteClick}\n labels={resolved.addToCartLabels}\n />\n );\n }\n return (\n <AddToCartImpl\n className={props.className ?? 'flex w-full items-center gap-2'}\n graphqlClient={resolved.graphqlClient}\n user={resolved.user}\n product={product}\n cartId={resolved.cartId}\n configuration={resolved.configuration}\n childItems={resolved.childItems}\n notes={resolved.notes}\n price={resolved.price}\n createCart={resolved.createCart}\n onCartCreated={resolved.onCartCreated}\n onAddToCart={resolved.onAddToCart}\n afterAddToCart={resolved.afterAddToCart}\n showModal={resolved.showModal}\n allowIncrDecr={resolved.allowIncrDecr}\n enableStockValidation={resolved.enableStockValidation}\n language={resolved.language}\n onProceedToCheckout={resolved.onProceedToCheckout}\n labels={resolved.addToCartLabels}\n companyId={resolved.companyId}\n onRequestQuoteClick={resolved.onRequestQuoteClick}\n />\n );\n}\n\n// ── Compound default export ─────────────────────────────────────────────────\n\n// Memoized: with ProductGrid passing only stable { product, allowAddToCart }\n// and config flowing via context, shallow-equal props skip re-render of the\n// whole card subtree.\nconst MemoizedRoot = React.memo(ProductCardRoot);\n\n/**\n * Compound component. Use either:\n *\n * **Compound mode (new — preferred):**\n * ```tsx\n * <ProductCard product={p}>\n * <ProductCard.Image variant=\"grid\" />\n * <ProductCard.Name linkable />\n * <ProductCard.Sku />\n * <ProductCard.Price />\n * <ProductCard.AddToCart />\n * </ProductCard>\n * ```\n *\n * **Legacy mode (deprecated — kept for back-compat):**\n * ```tsx\n * <ProductCard product={p} showName showPrice allowAddToCart />\n * ```\n * All the show* / allow* toggles still work and render the canonical layout\n * using the compound subcomponents internally.\n */\ntype ProductCardComponent = typeof MemoizedRoot & {\n Image: typeof ProductCardImage;\n Badges: typeof ProductCardBadges;\n Favorite: typeof ProductCardFavorite;\n Name: typeof ProductCardName;\n Sku: typeof ProductCardSku;\n ShortDescription: typeof ProductCardShortDescription;\n Manufacturer: typeof ProductCardManufacturer;\n TextLabels: typeof ProductCardTextLabels;\n Stock: typeof ProductCardStock;\n Price: typeof ProductCardPrice;\n AddToCart: typeof ProductCardAddToCart;\n};\n\nconst ProductCard = MemoizedRoot as ProductCardComponent;\nProductCard.Image = ProductCardImage;\nProductCard.Badges = ProductCardBadges;\nProductCard.Favorite = ProductCardFavorite;\nProductCard.Name = ProductCardName;\nProductCard.Sku = ProductCardSku;\nProductCard.ShortDescription = ProductCardShortDescription;\nProductCard.Manufacturer = ProductCardManufacturer;\nProductCard.TextLabels = ProductCardTextLabels;\nProductCard.Stock = ProductCardStock;\nProductCard.Price = ProductCardPrice;\nProductCard.AddToCart = ProductCardAddToCart;\n\nexport default ProductCard;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport type { Product, Cluster, LocalizedString } from '@propeller-commerce/propeller-sdk-v2';\n\nexport interface ProductDescriptionProps {\n /**\n * Product or Cluster object.\n * The component reads `product.descriptions` (an array of LocalizedString)\n * and renders the matching language entry as HTML.\n */\n product: Product | Cluster;\n\n /**\n * Language code used to resolve the correct localised description.\n * Defaults to 'NL'.\n */\n language?: string;\n\n /**\n * When true, the description is initially collapsed to `maxLength` characters.\n * A \"Read more\" / \"Read less\" toggle is shown.\n * Defaults to false.\n */\n collapsed?: boolean;\n\n /**\n * Maximum number of characters shown when collapsed.\n * Set to 0 to display the entire description without truncation.\n * Defaults to 0.\n */\n maxLength?: number;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's localised HTML description, optionally collapsed to a\n * character limit with a \"Read more\" / \"Read less\" toggle.\n */\nfunction ProductDescription(props: ProductDescriptionProps) {\n const [expanded, setExpanded] = useState(false);\n // Derived from props — no state needed. Was previously set via useEffect\n // (set-state-in-effect anti-pattern) which caused an extra render per\n // prop change with no real benefit.\n function getDescription(): string {\n const product = props.product as Product;\n if (!product?.descriptions) return '';\n const lang = props.language || 'NL';\n const match = product.descriptions.find((d: LocalizedString) => d.language === lang);\n return match?.value || product.descriptions?.[0]?.value || '';\n }\n const html = getDescription();\n const maxLen = !props.maxLength || props.maxLength <= 0 ? 0 : props.maxLength;\n const shouldTruncate = !!props.collapsed && maxLen > 0\n && html.replace(/<[^>]*>/g, '').length > maxLen;\n function getTruncated(): string {\n const plain = html.replace(/<[^>]*>/g, '');\n if (maxLen === 0 || plain.length <= maxLen) return html;\n const truncated = plain.substring(0, maxLen);\n return truncated.substring(0, truncated.lastIndexOf(' ')) + '\\u2026';\n }\n return (\n <>\n {!!html ? (\n <div\n className={`propeller-product-description ${props.className || ''}`}\n data-expanded={expanded ? 'true' : 'false'}\n data-truncatable={shouldTruncate ? 'true' : 'false'}\n >\n {!shouldTruncate || expanded ? (\n <div\n className=\"propeller-product-description__content prose prose-slate max-w-none text-muted-foreground\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n ) : (\n <p className=\"propeller-product-description__truncated text-muted-foreground\">{getTruncated()}</p>\n )}\n {shouldTruncate ? (\n <button\n type=\"button\"\n className=\"propeller-product-description__toggle mt-2 text-sm font-medium text-primary hover:underline\"\n onClick={() => setExpanded((v) => !v)}\n >\n {expanded ? 'Read less' : 'Read more'}\n </button>\n ) : null}\n </div>\n ) : null}\n </>\n );\n}\n\nexport default ProductDescription;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport {\n PaginatedMediaDocumentResponse,\n MediaDocument,\n LocalizedDocument,\n LocalizedString,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductDownloadsProps {\n /**\n * Media documents for the product.\n * Obtain from `product.media.documents`.\n */\n downloads: PaginatedMediaDocumentResponse;\n\n /**\n * Language code used to resolve the correct localised document URL and label.\n */\n language: string;\n\n /**\n * Override any UI string.\n * Available keys: title, download, empty\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's downloadable media documents as a list of localised\n * download links, or an empty-state message when there are none.\n */\nfunction ProductDownloads(props: ProductDownloadsProps) {\n const items: MediaDocument[] = props.downloads?.items || [];\n const hasItems = items.length > 0;\n const lang = props.language || 'NL';\n function getDocumentUrl(doc: MediaDocument): string {\n const docs = doc.documents || [];\n const match = docs.find((d: LocalizedDocument) => d.language === lang);\n return match?.originalUrl || docs?.[0]?.originalUrl || '';\n }\n function getDocumentName(doc: MediaDocument): string {\n const alts = doc.alt || [];\n const match = alts.find((a: LocalizedString) => a.language === lang);\n return match?.value || alts?.[0]?.value || 'Download';\n }\n return (\n <div className={`propeller-product-downloads ${props.className || ''}`}>\n {hasItems ? (\n <h3 className=\"propeller-product-downloads__title text-base font-semibold text-foreground mb-3\">\n {getLabel(props.labels, 'title', 'Downloads')}\n </h3>\n ) : null}\n {hasItems ? (\n <ul className=\"propeller-product-downloads__list space-y-2\">\n {items.map((doc, index) => (\n <li className=\"propeller-product-downloads__item\" key={index}>\n {!!getDocumentUrl(doc) ? (\n <a\n target=\"_blank\"\n className=\"propeller-product-downloads__link flex items-center gap-3 rounded-container border border-border bg-card px-4 py-3 text-sm text-foreground hover:bg-muted/30 hover:border-primary/40 transition-colors group\"\n href={getDocumentUrl(doc)}\n download\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"h-5 w-5 flex-shrink-0 text-muted-foreground group-hover:text-primary transition-colors\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"\n strokeWidth={1.5}\n />\n </svg>\n <span className=\"flex-1 min-w-0 truncate\">{getDocumentName(doc)}</span>\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"h-4 w-4 flex-shrink-0 text-muted-foreground group-hover:text-primary transition-colors\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4\"\n strokeWidth={2}\n />\n </svg>\n </a>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n {!hasItems ? (\n <p className=\"propeller-product-downloads__empty text-sm text-muted-foreground\">{getLabel(props.labels, 'empty', 'No downloads')}</p>\n ) : null}\n </div>\n );\n}\n\nexport default ProductDownloads;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductGalleryProps {\n /**\n * Array of image URLs to display.\n * Obtain from: `product.media?.images?.items?.[0]?.imageVariants?.map(v => v.url)`\n * Component is in skeleton/loading state when this is an empty array.\n */\n images: string[];\n\n /** Show image thumbnails below the main image. Defaults to true. */\n showThumbnails?: boolean;\n\n /** Enable cursor-zoom-in hint on the main image. Defaults to true. */\n enableZoom?: boolean;\n\n /** Enable fullscreen lightbox when clicking the main image. Defaults to true. */\n enableLightbox?: boolean;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n}\n/**\n * Renders a product image gallery with a main image, optional thumbnail strip,\n * cursor-zoom hint and a fullscreen lightbox with prev/next navigation.\n */\nfunction ProductGallery(props: ProductGalleryProps) {\n const [selectedIndex, setSelectedIndex] = useState(0);\n const [lightboxOpen, setLightboxOpen] = useState(false);\n const images = props.images || [];\n const mainImage = images.length === 0 ? '' : images[selectedIndex] || images[0] || '';\n const hasThumbnails = images.length > 1;\n function openLightbox(): void {\n if (props.enableLightbox !== false) setLightboxOpen(true);\n }\n function prevImage(): void {\n if (images.length === 0) return;\n setSelectedIndex((idx) => (idx - 1 + images.length) % images.length);\n }\n function nextImage(): void {\n if (images.length === 0) return;\n setSelectedIndex((idx) => (idx + 1) % images.length);\n }\n return (\n <div className={`propeller-product-gallery ${props.className || ''}`}>\n <div className=\"propeller-product-gallery__stage relative aspect-square bg-card overflow-hidden\">\n {images.length === 0 ? (\n <div className=\"propeller-product-gallery__empty flex h-full w-full items-center justify-center bg-surface-hover\">\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-product-gallery__empty-icon h-24 w-24 text-foreground-subtle\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n strokeWidth={1}\n />\n </svg>\n </div>\n ) : null}\n {images.length > 0 ? (\n <img\n alt={getLabel(props.labels, 'productImageAlt', 'Product image')}\n src={mainImage}\n onClick={openLightbox}\n className={`h-full w-full object-contain p-8 transition-transform duration-200 ${props.enableZoom !== false ? 'cursor-zoom-in hover:scale-105' : ''}`}\n />\n ) : null}\n </div>\n {props.showThumbnails !== false && hasThumbnails ? (\n <div className=\"flex gap-3 mt-4 overflow-x-auto pb-2\">\n {images.map((img, index) => (\n <button\n type=\"button\"\n key={index}\n onClick={() => setSelectedIndex(index)}\n className={`propeller-product-gallery__thumbnail relative flex-shrink-0 w-20 h-20 rounded-container border-2 overflow-hidden transition-all bg-card ${selectedIndex === index ? 'border-primary ring-2 ring-primary/20' : 'border-transparent hover:border-border'}`}\n >\n <img\n className=\"w-full h-full object-contain p-1\"\n src={img}\n alt={`${getLabel(props.labels, 'productImageAlt', 'Product image')} ${index + 1}`}\n />\n </button>\n ))}\n </div>\n ) : null}\n {lightboxOpen ? (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4\"\n onClick={() => setLightboxOpen(false)}\n >\n <button\n type=\"button\"\n aria-label={getLabel(props.labels, 'closeAriaLabel', 'Close')}\n className=\"absolute top-4 right-4 z-10 rounded-full bg-white/20 p-2 text-white hover:bg-white/40 transition-colors\"\n onClick={(e) => {\n e.stopPropagation();\n setLightboxOpen(false);\n }}\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-6 w-6\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M6 18L18 6M6 6l12 12\"\n strokeWidth={2}\n />\n </svg>\n </button>\n {hasThumbnails ? (\n <button\n type=\"button\"\n aria-label={getLabel(props.labels, 'previousImageAriaLabel', 'Previous image')}\n className=\"absolute left-4 z-10 rounded-full bg-white/20 p-2 text-white hover:bg-white/40 transition-colors\"\n onClick={(e) => {\n e.stopPropagation();\n prevImage();\n }}\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-6 w-6\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M15 19l-7-7 7-7\"\n strokeWidth={2}\n />\n </svg>\n </button>\n ) : null}\n <img\n alt={getLabel(props.labels, 'productImageFullscreenAlt', 'Product image fullscreen')}\n className=\"max-h-full max-w-full object-contain rounded-lg\"\n src={mainImage}\n onClick={(e) => e.stopPropagation()}\n />\n {hasThumbnails ? (\n <button\n type=\"button\"\n aria-label={getLabel(props.labels, 'nextImageAriaLabel', 'Next image')}\n className=\"absolute right-4 z-10 rounded-full bg-white/20 p-2 text-white hover:bg-white/40 transition-colors\"\n onClick={(e) => {\n e.stopPropagation();\n nextImage();\n }}\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-6 w-6\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 5l7 7-7 7\"\n strokeWidth={2}\n />\n </svg>\n </button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default ProductGallery;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: side effects (useEffect).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\n\nimport * as React from 'react';\nimport { createContext, useContext, useEffect } from 'react';\nimport {\n GraphQLClient,\n Product,\n Cluster,\n Contact,\n Customer,\n Cart,\n CartMainItem,\n AttributeFilter,\n ProductTextFilterInput,\n ProductsResponse,\n Category,\n MediaImageProductSearchInput,\n TransformationsInput,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductSearch } from '../composables/react/useProductSearch';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { ProductGridConfigProvider, ProductGridConfig } from '../context/ProductGridContext';\nimport ProductCard from './ProductCard';\nimport ClusterCard from './ClusterCard';\n\nexport interface ProductGridProps {\n // ── Data source ──────────────────────────────────────────────────────────\n\n /**\n * Initialised Propeller SDK GraphQL client.\n * Required when `products` is not provided — used for internal data fetching.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Pre-fetched products/clusters to display.\n * When provided the component skips internal API calls entirely.\n * Pass an empty array (not undefined) to show the empty state while the\n * parent controls loading.\n */\n products?: (Product | Cluster)[];\n\n // ── Locale / pricing ─────────────────────────────────────────────────────\n\n /** Language code for product data. Defaults to 'NL'. */\n language?: string;\n\n /** Tax zone used for price calculation. Defaults to 'NL'. */\n taxZone?: string;\n\n // ── Query mode (only used when graphqlClient is provided) ─────────────────\n\n /**\n * Category ID to list products for (category-page mode).\n * When omitted alongside `term` and `brand`, `config.baseCategoryId` is used.\n */\n categoryId?: number;\n\n /**\n * Search term — passes `term` into categoryProductSearchInput and uses\n * `config.baseCategoryId` so the whole catalog is searched.\n */\n term?: string;\n\n /**\n * Manufacturer/brand name — passes `manufacturers: [brand]` into\n * categoryProductSearchInput and uses `config.baseCategoryId`.\n */\n brand?: string;\n\n // ── Layout ────────────────────────────────────────────────────────────────\n\n /** Number of columns in the grid. Accepts 2, 3, 4, 5, or 6. Defaults to 3. */\n columns?: number;\n\n // ── Loading ───────────────────────────────────────────────────────────────\n\n /**\n * Show a skeleton loader.\n * Useful when the parent controls loading state and passes `products` down.\n * The grid automatically shows a skeleton during internal fetches regardless\n * of this prop. Defaults to false.\n */\n isLoading?: boolean;\n\n // ── Custom card renderers (render-prop / slot) ────────────────────────────\n\n /**\n * Provide a custom product card renderer.\n * Falls back to the built-in `<ProductCard>` when not set.\n */\n renderProductCard?: (product: Product) => any;\n\n /**\n * Provide a custom cluster card renderer.\n * Falls back to the built-in `<ClusterCard>` when not set.\n */\n renderClusterCard?: (cluster: Cluster) => any;\n\n // ── Portal / visibility ───────────────────────────────────────────────────\n\n /**\n * Controls portal visibility mode.\n * 'open' — full e-commerce; AddToCart is visible in product cards.\n * 'semi-closed' — catalog-only; AddToCart is hidden.\n * Defaults to 'open'.\n */\n portalMode?: string;\n\n /** Authenticated user passed through to ProductCard / AddToCart. */\n user?: Contact | Customer | null;\n\n /** Active company ID from the company switcher. Overrides user's default company for price calculation. Triggers a re-fetch when changed. */ companyId?: number;\n /** * When true, tax-inclusive (gross) price is the leading price. * Defaults to false. */ includeTax?: boolean;\n /** * Enables stock validation inside AddToCart. * Blocks add when requested quantity exceeds available stock. * Defaults to false. */ stockValidation?: boolean;\n /** * When false, hides the AddToCart control in product cards. * ClusterCards always show their \"View cluster\" navigation button. * Defaults to true. */ allowAddToCart?: boolean;\n /* ── External hooks ───────────────────────────────────────────────────────── */ /** * Called after each internal data fetch with the filterable attributes * returned by the API (for driving a sibling FiltersSidebar). */ onFiltersChange?: (\n filters: AttributeFilter[]\n ) => void;\n /** * Active text filters to apply — built by the parent from FiltersSidebar * `onFilterChange` callbacks. Each entry maps to a `textFilters` input * row in the CategoryService query. * When this prop changes the grid automatically re-fetches (page resets to 1). */ textFilters?: ProductTextFilterInput[];\n /** * Active price range lower bound from the FiltersSidebar `onPriceChange`. * Triggers a re-fetch when changed. */ priceFilterMin?: number;\n /** * Active price range upper bound from the FiltersSidebar `onPriceChange`. * Triggers a re-fetch when changed. */ priceFilterMax?: number;\n /** * Called when sort state changes internally (for syncing a sibling toolbar). */ onSortChange?: (\n field: string,\n order: string\n ) => void;\n /** * Called after each internal data fetch with the min/max price of the * current product set — use to populate a price range slider in the parent. */ onPriceBoundsChange?: (\n min: number,\n max: number\n ) => void;\n /** * Called after each fetch with the total number of products found — * use to display a result count in the parent toolbar. */ onItemsFoundChange?: (\n count: number\n ) => void;\n /** * Called after each fetch with the number of items visible on the current page * (after client-side language filtering). */ onPageItemCountChange?: (\n count: number\n ) => void;\n /** * Called when the user clicks Previous / Next in the built-in pagination — * use to keep the parent URL / page state in sync. */ onPageChange?: (\n page: number\n ) => void;\n /** * Called after each successful internal data fetch with the full * ProductsResponse object — use to drive an external GridPagination * component by passing the result as its `products` prop. */ onProductsResponse?: (\n products: ProductsResponse\n ) => void;\n /** * Called after each successful internal data fetch with the full * Category object — use to populate sibling components like GridTitle, * CategoryDescription, and CategoryShortDescription. */ onCategoryChange?: (\n category: Category\n ) => void;\n /** * Called whenever the internal loading state changes. * Use to disable sibling components (e.g. GridFilters) while a fetch is in flight. */ onLoadingChange?: (\n isLoading: boolean\n ) => void;\n /** * Externally controlled current page. * When provided, the grid uses this value instead of its internal page * counter. Wire this to the `onPageChange` callback from a sibling * GridPagination so the two components stay in sync. * When changed the grid automatically re-fetches. */ page?: number;\n /** * Number of products per page. Defaults to 12. * When changed the grid automatically re-fetches (page resets to 1). */ pageSize?: number;\n /** * Sort field to use (e.g. 'NAME', 'PRICE'). * When provided overrides internal sort state. * When changed the grid automatically re-fetches (page resets to 1). */ sortField?: string;\n /** * Sort direction: 'ASC' or 'DESC'. * Only used when sortField is also provided. * When changed the grid automatically re-fetches (page resets to 1). */ sortOrder?: string;\n /* ── Configuration ──────────────────────────────────────────────────────── */\n /**\n * Configuration object providing:\n * imageSearchFiltersGrid, imageVariantFiltersMedium — passed to CategoryService\n * baseCategoryId — used when querying by term or brand\n * urls.getProductUrl / urls.getClusterUrl — for card URL generation\n */\n configuration?: {\n baseCategoryId?: number;\n imageSearchFiltersGrid?: MediaImageProductSearchInput;\n imageVariantFiltersMedium?: TransformationsInput;\n urls?: {\n getProductUrl?: (p: Product) => string;\n getClusterUrl?: (c: Cluster) => string;\n };\n };\n /* ── ProductCard / AddToCart pass-through props ─────────────────────────── */ /** ID of an existing cart to add items into. */ cartId?: string;\n /** * Auto-create a cart when none is available. * Always pair with `onCartCreated` to persist the new cart ID. */ createCart?: boolean;\n /** Called after AddToCart creates a new cart internally. */ onCartCreated?: (cart: Cart) => void;\n /** Called after every successful add-to-cart operation. */ afterAddToCart?: (\n cart: Cart,\n item?: CartMainItem\n ) => void;\n /** * When true, AddToCart shows a success modal instead of a toast. * Defaults to false. */ showModal?: boolean;\n /** * Render − / + stepper buttons in AddToCart. * Defaults to true. */ allowIncrDecr?: boolean;\n /** Called when \"Proceed to checkout\" is clicked in the AddToCart modal. */ onProceedToCheckout?: () => void;\n /** Called when \"Request a Quote\" is clicked in the AddToCart modal. */ onRequestQuoteClick?: (\n cart: Cart\n ) => void;\n /** * Label overrides forwarded directly to the embedded AddToCart component. * Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding, * modalTitle, quantity, continueShopping, proceedToCheckout */ addToCartLabels?: Record<\n string,\n string\n >;\n /* ── Stock display ───────────────────────────────────────────────────────── */ /** * Show the stock / availability widget on each product card. * Forwarded directly to `ProductCard.showStock`. * Defaults to false. */ showStock?: boolean;\n /** * Show only the availability indicator inside the stock widget. * Forwarded to `ProductCard.showAvailability`. * Defaults to true. */ showAvailability?: boolean;\n /** * Show the price below the product name. * Defaults to true. */ showPrice?: boolean;\n /** * Label overrides forwarded to the embedded ItemStock component inside each card. * Keys: inStock, outOfStock, lowStock, available, notAvailable, pieces */ stockLabels?: Record<\n string,\n string\n >;\n\n /** Translated labels forwarded to the embedded `<ProductPrice>` display\n * inside each `<ProductCard>`. See `ProductPriceProps.labels` for slugs. */\n priceLabels?: Record<string, string>;\n\n /** Translated labels forwarded to embedded `<ProductCard>` instances.\n * See `ProductCardProps.labels` for slugs. */\n productCardLabels?: Record<string, string>;\n\n /** Translated labels forwarded to embedded `<ClusterCard>` instances.\n * See `ClusterCardProps.labels` for slugs. */\n clusterCardLabels?: Record<string, string>;\n\n /* ── Card interaction ────────────────────────────────────────────────────── */ /** Show a heart-icon favourite toggle on each card. */ enableAddFavorite?: boolean;\n /** * Called when a favourite is toggled on any card. * Receives the full Product or Cluster object and the new favourite state. */ onToggleFavorite?: (\n item: Product | Cluster,\n isFavorite: boolean\n ) => void;\n /** * Called when a cluster card name, image, or \"View cluster\" button is * clicked — use for SPA-style routing instead of full-page navigation. */ onClusterClick?: (\n cluster: Cluster\n ) => void;\n /** * Called when a product card name or image is clicked — use for SPA * routing instead of full-page navigation. */ onProductClick?: (\n product: Product\n ) => void;\n /** Extra CSS class applied to the root element. */ className?: string;\n\n /**\n * Compound API: when provided, the grid renders these children inside a\n * `<ProductGridContext>` instead of its built-in grid+pagination layout.\n * Subcomponents (`<ProductGrid.Items>`, `<ProductGrid.Pagination>`) read\n * the search state via the context; consumers control the layout.\n *\n * @example\n * <ProductGrid categoryId={17}>\n * <ProductGrid.Items renderItem={(item) => <ProductCard product={item as Product} />} />\n * <ProductGrid.Pagination />\n * </ProductGrid>\n */\n children?: React.ReactNode;\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n\n // ───── Extension API ─────\n // Sub-component injection — cascades through ProductGridConfig context\n // to every nested ProductCard / ClusterCard.\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n addToCartComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').AddToCartComponentProps>;\n imageComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ImageComponentProps>;\n badgesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').BadgesComponentProps>;\n favoriteComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').FavoriteComponentProps>;\n\n // Iteration-level: replace the whole ProductCard / ClusterCard. The custom\n // component receives the same props the default would. If a consumer wants\n // to honor cascaded sub-component slots inside their custom card, they\n // read ProductGridConfig via `useProductGridConfig()`.\n productCardComponent?: React.ComponentType<import('./ProductCard').ProductCardProps>;\n clusterCardComponent?: React.ComponentType<import('./ClusterCard').ClusterCardProps>;\n\n // Insertion slots — render before/after each iterated item without\n // forking ProductGrid. Common use cases: promo banners between cards,\n // bulk-select checkboxes, admin metadata rows.\n beforeItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n afterItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n}\n\n// ── Compound context ────────────────────────────────────────────────────────\n\n/**\n * Shared state the compound subcomponents read. Populated by `<ProductGrid>`\n * around its children. Not exported — consumers compose subcomponents under\n * `<ProductGrid>` rather than reading the context directly.\n */\ninterface ProductGridContextValue {\n items: (Product | Cluster)[];\n itemsFound: number;\n isLoading: boolean;\n currentPage: number;\n totalPages: number;\n goToPage: (page: number) => void;\n gridConfig: ProductGridConfig;\n // Iteration-level insertion slots from parent <ProductGrid> props.\n beforeItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n afterItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n}\n\nconst ProductGridSearchContext = createContext<ProductGridContextValue | null>(null);\n\nfunction useProductGrid(): ProductGridContextValue {\n const ctx = useContext(ProductGridSearchContext);\n if (!ctx) {\n throw new Error(\n '<ProductGrid.X> must be rendered inside <ProductGrid>. ' +\n 'Got null context — wrap the subcomponents in <ProductGrid categoryId={...}>...</ProductGrid>.'\n );\n }\n return ctx;\n}\n\n/**\n * Renders a responsive grid of product and cluster cards with skeleton\n * loading, empty state and pagination. Supports a built-in layout or a\n * compound API (`<ProductGrid.Items>`, `<ProductGrid.Pagination>`).\n *\n * @remarks Uses {@link useProductSearch} for fetching, filtering and paging.\n */\nfunction ProductGrid(rawProps: ProductGridProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const {\n displayProducts,\n itemsFound,\n isLoading,\n currentPage,\n totalPages,\n fetchProducts,\n goToPage,\n } = useProductSearch({\n graphqlClient: props.graphqlClient,\n products: props.products,\n categoryId: props.categoryId,\n term: props.term,\n brand: props.brand,\n language: props.language,\n taxZone: props.taxZone,\n user: props.user,\n companyId: props.companyId,\n textFilters: props.textFilters,\n priceFilterMin: props.priceFilterMin,\n priceFilterMax: props.priceFilterMax,\n sortField: props.sortField,\n sortOrder: props.sortOrder,\n pageSize: props.pageSize,\n configuration: props.configuration || {},\n onFiltersChange: props.onFiltersChange,\n onPriceBoundsChange: props.onPriceBoundsChange,\n onItemsFoundChange: props.onItemsFoundChange,\n onPageChange: props.onPageChange,\n onProductsResponse: props.onProductsResponse,\n onCategoryChange: props.onCategoryChange,\n });\n\n function isClusterItem(item: Product | Cluster): item is Cluster {\n return 'clusterId' in item && !!item.clusterId;\n }\n\n function getGridColsClass(): string {\n const cols = (props.columns as number) || 3;\n if (cols === 1) return 'flex flex-col gap-4';\n if (cols === 2) return 'grid grid-cols-2 gap-3 sm:gap-6 auto-rows-fr';\n if (cols === 4) return 'grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6 auto-rows-fr';\n if (cols === 5) return 'grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-6 auto-rows-fr';\n if (cols === 6) return 'grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-6 auto-rows-fr';\n return 'grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-6 auto-rows-fr';\n }\n\n useEffect(() => {\n if (props.onLoadingChange) props.onLoadingChange(isLoading);\n }, [isLoading]);\n\n useEffect(() => {\n if (props.page !== undefined) goToPage(props.page);\n }, [props.page]);\n\n function handlePageChange(page: number) {\n goToPage(page);\n if (props.onPageChange) props.onPageChange(page);\n }\n\n function getIsLoading(): boolean {\n return !!(props.isLoading as boolean) || isLoading;\n }\n\n function showAddToCart(): boolean {\n const mode = (props.portalMode as string) || 'open';\n const allow = (props.allowAddToCart as boolean) !== false;\n return mode === 'open' && allow;\n }\n\n function getSkeletonItems(): number[] {\n const cols = (props.columns as number) || 3;\n const count = cols === 2 ? 4 : cols === 4 ? 8 : cols === 5 ? 10 : cols === 6 ? 12 : 6;\n const items: number[] = [];\n for (let i = 0; i < count; i++) items.push(i);\n return items;\n }\n\n // Single config object provided to the card subtree, replacing the ~20 props\n // ProductGrid otherwise cascades to ProductCard/ClusterCard. Resolves the\n // stockValidation -> enableStockValidation alias. Inline handlers + this\n // object are auto-memoized by the React Compiler (this project's eslint\n // config enforces react-hooks/preserve-manual-memoization — manual\n // useCallback/useMemo here would defeat the Compiler), so the React.memo'd\n // cards still skip re-render when nothing relevant changed (rbp §5.2/§5.4).\n const gridConfig: ProductGridConfig = {\n columns: (props.columns as number) || 3,\n showPrice: props.showPrice as boolean,\n showStock: props.showStock as boolean,\n showAvailability: props.showAvailability as boolean,\n enableAddFavorite: props.enableAddFavorite as boolean,\n allowAddToCart: props.allowAddToCart as boolean,\n createCart: props.createCart as boolean,\n showModal: props.showModal as boolean,\n allowIncrDecr: props.allowIncrDecr,\n enableStockValidation: props.stockValidation as boolean,\n cartId: props.cartId as string,\n stockLabels: props.stockLabels,\n priceLabels: props.priceLabels,\n addToCartLabels: props.addToCartLabels,\n onCartCreated: props.onCartCreated,\n afterAddToCart: props.afterAddToCart,\n onProceedToCheckout: props.onProceedToCheckout,\n onRequestQuoteClick: props.onRequestQuoteClick,\n onToggleFavorite: (item: Product | Cluster, isFav: boolean) =>\n props.onToggleFavorite?.(item, isFav),\n onProductClick: (p: Product) => props.onProductClick?.(p),\n onClusterClick: (c: Cluster) => props.onClusterClick?.(c),\n // Extension API — cascade to nested cards via context.\n priceComponent: props.priceComponent,\n stockComponent: props.stockComponent,\n addToCartComponent: props.addToCartComponent,\n imageComponent: props.imageComponent,\n badgesComponent: props.badgesComponent,\n favoriteComponent: props.favoriteComponent,\n productCardComponent: props.productCardComponent,\n clusterCardComponent: props.clusterCardComponent,\n };\n\n // ── Compound mode ────────────────────────────────────────────────────────\n // When the consumer supplies children, render them inside the search\n // context instead of the built-in grid+pagination layout. Subcomponents\n // (<ProductGrid.Items>, <ProductGrid.Pagination>) read state from context.\n if (rawProps.children !== undefined) {\n const compoundCtx: ProductGridContextValue = {\n items: displayProducts,\n itemsFound,\n isLoading: getIsLoading(),\n currentPage,\n totalPages,\n goToPage: handlePageChange,\n gridConfig,\n beforeItem: props.beforeItem,\n afterItem: props.afterItem,\n };\n return (\n <ProductGridConfigProvider value={gridConfig}>\n <ProductGridSearchContext.Provider value={compoundCtx}>\n <div\n className={`propeller-product-grid w-full ${(props.className as string) || ''}`}\n data-loading={getIsLoading() ? 'true' : 'false'}\n data-mode=\"compound\"\n >\n {rawProps.children}\n </div>\n </ProductGridSearchContext.Provider>\n </ProductGridConfigProvider>\n );\n }\n\n return (\n <ProductGridConfigProvider value={gridConfig}>\n <div\n className={`propeller-product-grid w-full ${(props.className as string) || ''}`}\n data-loading={getIsLoading() ? 'true' : 'false'}\n >\n {getIsLoading() ? (\n <div className={`propeller-product-grid__skeleton-grid ${getGridColsClass()}`}>\n {getSkeletonItems()?.map((_, idx) => (\n <div\n className=\"propeller-product-grid__skeleton-card flex flex-col overflow-hidden rounded-container border border-border bg-card shadow-sm\"\n key={idx}\n >\n <div className=\"propeller-product-grid__skeleton-image aspect-square bg-surface-hover animate-pulse\" />\n <div className=\"p-4 flex flex-col gap-2 flex-1\">\n <div className=\"propeller-product-grid__skeleton-line h-3 bg-surface-hover animate-pulse rounded w-1/4\" />\n <div className=\"propeller-product-grid__skeleton-line h-4 bg-surface-hover animate-pulse rounded w-3/4\" />\n <div className=\"propeller-product-grid__skeleton-line h-4 bg-surface-hover animate-pulse rounded w-1/2\" />\n <div className=\"mt-auto pt-2\">\n <div className=\"propeller-product-grid__skeleton-line h-5 bg-surface-hover animate-pulse rounded w-1/3\" />\n </div>\n </div>\n {showAddToCart() ? (\n <div className=\"p-4 pt-0\">\n <div className=\"flex items-center gap-2\">\n <div className=\"propeller-product-grid__skeleton-line h-9 flex-1 bg-surface-hover animate-pulse rounded\" />\n <div className=\"propeller-product-grid__skeleton-line h-9 flex-1 bg-surface-hover animate-pulse rounded\" />\n </div>\n </div>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n {!getIsLoading() ? (\n <>\n {displayProducts.length === 0 ? (\n <div className=\"propeller-product-grid__empty text-center py-24 bg-surface-hover rounded-container border border-dashed border-border\">\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-product-grid__empty-icon mx-auto h-12 w-12 text-foreground-subtle\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4\"\n strokeWidth={1}\n />\n </svg>\n <h3 className=\"propeller-product-grid__empty-title mt-4 text-lg font-semibold text-foreground\"> {getLabel(props.labels, 'noProductsFound', 'No products found')} </h3>\n <p className=\"propeller-product-grid__empty-message mt-1 text-sm text-muted-foreground\">\n {' '}\n {getLabel(props.labels, 'noProductsHelp', 'Try adjusting your filters or search term.')}{' '}\n </p>\n </div>\n ) : null}{' '}\n {displayProducts.length > 0 ? (\n <div className={`propeller-product-grid__grid ${getGridColsClass()}`}>\n {displayProducts?.map((item, idx) => {\n // Whole-card swap — injected override wins over default.\n const ProductCardImpl = props.productCardComponent ?? ProductCard;\n const ClusterCardImpl = props.clusterCardComponent ?? ClusterCard;\n return (\n <React.Fragment\n key={(item as Product).productId || (item as Cluster).clusterId || idx}\n >\n {props.beforeItem?.(item, idx)}\n <div>\n {isClusterItem(item) ? (\n <>\n {!props.renderClusterCard ? (\n <ClusterCardImpl\n cluster={item as Cluster}\n labels={props.clusterCardLabels}\n stockLabels={props.stockLabels}\n />\n ) : null}\n </>\n ) : null}\n {!isClusterItem(item) ? (\n <>\n {!props.renderProductCard ? (\n <ProductCardImpl\n product={item as Product}\n allowAddToCart={showAddToCart()}\n labels={props.productCardLabels}\n stockLabels={props.stockLabels}\n priceLabels={props.priceLabels}\n addToCartLabels={props.addToCartLabels}\n />\n ) : null}\n </>\n ) : null}\n </div>\n {props.afterItem?.(item, idx)}\n </React.Fragment>\n );\n })}\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n </ProductGridConfigProvider>\n );\n}\n// ── Compound subcomponents ──────────────────────────────────────────────────\n\n/**\n * The items grid. By default renders `<ProductCard>` / `<ClusterCard>` for\n * each item — but `renderItem` is the proper extension point: pass a\n * function that returns whatever shape you want (compound `<ProductCard>`\n * with custom subcomponents, a fully custom card, a list row, etc.).\n *\n * Reads `items`, `isLoading`, and `gridConfig.columns` from the parent\n * `<ProductGrid>` context. Also handles the loading skeleton and empty state.\n */\nfunction ProductGridItems(props: {\n /** Custom per-item renderer. Falls back to built-in `<ProductCard>`/`<ClusterCard>`. */\n renderItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n /** Custom empty-state node. Defaults to the built-in \"No products found\" panel. */\n empty?: React.ReactNode;\n /** Extra class on the grid container. */\n className?: string;\n /** Translated labels for the default empty-state texts; ignored when `empty` is set. */\n labels?: Record<string, string>;\n}) {\n const { items, isLoading, gridConfig, beforeItem, afterItem } = useProductGrid();\n const cols = gridConfig.columns || 3;\n // Whole-card swap honored inside compound <ProductGrid.Items> too.\n const ProductCardImpl = (gridConfig.productCardComponent ?? ProductCard) as React.ComponentType<\n { product: Product } & Record<string, unknown>\n >;\n const ClusterCardImpl = (gridConfig.clusterCardComponent ?? ClusterCard) as React.ComponentType<\n { cluster: Cluster } & Record<string, unknown>\n >;\n const gridClass =\n cols === 1\n ? 'flex flex-col gap-4'\n : cols === 2\n ? 'grid grid-cols-2 gap-3 sm:gap-6 auto-rows-fr'\n : cols === 4\n ? 'grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6 auto-rows-fr'\n : cols === 5\n ? 'grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-6 auto-rows-fr'\n : cols === 6\n ? 'grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-6 auto-rows-fr'\n : 'grid grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-6 auto-rows-fr';\n\n if (isLoading) {\n const skeletonCount = cols === 2 ? 4 : cols === 4 ? 8 : cols === 5 ? 10 : cols === 6 ? 12 : 6;\n return (\n <div className={`propeller-product-grid__skeleton-grid ${gridClass} ${props.className ?? ''}`}>\n {Array.from({ length: skeletonCount }).map((_, idx) => (\n <div\n key={idx}\n className=\"propeller-product-grid__skeleton-card flex flex-col overflow-hidden rounded-container border border-border bg-card shadow-sm\"\n >\n <div className=\"propeller-product-grid__skeleton-image aspect-square bg-surface-hover animate-pulse\" />\n <div className=\"p-4 flex flex-col gap-2 flex-1\">\n <div className=\"propeller-product-grid__skeleton-line h-3 bg-surface-hover animate-pulse rounded w-1/4\" />\n <div className=\"propeller-product-grid__skeleton-line h-4 bg-surface-hover animate-pulse rounded w-3/4\" />\n <div className=\"propeller-product-grid__skeleton-line h-4 bg-surface-hover animate-pulse rounded w-1/2\" />\n </div>\n </div>\n ))}\n </div>\n );\n }\n\n if (items.length === 0) {\n return (\n <>\n {props.empty ?? (\n <div className=\"propeller-product-grid__empty text-center py-24 bg-surface-hover rounded-container border border-dashed border-border\">\n <h3 className=\"propeller-product-grid__empty-title mt-4 text-lg font-semibold text-foreground\">\n {getLabel(props.labels, 'noProductsFound', 'No products found')}\n </h3>\n <p className=\"propeller-product-grid__empty-message mt-1 text-sm text-muted-foreground\">\n {getLabel(props.labels, 'noProductsHelp', 'Try adjusting your filters or search term.')}\n </p>\n </div>\n )}\n </>\n );\n }\n\n return (\n <div className={`propeller-product-grid__grid ${gridClass} ${props.className ?? ''}`}>\n {items.map((item, idx) => {\n const isCluster = 'clusterId' in item && !!(item as Cluster).clusterId;\n const key = (item as Product).productId || (item as Cluster).clusterId || idx;\n return (\n <React.Fragment key={key}>\n {beforeItem?.(item, idx)}\n <div>\n {props.renderItem\n ? props.renderItem(item, idx)\n : isCluster\n ? <ClusterCardImpl cluster={item as Cluster} />\n : <ProductCardImpl product={item as Product} />}\n </div>\n {afterItem?.(item, idx)}\n </React.Fragment>\n );\n })}\n </div>\n );\n}\n\n/**\n * Pagination control wired to the parent ProductGrid context. Compact \"Prev /\n * Page X of Y / Next\" style by default — a future enhancement could expose\n * `style=\"full\"` matching GridPagination. For complex pagination, render\n * GridPagination directly (it accepts the same context fields as props).\n */\nfunction ProductGridPagination(props: {\n /** Extra class on the pagination nav element. */\n className?: string;\n /** Translated labels for Previous / Next / Page-of texts. */\n labels?: Record<string, string>;\n}) {\n const { currentPage, totalPages, goToPage, isLoading } = useProductGrid();\n if (totalPages <= 1) return null;\n return (\n <nav\n className={props.className ?? 'propeller-product-grid__pagination flex items-center justify-center gap-3 mt-6'}\n aria-label={getLabel(props.labels, 'paginationAriaLabel', 'Pagination')}\n >\n <button\n type=\"button\"\n className=\"px-3 py-1.5 rounded-control border border-border text-sm disabled:opacity-50\"\n disabled={currentPage <= 1 || isLoading}\n onClick={() => goToPage(currentPage - 1)}\n >\n {getLabel(props.labels, 'previous', 'Previous')}\n </button>\n <span className=\"text-sm text-muted-foreground\">\n {getLabel(props.labels, 'page', 'Page')} {currentPage} {getLabel(props.labels, 'of', 'of')} {totalPages}\n </span>\n <button\n type=\"button\"\n className=\"px-3 py-1.5 rounded-control border border-border text-sm disabled:opacity-50\"\n disabled={currentPage >= totalPages || isLoading}\n onClick={() => goToPage(currentPage + 1)}\n >\n {getLabel(props.labels, 'next', 'Next')}\n </button>\n </nav>\n );\n}\n\n// ── Compound default export ─────────────────────────────────────────────────\n\ntype ProductGridComponent = typeof ProductGrid & {\n Items: typeof ProductGridItems;\n Pagination: typeof ProductGridPagination;\n};\n\nconst ProductGridCompound = ProductGrid as ProductGridComponent;\nProductGridCompound.Items = ProductGridItems;\nProductGridCompound.Pagination = ProductGridPagination;\n\nexport default ProductGridCompound;\n","'use client';\n\nimport React from 'react';\nimport { getLanguageString } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { ImageComponentProps } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Default product / cluster image renderer for the extension API.\n *\n * Standalone implementation of the `ImageComponentProps` contract — accepts a\n * `product` OR `cluster`, picks the best image URL for the consumer's\n * language, and renders an `<img>` with lazy loading.\n *\n * URL resolution preference, applied across `product.media.images.items`\n * (or the cluster's `defaultProduct` equivalent):\n * 1. The first `MediaImage` whose `imageVariants` has an entry matching\n * the target `language`.\n * 2. The first `MediaImage` whose plain `images` (LocalizedImage) has an\n * entry matching the target `language`.\n * 3. The first available `imageVariants[0].url` across any media item\n * (single-language fallback so products always have an image).\n * 4. The first available `images[0].originalUrl` across any media item\n * (final fallback before the placeholder).\n *\n * Note: the SDK helper `getProductImageUrl` returns `items[0].imageVariants[0].url`\n * unconditionally — no language filter. This component does the filtering\n * client-side so a standalone `<DefaultProductImage>` (e.g. inside a\n * consumer-built card) is correct even when the upstream fetch didn't filter\n * media by language.\n */\ninterface LocalizedImage {\n language?: string;\n originalUrl?: string;\n}\n\ninterface ImageVariant {\n language?: string;\n url?: string;\n name?: string;\n}\n\ninterface MediaItem {\n images?: LocalizedImage[];\n imageVariants?: ImageVariant[];\n}\n\n/**\n * Pick the best image URL across a product's `media.images.items` list,\n * preferring (in order):\n * 1. an `imageVariant.url` whose `language` matches `target`\n * 2. an `image.originalUrl` whose `language` matches `target`\n * 3. the first available `imageVariant.url` (any language)\n * 4. the first available `image.originalUrl` (any language)\n * 5. null when no URL is found\n */\nfunction pickImageUrl(mediaItems: MediaItem[], target: string): string | null {\n if (!mediaItems || mediaItems.length === 0) return null;\n\n // Pass 1: prefer transformations matching the target language.\n for (const m of mediaItems) {\n const match = m.imageVariants?.find((v) => v.language === target && v.url);\n if (match?.url) return match.url;\n }\n // Pass 2: prefer original images matching the target language.\n for (const m of mediaItems) {\n const match = m.images?.find((i) => i.language === target && i.originalUrl);\n if (match?.originalUrl) return match.originalUrl;\n }\n // Pass 3: any transformation URL.\n for (const m of mediaItems) {\n const first = m.imageVariants?.find((v) => v.url);\n if (first?.url) return first.url;\n }\n // Pass 4: any original URL.\n for (const m of mediaItems) {\n const first = m.images?.find((i) => i.originalUrl);\n if (first?.originalUrl) return first.originalUrl;\n }\n return null;\n}\n\nexport function DefaultProductImage(props: ImageComponentProps): React.JSX.Element | null {\n const { product, cluster, className } = props;\n const targetLanguage = props.language ?? 'NL';\n\n const mediaItems = (() => {\n const target = product ?? (cluster as { defaultProduct?: unknown } | undefined)?.defaultProduct ?? cluster;\n return (\n (target as { media?: { images?: { items?: unknown[] } } } | undefined)?.media?.images?.items ?? []\n ) as MediaItem[];\n })();\n\n const url = pickImageUrl(mediaItems, targetLanguage);\n\n const altText = (() => {\n const target = product ?? cluster;\n if (!target) return '';\n const name = (target as { name?: unknown }).name;\n if (Array.isArray(name)) {\n return getLanguageString(name as never, targetLanguage, '') ?? '';\n }\n return typeof name === 'string' ? name : '';\n })();\n\n if (!url) {\n return (\n <div\n className={className ?? 'propeller-default-image-placeholder flex items-center justify-center bg-surface-hover'}\n aria-hidden=\"true\"\n >\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"h-12 w-12 text-foreground-subtle\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={1}\n d=\"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n </div>\n );\n }\n\n return (\n <img\n src={url}\n alt={altText}\n className={className ?? 'h-full w-full object-contain'}\n loading=\"lazy\"\n />\n );\n}\n\nexport default DefaultProductImage;\n","'use client';\n\nimport React from 'react';\nimport { collectAttributeValues } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { BadgesComponentProps } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Default badges renderer for the extension API.\n *\n * Standalone implementation of the `BadgesComponentProps` contract — looks at\n * the product/cluster attributes for an `imageLabel` attribute (case-\n * insensitive substring match via core-ui's `collectAttributeValues`) and\n * renders each value as a small badge pill.\n *\n * The hardcoded `imageLabel` attribute name matches what `ProductCard`\n * exposes by default via its `imageLabels` prop. Consumers with a different\n * attribute taxonomy inject their own `badgesComponent`.\n */\nexport function DefaultProductBadges(props: BadgesComponentProps): React.JSX.Element | null {\n const { product, cluster, className } = props;\n const target = product ?? cluster;\n if (!target) return null;\n\n const attributes = (target as { attributes?: unknown[] }).attributes ?? [];\n const labels = collectAttributeValues(attributes as never, 'imageLabel');\n\n if (!labels || labels.length === 0) return null;\n\n return (\n <div className={className ?? 'pointer-events-none absolute left-2 top-2 flex flex-col gap-1'}>\n {labels.map((label) => (\n <span\n key={label}\n className=\"inline-block rounded bg-secondary px-2 py-0.5 text-xs font-medium text-secondary-foreground shadow-sm\"\n >\n {label}\n </span>\n ))}\n </div>\n );\n}\n\nexport default DefaultProductBadges;\n","'use client';\n\nimport React from 'react';\nimport { formatSurcharge, getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport type { ProductSurchargesComponentProps } from '@propeller-commerce/propeller-v2-core-ui';\n\n/**\n * Default surcharges renderer for the extension API.\n *\n * Standalone implementation of the `ProductSurchargesComponentProps` contract\n * — accepts either a `product` (PDP surcharges from `product.surcharges`) or\n * a `cartItem` (line-item surcharges) and renders them as a stacked list\n * with formatted amounts via core-ui's `formatSurcharge`.\n *\n * Used as the fallback when `ProductInfo` or `CartItem` has no\n * `surchargesComponent` injected.\n */\nexport function DefaultProductSurcharges(\n props: ProductSurchargesComponentProps,\n): React.JSX.Element | null {\n const { product, cartItem, includeTax, labels, className } = props;\n\n const source =\n (cartItem as { surcharges?: unknown[] } | undefined)?.surcharges ??\n (product as { surcharges?: unknown[] } | undefined)?.surcharges ??\n [];\n\n if (!source || source.length === 0) return null;\n\n return (\n <ul className={className ?? 'text-xs text-foreground-subtle space-y-0.5'}>\n {source.map((s, idx) => {\n const item = s as {\n id?: string | number;\n code?: string;\n name?: string;\n description?: string;\n };\n const key = item?.id ?? idx;\n const labelKey = item?.code ?? 'surcharge';\n const fallback = item?.description ?? item?.name ?? 'Surcharge';\n return (\n <li key={key}>\n {getLabel(labels, labelKey, fallback)}: {formatSurcharge(s as never, includeTax as never)}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport default DefaultProductSurcharges;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: side effects (useEffect).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useEffect } from 'react';\nimport {\n GraphQLClient,\n Product,\n ProductService,\n LocalizedString,\n Contact,\n Customer,\n OrderlistService,\n Orderlist,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductInfo } from '../composables/react/useProductInfo';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport DefaultProductPriceImpl from './ProductPrice';\nimport DefaultItemStockImpl from './ItemStock';\nimport DefaultAddToCartImpl from './AddToCart';\nimport DefaultAddToFavoriteImpl from './AddToFavorite';\nimport DefaultProductBundlesImpl from './ProductBundles';\nimport DefaultProductBulkPricesImpl from './ProductBulkPrices';\nimport { DefaultProductImage as DefaultProductImageImpl } from './defaults/DefaultProductImage';\nimport { DefaultProductBadges as DefaultProductBadgesImpl } from './defaults/DefaultProductBadges';\nimport { DefaultProductSurcharges as DefaultProductSurchargesImpl } from './defaults/DefaultProductSurcharges';\nimport { ProductGridConfigProvider, type ProductGridConfig } from '../context/ProductGridContext';\n\nexport interface ProductInfoProps {\n // ── Data source ──────────────────────────────────────────────────────────\n /** The authenticated user (Contact or Customer). Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer | null;\n\n /** Active company ID from the company switcher.\n * Overrides default company for price calculation.\n * Triggers a re-fetch when changed. */\n companyId?: number;\n\n /**\n * Pre-fetched product object to display.\n * When provided the component skips internal fetching.\n */\n product?: Product;\n\n /**\n * Product ID to fetch data for when no `product` prop is provided.\n * Requires `graphqlClient` to be set.\n */\n productId?: number;\n\n /**\n * Initialised Propeller SDK GraphQL client.\n * Required when `productId` is provided for internal data fetching.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Image search filter passed to ProductService.getProduct().\n * Controls how many image items are returned.\n * Example: { page: 1, offset: 20 }\n */\n imageSearchFilters?: any;\n\n /**\n * Image variant transformation filter passed to ProductService.getProduct().\n * Controls image size/format variants returned with the product.\n * Example: imageVariantFiltersLarge from @/data/defaults\n * Defaults to { transformations: [] } when omitted.\n */\n imageVariantFilters?: any;\n\n /**\n * Tax zone to use for price calculation.\n */\n taxZone?: string;\n\n /**\n * Called once the product data is loaded — either immediately (when\n * `product` prop is supplied) or after the internal fetch completes.\n * Use this to hydrate sibling components (gallery, price, descriptions, etc.).\n */\n onProductLoaded?: (product: Product) => void;\n\n // ── Display toggles ───────────────────────────────────────────────────────\n\n /** Show the product name. Defaults to true. */\n showTitle?: boolean;\n\n /** Show the product SKU. Defaults to true. */\n showSku?: boolean;\n\n // ── Locale ────────────────────────────────────────────────────────────────\n\n /** Language code used to resolve localised names. Defaults to 'NL'. */\n language?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n /**\n * Config object providing imageSearchFiltersGrid and imageVariantFiltersSmall.\n */\n configuration?: any;\n\n /**\n * Attribute codes/names to look up and display as badge overlays on the product image.\n * Each code is resolved against `product.attributes.items[].attributeDescription.code`\n * (or `.name`). Attributes with no matching value are silently omitted.\n * Example: ['new', 'sale']\n */\n imageLabels?: string[];\n\n /**\n * Attribute codes/names to look up and display as extra text rows below the product name.\n * Resolved the same way as `imageLabels`.\n * Example: ['brand', 'color']\n */\n textLabels?: string[];\n\n // ───── Extension API ─────\n // New PDP shell. Passing ANY new `show*` prop or any injection component\n // opts INTO the new shell layout. When none is passed, ProductInfo\n // preserves the legacy minimal title+SKU block (backward compat).\n showImage?: boolean;\n showBadges?: boolean;\n showFavorite?: boolean;\n showPrice?: boolean;\n showStock?: boolean;\n showAddToCart?: boolean;\n showBundles?: boolean;\n showBulkPrices?: boolean;\n showSurcharges?: boolean;\n\n imageComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ImageComponentProps>;\n badgesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').BadgesComponentProps>;\n favoriteComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').FavoriteComponentProps>;\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n addToCartComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').AddToCartComponentProps>;\n bundlesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ProductBundlesComponentProps>;\n bulkPricesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ProductBulkPricesComponentProps>;\n surchargesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ProductSurchargesComponentProps>;\n\n /**\n * Tax zone to use for ProductBundles pricing (required by ProductBundles).\n * Defaults to the `taxZone` prop or 'NL' when omitted.\n */\n bundlesTaxZone?: string;\n\n /** Optional localized label overrides forwarded to every section. */\n labels?: Record<string, string>;\n\n /** Tax-inclusive vs. tax-exclusive price toggle for price / bulk-prices / surcharges. */\n includeTax?: boolean;\n\n /** Currency symbol used by the price section. */\n currency?: string;\n\n /** Portal visibility mode forwarded to the price section. */\n portalMode?: string;\n\n beforeContent?: (product: Product) => React.ReactNode;\n afterContent?: (product: Product) => React.ReactNode;\n\n /** Compound mode opt-in. When provided, ProductInfo renders the compound\n * subtree (using <ProductInfo.X> subcomponents) and also triggers the\n * new-shell layout. Subcomponents read shared product data from context. */\n children?: React.ReactNode;\n}\n\n// ── Compound context ────────────────────────────────────────────────────────\n// Shared product data exposed to <ProductInfo.X> subcomponents. Named\n// useProductInfoContext (not useProductInfo) to avoid clashing with the\n// existing useProductInfo composable already imported from\n// '../composables/react/useProductInfo'.\n\ninterface ProductInfoContextValue {\n product: Product;\n resolved: ProductInfoProps;\n derived: {\n name: string;\n sku: string;\n language: string | undefined;\n useTax: boolean;\n currency: string | undefined;\n taxZone: string;\n bundlesTaxZone: string;\n portalMode: string | undefined;\n labels: Record<string, string> | undefined;\n user: Contact | Customer | null;\n };\n}\n\nconst ProductInfoContext = React.createContext<ProductInfoContextValue | null>(null);\n\nfunction useProductInfoContext(): ProductInfoContextValue {\n const ctx = React.useContext(ProductInfoContext);\n if (!ctx) {\n throw new Error(\n 'ProductInfo compound subcomponents must be rendered inside <ProductInfo>.',\n );\n }\n return ctx;\n}\n\n/**\n * Renders a product's heading block (name and SKU), fetching the product by ID\n * when no pre-fetched `product` is supplied.\n *\n * @remarks Uses {@link useProductInfo} to fetch product data.\n */\nfunction ProductInfo(rawProps: ProductInfoProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const { product: fetchedProduct, loading, fetchProduct } = useProductInfo(\n props.graphqlClient\n ? { graphqlClient: props.graphqlClient, language: props.language, configuration: props.configuration }\n : { graphqlClient: {} as GraphQLClient, language: props.language, configuration: props.configuration }\n );\n\n const activeProduct: Product | null = props.product || fetchedProduct;\n\n function getProductName(): string {\n if (!activeProduct) return '';\n const lang = props.language || 'NL';\n const match = activeProduct.names?.find((n: LocalizedString) => n.language === lang);\n return match?.value || activeProduct.names?.[0]?.value || '';\n }\n\n function getProductSku(): string {\n return activeProduct?.sku || '';\n }\n\n useEffect(() => {\n if (props.product) {\n if (props.onProductLoaded) {\n props.onProductLoaded(props.product);\n }\n return;\n }\n if (!props.productId || !props.graphqlClient) return;\n fetchProduct(props.productId, props.imageSearchFilters, props.imageVariantFilters);\n }, [props.productId, props.product, props.language, props.user, props.companyId]);\n\n useEffect(() => {\n if (fetchedProduct && props.onProductLoaded) {\n props.onProductLoaded(fetchedProduct);\n }\n }, [fetchedProduct]);\n\n // ───── Backward-compat heuristic ─────\n // Opt INTO the new composable PDP shell only when the caller passes any of\n // the new show*/component/before/afterContent props. With none passed,\n // ProductInfo keeps emitting the legacy minimal title+SKU block below.\n const NEW_SHELL_KEYS: ReadonlyArray<keyof ProductInfoProps> = [\n 'showImage', 'showBadges', 'showFavorite', 'showPrice', 'showStock',\n 'showAddToCart', 'showBundles', 'showBulkPrices', 'showSurcharges',\n 'imageComponent', 'badgesComponent', 'favoriteComponent', 'priceComponent',\n 'stockComponent', 'addToCartComponent', 'bundlesComponent',\n 'bulkPricesComponent', 'surchargesComponent',\n 'beforeContent', 'afterContent',\n ] as const;\n\n const useNewShell =\n rawProps.children !== undefined ||\n NEW_SHELL_KEYS.some(\n (k) => (rawProps as Record<string, unknown>)[k] !== undefined,\n );\n\n if (useNewShell && activeProduct) {\n const product = activeProduct;\n\n // Task 19: cascade slot overrides into nested components (e.g. a related-\n // products ProductSlider inside before/afterContent) via the grid-config\n // context. PDP isn't really a \"grid\" — columns:1 is the conventional\n // pass-through value when a single product hosts the provider.\n const pdpConfig: ProductGridConfig = {\n columns: 1,\n priceComponent: props.priceComponent,\n stockComponent: props.stockComponent,\n addToCartComponent: props.addToCartComponent,\n imageComponent: props.imageComponent,\n badgesComponent: props.badgesComponent,\n favoriteComponent: props.favoriteComponent,\n };\n\n const includeTax = !!(props as { includeTax?: boolean }).includeTax;\n const taxZone = (props.taxZone as string | undefined) ?? 'NL';\n const bundlesTaxZone = props.bundlesTaxZone ?? taxZone;\n const currency = (props as { currency?: string }).currency;\n const portalMode = (props as { portalMode?: string }).portalMode;\n const labels = props.labels;\n const language = props.language;\n const user = (props as { user?: Contact | Customer | null }).user ?? null;\n\n const contextValue: ProductInfoContextValue = {\n product,\n resolved: props,\n derived: {\n name: getProductName(),\n sku: getProductSku(),\n language,\n useTax: includeTax,\n currency,\n taxZone,\n bundlesTaxZone,\n portalMode,\n labels,\n user,\n },\n };\n\n // Compound mode: consumer supplied children. Render them inside the\n // standard PDP wrapper so the consumer fully controls section order and\n // composition; the shared product data is read via useProductInfoContext().\n if (rawProps.children !== undefined) {\n return (\n <ProductInfoContext.Provider value={contextValue}>\n <ProductGridConfigProvider value={pdpConfig}>\n <div className={`propeller-product-info ${(props.className as string) || ''}`}>\n {props.beforeContent ? props.beforeContent(product) : null}\n {rawProps.children}\n {props.afterContent ? props.afterContent(product) : null}\n </div>\n </ProductGridConfigProvider>\n </ProductInfoContext.Provider>\n );\n }\n\n // Default new-shell layout. Uses the compound subcomponents internally so\n // there's a single rendering path; each subcomponent honors its own\n // show*/*Component resolution and returns null when its branch doesn't\n // apply.\n return (\n <ProductInfoContext.Provider value={contextValue}>\n <ProductGridConfigProvider value={pdpConfig}>\n <div className={`propeller-product-info ${(props.className as string) || ''}`}>\n {props.beforeContent ? props.beforeContent(product) : null}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-6\">\n <div className=\"propeller-product-info__media relative\">\n {props.showImage !== false ? <ProductInfoImage /> : null}\n {props.showBadges !== false ? <ProductInfoBadges /> : null}\n </div>\n <div className=\"propeller-product-info__content space-y-4\">\n {props.showTitle !== false ? <ProductInfoTitle /> : null}\n {props.showSku !== false ? <ProductInfoSku /> : null}\n {props.showFavorite !== false ? <ProductInfoFavorite /> : null}\n {props.showPrice !== false ? <ProductInfoPrice /> : null}\n {props.showStock !== false ? <ProductInfoStock /> : null}\n {props.showAddToCart !== false ? <ProductInfoAddToCart /> : null}\n {props.showBundles !== false ? <ProductInfoBundles /> : null}\n {props.showBulkPrices !== false ? <ProductInfoBulkPrices /> : null}\n {props.showSurcharges !== false ? <ProductInfoSurcharges /> : null}\n </div>\n </div>\n {props.afterContent ? props.afterContent(product) : null}\n </div>\n </ProductGridConfigProvider>\n </ProductInfoContext.Provider>\n );\n }\n\n return (\n <div className={`propeller-product-info ${(props.className as string) || ''}`} data-loading={loading ? 'true' : 'false'}>\n {loading && !props.product ? (\n <div className=\"propeller-product-info__skeleton animate-pulse space-y-3\">\n <div className=\"propeller-product-info__skeleton-line h-4 bg-surface-hover rounded w-1/4\" />\n <div className=\"propeller-product-info__skeleton-line h-8 bg-surface-hover rounded w-3/4\" />\n </div>\n ) : null}\n {!loading || !!props.product ? (\n <>\n {props.showSku !== false && !!getProductSku() ? (\n <div className=\"text-sm font-mono text-muted-foreground mb-2\">\n SKU: {getProductSku()}\n </div>\n ) : null}\n {props.showTitle !== false && !!getProductName() ? (\n <h1 className=\"text-4xl font-bold tracking-tight text-foreground mb-4\">\n {getProductName()}\n </h1>\n ) : null}\n </>\n ) : null}\n </div>\n );\n}\n\n// ── Compound subcomponents ──────────────────────────────────────────────────\n// Each subcomponent reads the shared product data via useProductInfoContext()\n// and either delegates to its injected *Component slot or renders the default\n// markup verbatim from the legacy new-shell layout. Section-level gating\n// (e.g. BulkPrices only when product.bulkPrices is present) is preserved.\n\n/** Product image area. When `imageComponent` is injected, the consumer takes\n * over the entire image render. */\nfunction ProductInfoImage(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.imageComponent;\n if (Injected) {\n return (\n <Injected\n product={product}\n language={derived.language}\n imageSearchFilters={resolved.imageSearchFilters}\n imageVariantFilters={resolved.imageVariantFilters}\n className={props.className}\n />\n );\n }\n return (\n <DefaultProductImageImpl\n product={product}\n language={derived.language ?? 'NL'}\n imageSearchFilters={resolved.imageSearchFilters}\n imageVariantFilters={resolved.imageVariantFilters}\n className={props.className}\n />\n );\n}\n\n/** Image-overlay badges (e.g. \"new\", \"sale\" attributes). */\nfunction ProductInfoBadges(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.badgesComponent;\n if (Injected) {\n return <Injected product={product} labels={derived.labels} className={props.className} />;\n }\n return <DefaultProductBadgesImpl product={product} labels={derived.labels} className={props.className} />;\n}\n\n/** Product title (h1). Returns null when no name resolves. */\nfunction ProductInfoTitle(props: { className?: string } = {}) {\n const { derived } = useProductInfoContext();\n if (!derived.name) return null;\n return (\n <h1 className={props.className ?? 'text-2xl font-bold tracking-tight text-foreground'}>\n {derived.name}\n </h1>\n );\n}\n\n/** Product SKU row. Returns null when no SKU resolves. */\nfunction ProductInfoSku(props: { className?: string } = {}) {\n const { derived } = useProductInfoContext();\n if (!derived.sku) return null;\n return (\n <div className={props.className ?? 'text-sm font-mono text-muted-foreground'}>\n SKU: {derived.sku}\n </div>\n );\n}\n\n/** Add-to-favorites control. When `favoriteComponent` is injected, the\n * consumer takes over the entire favorite render. */\nfunction ProductInfoFavorite(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.favoriteComponent;\n if (Injected) {\n return <Injected product={product} user={derived.user} labels={derived.labels} className={props.className} />;\n }\n return (\n <DefaultAddToFavoriteImpl\n graphqlClient={resolved.graphqlClient}\n user={derived.user}\n productId={product.productId}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Product price display. Returns null when `product.price` is missing. */\nfunction ProductInfoPrice(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n if (!product.price) return null;\n const Injected = resolved.priceComponent;\n if (Injected) {\n return (\n <Injected\n price={product.price}\n includeTax={derived.useTax}\n currency={derived.currency}\n taxZone={derived.taxZone}\n labels={derived.labels}\n className={props.className}\n />\n );\n }\n return (\n <DefaultProductPriceImpl\n price={product.price}\n includeTax={derived.useTax}\n currency={derived.currency}\n taxZone={derived.taxZone}\n portalMode={derived.portalMode}\n user={derived.user}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Inventory/stock row. Returns null when `product.inventory` is missing. */\nfunction ProductInfoStock(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n if (!product.inventory) return null;\n const Injected = resolved.stockComponent;\n if (Injected) {\n return (\n <Injected\n inventory={product.inventory}\n showStock\n showAvailability\n labels={derived.labels}\n className={props.className}\n />\n );\n }\n return (\n <DefaultItemStockImpl\n inventory={product.inventory}\n showStock\n showAvailability\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Add-to-cart control. */\nfunction ProductInfoAddToCart(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.addToCartComponent;\n if (Injected) {\n return <Injected product={product} labels={derived.labels} className={props.className} />;\n }\n return (\n <DefaultAddToCartImpl\n graphqlClient={resolved.graphqlClient}\n user={derived.user}\n currency={derived.currency}\n product={product}\n configuration={resolved.configuration}\n companyId={(resolved as { companyId?: number }).companyId}\n includeTax={derived.useTax}\n language={derived.language ?? 'NL'}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Bundles section. */\nfunction ProductInfoBundles(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.bundlesComponent;\n if (Injected) {\n return <Injected product={product} labels={derived.labels} className={props.className} />;\n }\n return (\n <DefaultProductBundlesImpl\n graphqlClient={resolved.graphqlClient}\n productId={product.productId}\n taxZone={derived.bundlesTaxZone}\n includeTax={derived.useTax}\n portalMode={derived.portalMode}\n user={derived.user}\n companyId={(resolved as { companyId?: number }).companyId}\n language={derived.language ?? 'NL'}\n configuration={resolved.configuration}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Bulk-price table. Returns null when `product.bulkPrices` is missing. */\nfunction ProductInfoBulkPrices(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n if (!product.bulkPrices) return null;\n const Injected = resolved.bulkPricesComponent;\n if (Injected) {\n return (\n <Injected\n product={product}\n includeTax={derived.useTax}\n labels={derived.labels}\n className={props.className}\n />\n );\n }\n return (\n <DefaultProductBulkPricesImpl\n bulkPrices={product.bulkPrices}\n includeTax={derived.useTax}\n portalMode={derived.portalMode}\n user={derived.user}\n taxZone={derived.taxZone}\n currency={derived.currency}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n/** Surcharges section. */\nfunction ProductInfoSurcharges(props: { className?: string } = {}) {\n const { product, resolved, derived } = useProductInfoContext();\n const Injected = resolved.surchargesComponent;\n if (Injected) {\n return (\n <Injected\n product={product}\n includeTax={derived.useTax}\n labels={derived.labels}\n className={props.className}\n />\n );\n }\n return (\n <DefaultProductSurchargesImpl\n product={product}\n includeTax={derived.useTax}\n labels={derived.labels}\n className={props.className}\n />\n );\n}\n\n// ── Static attachments (compound API surface) ───────────────────────────────\n\ntype ProductInfoComponent = typeof ProductInfo & {\n Image: typeof ProductInfoImage;\n Badges: typeof ProductInfoBadges;\n Favorite: typeof ProductInfoFavorite;\n Title: typeof ProductInfoTitle;\n Sku: typeof ProductInfoSku;\n Price: typeof ProductInfoPrice;\n Stock: typeof ProductInfoStock;\n AddToCart: typeof ProductInfoAddToCart;\n Bundles: typeof ProductInfoBundles;\n BulkPrices: typeof ProductInfoBulkPrices;\n Surcharges: typeof ProductInfoSurcharges;\n};\n\nconst ProductInfoExport = ProductInfo as ProductInfoComponent;\nProductInfoExport.Image = ProductInfoImage;\nProductInfoExport.Badges = ProductInfoBadges;\nProductInfoExport.Favorite = ProductInfoFavorite;\nProductInfoExport.Title = ProductInfoTitle;\nProductInfoExport.Sku = ProductInfoSku;\nProductInfoExport.Price = ProductInfoPrice;\nProductInfoExport.Stock = ProductInfoStock;\nProductInfoExport.AddToCart = ProductInfoAddToCart;\nProductInfoExport.Bundles = ProductInfoBundles;\nProductInfoExport.BulkPrices = ProductInfoBulkPrices;\nProductInfoExport.Surcharges = ProductInfoSurcharges;\n\nexport default ProductInfoExport;\n","'use client';\n/**\n * Client wrapper around the pure `ProductPrice` component. Resolves\n * `includeTax`, `user`, `portalMode`, and `currency` from\n * `<PropellerProvider>` when the caller doesn't pass them explicitly. The\n * pure version stays exported from `/pure` for RSC use.\n */\nimport * as React from 'react';\nimport ProductPrice, { type ProductPriceProps } from './ProductPrice';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction ProductPriceWithProvider(rawProps: ProductPriceProps) {\n const props = useInfraProps(rawProps);\n return <ProductPrice {...props} />;\n}\n\nexport default ProductPriceWithProvider;\nexport type { ProductPriceProps };\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. The legacy `'use client'` header was\n * removed in C0 once verified pure. Renders directly\n * from props and can be imported into a React Server Component.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\n\nimport type { Product, Cluster, LocalizedString } from '@propeller-commerce/propeller-sdk-v2';\n\nexport interface ProductShortDescriptionProps {\n /**\n * Product or Cluster object.\n * The component reads `product.shortDescriptions` (an array of LocalizedString)\n * and renders the matching language entry as HTML.\n */\n product: Product | Cluster;\n\n /**\n * Language code used to resolve the correct localised short description.\n * Defaults to 'NL'.\n */\n language?: string;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's localised short description as HTML.\n */\nfunction ProductShortDescription(props: ProductShortDescriptionProps) {\n // Derived from props — pure render-time computation, no state needed.\n function getShortDescription(): string {\n const product = props.product as Product;\n if (!product?.shortDescriptions) return '';\n const lang = props.language || 'NL';\n const match = product.shortDescriptions.find((d: LocalizedString) => d.language === lang);\n return match?.value || product.shortDescriptions?.[0]?.value || '';\n }\n const html = getShortDescription();\n return (\n <>\n {!!html ? (\n <div\n dangerouslySetInnerHTML={{ __html: html }}\n className={`propeller-product-short-description prose prose-slate max-w-none text-muted-foreground ${props.className || ''}`}\n />\n ) : null}\n </>\n );\n}\n\nexport default ProductShortDescription;\n","'use client';\n/**\n * Client wrapper around the pure `ProductShortDescription` component.\n * Resolves `language` from `<PropellerProvider>` when the caller doesn't\n * pass it explicitly. The pure version stays exported from `/pure` for RSC\n * use.\n */\nimport * as React from 'react';\nimport ProductShortDescription, { type ProductShortDescriptionProps } from './ProductShortDescription';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nfunction ProductShortDescriptionWithProvider(rawProps: ProductShortDescriptionProps) {\n const props = useInfraProps(rawProps);\n return <ProductShortDescription {...props} />;\n}\n\nexport default ProductShortDescriptionWithProvider;\nexport type { ProductShortDescriptionProps };\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect, useRef } from 'react';\nimport { Cart, CartMainItem, Cluster, Contact, CrossupsellType, Customer, GraphQLClient, Product } from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductSlider } from '../composables/react/useProductSlider';\nimport ProductCard from './ProductCard';\nimport ClusterCard from './ClusterCard';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { ProductGridConfigProvider, ProductGridConfig } from '../context/ProductGridContext';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductSliderProps {\n // === Data source ===\n\n /** Propeller SDK GraphQL client. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** Pre-loaded products or clusters to display. When provided, skips internal fetching. */\n products?: (Product | Cluster)[];\n\n /** Product IDs to fetch internally when `products` is not provided */\n productIds?: number[];\n\n /** Cluster IDs to fetch internally when `products` is not provided */\n clusterIds?: number[];\n\n /**\n * Cross-upsell types to fetch. When provided, fetches cross-upsells for the given\n * productId/clusterId instead of fetching products by IDs.\n * Values: 'ACCESSORIES' | 'ALTERNATIVES' | 'RELATED' | 'OPTIONS' | 'PARTS'\n */\n crossUpsellTypes?: CrossupsellType[];\n\n /** Source product ID for cross-upsell lookup. Required when crossUpsellTypes is set. */\n productId?: number;\n\n /** Source cluster ID for cross-upsell lookup. Required when crossUpsellTypes is set. */\n clusterId?: number;\n\n // === Locale / pricing ===\n\n /** Language code for API requests and localized content. Resolved from PropellerProvider when omitted. */\n language?: string;\n\n /** Tax zone for price calculations */\n taxZone: string;\n\n /**\n * When true, net price (incl. tax) is the leading price.\n * Forwarded to each ProductCard / ClusterCard.\n */\n includeTax?: boolean;\n\n // === Portal / visibility ===\n\n /**\n * Controls portal visibility mode.\n * 'open' — AddToCart is shown on product cards.\n * 'semi-closed' — AddToCart is hidden (catalog-only view).\n * Defaults to 'open'.\n */\n portalMode?: string;\n\n /** Authenticated user for cart operations */\n user?: Contact | Customer | null;\n\n /**\n * Active company ID from the company switcher.\n * Overrides the user's default company for price calculation in cross-upsell fetches * and is forwarded to each embedded ProductCard / AddToCart. * Triggers a re-fetch when changed. */ companyId?: number;\n /* === Layout === */ /** Items visible per breakpoint */ itemsPerView?: {\n /** Number of items visible on mobile viewports. */\n mobile?: number;\n /** Number of items visible on tablet viewports. */\n tablet?: number;\n /** Number of items visible on desktop viewports. Defaults to `4`. */\n desktop?: number;\n };\n /** Slider title displayed above the track */ title?: string;\n /** Additional CSS class for the outer container */ containerClassName?: string;\n /* === Card stock display === */ /** * Show the stock / availability widget on each product card. * Forwarded to `ProductCard.showStock`. * Defaults to false. */ showStock?: boolean;\n /** * Show only the availability indicator (Available / Not available) inside the stock widget. * Forwarded to `ProductCard.showAvailability`. * Defaults to true. */ showAvailability?: boolean;\n /** * Label overrides forwarded to the embedded ItemStock component inside each card. * Keys: inStock, outOfStock, lowStock, available, notAvailable, pieces */ stockLabels?: Record<\n string,\n string\n >;\n /** Translated labels forwarded to the embedded `<ProductPrice>` display\n * inside each `<ProductCard>`. See `ProductPriceProps.labels` for slugs. */\n priceLabels?: Record<string, string>;\n /* === Card favourites === */ /** Show a heart-icon favourite toggle on each card. Defaults to false. */ enableAddFavorite?: boolean;\n /** * Called when a favourite is toggled on any card. * Receives the full Product or Cluster object and the new favourite state. */ onToggleFavorite?: (\n item: Product | Cluster,\n isFavorite: boolean\n ) => void;\n /* === Card navigation === */ /** Called when a product card is clicked — use for SPA-style routing. */ onProductClick?: (\n product: Product\n ) => void;\n /** Called when a cluster card is clicked — use for SPA-style routing. */ onClusterClick?: (\n cluster: Cluster\n ) => void;\n /* === AddToCart pass-through === */ /** Validate stock before adding to cart. Defaults to false. */ stockValidation?: boolean;\n /** Show increment/decrement stepper buttons in AddToCart. Defaults to true. */ showIncrDecr?: boolean;\n /** ID of an existing cart to add items to. */ cartId?: string;\n /** Auto-create a cart when none is available. Pair with onCartCreated. */ createCart?: boolean;\n /** Called after AddToCart creates a new cart internally. */ onCartCreated?: (cart: Cart) => void;\n /** Called after every successful add-to-cart. Receives the updated cart and the added item. */ afterAddToCart?: (\n cart: Cart,\n item?: CartMainItem\n ) => void;\n /** * When true, AddToCart shows a success modal instead of a toast. * Defaults to false. */ showModal?: boolean;\n /** Called when \"Proceed to checkout\" is clicked in the AddToCart modal. */ onProceedToCheckout?: () => void;\n /** Called when \"Request a Quote\" is clicked in the AddToCart modal. */ onRequestQuoteClick?: (\n cart: Cart\n ) => void;\n /** * Label overrides forwarded to the embedded AddToCart component. * Keys: add, adding, addedToCart, outOfStock, noCartId, errorAdding, * modalTitle, quantity, continueShopping, proceedToCheckout */ addToCartLabels?: Record<\n string,\n string\n >;\n\n /** Translated labels forwarded to embedded `<ProductCard>` instances. */\n productCardLabels?: Record<string, string>;\n\n /** Translated labels forwarded to embedded `<ClusterCard>` instances. */\n clusterCardLabels?: Record<string, string>;\n\n /* === Misc === */ /** Configuration object providing imageSearchFiltersGrid, imageVariantFiltersMedium, urls */ configuration?: any;\n /** * Label overrides for the slider UI. * Available keys: scrollLeft, scrollRight, noProducts, viewCluster, * ACCESSORIES, ALTERNATIVES, RELATED, OPTIONS, PARTS */ labels?: Record<\n string,\n string\n >;\n\n // ───── Extension API ─────\n // Sub-component injection — cascades through ProductGridConfig context\n // to every nested ProductCard / ClusterCard rendered in the carousel.\n priceComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').PriceComponentProps>;\n stockComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').StockComponentProps>;\n addToCartComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').AddToCartComponentProps>;\n imageComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').ImageComponentProps>;\n badgesComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').BadgesComponentProps>;\n favoriteComponent?: React.ComponentType<import('@propeller-commerce/propeller-v2-core-ui').FavoriteComponentProps>;\n\n // Iteration-level: replace the whole ProductCard / ClusterCard in the\n // carousel. Custom card receives the same props the default would.\n productCardComponent?: React.ComponentType<import('./ProductCard').ProductCardProps>;\n clusterCardComponent?: React.ComponentType<import('./ClusterCard').ClusterCardProps>;\n\n // Insertion slots — render before/after each carousel slide without\n // forking ProductSlider.\n beforeItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n afterItem?: (item: Product | Cluster, index: number) => React.ReactNode;\n}\n\n/**\n * Renders a horizontally scrollable carousel of product/cluster cards, sourced\n * from explicit items, product/cluster IDs, or cross-upsell lookups.\n *\n * @remarks Uses {@link useProductSlider} for fetching and scroll handling.\n */\nfunction ProductSlider(rawProps: ProductSliderProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const trackRef = useRef<HTMLDivElement>(null);\n const [sliderId] = useState(() => 'slider-' + Math.random().toString(36).substring(2, 9));\n\n const {\n products: fetchedItems,\n loading: isLoading,\n canScrollLeft,\n canScrollRight,\n fetchCrossupsells,\n fetchProducts,\n scrollLeft: sliderScrollLeft,\n scrollRight: sliderScrollRight,\n onScroll: sliderOnScroll,\n } = useProductSlider({\n graphqlClient: props.graphqlClient!,\n language: props.language,\n taxZone: props.taxZone,\n // Forwarded so crossupsell results are filtered to the signed-in user's\n // assortment (and priced per user/company) — same scoping the catalog and\n // search listings use. Without these, the slider can show products the\n // user can't order or open.\n user: props.user,\n companyId: props.companyId,\n configuration: props.configuration,\n });\n\n // Grid config provided to the card subtree, collapsing the cascade of\n // feature/callback props ProductSlider otherwise forwards to\n // ProductCard/ClusterCard. Inline (Compiler auto-memoizes — no manual memo).\n const gridConfig: ProductGridConfig = {\n columns: 3,\n showStock: props.showStock,\n showAvailability: props.showAvailability,\n enableAddFavorite: props.enableAddFavorite,\n createCart: props.createCart,\n showModal: props.showModal,\n allowIncrDecr: props.showIncrDecr !== false,\n enableStockValidation: props.stockValidation,\n cartId: props.cartId,\n stockLabels: props.stockLabels,\n priceLabels: props.priceLabels,\n addToCartLabels: props.addToCartLabels,\n onCartCreated: props.onCartCreated,\n afterAddToCart: props.afterAddToCart,\n onProceedToCheckout: props.onProceedToCheckout,\n onRequestQuoteClick: props.onRequestQuoteClick,\n onToggleFavorite: (item: Product | Cluster, isFav: boolean) =>\n props.onToggleFavorite?.(item, isFav),\n onProductClick: (p: Product) => handleProductClick(p),\n onClusterClick: (c: Cluster) => handleClusterClick(c),\n // Extension API — cascade to nested cards via context.\n priceComponent: props.priceComponent,\n stockComponent: props.stockComponent,\n addToCartComponent: props.addToCartComponent,\n imageComponent: props.imageComponent,\n badgesComponent: props.badgesComponent,\n favoriteComponent: props.favoriteComponent,\n productCardComponent: props.productCardComponent,\n clusterCardComponent: props.clusterCardComponent,\n };\n\n // Iteration-level card swap. Resolve once per render; default to\n // the built-in cards when no override is provided.\n const ProductCardImpl = props.productCardComponent ?? ProductCard;\n const ClusterCardImpl = props.clusterCardComponent ?? ClusterCard;\n\n function items(): (Product | Cluster)[] {\n if (props.products && props.products.length > 0) {\n return props.products;\n }\n return fetchedItems as (Product | Cluster)[];\n }\n\n function isCrossUpsellMode(): boolean {\n return !!(props.crossUpsellTypes && props.crossUpsellTypes.length > 0);\n }\n\n function crossUpsellTitle(): string {\n if (!props.crossUpsellTypes || props.crossUpsellTypes.length === 0) return '';\n const typeLabels: Record<string, string> = {\n ACCESSORIES: 'Accessories',\n ALTERNATIVES: 'Alternatives',\n RELATED: 'Related products',\n OPTIONS: 'Options',\n PARTS: 'Parts',\n };\n return props.crossUpsellTypes\n .map((t: string) => props.labels?.[t.toLowerCase()] || typeLabels[t] || t)\n .join(' & ');\n }\n\n function sliderTitle(): string | undefined {\n if (props.title !== undefined) return props.title;\n if (isCrossUpsellMode()) return crossUpsellTitle();\n return undefined;\n }\n\n function desktopCount(): number {\n return props.itemsPerView?.desktop || 4;\n }\n\n function portalMode(): string {\n return (props.portalMode as string) || 'open';\n }\n\n\n function isCluster(item: any): boolean {\n return 'clusterId' in item && !('productId' in item);\n }\n\n function getItemId(item: any): number {\n return isCluster(item) ? item.clusterId : item.productId;\n }\n\n function handleScrollLeft(): void {\n if (trackRef.current) {\n const scrollAmount = trackRef.current.clientWidth * 0.8;\n trackRef.current.scrollBy({ left: -scrollAmount, behavior: 'smooth' });\n }\n }\n\n function handleScrollRight(): void {\n if (trackRef.current) {\n const scrollAmount = trackRef.current.clientWidth * 0.8;\n trackRef.current.scrollBy({ left: scrollAmount, behavior: 'smooth' });\n }\n }\n\n function handleScroll(e: any): void {\n if (trackRef.current) {\n sliderOnScroll(trackRef.current);\n }\n }\n\n function handleProductClick(product: Product): void {\n if (props.onProductClick) {\n props.onProductClick(product);\n }\n }\n\n function handleClusterClick(cluster: Cluster): void {\n if (props.onClusterClick) {\n props.onClusterClick(cluster);\n }\n }\n\n useEffect(() => {\n if (props.products && props.products.length > 0) return;\n if (isCrossUpsellMode()) {\n // Cluster pages pass clusterId (not productId), so guard on having\n // either source — without this, sliders mounted on a cluster page\n // silently never fire and render empty.\n if (props.productId || props.clusterId) {\n fetchCrossupsells({\n productId: props.productId,\n clusterId: props.clusterId,\n types: props.crossUpsellTypes,\n });\n }\n } else if (props.productIds && props.productIds.length > 0) {\n fetchProducts(props.productIds);\n }\n }, [\n JSON.stringify(props.productIds),\n JSON.stringify(props.clusterIds),\n JSON.stringify(props.crossUpsellTypes),\n props.productId,\n props.clusterId,\n props.language,\n props.companyId,\n ]);\n\n useEffect(() => {\n /* Initialize scroll dimensions once sliderId is set and items are rendered */ if (\n sliderId &&\n items().length > 0\n ) {\n setTimeout(() => {\n if (trackRef.current) {\n sliderOnScroll(trackRef.current);\n }\n }, 50);\n }\n }, [sliderId, items().length]);\n\n return (\n <>\n {' '}\n {!(isCrossUpsellMode() && !isLoading && items().length === 0) ? (\n <>\n <div className={`propeller-product-slider ${props.containerClassName || 'mb-12'}`} data-loading={isLoading ? 'true' : 'false'}>\n {sliderTitle() || items().length > 0 ? (\n <div className=\"propeller-product-slider__header flex items-center justify-between mb-6\">\n {sliderTitle() ? <h2 className=\"propeller-product-slider__title text-2xl font-bold\">{sliderTitle()}</h2> : null}\n {items().length > desktopCount() ? (\n <div className=\"propeller-product-slider__nav flex gap-2\">\n <button\n className=\"propeller-product-slider__nav-btn propeller-product-slider__nav-btn--prev p-2 rounded-full bg-card shadow hover:bg-surface-hover transition disabled:opacity-30 disabled:cursor-not-allowed\"\n onClick={(event) => handleScrollLeft()}\n disabled={!canScrollLeft}\n aria-label={getLabel(props.labels, 'scrollLeft', 'Scroll left')}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"w-5 h-5\"\n >\n <path d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n <button\n className=\"propeller-product-slider__nav-btn propeller-product-slider__nav-btn--next p-2 rounded-full bg-card shadow hover:bg-surface-hover transition disabled:opacity-30 disabled:cursor-not-allowed\"\n onClick={(event) => handleScrollRight()}\n disabled={!canScrollRight}\n aria-label={getLabel(props.labels, 'scrollRight', 'Scroll right')}\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"w-5 h-5\"\n >\n <path d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n ) : null}\n </div>\n ) : null}\n {isLoading ? (\n <div className=\"propeller-product-slider__skeleton flex gap-6 overflow-hidden\">\n <div className=\"propeller-product-slider__skeleton-card flex-shrink-0 w-72 h-80 bg-surface-hover rounded-container animate-pulse\" />\n <div className=\"propeller-product-slider__skeleton-card flex-shrink-0 w-72 h-80 bg-surface-hover rounded-container animate-pulse\" />\n <div className=\"propeller-product-slider__skeleton-card flex-shrink-0 w-72 h-80 bg-surface-hover rounded-container animate-pulse\" />\n <div className=\"propeller-product-slider__skeleton-card flex-shrink-0 w-72 h-80 bg-surface-hover rounded-container animate-pulse\" />\n </div>\n ) : null}\n {!isLoading && items().length > 0 ? (\n <div\n ref={trackRef}\n className=\"propeller-product-slider__track flex gap-6 overflow-x-auto scroll-smooth pb-4\"\n data-slider-id={sliderId}\n onScroll={(e) => handleScroll(e)}\n style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}\n >\n <ProductGridConfigProvider value={gridConfig}>\n {items()?.map((item, index) => (\n <div\n className=\"propeller-product-slider__slide flex-shrink-0 w-[calc((100%_-_1.5rem)_/_1.5)] md:w-[calc((100%_-_3rem)_/_2.5)] lg:w-[calc((100%_-_4.5rem)_/_4)]\"\n key={getItemId(item) + '-' + index}\n >\n {props.beforeItem?.(item, index)}\n {isCluster(item) ? (\n <ClusterCardImpl\n cluster={item as Cluster}\n labels={props.clusterCardLabels}\n stockLabels={props.stockLabels}\n />\n ) : (\n <ProductCardImpl\n product={item as Product}\n allowAddToCart={portalMode() === 'open'}\n labels={props.productCardLabels}\n stockLabels={props.stockLabels}\n priceLabels={props.priceLabels}\n addToCartLabels={props.addToCartLabels}\n />\n )}\n {props.afterItem?.(item, index)}\n </div>\n ))}\n </ProductGridConfigProvider>\n </div>\n ) : null}\n {!isLoading && items().length === 0 && !props.products && !isCrossUpsellMode() ? (\n <div className=\"propeller-product-slider__empty text-center text-muted-foreground py-8\">\n {getLabel(props.labels, 'noProducts', 'No products found')}\n </div>\n ) : null}\n </div>\n </>\n ) : null}{' '}\n </>\n );\n}\nexport default ProductSlider;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: side effects (useEffect).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useEffect } from 'react';\nimport {\n AttributeResult,\n AttributeType,\n GraphQLClient,\n LocalizedString,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport type {\n AttributeTextValue,\n AttributeEnumValue,\n AttributeIntValue,\n AttributeDecimalValue,\n AttributeColorValue,\n AttributeDateTimeValue,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductSpecs } from '../composables/react/useProductSpecs';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface ProductSpecificationsProps {\n /**\n * Initialised Propeller SDK GraphQL client.\n * Required when `productId` is set — used to fetch public attributes.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Product ID to fetch attributes for.\n */\n productId?: number;\n\n /**\n * Pre-fetched attribute result items used as fallback when `productId` is not provided.\n * When `productId` is provided the component fetches its own data and this prop is ignored.\n */\n attributes?: AttributeResult[];\n\n /**\n * Language code used to resolve localised attribute labels.\n * Defaults to 'NL'.\n */\n language?: string;\n\n /**\n * Display layout for the specifications.\n * 'table' — two-column table (name | value). Default.\n * 'list' — vertical label + value stacked rows.\n */\n layout?: string;\n\n /**\n * When true, groups attributes by their group field with a heading per section.\n * When false or omitted, displays a flat ungrouped table/list. Default: false.\n */\n grouping?: boolean;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n\n/**\n * Renders a product's public attributes as a specifications table or list,\n * optionally grouped by attribute group.\n *\n * @remarks Uses {@link useProductSpecs} to fetch attribute data.\n */\nfunction ProductSpecifications(rawProps: ProductSpecificationsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const { attributes: fetchedAttributes, loading, fetchSpecs } = useProductSpecs(\n props.graphqlClient\n ? { graphqlClient: props.graphqlClient, language: props.language }\n : { graphqlClient: {} as GraphQLClient, language: props.language }\n );\n\n function getAttributes(): AttributeResult[] {\n // Prefer fetched internalAttributes; fall back to props.attributes\n const attrs = fetchedAttributes.length\n ? fetchedAttributes\n : (props.attributes as AttributeResult[]) || [];\n return attrs.filter(\n (a: AttributeResult) =>\n a.attributeDescription?.isPublic === true &&\n getAttributeValue(a) !== '' &&\n getAttributeValue(a) !== null &&\n getAttributeValue(a) !== '0'\n );\n }\n\n function getGroups(): string[] {\n const attrs = getAttributes();\n const seen: string[] = [];\n attrs.forEach((a: AttributeResult) => {\n const group = a.attributeDescription?.group || '';\n if (!seen.includes(group)) seen.push(group);\n });\n return seen;\n }\n\n function getAttributesByGroup(group: string): AttributeResult[] {\n return getAttributes().filter(\n (a: AttributeResult) => (a.attributeDescription?.group || '') === group\n );\n }\n\n function getAttributeLabel(attr: AttributeResult): string {\n const lang = (props.language as string) || 'NL';\n const descs = attr.attributeDescription?.descriptions || [];\n const match = descs.find((d: LocalizedString) => d.language === lang);\n return match?.value || attr.attributeDescription?.name || '';\n }\n\n function getAttributeValue(attr: AttributeResult): string {\n const v = attr.value;\n if (!v) return '';\n const lang = (props.language as string) || 'NL';\n // AttributeValue is a discriminated union by `type`. The SDK's base\n // interface only types `value: any`; each concrete attribute type adds a\n // field with the type-specific shape. We cast through the corresponding\n // SDK type per branch to get real autocompletion / safety on the field\n // we expect to read.\n if (v.type === AttributeType.TEXT) {\n const tv = v as AttributeTextValue;\n const entry = tv.textValues?.find((row) => row.language === lang);\n const vals = (entry?.values || []).filter(Boolean);\n return vals.join(', ');\n }\n if (v.type === AttributeType.ENUM) {\n const ev = v as AttributeEnumValue;\n const vals = (ev.enumValues || []).filter(Boolean);\n return vals.join(', ');\n }\n if (v.type === AttributeType.INT) {\n const iv = v as AttributeIntValue;\n return iv.intValue !== null && iv.intValue !== undefined ? String(iv.intValue) : '';\n }\n if (v.type === AttributeType.DECIMAL) {\n const dv = v as AttributeDecimalValue;\n return dv.decimalValue !== null && dv.decimalValue !== undefined ? String(dv.decimalValue) : '';\n }\n if (v.type === AttributeType.DATETIME) {\n return (v as AttributeDateTimeValue).dateTimeValue || '';\n }\n if (v.type === AttributeType.COLOR) {\n return (v as AttributeColorValue).colorValue || '';\n }\n const fallback = v.value;\n if (fallback === null || fallback === undefined) return '';\n if (typeof fallback === 'boolean') return fallback ? 'Yes' : 'No';\n return String(fallback);\n }\n\n function hasPublicAttributes(): boolean {\n return getAttributes().length > 0;\n }\n\n useEffect(() => {\n if (!props.productId || !props.graphqlClient) return;\n fetchSpecs(props.productId);\n }, [props.productId]);\n\n return (\n <>\n {!loading && hasPublicAttributes() ? (\n <>\n <div\n className={`propeller-product-specifications ${(props.className as string) || ''}`}\n data-layout={(props.layout as string) === 'list' ? 'list' : 'table'}\n data-grouped={props.grouping ? 'true' : 'false'}\n >\n {!props.grouping ? (\n <>\n {(props.layout as string) !== 'list' ? (\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <table className=\"w-full text-sm\">\n <tbody className=\"divide-y divide-border\">\n {getAttributes()?.map((attr, i) => (\n <tr className=\"propeller-product-specifications__row odd:bg-card even:bg-muted/20\" key={i}>\n <td className=\"px-4 py-2 font-medium text-foreground w-1/2\">\n {getAttributeLabel(attr)}\n </td>\n <td className=\"px-4 py-2 text-muted-foreground\">\n {getAttributeValue(attr)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : null}\n {(props.layout as string) === 'list' ? (\n <div className=\"space-y-3\">\n {getAttributes()?.map((attr, i) => (\n <div className=\"flex flex-col gap-0.5\" key={i}>\n <span className=\"text-xs font-medium text-muted-foreground uppercase tracking-wide\">\n {getAttributeLabel(attr)}\n </span>\n <span className=\"text-sm text-foreground\">{getAttributeValue(attr)}</span>\n </div>\n ))}\n </div>\n ) : null}\n </>\n ) : null}\n {!!props.grouping ? (\n <>\n {getGroups()?.map((group) => (\n <div className=\"mb-6\" key={group}>\n {!!group ? (\n <h4 className=\"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-2\">\n {group}\n </h4>\n ) : null}\n {(props.layout as string) !== 'list' ? (\n <div className=\"overflow-hidden rounded-lg border border-border\">\n <table className=\"w-full text-sm\">\n <tbody className=\"divide-y divide-border\">\n {getAttributesByGroup(group)?.map((attr, i) => (\n <tr className=\"propeller-product-specifications__row odd:bg-card even:bg-muted/20\" key={i}>\n <td className=\"px-4 py-2 font-medium text-foreground w-1/2\">\n {getAttributeLabel(attr)}\n </td>\n <td className=\"px-4 py-2 text-muted-foreground\">\n {getAttributeValue(attr)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : null}\n {(props.layout as string) === 'list' ? (\n <div className=\"space-y-3\">\n {getAttributesByGroup(group)?.map((attr, i) => (\n <div className=\"flex flex-col gap-0.5\" key={i}>\n <span className=\"text-xs font-medium text-muted-foreground uppercase tracking-wide\">\n {getAttributeLabel(attr)}\n </span>\n <span className=\"text-sm text-foreground\">\n {getAttributeValue(attr)}\n </span>\n </div>\n ))}\n </div>\n ) : null}\n </div>\n ))}\n </>\n ) : null}\n </div>\n </>\n ) : null}\n </>\n );\n}\n\nexport default ProductSpecifications;\n","/**\n * @rsc-safe — Pure display component. No React hooks, no event handlers, no\n * browser APIs, no context reads. Renders directly from props and can be\n * imported into a React Server Component without a 'use client' boundary.\n * Verified C0.2 (2026-05-20).\n */\nimport * as React from 'react';\nimport {\n PaginatedMediaVideoResponse,\n MediaVideo,\n LocalizedVideo,\n LocalizedString,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductVideosProps {\n /**\n * Media videos for the product.\n * Obtain from `product.media.videos`.\n */\n videos: PaginatedMediaVideoResponse;\n\n /**\n * Language code used to resolve the correct localised video URI.\n */\n language: string;\n\n /**\n * Override any UI string.\n * Available keys: title, empty\n */\n labels?: Record<string, string>;\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n}\n/**\n * Renders a product's media videos, embedding YouTube/Vimeo URLs in an iframe\n * and other URLs in a native `<video>` player.\n */\nfunction ProductVideos(props: ProductVideosProps) {\n const items: MediaVideo[] = props.videos?.items || [];\n const hasItems = items.length > 0;\n const lang = props.language || 'NL';\n function getVideoUri(video: MediaVideo): string {\n const vids = video.videos || [];\n const match = vids.find((v: LocalizedVideo) => v.language === lang);\n return match?.uri || vids?.[0]?.uri || '';\n }\n function getVideoTitle(video: MediaVideo): string {\n const alts = video.alt || [];\n const match = alts.find((a: LocalizedString) => a.language === lang);\n return match?.value || alts?.[0]?.value || 'Video';\n }\n function isEmbeddable(uri: string): boolean {\n return uri.includes('youtube.com') || uri.includes('youtu.be') || uri.includes('vimeo.com');\n }\n function getEmbedUrl(uri: string): string {\n // Already an embed URL — return as-is\n if (uri.includes('youtube.com/embed/') || uri.includes('player.vimeo.com/video/')) {\n return uri;\n }\n // YouTube watch URL → embed URL\n if (uri.includes('youtube.com/watch')) {\n const url = new URL(uri);\n const videoId = url.searchParams.get('v') || '';\n return `https://www.youtube.com/embed/${videoId}`;\n }\n // YouTube short URL\n if (uri.includes('youtu.be/')) {\n const videoId = uri.split('youtu.be/')[1]?.split('?')[0] || '';\n return `https://www.youtube.com/embed/${videoId}`;\n }\n // Vimeo standard URL (https://vimeo.com/ID or https://vimeo.com/ID/HASH)\n if (uri.includes('vimeo.com/')) {\n const parts = uri.split('vimeo.com/')[1]?.split('?')[0]?.split('/') || [];\n const videoId = parts[0] || '';\n const hash = parts[1] || '';\n return hash\n ? `https://player.vimeo.com/video/${videoId}?h=${hash}`\n : `https://player.vimeo.com/video/${videoId}`;\n }\n return uri;\n }\n return (\n <div className={`propeller-product-videos ${props.className || ''}`}>\n {hasItems ? (\n <h3 className=\"propeller-product-videos__title text-base font-semibold text-foreground mb-3\">\n {getLabel(props.labels, 'title', 'Videos')}\n </h3>\n ) : null}\n {hasItems ? (\n <div className=\"propeller-product-videos__list space-y-4\">\n {items.map((video, index) => (\n <div\n className=\"propeller-product-videos__item rounded-container overflow-hidden border border-border bg-foreground\"\n key={index}\n data-embedded={!!getVideoUri(video) && isEmbeddable(getVideoUri(video)) ? 'true' : 'false'}\n >\n {!!getVideoUri(video) ? (\n <>\n {isEmbeddable(getVideoUri(video)) ? (\n <div\n className=\"propeller-product-videos__embed relative w-full\"\n style={{\n paddingBottom: '56.25%',\n }}\n >\n <iframe\n loading=\"lazy\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n className=\"propeller-product-videos__iframe absolute inset-0 w-full h-full\"\n src={getEmbedUrl(getVideoUri(video))}\n title={getVideoTitle(video)}\n allowFullScreen\n />\n </div>\n ) : null}\n {!isEmbeddable(getVideoUri(video)) ? (\n <video preload=\"metadata\" className=\"propeller-product-videos__video w-full\" controls>\n <source src={getVideoUri(video)} />\n </video>\n ) : null}\n </>\n ) : null}\n </div>\n ))}\n </div>\n ) : null}\n {!hasItems ? (\n <p className=\"propeller-product-videos__empty text-sm text-muted-foreground\">{getLabel(props.labels, 'empty', 'No videos')}</p>\n ) : null}\n </div>\n );\n}\n\nexport default ProductVideos;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect } from 'react';\nimport {\n Product,\n GraphQLClient,\n PaginatedMediaDocumentResponse,\n PaginatedMediaVideoResponse,\n AttributeResult,\n} from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductSpecs } from '../composables/react/useProductSpecs';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport DefaultProductDescriptionImpl from './ProductDescription';\nimport DefaultProductSpecificationsImpl from './ProductSpecifications';\nimport DefaultProductDownloadsImpl from './ProductDownloads';\nimport DefaultProductVideosImpl from './ProductVideos';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface ProductTabsProps {\n /** Product for which to display the information. */\n product: Product;\n\n // ── Tab visibility ────────────────────────────────────────────────────────\n\n /** If true, displays the Description tab. Defaults to true. */\n showDescription?: boolean;\n\n /** If true, displays the Specifications tab. Defaults to true. */\n showSpecifications?: boolean;\n\n /** If true, displays the Downloads tab. Defaults to true. */\n showDownloads?: boolean;\n\n /** If true, displays the Videos tab. Defaults to true. */\n showVideos?: boolean;\n\n // ── Shared ────────────────────────────────────────────────────────────────\n\n /**\n * Language code passed to all sub-components.\n * Defaults to 'NL'.\n */\n language?: string;\n\n /**\n * Override the tab button labels.\n * Available keys: description, specifications, downloads, videos\n */\n labels?: Record<string, string>;\n\n // ── Description tab ───────────────────────────────────────────────────────\n\n /**\n * When true, the description is initially collapsed to `descriptionMaxLength` characters.\n * A \"Read more\" / \"Read less\" toggle is shown.\n * Passed as `collapsed` to ProductDescription. Defaults to false.\n */\n descriptionCollapsed?: boolean;\n\n /**\n * Maximum number of characters shown when the description is collapsed.\n * Passed as `maxLength` to ProductDescription. Defaults to 0 (no truncation).\n */\n descriptionMaxLength?: number;\n\n // ── Specifications tab ────────────────────────────────────────────────────\n\n /**\n * Initialised Propeller SDK GraphQL client.\n * Passed to ProductSpecifications for internal attribute fetching.\n */\n graphqlClient?: GraphQLClient;\n\n /**\n * Product ID to fetch attributes for.\n * Passed to ProductSpecifications for internal attribute fetching.\n */\n productId?: number;\n\n /**\n * Display layout for the specifications.\n * 'table' — two-column table (name | value). Default.\n * 'list' — vertical label + value stacked rows.\n * Passed as `layout` to ProductSpecifications.\n */\n specificationsLayout?: string;\n\n /**\n * When true, groups specifications by their group field with a heading per section.\n * When false or omitted, displays a flat ungrouped table. Default: false.\n * Passed as `grouping` to ProductSpecifications.\n */\n specificationsGrouping?: boolean;\n\n // ── Downloads tab ─────────────────────────────────────────────────────────\n\n /**\n * Override UI strings for the Downloads section.\n * Available keys: title, download\n * Passed as `labels` to ProductDownloads.\n */\n downloadsLabels?: Record<string, string>;\n\n // ── Videos tab ───────────────────────────────────────────────────────────\n\n /**\n * Override UI strings for the Videos section.\n * Available key: title\n * Passed as `labels` to ProductVideos.\n */\n videosLabels?: Record<string, string>;\n\n // ── Root ─────────────────────────────────────────────────────────────────\n\n /** Extra CSS class applied to the root element. */\n className?: string;\n\n // ───── Extension API ─────\n // Replaces each tab-content component when the corresponding tab is active.\n // Each consumes the same props the default tab body would.\n productDescriptionComponent?: React.ComponentType<import('./ProductDescription').ProductDescriptionProps>;\n productSpecificationsComponent?: React.ComponentType<import('./ProductSpecifications').ProductSpecificationsProps>;\n productDownloadsComponent?: React.ComponentType<import('./ProductDownloads').ProductDownloadsProps>;\n productVideosComponent?: React.ComponentType<import('./ProductVideos').ProductVideosProps>;\n}\n/**\n * Renders a tabbed (desktop) / accordion (mobile) panel for a product's\n * description, specifications, downloads and videos sections.\n *\n * @remarks Uses {@link useProductSpecs} to fetch attributes for the specs tab.\n */\nfunction ProductTabs(rawProps: ProductTabsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const ProductDescriptionImpl = props.productDescriptionComponent ?? DefaultProductDescriptionImpl;\n const ProductSpecificationsImpl = props.productSpecificationsComponent ?? DefaultProductSpecificationsImpl;\n const ProductDownloadsImpl = props.productDownloadsComponent ?? DefaultProductDownloadsImpl;\n const ProductVideosImpl = props.productVideosComponent ?? DefaultProductVideosImpl;\n // --- composable ---\n const { attributes: fetchedAttributes, fetchSpecs } = useProductSpecs({\n graphqlClient: props.graphqlClient as GraphQLClient,\n language: props.language || 'NL',\n });\n\n // Lazy-pick the first visible tab so we don't useState('description')\n // and then immediately setActiveTab(...) inside a useEffect.\n const initialTab: string = (() => {\n const lang = props.language || 'NL';\n const descs = props.product?.descriptions;\n const hasDesc = !!descs && descs.length > 0\n && (descs.find((d) => d.language === lang)?.value\n || descs[0]?.value || '').length > 0;\n if (props.showDescription !== false && hasDesc) return 'description';\n if (props.showSpecifications !== false) return 'specifications';\n if (props.showDownloads !== false) return 'downloads';\n return 'videos';\n })();\n const [activeTab, setActiveTab] = useState(() => initialTab);\n const [specsVisited, setSpecsVisited] = useState(\n () => initialTab === 'specifications'\n );\n function getSpecsAttributes() {\n return fetchedAttributes.length\n ? fetchedAttributes\n : (props.product?.attributes?.items as AttributeResult[]) || [];\n }\n function hasDescription() {\n const lang = props.language || 'NL';\n const descriptions = props.product?.descriptions;\n if (!descriptions || descriptions.length === 0) return false;\n const match = descriptions.find((d) => d.language === lang);\n return !!(match?.value || descriptions[0]?.value);\n }\n function isTabVisible(tab: string) {\n if (tab === 'description') return props.showDescription !== false && hasDescription();\n if (tab === 'specifications') return props.showSpecifications !== false;\n if (tab === 'downloads') return props.showDownloads !== false;\n if (tab === 'videos') return props.showVideos !== false;\n return false;\n }\n function isActive(tab: string) {\n return activeTab === tab;\n }\n function selectTab(tab: string) {\n if (tab === 'specifications') {\n setSpecsVisited(true);\n }\n setActiveTab(tab);\n }\n // Re-evaluate the active tab when product / language changes (e.g. user\n // navigates between products with the same component instance). Repeats\n // the initial-tab logic computed lazily above. Intentional external-state\n // sync — the user might have manually switched tabs between renders, but\n // when the product itself changes that selection is no longer meaningful.\n useEffect(() => {\n if (props.showDescription !== false && hasDescription()) {\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setActiveTab('description');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.product, props.language]);\n useEffect(() => {\n if (!props.productId || !props.graphqlClient) return;\n fetchSpecs(props.productId as number);\n }, [props.productId]);\n return (\n <>\n {props.product ? (\n <>\n <div\n className={`propeller-product-tabs ${(props.className as string) || ''}`}\n data-active-tab={activeTab}\n >\n <div className=\"propeller-product-tabs__desktop hidden md:block\">\n <div className=\"propeller-product-tabs__tablist flex border-b border-border\">\n {isTabVisible('description') ? (\n <button\n type=\"button\"\n onClick={(event) => selectTab('description')}\n className={`propeller-product-tabs__tab px-5 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${isActive('description') ? 'border-foreground text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border'}`}\n data-tab=\"description\"\n data-active={isActive('description') ? 'true' : 'false'}\n >\n {getLabel(props.labels, 'description', 'Description')}\n </button>\n ) : null}\n {isTabVisible('specifications') ? (\n <button\n type=\"button\"\n onClick={(event) => selectTab('specifications')}\n className={`propeller-product-tabs__tab px-5 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${isActive('specifications') ? 'border-foreground text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border'}`}\n data-tab=\"specifications\"\n data-active={isActive('specifications') ? 'true' : 'false'}\n >\n {getLabel(props.labels, 'specifications', 'Specifications')}\n </button>\n ) : null}\n {isTabVisible('downloads') ? (\n <button\n type=\"button\"\n onClick={(event) => selectTab('downloads')}\n className={`propeller-product-tabs__tab px-5 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${isActive('downloads') ? 'border-foreground text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border'}`}\n data-tab=\"downloads\"\n data-active={isActive('downloads') ? 'true' : 'false'}\n >\n {getLabel(props.labels, 'downloads', 'Downloads')}\n </button>\n ) : null}\n {isTabVisible('videos') ? (\n <button\n type=\"button\"\n onClick={(event) => selectTab('videos')}\n className={`propeller-product-tabs__tab px-5 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${isActive('videos') ? 'border-foreground text-foreground' : 'border-transparent text-muted-foreground hover:text-foreground hover:border-border'}`}\n data-tab=\"videos\"\n data-active={isActive('videos') ? 'true' : 'false'}\n >\n {getLabel(props.labels, 'videos', 'Videos')}\n </button>\n ) : null}\n </div>\n <div className=\"propeller-product-tabs__panel pt-6\">\n {isActive('description') && isTabVisible('description') ? (\n <ProductDescriptionImpl\n product={props.product}\n language={props.language}\n collapsed={props.descriptionCollapsed}\n maxLength={props.descriptionMaxLength}\n />\n ) : null}\n {specsVisited && isTabVisible('specifications') ? (\n <div className={isActive('specifications') ? '' : 'hidden'}>\n <ProductSpecificationsImpl\n attributes={getSpecsAttributes()}\n language={props.language}\n layout={props.specificationsLayout}\n grouping={props.specificationsGrouping}\n />\n </div>\n ) : null}\n {isActive('downloads') && isTabVisible('downloads') ? (\n <ProductDownloadsImpl\n downloads={\n (props.product as Product).media?.documents as PaginatedMediaDocumentResponse\n }\n language={(props.language as string) || 'NL'}\n labels={props.downloadsLabels}\n />\n ) : null}\n {isActive('videos') && isTabVisible('videos') ? (\n <ProductVideosImpl\n videos={(props.product as Product).media?.videos as PaginatedMediaVideoResponse}\n language={(props.language as string) || 'NL'}\n labels={props.videosLabels}\n />\n ) : null}\n </div>\n </div>\n <div className=\"propeller-product-tabs__mobile md:hidden divide-y divide-border border border-border rounded-container\">\n {isTabVisible('description') ? (\n <div>\n <button\n type=\"button\"\n className=\"propeller-product-tabs__accordion-trigger flex items-center justify-between w-full px-4 py-3 text-sm font-medium text-left\"\n onClick={(event) => {\n setActiveTab(activeTab === 'description' ? '' : 'description');\n }}\n >\n {getLabel(props.labels, 'description', 'Description')}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={`transition-transform ${isActive('description') ? 'rotate-180' : ''}`}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n {isActive('description') ? (\n <div className=\"propeller-product-tabs__accordion-panel px-4 pb-4\">\n <ProductDescriptionImpl\n product={props.product}\n language={props.language}\n collapsed={props.descriptionCollapsed}\n maxLength={props.descriptionMaxLength}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n {isTabVisible('specifications') ? (\n <div>\n <button\n type=\"button\"\n className=\"propeller-product-tabs__accordion-trigger flex items-center justify-between w-full px-4 py-3 text-sm font-medium text-left\"\n onClick={(event) => {\n if (activeTab !== 'specifications') {\n setSpecsVisited(true);\n setActiveTab('specifications');\n } else {\n setActiveTab('');\n }\n }}\n >\n {getLabel(props.labels, 'specifications', 'Specifications')}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={`transition-transform ${isActive('specifications') ? 'rotate-180' : ''}`}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n {specsVisited && isActive('specifications') ? (\n <div className=\"propeller-product-tabs__accordion-panel px-4 pb-4\">\n <ProductSpecificationsImpl\n attributes={getSpecsAttributes()}\n language={props.language}\n layout={props.specificationsLayout}\n grouping={props.specificationsGrouping}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n {isTabVisible('downloads') ? (\n <div>\n <button\n type=\"button\"\n className=\"propeller-product-tabs__accordion-trigger flex items-center justify-between w-full px-4 py-3 text-sm font-medium text-left\"\n onClick={(event) => {\n setActiveTab(activeTab === 'downloads' ? '' : 'downloads');\n }}\n >\n {getLabel(props.labels, 'downloads', 'Downloads')}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={`transition-transform ${isActive('downloads') ? 'rotate-180' : ''}`}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n {isActive('downloads') ? (\n <div className=\"propeller-product-tabs__accordion-panel px-4 pb-4\">\n <ProductDownloadsImpl\n downloads={\n (props.product as Product).media\n ?.documents as PaginatedMediaDocumentResponse\n }\n language={(props.language as string) || 'NL'}\n labels={props.downloadsLabels}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n {isTabVisible('videos') ? (\n <div>\n <button\n type=\"button\"\n className=\"propeller-product-tabs__accordion-trigger flex items-center justify-between w-full px-4 py-3 text-sm font-medium text-left\"\n onClick={(event) => {\n setActiveTab(activeTab === 'videos' ? '' : 'videos');\n }}\n >\n {getLabel(props.labels, 'videos', 'Videos')}\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={`transition-transform ${isActive('videos') ? 'rotate-180' : ''}`}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n {isActive('videos') ? (\n <div className=\"propeller-product-tabs__accordion-panel px-4 pb-4\">\n <ProductVideosImpl\n videos={\n (props.product as Product).media?.videos as PaginatedMediaVideoResponse\n }\n language={(props.language as string) || 'NL'}\n labels={props.videosLabels}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n </>\n ) : null}\n </>\n );\n}\n\nexport default ProductTabs;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: context reads (useAuth/useCart/useInfraProps/etc.).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { Contact, Customer, Gender, GraphQLClient, PurchaseAuthorizationConfig, PurchaseAuthorizationConfigCreateInput, PurchaseRole, RegisterContactInput } from '@propeller-commerce/propeller-sdk-v2';\nimport { usePurchaseAuthorizationConfigurator } from '../composables/react/usePurchaseAuthorization';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface PurchaseAuthorizationConfiguratorProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The logged-in user. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer;\n\n /** The companyId of the current selected company. Resolved from PropellerProvider when omitted. */\n companyId?: number;\n\n /**\n * Adds a button \"Add contact\" above the contacts list and enables registering contacts\n * @default true\n */\n allowContactCreate?: boolean;\n\n /** Fires before a contact is added to the company */\n beforeContactCreate?: (input: RegisterContactInput) => void;\n\n /** Override: fires instead of the default UserService.registerContact() call */\n onContactCreate?: (input: RegisterContactInput) => void;\n\n /** Fires after a contact is registered. If not provided, refreshes contacts list. */\n afterContactCreate?: (contact: Contact) => void;\n\n /** Override: fires instead of the default PurchaseAuthorizationConfigCreateInput() call */\n onPurchaseAuthorizationCreate?: (pac: PurchaseAuthorizationConfigCreateInput) => void;\n\n /** Fires after a PAC is created. If not provided, refreshes contacts list. */\n afterPurchaseAuthorizationCreate?: (pac: PurchaseAuthorizationConfig) => void;\n\n /** Override: fires instead of the default updatePurchaseAuthorizationConfig() call */\n onPurchaseAuthorizationUpdate?: (pac: PurchaseAuthorizationConfig) => void;\n\n /** Fires after a PAC is updated. If not provided, refreshes contacts list. */\n afterPurchaseAuthorizationUpdate?: (pac: PurchaseAuthorizationConfig) => void;\n\n /** Override: fires instead of the default deletePurchaseAuthorizationConfig() call */\n onPurchaseAuthorizationDelete?: (pac: PurchaseAuthorizationConfig) => void;\n\n /** Fires after a PAC is deleted. If not provided, refreshes contacts list. */\n afterPurchaseAuthorizationDelete?: (deleted: boolean) => void;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Custom CSS class for the component */\n className?: string;\n\n /** Configuration object from the application */\n configuration?: Record<string, any>;\n}\n\n/**\n * Renders the authorization-manager table for assigning purchase roles and\n * spending limits to company contacts, with an \"Add contact\" modal.\n *\n * @remarks Uses {@link usePurchaseAuthorizationConfigurator} for contact and\n * purchase-authorization-config data and mutations.\n */\nfunction PurchaseAuthorizationConfigurator(rawProps: PurchaseAuthorizationConfiguratorProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const {\n company, loading, contacts, totalPages, currentPage, isAuthManager,\n showAddContactModal, addContactForm, addContactLoading, addContactError,\n hasPac, isCurrentUser, isRowDirty, getRowRole, getRowLimit, isRowLoading,\n handleRoleChange, handleLimitChange, handleCreate, handleSave, handleDelete,\n handlePageChange, openAddContactModal, closeAddContactModal, setAddContactForm,\n handleAddContactSubmit,\n } = usePurchaseAuthorizationConfigurator({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n companyId: props.companyId!,\n beforeContactCreate: props.beforeContactCreate,\n onContactCreate: props.onContactCreate,\n afterContactCreate: props.afterContactCreate,\n onPurchaseAuthorizationCreate: props.onPurchaseAuthorizationCreate,\n afterPurchaseAuthorizationCreate: props.afterPurchaseAuthorizationCreate,\n onPurchaseAuthorizationUpdate: props.onPurchaseAuthorizationUpdate,\n afterPurchaseAuthorizationUpdate: props.afterPurchaseAuthorizationUpdate,\n onPurchaseAuthorizationDelete: props.onPurchaseAuthorizationDelete,\n afterPurchaseAuthorizationDelete: props.afterPurchaseAuthorizationDelete,\n });\n\n \n\n return (\n <div className={`propeller-purchase-authorization-configurator ${props.className || ''}`}>\n {isAuthManager ? (\n <>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-xl font-semibold\">\n {getLabel(props.labels, 'title', 'Purchase Authorization Settings')}\n </h2>\n {props.allowContactCreate !== false ? (\n <button\n type=\"button\"\n className=\"propeller-purchase-authorization-configurator__add-btn flex items-center gap-2 bg-primary text-primary-foreground px-4 py-2 rounded-container hover:bg-primary/80 transition text-sm font-medium\"\n onClick={() => openAddContactModal()}\n >\n {getLabel(props.labels, 'addContact', 'Add contact')}\n </button>\n ) : null}\n </div>\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin\" />\n </div>\n ) : null}\n {!loading ? (\n <>\n <div className=\"overflow-x-auto rounded-lg border border-border bg-card shadow-sm\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colId', 'ID')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colName', 'Name')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colRole', 'Role')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colLimit', 'Limit')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {contacts.map((contact) => (\n <tr className=\"hover:bg-muted/30 transition-colors\" key={contact.contactId}>\n <td className=\"px-4 py-3 text-muted-foreground\">{contact.contactId}</td>\n <td className=\"px-4 py-3\">\n <div className=\"font-medium\">\n {[contact.firstName, contact.middleName, contact.lastName]\n .filter(Boolean)\n .join(' ')}\n </div>\n <div className=\"text-xs text-muted-foreground mt-0.5\">{contact.email}</div>\n </td>\n <td className=\"px-4 py-3\">\n <select\n className=\"border border-input rounded-md px-2 py-1.5 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary disabled:opacity-50 disabled:cursor-not-allowed\"\n value={getRowRole(contact.contactId)}\n disabled={isCurrentUser(contact.contactId)}\n onChange={(e) => handleRoleChange(contact.contactId, e.target.value)}\n >\n <option value=\"\">{getLabel(props.labels, 'selectRole', '— Select role —')}</option>\n <option value={PurchaseRole.PURCHASER}>\n {getLabel(props.labels, 'rolePurchaser', 'Purchaser')}\n </option>\n <option value={PurchaseRole.AUTHORIZATION_MANAGER}>\n {getLabel(props.labels, 'roleManager', 'Authorization Manager')}\n </option>\n </select>\n </td>\n <td className=\"px-4 py-3\">\n {getRowRole(contact.contactId) === PurchaseRole.PURCHASER ? (\n <input\n type=\"number\"\n min=\"0\"\n step=\"0.01\"\n className=\"w-28 border border-input rounded-md px-2 py-1.5 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary disabled:opacity-50\"\n value={getRowLimit(contact.contactId) ?? ''}\n disabled={isCurrentUser(contact.contactId)}\n onChange={(e) => handleLimitChange(contact.contactId, e.target.value)}\n placeholder={getLabel(props.labels, 'limitPlaceholder', '0.00')}\n />\n ) : null}\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n {hasPac(contact.contactId) && isRowDirty(contact.contactId) ? (\n <button\n type=\"button\"\n className=\"text-xs bg-primary text-primary-foreground px-3 py-1.5 rounded-control hover:bg-primary/80 transition disabled:opacity-50 disabled:cursor-not-allowed\"\n disabled={isRowLoading(contact.contactId)}\n onClick={() => handleSave(contact.contactId)}\n >\n {isRowLoading(contact.contactId) ? (\n <span className=\"inline-block w-3 h-3 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin mr-1\" />\n ) : null}\n {getLabel(props.labels, 'save', 'Save')}\n </button>\n ) : null}\n {!hasPac(contact.contactId) ? (\n <button\n type=\"button\"\n className=\"text-xs bg-primary text-primary-foreground px-3 py-1.5 rounded-control hover:bg-primary/80 transition disabled:opacity-50 disabled:cursor-not-allowed\"\n disabled={isRowLoading(contact.contactId) || !getRowRole(contact.contactId)}\n onClick={() => handleCreate(contact.contactId)}\n >\n {isRowLoading(contact.contactId) ? (\n <span className=\"inline-block w-3 h-3 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin mr-1\" />\n ) : null}\n {getLabel(props.labels, 'create', 'Create')}\n </button>\n ) : null}\n {hasPac(contact.contactId) ? (\n <button\n type=\"button\"\n className=\"text-xs border border-border px-3 py-1.5 rounded-control hover:bg-surface-hover transition disabled:opacity-50 disabled:cursor-not-allowed\"\n disabled={isRowLoading(contact.contactId) || isCurrentUser(contact.contactId)}\n onClick={() => handleDelete(contact.contactId)}\n >\n {isRowLoading(contact.contactId) ? (\n <span className=\"inline-block w-3 h-3 border-2 border-foreground border-t-transparent rounded-full animate-spin mr-1\" />\n ) : null}\n {getLabel(props.labels, 'delete', 'Delete')}\n </button>\n ) : null}\n </div>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n {totalPages > 1 ? (\n <div className=\"flex items-center justify-center gap-3 pt-2\">\n <button\n type=\"button\"\n className=\"text-sm px-3 py-1.5 border border-border rounded-md hover:bg-muted transition disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage <= 1}\n onClick={() => handlePageChange(currentPage - 1)}\n >\n {getLabel(props.labels, 'previous', 'Previous')}\n </button>\n <span className=\"text-sm text-muted-foreground\">\n {getLabel(props.labels, 'page', 'Page')} {currentPage} {getLabel(props.labels, 'of', 'of')} {totalPages}\n </span>\n <button\n type=\"button\"\n className=\"text-sm px-3 py-1.5 border border-border rounded-md hover:bg-muted transition disabled:opacity-40 disabled:cursor-not-allowed\"\n disabled={currentPage >= totalPages}\n onClick={() => handlePageChange(currentPage + 1)}\n >\n {getLabel(props.labels, 'next', 'Next')}\n </button>\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n {showAddContactModal ? (\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-foreground/50\"\n onClick={() => closeAddContactModal()}\n >\n <div\n className=\"bg-background rounded-xl shadow-2xl w-full max-w-lg mx-4 p-6 space-y-4\"\n onClick={(e) => e.stopPropagation()}\n >\n <div className=\"flex items-center justify-between\">\n <h3 className=\"text-lg font-semibold\">{getLabel(props.labels, 'addContactTitle', 'Add Contact')}</h3>\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground transition\"\n onClick={() => closeAddContactModal()}\n >\n ✕\n </button>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'companyName', 'Company')}</label>\n <input\n type=\"text\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-muted cursor-not-allowed\"\n readOnly\n value={(company as any)?.name ?? ''}\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'gender', 'Gender')}</label>\n <select\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.gender}\n onChange={(e) => setAddContactForm({ ...addContactForm, gender: e.target.value })}\n >\n <option value=\"\">{getLabel(props.labels, 'selectGender', '— Select —')}</option>\n <option value={Gender.M}>{getLabel(props.labels, 'genderM', 'Male')}</option>\n <option value={Gender.F}>{getLabel(props.labels, 'genderF', 'Female')}</option>\n <option value={Gender.U}>{getLabel(props.labels, 'genderU', 'Unspecified')}</option>\n </select>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'email', 'Email')} *</label>\n <input\n type=\"email\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.email}\n onChange={(e) => setAddContactForm({ ...addContactForm, email: e.target.value })}\n />\n </div>\n <div className=\"grid grid-cols-3 gap-3\">\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'firstName', 'First name')}</label>\n <input\n type=\"text\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.firstName}\n onChange={(e) => setAddContactForm({ ...addContactForm, firstName: e.target.value })}\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'middleName', 'Middle')}</label>\n <input\n type=\"text\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.middleName}\n onChange={(e) => setAddContactForm({ ...addContactForm, middleName: e.target.value })}\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'lastName', 'Last name')}</label>\n <input\n type=\"text\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.lastName}\n onChange={(e) => setAddContactForm({ ...addContactForm, lastName: e.target.value })}\n />\n </div>\n </div>\n <div>\n <label className=\"block text-sm font-medium mb-1\">{getLabel(props.labels, 'phone', 'Phone')}</label>\n <input\n type=\"tel\"\n className=\"w-full border border-input rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus:ring-2 focus:ring-primary\"\n value={addContactForm.phone}\n onChange={(e) => setAddContactForm({ ...addContactForm, phone: e.target.value })}\n />\n </div>\n {addContactError ? (\n <p className=\"text-sm text-destructive\">{addContactError}</p>\n ) : null}\n <div className=\"flex justify-end gap-3 pt-2\">\n <button\n type=\"button\"\n className=\"px-4 py-2 text-sm border border-border rounded-md hover:bg-muted transition\"\n onClick={() => closeAddContactModal()}\n >\n {getLabel(props.labels, 'cancel', 'Cancel')}\n </button>\n <button\n type=\"button\"\n className=\"px-4 py-2 text-sm bg-primary text-primary-foreground rounded-control hover:bg-primary/80 transition disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2\"\n disabled={addContactLoading || !addContactForm.email}\n onClick={() => handleAddContactSubmit()}\n >\n {addContactLoading ? (\n <span className=\"inline-block w-4 h-4 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin\" />\n ) : null}\n {getLabel(props.labels, 'addContactSubmit', 'Add Contact')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n );\n}\n\nexport default PurchaseAuthorizationConfigurator;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Contact, Customer, GraphQLClient, Cart } from '@propeller-commerce/propeller-sdk-v2';\nimport { usePurchaseAuthorizationRequests } from '../composables/react/usePurchaseAuthorization';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { getLanguageString } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice as _formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface PurchaseAuthorizationRequestsProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The logged-in user. Resolved from PropellerProvider when omitted. */\n user?: Contact | Customer;\n\n /** The companyId of the current selected company. Resolved from PropellerProvider when omitted. */\n companyId?: number;\n\n /**\n * Override: fires instead of the default CartService.acceptPurchaseAuthorizationRequest() call.\n * Receives the cartId string.\n */\n onAcceptRequest?: (cartId: string) => void;\n\n /**\n * Fires after a purchase authorization request has been accepted.\n * Receives the full accepted Cart object (or the selectedCart if onAcceptRequest override was used).\n */\n afterAcceptRequest?: (cart: Cart) => void;\n\n /**\n * Override: fires instead of the default CartService.deleteCart() call.\n * Receives the cartId string.\n */\n onDeleteRequest?: (cartId: string) => void;\n\n /**\n * Fires after a purchase authorization request has been deleted (cart removed).\n * Receives the deleted cart's id.\n */\n afterDeleteRequest?: (cartId: string) => void;\n\n /** Format date */\n formatDate?: (dateString: string) => string;\n\n /** Format price */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Language used to resolve localized product names in the items table. Defaults to 'NL'. */\n language?: string;\n\n /** Additional CSS class for the root element */\n className?: string;\n\n /**\n * App configuration passthrough.\n * Used for imageSearchFiltersGrid, imageVariantFiltersSmall when fetching cart detail.\n */\n configuration?: Record<string, any>;\n\n /** Called when an SDK operation fails; receives the normalized error */\n onError?: (err: Error) => void;\n}\n/**\n * Renders a table of pending purchase-authorization requests (carts awaiting\n * approval) with a preview modal to accept or delete each request.\n *\n * @remarks Uses {@link usePurchaseAuthorizationRequests} for request data and\n * accept/delete operations.\n */\nfunction PurchaseAuthorizationRequests(rawProps: PurchaseAuthorizationRequestsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const {\n carts, loading, selectedCart, modalLoading, acceptLoading, deleteLoading, isAuthManager,\n getTotalQuantity, getContactName, getModalItems,\n handleViewCart, handleAcceptRequest, handleDeleteRequest, closeModal,\n } = usePurchaseAuthorizationRequests({\n graphqlClient: props.graphqlClient!,\n user: props.user ?? null,\n companyId: props.companyId!,\n configuration: props.configuration,\n onAcceptRequest: props.onAcceptRequest,\n afterAcceptRequest: props.afterAcceptRequest,\n onDeleteRequest: props.onDeleteRequest,\n afterDeleteRequest: props.afterDeleteRequest,\n onError: props.onError,\n });\n\n // Two-step delete UX: clicking Delete in the preview modal opens a small\n // confirmation overlay so the destructive action requires explicit user\n // confirmation.\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const openDeleteConfirm = () => setShowDeleteConfirm(true);\n const closeDeleteConfirm = () => setShowDeleteConfirm(false);\n const confirmDelete = async () => {\n await handleDeleteRequest();\n setShowDeleteConfirm(false);\n };\n\n \n\n function formatDate(dateStr: string): string {\n if (props.formatDate) return props.formatDate(dateStr);\n if (!dateStr) return '-';\n const d = new Date(dateStr);\n return `${d.getDate()}.${d.getMonth() + 1}.${d.getFullYear()}`;\n }\n\n function formatPrice(price: number): string {\n if (props.formatPrice) return props.formatPrice(price);\n return _formatPrice(price, { symbol: props.currency ?? '€' });\n }\n\n function getProductName(item: any): string {\n // First-class lookup: localized names array on the line item's product.\n // Falls back to bundle name (bundle items) and finally to the SKU so the\n // cell never renders empty for an item that does have data.\n const lang = props.language || 'NL';\n const fromNames = getLanguageString(item?.product?.names, lang, '');\n if (fromNames) return fromNames;\n const fromBundle = getLanguageString(item?.bundle?.names, lang, '');\n if (fromBundle) return fromBundle;\n return item?.product?.sku || '';\n }\n\n return (\n <div className={`propeller-purchase-authorization-requests ${props.className || ''}`}>\n {isAuthManager ? (\n <div className=\"propeller-purchase-authorization-requests__content space-y-4\">\n <h2 className=\"propeller-purchase-authorization-requests__title text-xl font-semibold\">{getLabel(props.labels, 'title', 'Authorization Requests')}</h2>\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <div className=\"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin\" />\n </div>\n ) : null}\n {!loading ? (\n <>\n {carts.length === 0 ? (\n <div className=\"text-center py-12 text-muted-foreground\">\n {getLabel(props.labels, 'empty', 'No pending authorization requests')}\n </div>\n ) : null}\n {carts.length > 0 ? (\n <div className=\"overflow-x-auto rounded-lg border border-border bg-card shadow-sm\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colDate', 'Date')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colQuantity', 'Quantity')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colTotal', 'Total')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colRequestedBy', 'Requested by')}\n </th>\n <th className=\"text-left px-4 py-3 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'colActions', 'Actions')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {carts.map((cart, index) => (\n <tr className=\"hover:bg-muted/30 transition-colors\" key={index}>\n <td className=\"px-4 py-3 text-muted-foreground\">\n {formatDate(cart.lastModifiedAt ?? '')}\n </td>\n <td className=\"px-4 py-3\">{getTotalQuantity(cart)}</td>\n <td className=\"px-4 py-3 font-medium\">\n {formatPrice(cart.total?.totalNet ?? 0)}\n </td>\n <td className=\"px-4 py-3\">\n <div className=\"font-medium\">\n {getContactName(cart.contact)}\n </div>\n <div className=\"text-xs text-muted-foreground mt-0.5\">\n {cart.contact?.email}\n </div>\n </td>\n <td className=\"px-4 py-3\">\n <button\n type=\"button\"\n className=\"px-3 py-1.5 text-sm border border-input rounded-md bg-background hover:bg-muted/50 transition-colors\"\n onClick={() => handleViewCart(cart)}\n >\n {getLabel(props.labels, 'view', 'View')}\n </button>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : null}\n </>\n ) : null}\n {selectedCart ? (\n <div className=\"propeller-purchase-authorization-requests__modal fixed inset-0 z-50 flex items-center justify-center px-4\">\n <div className=\"propeller-purchase-authorization-requests__modal-backdrop fixed inset-0 bg-foreground/20\" onClick={() => closeModal()} />\n <div className=\"propeller-purchase-authorization-requests__modal-content relative w-full max-w-2xl bg-card rounded-container shadow-2xl overflow-hidden max-h-[90vh] flex flex-col\">\n <div className=\"propeller-purchase-authorization-requests__modal-header flex items-center justify-between px-6 py-4 border-b border-border-subtle flex-shrink-0\">\n <h3 className=\"propeller-purchase-authorization-requests__modal-title text-base font-semibold text-foreground\">\n {getLabel(props.labels, 'modalTitle', 'Authorization Request')}\n </h3>\n <button\n type=\"button\"\n className=\"propeller-purchase-authorization-requests__modal-close text-foreground-subtle hover:text-foreground focus:outline-none\"\n onClick={() => closeModal()}\n >\n <svg fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" className=\"h-5 w-5\" strokeWidth={2}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n {modalLoading ? (\n <div className=\"flex items-center justify-center py-16\">\n <div className=\"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin\" />\n </div>\n ) : null}\n {!modalLoading ? (\n <>\n <div className=\"overflow-y-auto flex-1 px-6 py-5 space-y-6\">\n <div>\n <h4 className=\"propeller-purchase-authorization-requests__modal-section-title text-sm font-semibold text-muted-foreground mb-2\">\n {getLabel(props.labels, 'requesterInfo', 'Requester')}\n </h4>\n <p className=\"text-sm font-medium\">\n {getContactName(selectedCart?.contact as Contact)}\n </p>\n <p className=\"text-sm text-muted-foreground\">\n {selectedCart?.contact?.email}\n </p>\n </div>\n <div>\n <h4 className=\"propeller-purchase-authorization-requests__modal-section-title text-sm font-semibold text-muted-foreground mb-2\">\n {getLabel(props.labels, 'itemsTitle', 'Items')}\n </h4>\n <div className=\"overflow-x-auto rounded border border-border\">\n <table className=\"w-full text-sm\">\n <thead className=\"bg-muted/50 border-b border-border\">\n <tr>\n <th className=\"text-left px-3 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'itemProduct', 'Product')}\n </th>\n <th className=\"text-right px-3 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'itemQty', 'Qty')}\n </th>\n <th className=\"text-right px-3 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'itemUnitPrice', 'Unit price')}\n </th>\n <th className=\"text-right px-3 py-2 font-medium text-muted-foreground\">\n {getLabel(props.labels, 'itemTotal', 'Total')}\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border\">\n {getModalItems().map((item, idx) => (\n <tr key={idx}>\n <td className=\"px-3 py-2\">{getProductName(item)}</td>\n <td className=\"px-3 py-2 text-right\">{item.quantity ?? 0}</td>\n <td className=\"px-3 py-2 text-right\">\n {formatPrice(\n (item.quantity ?? 0) > 0\n ? (item.totalSum ?? 0) / (item.quantity ?? 1)\n : 0\n )}\n </td>\n <td className=\"px-3 py-2 text-right font-medium\">\n {formatPrice(item.totalSumNet ?? 0)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n <div className=\"border-t border-border pt-4 space-y-2 text-sm\">\n <div className=\"flex justify-between text-muted-foreground\">\n <span>{getLabel(props.labels, 'totalExclVat', 'Total excl. VAT:')}</span>\n <span>{formatPrice(selectedCart?.total?.totalGross ?? 0)}</span>\n </div>\n <div className=\"flex justify-between text-muted-foreground\">\n <span>{getLabel(props.labels, 'totalVat', 'VAT:')}</span>\n <span>\n {formatPrice((selectedCart?.total?.totalNet ?? 0) - (selectedCart?.total?.totalGross ?? 0))}\n </span>\n </div>\n <div className=\"flex justify-between font-bold text-base border-t border-border pt-2\">\n <span>{getLabel(props.labels, 'total', 'Total:')}</span>\n <span>{formatPrice(selectedCart?.total?.totalNet ?? 0)}</span>\n </div>\n </div>\n </div>\n <div className=\"propeller-purchase-authorization-requests__modal-actions flex gap-3 px-6 py-4 border-t border-border-subtle flex-shrink-0\">\n <button\n type=\"button\"\n className=\"propeller-purchase-authorization-requests__modal-delete flex-1 inline-flex justify-center rounded-control border border-input bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover/50 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors\"\n onClick={() => openDeleteConfirm()}\n disabled={deleteLoading || acceptLoading}\n >\n {getLabel(props.labels, 'delete', 'Delete')}\n </button>\n <button\n type=\"button\"\n className=\"propeller-purchase-authorization-requests__modal-accept flex-1 inline-flex justify-center rounded-control border border-transparent bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-secondary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n onClick={() => handleAcceptRequest()}\n disabled={acceptLoading || deleteLoading}\n >\n {acceptLoading ? <>{getLabel(props.labels, 'accepting', 'Accepting...')}</> : null}\n {!acceptLoading ? <>{getLabel(props.labels, 'acceptRequest', 'Accept request')}</> : null}\n </button>\n </div>\n\n {/*\n Delete confirmation overlay. Shown on top of the preview\n modal when the user clicks Delete; a two-step flow so the\n destructive action requires explicit consent before the\n cart is removed.\n */}\n {showDeleteConfirm ? (\n <div className=\"propeller-purchase-authorization-requests__delete-confirm fixed inset-0 z-[60] flex items-center justify-center px-4\">\n <div\n className=\"propeller-purchase-authorization-requests__delete-confirm-backdrop fixed inset-0 bg-foreground/40\"\n onClick={() => closeDeleteConfirm()}\n />\n <div className=\"propeller-purchase-authorization-requests__delete-confirm-content relative w-full max-w-md bg-card rounded-container shadow-2xl overflow-hidden\">\n <div className=\"px-6 py-4 border-b border-border-subtle\">\n <h4 className=\"propeller-purchase-authorization-requests__delete-confirm-title text-base font-semibold text-foreground\">\n {getLabel(props.labels, 'deleteConfirmTitle', 'Delete authorization request?')}\n </h4>\n </div>\n <div className=\"px-6 py-4\">\n <p className=\"text-sm text-muted-foreground\">\n {getLabel(\n props.labels,\n 'deleteConfirmBody',\n 'Are you sure you want to delete this authorization request? The cart will be permanently removed.',\n )}\n </p>\n </div>\n <div className=\"flex gap-3 px-6 py-4 border-t border-border-subtle\">\n <button\n type=\"button\"\n className=\"flex-1 inline-flex justify-center rounded-control border border-input bg-card px-4 py-2 text-sm font-medium text-muted-foreground hover:bg-surface-hover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\"\n onClick={() => closeDeleteConfirm()}\n disabled={deleteLoading}\n >\n {getLabel(props.labels, 'deleteConfirmNo', 'No')}\n </button>\n <button\n type=\"button\"\n className=\"flex-1 inline-flex justify-center rounded-control border border-transparent bg-destructive px-4 py-2 text-sm font-medium text-destructive-foreground hover:bg-destructive/90 focus:outline-none focus:ring-2 focus:ring-destructive focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n onClick={() => confirmDelete()}\n disabled={deleteLoading}\n >\n {deleteLoading\n ? getLabel(props.labels, 'deleting', 'Deleting...')\n : getLabel(props.labels, 'deleteConfirmYes', 'Yes, delete')}\n </button>\n </div>\n </div>\n </div>\n ) : null}\n </>\n ) : null}\n </div>\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default PurchaseAuthorizationRequests;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Order, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport { useOrders } from '../composables/react/useOrders';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface QuoteActionsProps {\n /** GraphQL client for the Propeller SDK */\n graphqlClient?: GraphQLClient;\n\n /** The quotation for which the actions will take place */\n quote: Order;\n\n /** Labels used in the quote actions component */\n labels?: Record<string, string>;\n\n /** Action function triggered when the \"Accept quotation\" button is clicked.\n * If not provided, the base implementation calls setOrderStatus on the SDK. */\n onAccept?: (quote: Order) => void;\n\n /** Action function triggered after the quote is accepted. Usually for navigating towards the thank you page. */\n afterAccept?: (quote: Order) => void;\n\n /** Show the terms and conditions acceptance */\n showTermsAndConditions?: boolean;\n\n /** Action when the \"Terms and conditions\" link is clicked */\n onTermsAndConditionsClick?: () => void;\n}\n\n/**\n * Renders the accept-quotation action for a quote, with optional terms-and-\n * conditions consent and an expired-quote notice.\n *\n * @remarks Uses {@link useOrders} to set the quote status on acceptance.\n */\nfunction QuoteActions(rawProps: QuoteActionsProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [termsAccepted, setTermsAccepted] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const { setQuoteStatus } = useOrders({\n graphqlClient: props.graphqlClient!,\n user: null,\n });\n\n function showTermsAndConditions(): boolean {\n return props.showTermsAndConditions !== undefined ? props.showTermsAndConditions : true;\n }\n\n function isExpired(): boolean {\n const validUntil = (props.quote as any)?.validUntil;\n if (!validUntil) return false;\n const validUntilDate = new Date(validUntil);\n if (Number.isNaN(validUntilDate.getTime())) return false;\n return validUntilDate.getTime() < Date.now();\n }\n\n function isAcceptDisabled(): boolean {\n if (showTermsAndConditions() && !termsAccepted) return true;\n if (loading) return true;\n return false;\n }\n\n \n\n function handleTermsChange(checked: boolean) {\n setTermsAccepted(checked);\n }\n\n function handleTermsLinkClick(event: Event) {\n event.preventDefault();\n if (props.onTermsAndConditionsClick) {\n props.onTermsAndConditionsClick();\n }\n }\n\n async function handleAcceptClick() {\n if (isAcceptDisabled()) return;\n setLoading(true);\n try {\n if (props.onAccept) {\n props.onAccept(props.quote);\n } else if (props.graphqlClient && props.quote?.id) {\n await setQuoteStatus(props.quote.id, { status: 'NEW' });\n }\n if (props.afterAccept) {\n props.afterAccept(props.quote);\n }\n } finally {\n setLoading(false);\n }\n }\n\n return (\n <div className=\"quote-actions space-y-4\">\n {isExpired() ? (\n <div className=\"propeller-quote-actions__expired text-sm text-muted-foreground bg-surface-hover/50 border border-border rounded-container p-3\">\n {getLabel(props.labels, 'expiredMessage', 'This quote has expired.')}\n </div>\n ) : (\n <>\n {showTermsAndConditions() ? (\n <div className=\"flex items-center space-x-2 pt-2\">\n <input\n type=\"checkbox\"\n id=\"quote-actions-terms\"\n className=\"propeller-quote-actions__checkbox h-4 w-4 rounded border-input text-primary focus:ring-primary\"\n checked={termsAccepted}\n onChange={(event) => handleTermsChange(event.target.checked)}\n />\n <label htmlFor=\"quote-actions-terms\" className=\"text-sm leading-none\">\n {getLabel(props.labels, 'termsPrefix', 'I agree to the')}\n <a\n href=\"#\"\n className=\"text-primary hover:underline font-medium\"\n onClick={(event) => handleTermsLinkClick(event as unknown as Event)}\n >\n {getLabel(props.labels, 'termsLink', 'Terms and Conditions')}\n </a>\n </label>\n </div>\n ) : null}\n <button\n type=\"button\"\n className=\"propeller-quote-actions__submit flex items-center justify-center gap-2 w-full bg-primary text-primary-foreground text-center py-3 rounded-container hover:bg-primary/80 transition font-semibold text-lg disabled:opacity-50 disabled:cursor-not-allowed mt-2\"\n onClick={(event) => handleAcceptClick()}\n disabled={isAcceptDisabled()}\n >\n {loading ? (\n <div className=\"propeller-quote-actions__spinner w-5 h-5 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin\" />\n ) : null}\n {loading ? <>{getLabel(props.labels, 'processing', 'Processing...')}</> : null}\n {!loading ? <>{getLabel(props.labels, 'acceptButton', 'Accept Quotation')}</> : null}\n </button>\n </>\n )}\n </div>\n );\n}\n\nexport default QuoteActions;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState } from 'react';\nimport { Cart, Contact, Customer, Gender, GraphQLClient } from '@propeller-commerce/propeller-sdk-v2';\nimport { useAuth } from '../composables/react/useAuth';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface RegisterFormProps {\n /** GraphQL client for the Propeller SDK. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** Title of the register form\n * @default \"Create account\"\n */\n title?: string;\n\n /** Subtitle of the register form\n * @default \"\"\n */\n subtitle?: string;\n\n /** Label for the submit button\n * @default \"Register\"\n */\n buttonText?: string;\n\n /**\n * Enable choosing between Contact or Customer if null,\n * otherwise proceed with one user type registration only.\n * 'Contact' = Company account (has company name, VAT, CoC fields)\n * 'Customer' = Consumer/personal account\n * @default null\n */\n showUserType?: 'Contact' | 'Customer' | null;\n\n /**\n * Required fields for the registration form.\n * Available field names: firstName, middleName, lastName, email, password,\n * phone, mobile, gender, companyName, vatNumber, cocNumber,\n * street, number, numberExtension, postalCode, city, country\n * @default []\n */\n requiredFields?: string[];\n\n /**\n * When true (default) the new contact/customer is automatically logged in\n * after registration: the SDK access token is set on the GraphQL client and\n * forwarded to `afterRegistration` so the parent can populate auth state.\n * When false, registration completes server-side but no session is kept;\n * `afterRegistration` is called without tokens so the parent can redirect\n * the user to the login page.\n * @default true\n */\n automaticLogin?: boolean;\n\n /**\n * Labels for the registration form fields.\n *\n * Available keys:\n * - firstName, middleName, lastName, email, password, confirmPassword\n * - phone, gender, companyName, vatNumber, cocNumber\n * - street, number, numberExtension, postalCode, city, country\n * - userTypeLabel, contactLabel, customerLabel\n * - emailPlaceholder, passwordPlaceholder, passwordMismatch\n * - billingAddressTitle, deliveryAddressTitle, sameAsDelivery\n * - loginText, loginLink\n * - personalDetailsTitle, passwordTitle\n */\n labels?: Record<string, string>;\n\n /** Callback before the registration process starts */\n beforeRegistration?: () => void;\n\n /** Callback after the user is registered.\n * `anonymousCart` is the cart held in the parent's state at the moment of submission,\n * forwarded so the parent can merge it into the new user's cart.\n */\n afterRegistration?: (\n user: Contact | Customer,\n accessToken?: string,\n refreshToken?: string,\n expiresAt?: string,\n anonymousCart?: Cart | null\n ) => void;\n\n /** Anonymous cart snapshot from the parent's state — forwarded to `afterRegistration`. */\n cart?: Cart | null;\n\n /** Action for the login link click */\n onLoginClick?: () => void;\n\n /** Show/hide the login link\n * @default true\n */\n displayLoginLink?: boolean;\n\n /**\n * Prefered language\n * @default 'NL'\n */\n preferredLanguage?: string;\n\n /**\n * List of countries to display in the country dropdown\n * @default {}\n */\n countries?: Record<string, string>;\n}\n\n/**\n * Renders a registration form for company (Contact) or consumer (Customer)\n * accounts, collecting personal details, billing/delivery addresses and a\n * password, with optional automatic login on success.\n *\n * @remarks Uses {@link useAuth} to register the contact or customer.\n */\nfunction RegisterForm(rawProps: RegisterFormProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n // Personal details\n const [firstName, setFirstName] = useState('');\n const [middleName, setMiddleName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const [phone, setPhone] = useState('');\n const [gender, setGender] = useState<Gender>(Gender.U);\n // Company fields (Contact only)\n const [companyName, setCompanyName] = useState('');\n const [vatNumber, setVatNumber] = useState('');\n const [cocNumber, setCocNumber] = useState('');\n // Billing/Invoice address\n const [billingStreet, setBillingStreet] = useState('');\n const [billingNumber, setBillingNumber] = useState('');\n const [billingNumberExtension, setBillingNumberExtension] = useState('');\n const [billingPostalCode, setBillingPostalCode] = useState('');\n const [billingCity, setBillingCity] = useState('');\n const [billingCountry, setBillingCountry] = useState('');\n // Delivery address\n const [sameAsDelivery, setSameAsDelivery] = useState(true);\n const [deliveryStreet, setDeliveryStreet] = useState('');\n const [deliveryNumber, setDeliveryNumber] = useState('');\n const [deliveryNumberExtension, setDeliveryNumberExtension] = useState('');\n const [deliveryPostalCode, setDeliveryPostalCode] = useState('');\n const [deliveryCity, setDeliveryCity] = useState('');\n const [deliveryCountry, setDeliveryCountry] = useState('');\n // User type\n const [selectedUserType, setSelectedUserType] = useState<'' | 'Contact' | 'Customer'>('');\n // State\n const [error, setError] = useState('');\n const [submitted, setSubmitted] = useState(false);\n\n const { loading, registerContact, registerCustomer } = useAuth({\n graphqlClient: props.graphqlClient!,\n language: props.preferredLanguage || 'NL',\n });\n\n // Flags / labels resolved once per render (previously each was a one-line\n // function redefined every render and called from the JSX).\n const resolvedTitle = props.title !== undefined ? props.title : 'Create account';\n const resolvedButtonText = props.buttonText || 'Register';\n const showUserTypeSelector =\n props.showUserType === undefined || props.showUserType === null;\n const effectiveUserType = props.showUserType ? props.showUserType : selectedUserType;\n const isContact = effectiveUserType === 'Contact';\n const showLoginLink = props.displayLoginLink !== false;\n const personalDetailsTitle = props.labels?.personalDetailsTitle || 'Your details';\n const billingAddressTitle = props.labels?.billingAddressTitle || 'Billing address';\n const deliveryAddressTitle = props.labels?.deliveryAddressTitle || 'Delivery address';\n const passwordTitle = props.labels?.passwordTitle || 'Password';\n const sameAsDeliveryLabel =\n props.labels?.sameAsDelivery || 'Delivery address is the same as billing address';\n const firstNameLabel = props.labels?.firstName || 'First name';\n const middleNameLabel = props.labels?.middleName || 'Insertion';\n const lastNameLabel = props.labels?.lastName || 'Last name';\n const emailLabel = props.labels?.email || 'Email address';\n const passwordLabel = props.labels?.password || 'Password';\n const confirmPasswordLabel = props.labels?.confirmPassword || 'Repeat password';\n const phoneLabel = props.labels?.phone || 'Phone number';\n const genderLabel = props.labels?.gender || 'Title';\n const companyNameLabel = props.labels?.companyName || 'Company name';\n const vatNumberLabel = props.labels?.vatNumber || 'VAT number';\n const cocNumberLabel = props.labels?.cocNumber || 'CoC number';\n const streetLabel = props.labels?.street || 'Street';\n const numberLabel = props.labels?.number || 'Number';\n const numberExtensionLabel = props.labels?.numberExtension || 'Apt/Suite/Unit';\n const postalCodeLabel = props.labels?.postalCode || 'Postal code';\n const cityLabel = props.labels?.city || 'City';\n const countryLabel = props.labels?.country || 'Country';\n const selectCountryPlaceholder = props.labels?.selectCountry || 'Select country';\n const registeringText = props.labels?.registering || 'Registering...';\n const genderMrLabel = props.labels?.genderMr || 'Mr.';\n const genderMrsLabel = props.labels?.genderMrs || 'Mrs.';\n const genderOtherLabel = props.labels?.genderOther || 'Other';\n const userTypeLabel = props.labels?.userTypeLabel || 'Account type';\n const contactLabel = props.labels?.contactLabel || 'Company';\n const customerLabel = props.labels?.customerLabel || 'Consumer';\n const emailPlaceholder = props.labels?.emailPlaceholder || 'name@example.com';\n const passwordPlaceholder = props.labels?.passwordPlaceholder || '••••••••';\n const passwordMismatchText = props.labels?.passwordMismatch || 'Passwords do not match';\n const loginText = props.labels?.loginText || 'Already have an account?';\n const loginLinkText = props.labels?.loginLink || 'Log in';\n\n function isFieldRequired(fieldName: string): boolean {\n if (fieldName === 'companyName' && isContact) return true;\n if (!props.requiredFields) return false;\n return props.requiredFields.indexOf(fieldName) !== -1;\n }\n async function handleSubmit(e: React.FormEvent): Promise<void> {\n e.preventDefault();\n if (!effectiveUserType) {\n setError('Please select an account type.');\n return;\n }\n if (password !== confirmPassword) {\n setError(passwordMismatchText);\n return;\n }\n if (loading) return;\n if (props.beforeRegistration) {\n props.beforeRegistration();\n }\n setError('');\n\n const autoLogin = props.automaticLogin !== false;\n let result;\n if (isContact) {\n result = await registerContact({\n email,\n password,\n firstName,\n middleName,\n lastName,\n phone,\n gender,\n companyName,\n vatNumber,\n cocNumber,\n street: billingStreet,\n number: billingNumber,\n numberExtension: billingNumberExtension,\n postalCode: billingPostalCode,\n city: billingCity,\n country: billingCountry,\n deliveryStreet: sameAsDelivery ? billingStreet : deliveryStreet,\n deliveryNumber: sameAsDelivery ? billingNumber : deliveryNumber,\n deliveryNumberExtension: sameAsDelivery ? billingNumberExtension : deliveryNumberExtension,\n deliveryPostalCode: sameAsDelivery ? billingPostalCode : deliveryPostalCode,\n deliveryCity: sameAsDelivery ? billingCity : deliveryCity,\n deliveryCountry: sameAsDelivery ? billingCountry : deliveryCountry,\n sameDeliveryAsBilling: sameAsDelivery,\n }, props.preferredLanguage || 'NL', autoLogin);\n } else {\n result = await registerCustomer({\n email,\n password,\n firstName,\n middleName,\n lastName,\n phone,\n gender,\n street: billingStreet,\n number: billingNumber,\n numberExtension: billingNumberExtension,\n postalCode: billingPostalCode,\n city: billingCity,\n country: billingCountry,\n deliveryStreet: sameAsDelivery ? billingStreet : deliveryStreet,\n deliveryNumber: sameAsDelivery ? billingNumber : deliveryNumber,\n deliveryNumberExtension: sameAsDelivery ? billingNumberExtension : deliveryNumberExtension,\n deliveryPostalCode: sameAsDelivery ? billingPostalCode : deliveryPostalCode,\n deliveryCity: sameAsDelivery ? billingCity : deliveryCity,\n deliveryCountry: sameAsDelivery ? billingCountry : deliveryCountry,\n sameDeliveryAsBilling: sameAsDelivery,\n }, props.preferredLanguage || 'NL', autoLogin);\n }\n\n if (result.ok) {\n setSubmitted(true);\n // Phase D.3: the package no longer dispatches a global `userLoggedIn`\n // event — the host's `afterRegistration` callback (below) is the\n // documented hook for \"user just registered/logged in, refresh stores\".\n if (props.afterRegistration) {\n props.afterRegistration(\n (result.data.user ?? null) as Contact | Customer,\n autoLogin ? result.data.accessToken : undefined,\n autoLogin ? result.data.refreshToken : undefined,\n autoLogin ? result.data.expiresAt : undefined,\n props.cart ?? null,\n );\n }\n } else if (result.error) {\n setError(result.error);\n }\n }\n return (\n <div className=\"propeller-register-form\" data-loading={loading ? 'true' : 'false'} data-user-type={selectedUserType}>\n {resolvedTitle ? (\n <div className=\"propeller-register-form__header space-y-1 text-center mb-6\">\n <h2 className=\"propeller-register-form__title text-2xl font-bold\">{resolvedTitle}</h2>\n {props.subtitle ? <p className=\"propeller-register-form__subtitle text-sm text-muted-foreground\">{props.subtitle}</p> : null}\n </div>\n ) : null}\n {!submitted ? (\n <form className=\"space-y-6\" onSubmit={(e) => handleSubmit(e)}>\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold border-b pb-2\">{personalDetailsTitle}</h3>\n {showUserTypeSelector ? (\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium leading-none\">{userTypeLabel}</label>\n <div className=\"flex gap-3\">\n <button\n type=\"button\"\n onClick={() => {\n setSelectedUserType('Contact');\n }}\n className={\n 'flex-1 h-10 px-4 py-2 text-sm font-medium rounded-md border transition-colors ' +\n (selectedUserType === 'Contact'\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-input hover:bg-surface-hover')\n }\n >\n {contactLabel}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setSelectedUserType('Customer');\n }}\n className={\n 'flex-1 h-10 px-4 py-2 text-sm font-medium rounded-md border transition-colors ' +\n (selectedUserType === 'Customer'\n ? 'border-primary bg-primary/5 text-primary'\n : 'border-input hover:bg-surface-hover')\n }\n >\n {customerLabel}\n </button>\n </div>\n </div>\n ) : null}\n <div className=\"space-y-2\">\n <label className=\"text-sm font-medium leading-none\">{genderLabel}</label>\n <div className=\"flex gap-4\">\n <label className=\"flex items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name=\"gender\"\n value=\"M\"\n className=\"propeller-register-form__radio h-4 w-4 border-input text-primary focus:ring-primary\"\n checked={gender === Gender.M}\n onChange={() => {\n setGender(Gender.M);\n }}\n disabled={loading}\n />\n {genderMrLabel}\n </label>\n <label className=\"flex items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name=\"gender\"\n value=\"F\"\n className=\"propeller-register-form__radio h-4 w-4 border-input text-primary focus:ring-primary\"\n checked={gender === Gender.F}\n onChange={() => {\n setGender(Gender.F);\n }}\n disabled={loading}\n />\n {genderMrsLabel}\n </label>\n <label className=\"flex items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name=\"gender\"\n value=\"U\"\n className=\"propeller-register-form__radio h-4 w-4 border-input text-primary focus:ring-primary\"\n checked={gender === Gender.U}\n onChange={() => {\n setGender(Gender.U);\n }}\n disabled={loading}\n />\n {genderOtherLabel}\n </label>\n </div>\n </div>\n <div className=\"space-y-2\">\n <label htmlFor=\"register-email\" className=\"text-sm font-medium leading-none\">\n {emailLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"email\"\n id=\"register-email\"\n name=\"email\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={email}\n onChange={(e) => {\n setEmail((e.target as HTMLInputElement).value);\n }}\n placeholder={emailPlaceholder}\n required\n disabled={loading}\n />\n </div>\n {isContact ? (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-vatNumber\"\n className=\"text-sm font-medium leading-none\"\n >\n {vatNumberLabel}\n {isFieldRequired('vatNumber') ? (\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n ) : null}\n </label>\n <input\n type=\"text\"\n id=\"register-vatNumber\"\n name=\"vatNumber\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={vatNumber}\n onChange={(e) => {\n setVatNumber((e.target as HTMLInputElement).value);\n }}\n required={isFieldRequired('vatNumber')}\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-cocNumber\"\n className=\"text-sm font-medium leading-none\"\n >\n {cocNumberLabel}\n {isFieldRequired('cocNumber') ? (\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n ) : null}\n </label>\n <input\n type=\"text\"\n id=\"register-cocNumber\"\n name=\"cocNumber\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={cocNumber}\n onChange={(e) => {\n setCocNumber((e.target as HTMLInputElement).value);\n }}\n required={isFieldRequired('cocNumber')}\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-companyName\"\n className=\"text-sm font-medium leading-none\"\n >\n {companyNameLabel}\n {isFieldRequired('companyName') ? (\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n ) : null}\n </label>\n <input\n type=\"text\"\n id=\"register-companyName\"\n name=\"companyName\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={companyName}\n onChange={(e) => {\n setCompanyName((e.target as HTMLInputElement).value);\n }}\n required={isFieldRequired('companyName')}\n disabled={loading}\n />\n </div>\n </div>\n ) : null}\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label htmlFor=\"register-firstName\" className=\"text-sm font-medium leading-none\">\n {firstNameLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-firstName\"\n name=\"firstName\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={firstName}\n onChange={(e) => {\n setFirstName((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label htmlFor=\"register-middleName\" className=\"text-sm font-medium leading-none\">\n {middleNameLabel}\n </label>\n <input\n type=\"text\"\n id=\"register-middleName\"\n name=\"middleName\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={middleName}\n onChange={(e) => {\n setMiddleName((e.target as HTMLInputElement).value);\n }}\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label htmlFor=\"register-lastName\" className=\"text-sm font-medium leading-none\">\n {lastNameLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-lastName\"\n name=\"lastName\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={lastName}\n onChange={(e) => {\n setLastName((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label htmlFor=\"register-phone\" className=\"text-sm font-medium leading-none\">\n {phoneLabel}\n {isFieldRequired('phone') ? <span className=\"propeller-register-form__required text-destructive ml-1\">*</span> : null}\n </label>\n <input\n type=\"tel\"\n id=\"register-phone\"\n name=\"phone\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={phone}\n onChange={(e) => {\n setPhone((e.target as HTMLInputElement).value);\n }}\n required={isFieldRequired('phone')}\n disabled={loading}\n />\n </div>\n </div>\n </div>\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold border-b pb-2\">{billingAddressTitle}</h3>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-billingPostalCode\"\n className=\"text-sm font-medium leading-none\"\n >\n {postalCodeLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-billingPostalCode\"\n name=\"billingPostalCode\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingPostalCode}\n onChange={(e) => {\n setBillingPostalCode((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-billingStreet\"\n className=\"text-sm font-medium leading-none\"\n >\n {streetLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-billingStreet\"\n name=\"billingStreet\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingStreet}\n onChange={(e) => {\n setBillingStreet((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-billingNumber\"\n className=\"text-sm font-medium leading-none\"\n >\n {numberLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-billingNumber\"\n name=\"billingNumber\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingNumber}\n onChange={(e) => {\n setBillingNumber((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-billingNumberExtension\"\n className=\"text-sm font-medium leading-none\"\n >\n {numberExtensionLabel}\n </label>\n <input\n type=\"text\"\n id=\"register-billingNumberExtension\"\n name=\"billingNumberExtension\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingNumberExtension}\n onChange={(e) => {\n setBillingNumberExtension((e.target as HTMLInputElement).value);\n }}\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label htmlFor=\"register-billingCity\" className=\"text-sm font-medium leading-none\">\n {cityLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-billingCity\"\n name=\"billingCity\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingCity}\n onChange={(e) => {\n setBillingCity((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-billingCountry\"\n className=\"text-sm font-medium leading-none\"\n >\n {countryLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <select\n id=\"register-billingCountry\"\n name=\"billingCountry\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={billingCountry}\n onChange={(e) => {\n setBillingCountry((e.target as HTMLSelectElement).value);\n }}\n required\n disabled={loading}\n >\n <option value=\"\">{selectCountryPlaceholder}</option>\n {Object.entries(props.countries || {})?.map((entry) => (\n <option key={entry[0]} value={entry[0]}>\n {entry[1]}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold border-b pb-2\">{deliveryAddressTitle}</h3>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"checkbox\"\n id=\"register-sameAsDelivery\"\n name=\"sameAsDelivery\"\n className=\"propeller-register-form__checkbox h-4 w-4 rounded border-input text-primary focus:ring-primary\"\n checked={sameAsDelivery}\n onChange={(e) => {\n setSameAsDelivery((e.target as HTMLInputElement).checked);\n }}\n disabled={loading}\n />\n <label htmlFor=\"register-sameAsDelivery\" className=\"text-sm font-medium leading-none\">\n {sameAsDeliveryLabel}\n </label>\n </div>\n {!sameAsDelivery ? (\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryPostalCode\"\n className=\"text-sm font-medium leading-none\"\n >\n {postalCodeLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-deliveryPostalCode\"\n name=\"deliveryPostalCode\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryPostalCode}\n onChange={(e) => {\n setDeliveryPostalCode((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryStreet\"\n className=\"text-sm font-medium leading-none\"\n >\n {streetLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-deliveryStreet\"\n name=\"deliveryStreet\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryStreet}\n onChange={(e) => {\n setDeliveryStreet((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryNumber\"\n className=\"text-sm font-medium leading-none\"\n >\n {numberLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-deliveryNumber\"\n name=\"deliveryNumber\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryNumber}\n onChange={(e) => {\n setDeliveryNumber((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryNumberExtension\"\n className=\"text-sm font-medium leading-none\"\n >\n {numberExtensionLabel}\n </label>\n <input\n type=\"text\"\n id=\"register-deliveryNumberExtension\"\n name=\"deliveryNumberExtension\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryNumberExtension}\n onChange={(e) => {\n setDeliveryNumberExtension((e.target as HTMLInputElement).value);\n }}\n disabled={loading}\n />\n </div>\n </div>\n <div className=\"grid grid-cols-2 gap-3\">\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryCity\"\n className=\"text-sm font-medium leading-none\"\n >\n {cityLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"text\"\n id=\"register-deliveryCity\"\n name=\"deliveryCity\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryCity}\n onChange={(e) => {\n setDeliveryCity((e.target as HTMLInputElement).value);\n }}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-deliveryCountry\"\n className=\"text-sm font-medium leading-none\"\n >\n {countryLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <select\n id=\"register-deliveryCountry\"\n name=\"deliveryCountry\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={deliveryCountry}\n onChange={(e) => {\n setDeliveryCountry((e.target as HTMLSelectElement).value);\n }}\n required\n disabled={loading}\n >\n <option value=\"\">{selectCountryPlaceholder}</option>\n {Object.entries(props.countries || {})?.map((entry) => (\n <option key={entry[0]} value={entry[0]}>\n {entry[1]}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n ) : null}\n </div>\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold border-b pb-2\">{passwordTitle}</h3>\n <div className=\"space-y-2\">\n <label htmlFor=\"register-password\" className=\"text-sm font-medium leading-none\">\n {passwordLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"password\"\n id=\"register-password\"\n name=\"password\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={password}\n onChange={(e) => {\n setPassword((e.target as HTMLInputElement).value);\n }}\n placeholder={passwordPlaceholder}\n required\n disabled={loading}\n />\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor=\"register-confirmPassword\"\n className=\"text-sm font-medium leading-none\"\n >\n {confirmPasswordLabel}\n <span className=\"propeller-register-form__required text-destructive ml-1\">*</span>\n </label>\n <input\n type=\"password\"\n id=\"register-confirmPassword\"\n name=\"confirmPassword\"\n className=\"propeller-register-form__input flex h-10 w-full rounded-control border border-input bg-card px-3 py-2 text-sm placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50\"\n value={confirmPassword}\n onChange={(e) => {\n setConfirmPassword((e.target as HTMLInputElement).value);\n }}\n placeholder={passwordPlaceholder}\n required\n disabled={loading}\n />\n </div>\n </div>\n {error ? (\n <div className=\"propeller-register-form__error text-sm text-destructive bg-destructive/10 p-3 rounded-control\">{error}</div>\n ) : null}\n <button\n type=\"submit\"\n className=\"propeller-register-form__submit inline-flex items-center justify-center w-full h-10 px-4 py-2 text-sm font-medium text-primary-foreground bg-primary rounded-control hover:bg-primary/80 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed\"\n disabled={loading}\n >\n {loading ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-register-form__spinner animate-spin -ml-1 mr-2 h-4 w-4 text-primary-foreground\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n className=\"opacity-25\"\n />\n <path\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n className=\"opacity-75\"\n />\n </svg>\n ) : null}\n {loading ? <>{registeringText}</> : <>{resolvedButtonText}</>}\n </button>\n </form>\n ) : null}\n {submitted ? (\n <div className=\"text-center space-y-4\">\n <div className=\"flex justify-center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n className=\"propeller-register-form__success-icon h-12 w-12 text-success\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n <p className=\"propeller-register-form__success-message text-sm text-muted-foreground\">{props.labels?.successMessage || 'Your account has been created successfully.'}</p>\n </div>\n ) : null}\n {showLoginLink && !submitted ? (\n <div className=\"mt-6 border-t pt-6\">\n <div className=\"text-center\">\n <p className=\"propeller-register-form__login-prompt text-sm text-muted-foreground mb-2\">{loginText}</p>\n <button\n type=\"button\"\n className=\"text-sm text-primary hover:underline\"\n onClick={() => {\n if (props.onLoginClick) props.onLoginClick();\n }}\n >\n {loginLinkText}\n </button>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default RegisterForm;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: browser-only APIs (window/document/storage).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\nimport { useState, useEffect, useRef } from 'react';\nimport { GraphQLClient, Product, Cluster, Contact, Customer } from '@propeller-commerce/propeller-sdk-v2';\nimport { useProductSearch } from '../composables/react/useProductSearch';\nimport { useInfraProps } from '../composables/react/useInfraProps';\nimport { getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { formatPrice } from '@propeller-commerce/propeller-v2-core-ui';\n\nexport interface SearchBarResult {\n /** Unique identifier */\n id: number | string;\n /** Display name */\n name: string;\n /** SKU code */\n sku?: string;\n /** Price value */\n price?: number;\n /** Image URL */\n imageUrl?: string;\n /** URL path to navigate to */\n url?: string;\n /** Whether this is a cluster (vs product) */\n isCluster?: boolean;\n}\n\nexport interface SearchBarProps {\n /** Propeller SDK GraphQL client. Resolved from PropellerProvider when omitted. */\n graphqlClient?: GraphQLClient;\n\n /** The currently logged in user (Contact or Customer) */\n user?: Contact | Customer | null;\n\n /** Language code for search requests */\n language?: string;\n\n /** Placeholder text for the search input */\n placeholder?: string;\n\n /** Minimum characters before search triggers */\n minSearchLength?: number;\n\n /** Debounce delay in milliseconds */\n debounceMs?: number;\n\n /** Maximum number of results to show in dropdown */\n maxResults?: number;\n\n /** Fallback image URL when product has no image */\n noImageUrl?: string;\n\n /** Fires when the search form is submitted (Enter key). Receives the search term. */\n onSubmit?: (term: string) => void;\n\n /** Fires when a result item is clicked. Receives the result object. */\n onResultClick?: (result: SearchBarResult) => void;\n\n /** Fires when \"View all results\" is clicked. Receives the search term. */\n onViewAllClick?: (term: string) => void;\n\n /** Custom price formatting function */\n formatPrice?: (price: number) => string;\n\n /** Currency symbol for prices. Resolved from PropellerProvider when omitted; defaults to '€'. */\n currency?: string;\n\n /** Labels for the component */\n labels?: Record<string, string>;\n\n /** Additional class name for the container */\n containerClassName?: string;\n\n /** Tax zone used for price calculation. Defaults to 'NL'. */\n taxZone?: string;\n\n /**\n * Configuration object providing:\n * imageSearchFiltersGrid, imageVariantFiltersMedium — passed to CategoryService\n * baseCategoryId — used when querying by term or brand\n * urls.getProductUrl / urls.getClusterUrl — for card URL generation\n */\n configuration?: any;\n\n /**\n * Active company ID from the company switcher.\n */\n companyId?: number;\n\n /**\n * Bump this counter to clear the search input from outside (e.g. on route\n * change). Each unique value triggers a one-time reset of the local term.\n */\n clearSignal?: number;\n}\n\nfunction mapToSearchBarResult(item: Product | Cluster): SearchBarResult {\n const isCluster = 'clusterId' in item;\n const displayItem = isCluster ? (item as Cluster).defaultProduct : item;\n const id = isCluster ? (item as Cluster).clusterId : (item as Product).productId;\n const slug = item.slugs?.[0]?.value || '';\n const url = isCluster ? '/cluster/' + id + '/' + slug : '/product/' + id + '/' + slug;\n return {\n id,\n name: item.names?.[0]?.value || 'Product',\n sku: item.sku || displayItem?.sku || '',\n price: displayItem?.price?.gross || 0,\n imageUrl: displayItem?.media?.images?.items?.[0]?.imageVariants?.[0]?.url || '',\n url,\n isCluster,\n };\n}\n\n/**\n * Renders a product search input with a debounced live-results dropdown and a\n * \"View all results\" link.\n *\n * @remarks Uses {@link useProductSearch} for the live search query.\n */\nfunction SearchBar(rawProps: SearchBarProps) {\n // Explicit props win; otherwise infra is resolved from <PropellerProvider>.\n const props = useInfraProps(rawProps);\n const [showDropdown, setShowDropdown] = useState(false);\n const [localTerm, setLocalTerm] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n\n const minLength = props.minSearchLength !== undefined ? props.minSearchLength : 3;\n const maxResults = props.maxResults !== undefined ? props.maxResults : 8;\n\n const { search, searchResults, searchItemsFound, searchLoading } = useProductSearch({\n graphqlClient: props.graphqlClient,\n language: props.language,\n configuration: props.configuration || {},\n companyId: props.companyId,\n });\n\n const results: SearchBarResult[] = searchResults\n .slice(0, maxResults)\n .map((item) => mapToSearchBarResult(item as Product | Cluster));\n\n const itemsFound = searchItemsFound;\n\n \n\n function formatItemPrice(price: number): string {\n if (props.formatPrice) {\n return props.formatPrice(price);\n }\n return formatPrice(price || 0, { symbol: props.currency ?? '\\u20AC' });\n }\n\n function noImageUrl(): string {\n return props.noImageUrl || '';\n }\n\n function handleInputChange(value: string) {\n setLocalTerm(value);\n if (value.length < minLength) {\n setShowDropdown(false);\n return;\n }\n search(value);\n setShowDropdown(true);\n }\n\n // Keep dropdown open when results arrive\n useEffect(() => {\n if (searchResults.length > 0) {\n setShowDropdown(true);\n }\n }, [searchResults]);\n\n // Parents bump `clearSignal` (e.g. on route change) to reset the input. We\n // also stop any in-flight search and close the dropdown.\n useEffect(() => {\n if (props.clearSignal === undefined) return;\n setLocalTerm('');\n setShowDropdown(false);\n search('');\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.clearSignal]);\n\n function handleSubmit(e: any) {\n e.preventDefault();\n const term = localTerm.trim();\n if (props.onSubmit) {\n props.onSubmit(term);\n setShowDropdown(false);\n }\n }\n\n function handleResultClick(result: SearchBarResult) {\n if (props.onResultClick) {\n props.onResultClick(result);\n }\n setShowDropdown(false);\n setLocalTerm('');\n }\n\n function handleViewAllClick() {\n if (props.onViewAllClick) {\n props.onViewAllClick(localTerm);\n }\n setShowDropdown(false);\n }\n\n // Click-outside to close dropdown\n useEffect(() => {\n const listener = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setShowDropdown(false);\n }\n };\n document.addEventListener('mousedown', listener);\n return () => document.removeEventListener('mousedown', listener);\n }, []);\n\n return (\n <div\n ref={containerRef}\n data-search-bar\n className={`propeller-search-bar ${props.containerClassName || 'relative flex-1 max-w-2xl mx-8'}`}\n data-open={showDropdown ? 'true' : 'false'}\n >\n <form className=\"propeller-search-bar__form\" onSubmit={(e) => handleSubmit(e)}>\n <div className=\"propeller-search-bar__input-wrapper relative\">\n <button\n type=\"submit\"\n className=\"propeller-search-bar__submit absolute left-3 top-1/2 transform -translate-y-1/2 p-0 bg-transparent border-none cursor-pointer\"\n >\n <svg\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n className=\"propeller-search-bar__submit-icon w-5 h-5 text-foreground-subtle hover:text-foreground\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.35-4.35\" />\n </svg>\n </button>\n <input\n type=\"search\"\n autoComplete=\"off\"\n className=\"propeller-search-bar__input w-full pl-10 pr-10 py-2 bg-white/95 border border-white/20 rounded-container focus:outline-none focus:ring-2 focus:ring-secondary placeholder:text-muted-foreground\"\n placeholder={props.placeholder || 'Search products...'}\n value={localTerm}\n onChange={(e) => handleInputChange((e.target as HTMLInputElement).value)}\n />\n {searchLoading ? (\n <div className=\"propeller-search-bar__spinner-wrapper absolute right-3 top-1/2 transform -translate-y-1/2\">\n <div className=\"propeller-search-bar__spinner animate-spin rounded-full h-5 w-5 border-b-2 border-primary\" />\n </div>\n ) : null}\n </div>\n </form>\n {showDropdown ? (\n <div className=\"propeller-search-bar__dropdown absolute top-full left-0 right-0 mt-2 bg-card rounded-container shadow-xl border border-border z-50 flex flex-col max-h-96\">\n {results.length > 0 ? (\n <>\n <div className=\"propeller-search-bar__results flex-1 overflow-y-auto\">\n {results?.map((result, index) => (\n <div\n className=\"propeller-search-bar__result flex items-center gap-4 p-3 hover:bg-surface-hover cursor-pointer border-b border-border-subtle last:border-b-0\"\n key={result.id + '-' + index}\n onClick={(event) => handleResultClick(result)}\n >\n {result.imageUrl || noImageUrl() ? (\n <div className=\"propeller-search-bar__result-media relative w-16 h-16 flex-shrink-0\">\n <img\n className=\"propeller-search-bar__result-image w-full h-full object-contain\"\n src={result.imageUrl || noImageUrl()}\n alt={result.name}\n />\n </div>\n ) : null}\n <div className=\"flex-1 min-w-0\">\n <div className=\"propeller-search-bar__result-name font-semibold truncate\">{result.name}</div>\n {result.sku ? (\n <div className=\"propeller-search-bar__result-sku text-sm text-muted-foreground\">SKU: {result.sku}</div>\n ) : null}\n </div>\n {result.price !== undefined && result.price !== null ? (\n <div className=\"propeller-search-bar__result-price text-sm font-semibold text-foreground flex-shrink-0\">\n {formatItemPrice(result.price!)}\n </div>\n ) : null}\n </div>\n ))}\n </div>\n {itemsFound > results.length ? (\n <div\n className=\"propeller-search-bar__view-all flex-shrink-0 p-3 text-center text-primary hover:bg-primary/5 cursor-pointer font-semibold border-t border-border bg-card rounded-b-container\"\n onClick={(event) => handleViewAllClick()}\n >\n {getLabel(props.labels, 'viewAll', 'View all results')} ({itemsFound})\n </div>\n ) : null}\n </>\n ) : null}\n {results.length === 0 && localTerm.length >= minLength && !searchLoading ? (\n <div className=\"propeller-search-bar__empty p-4 text-center text-muted-foreground\">\n {getLabel(props.labels, 'noResults', 'No products found for')} &quot;{localTerm}&quot;\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default SearchBar;\n","'use client';\n/**\n * @rsc-blocked — Client-only component: interactive state (useState/useReducer).\n * Must be rendered inside (or below) a Client Component boundary; cannot be\n * imported directly into a React Server Component. The 'use client' header\n * above marks this boundary to Next.js.\n */\nimport * as React from 'react';\n\n// Note: useState/useEffect were used for a hydration-gate (`isMounted`) that's\n// unnecessary on this 'use client' component — see git history pre-2026-05-20.\nimport { Contact, Customer, Company, Address } from '@propeller-commerce/propeller-sdk-v2';\nimport { getCountryName as _getCountryName, getLabel } from '@propeller-commerce/propeller-v2-core-ui';\nimport { useInfraProps } from '../composables/react/useInfraProps';\n\nexport interface UserDetailsProps {\n /** The currently logged in user (Contact or Customer). Resolved from `<PropellerProvider>` when not passed explicitly. */\n user?: Contact | Customer | null;\n\n /**\n * The currently active company\n */\n activeCompany: Company | null;\n\n /**\n * Display basic company information for the default company if the user is Contact\n * @default true\n */\n showCompanyInfo?: boolean;\n\n /**\n * Display a list of all companies if the user is Contact\n * @default false\n */\n listAllContactCompanies?: boolean;\n\n /**\n * Display details of the user's default invoice address.\n * @default true\n */\n showDefaultInvoiceAddress?: boolean;\n\n /**\n * Display details of the user's default delivery address.\n * @default false\n */\n showDefaultDeliveryAddress?: boolean;\n\n /** Country code-to-name mapping for address display */\n countries?: {\n code: string;\n name: string;\n }[];\n\n /** Translated labels keyed by the slugs used inside the component (see\n * `getLabel` calls). Missing keys fall back to the English defaults. */\n labels?: Record<string, string>;\n}\n// Pure address helpers — hoisted to module scope; no `props` dependencies.\nconst getAddressName = (addr: Address): string =>\n [addr.firstName, addr.middleName, addr.lastName].filter(Boolean).join(' ');\nconst getAddressLine1 = (addr: Address): string =>\n [addr.street, addr.number, addr.numberExtension].filter(Boolean).join(' ');\nconst getAddressLine2 = (addr: Address): string =>\n [addr.postalCode, addr.city].filter(Boolean).join(' ');\n\n/**\n * Renders a read-only profile panel showing the user's personal information,\n * company details (for Contacts) and default invoice/delivery addresses.\n */\nfunction UserDetails(rawProps: UserDetailsProps) {\n const props = useInfraProps(rawProps);\n const isContact = props.user != null && 'company' in props.user;\n const name = props.user && props.user.firstName\n ? [props.user.firstName, props.user.lastName].filter(Boolean).join(' ')\n : getLabel(props.labels, 'userFallback', 'User');\n const activeCompany: Company | null = isContact ? props.activeCompany : null;\n const companies: Company[] = (() => {\n if (!isContact) return [];\n const contact = props.user as Contact;\n if (contact.companies?.items && contact.companies.items.length > 0) {\n return contact.companies.items;\n }\n return contact.company ? [contact.company] : [];\n })();\n const allAddresses: Address[] = isContact\n ? activeCompany?.addresses || []\n : ((props.user as Customer)?.addresses || []);\n const defaultInvoiceAddress: Address | null =\n allAddresses.find((a: Address) => a.type === 'invoice' && a.isDefault === 'Y') ?? null;\n const defaultDeliveryAddress: Address | null =\n allAddresses.find((a: Address) => a.type === 'delivery' && a.isDefault === 'Y') ?? null;\n const getCountryName = (code: string): string => _getCountryName(code, props.countries);\n const shouldShowCompanyInfo = props.showCompanyInfo !== false && isContact;\n const shouldListCompanies = props.listAllContactCompanies === true && isContact;\n const shouldShowInvoiceAddress = props.showDefaultInvoiceAddress !== false;\n const shouldShowDeliveryAddress = props.showDefaultDeliveryAddress === true;\n return (\n <div className=\"propeller-user-details space-y-6\">\n <div className=\"propeller-user-details__section propeller-user-details__section--personal rounded-container bg-card text-card-foreground shadow-sm\">\n <div className=\"propeller-user-details__section-header p-6 pb-2\">\n <h3 className=\"propeller-user-details__section-title text-lg font-semibold\">{getLabel(props.labels, 'personalInformation', 'Personal Information')}</h3>\n </div>\n <div className=\"propeller-user-details__section-body p-6 pt-2 space-y-4\">\n <div className=\"propeller-user-details__field grid grid-cols-1 gap-1\">\n <label className=\"propeller-user-details__field-label text-xs font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'nameLabel', 'Name')}\n </label>\n <div className=\"propeller-user-details__field-value font-medium\">{name}</div>\n </div>\n <div className=\"propeller-user-details__field grid grid-cols-1 gap-1\">\n <label className=\"propeller-user-details__field-label text-xs font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'emailLabel', 'Email')}\n </label>\n <div className=\"propeller-user-details__field-value font-medium\">{props.user?.email}</div>\n </div>\n </div>\n </div>\n {shouldShowCompanyInfo && activeCompany ? (\n <div className=\"propeller-user-details__section propeller-user-details__section--company rounded-container bg-card text-card-foreground shadow-sm\">\n <div className=\"propeller-user-details__section-header p-6 pb-2\">\n <h3 className=\"propeller-user-details__section-title text-lg font-semibold\">{getLabel(props.labels, 'companyInformation', 'Company Information')}</h3>\n </div>\n <div className=\"propeller-user-details__section-body p-6 pt-2 space-y-4\">\n <div className=\"propeller-user-details__field grid grid-cols-1 gap-1\">\n <label className=\"propeller-user-details__field-label text-xs font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'companyNameLabel', 'Company Name')}\n </label>\n <div className=\"propeller-user-details__field-value font-medium\">{activeCompany?.name}</div>\n </div>\n {activeCompany?.taxNumber ? (\n <div className=\"propeller-user-details__field grid grid-cols-1 gap-1\">\n <label className=\"propeller-user-details__field-label text-xs font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'taxNumberLabel', 'Tax Number')}\n </label>\n <div className=\"propeller-user-details__field-value font-medium\">{activeCompany?.taxNumber}</div>\n </div>\n ) : null}\n {activeCompany?.cocNumber ? (\n <div className=\"propeller-user-details__field grid grid-cols-1 gap-1\">\n <label className=\"propeller-user-details__field-label text-xs font-semibold text-muted-foreground uppercase tracking-wide\">\n {getLabel(props.labels, 'cocNumberLabel', 'CoC Number')}\n </label>\n <div className=\"propeller-user-details__field-value font-medium\">{activeCompany?.cocNumber}</div>\n </div>\n ) : null}\n </div>\n </div>\n ) : null}\n {shouldListCompanies && companies.length > 0 ? (\n <div className=\"propeller-user-details__section propeller-user-details__section--companies rounded-container bg-card text-card-foreground shadow-sm\">\n <div className=\"propeller-user-details__section-header p-6 pb-2\">\n <h3 className=\"propeller-user-details__section-title text-lg font-semibold\">{getLabel(props.labels, 'companies', 'Companies')}</h3>\n </div>\n <div className=\"propeller-user-details__section-body p-6 pt-2\">\n <ul className=\"propeller-user-details__companies space-y-2\">\n {companies?.map((company) => (\n <li\n key={String(company.companyId)}\n data-active={activeCompany?.companyId === company.companyId ? 'true' : 'false'}\n className={`propeller-user-details__company flex items-center gap-2 py-2 px-3 rounded-control ${activeCompany?.companyId === company.companyId ? 'bg-primary/10 font-semibold text-primary' : 'text-foreground'}`}\n >\n <span className=\"propeller-user-details__company-name truncate\">{company.name}</span>\n {activeCompany?.companyId === company.companyId ? (\n <span className=\"propeller-user-details__company-badge text-xs bg-primary/20 text-primary px-2 py-0.5 rounded-full\">\n {getLabel(props.labels, 'activeBadge', 'Active')}\n </span>\n ) : null}\n </li>\n ))}\n </ul>\n </div>\n </div>\n ) : null}\n {shouldShowInvoiceAddress || shouldShowDeliveryAddress ? (\n <div className=\"propeller-user-details__section propeller-user-details__section--addresses rounded-container bg-card text-card-foreground shadow-sm\">\n <div className=\"propeller-user-details__section-header p-6 pb-2\">\n <h3 className=\"propeller-user-details__section-title text-lg font-semibold\">{getLabel(props.labels, 'defaultAddresses', 'Default Addresses')}</h3>\n </div>\n <div className=\"propeller-user-details__section-body p-6 pt-2\">\n <div className=\"propeller-user-details__addresses grid grid-cols-1 md:grid-cols-2 gap-6\">\n {shouldShowInvoiceAddress ? (\n <div className=\"propeller-user-details__address-group space-y-3\" data-address=\"invoice\">\n <h4 className=\"propeller-user-details__address-title text-base font-bold\">{getLabel(props.labels, 'invoiceAddress', 'Invoice Address')}</h4>\n {defaultInvoiceAddress ? (\n <div className=\"propeller-user-details__address-card bg-card p-4 rounded-container shadow-sm border border-border\">\n {defaultInvoiceAddress?.company ? (\n <div className=\"propeller-user-details__address-company font-bold text-lg mb-1\">\n {defaultInvoiceAddress?.company}\n </div>\n ) : null}\n {getAddressName(defaultInvoiceAddress!) ? (\n <div className=\"propeller-user-details__address-name font-medium mb-1\">\n {getAddressName(defaultInvoiceAddress!)}\n </div>\n ) : null}\n <div className=\"propeller-user-details__address-line text-muted-foreground\">\n {getAddressLine1(defaultInvoiceAddress!)}\n </div>\n <div className=\"propeller-user-details__address-line text-muted-foreground\">\n {getAddressLine2(defaultInvoiceAddress!)}\n </div>\n {defaultInvoiceAddress?.country ? (\n <div className=\"propeller-user-details__address-country text-muted-foreground\">\n {getCountryName(defaultInvoiceAddress?.country || '')}\n </div>\n ) : null}\n </div>\n ) : null}\n {!defaultInvoiceAddress ? (\n <p className=\"propeller-user-details__address-empty text-muted-foreground italic\">{getLabel(props.labels, 'noInvoiceAddress', 'No invoice address found')}</p>\n ) : null}\n </div>\n ) : null}\n {shouldShowDeliveryAddress ? (\n <div className=\"propeller-user-details__address-group space-y-3\" data-address=\"delivery\">\n <h4 className=\"propeller-user-details__address-title text-base font-bold\">{getLabel(props.labels, 'deliveryAddress', 'Delivery Address')}</h4>\n {defaultDeliveryAddress ? (\n <div className=\"propeller-user-details__address-card bg-card p-4 rounded-container shadow-sm border border-border\">\n {defaultDeliveryAddress?.company ? (\n <div className=\"propeller-user-details__address-company font-bold text-lg mb-1\">\n {defaultDeliveryAddress?.company}\n </div>\n ) : null}\n {getAddressName(defaultDeliveryAddress!) ? (\n <div className=\"propeller-user-details__address-name font-medium mb-1\">\n {getAddressName(defaultDeliveryAddress!)}\n </div>\n ) : null}\n <div className=\"propeller-user-details__address-line text-muted-foreground\">\n {getAddressLine1(defaultDeliveryAddress!)}\n </div>\n <div className=\"propeller-user-details__address-line text-muted-foreground\">\n {getAddressLine2(defaultDeliveryAddress!)}\n </div>\n {defaultDeliveryAddress?.country ? (\n <div className=\"propeller-user-details__address-country text-muted-foreground\">\n {getCountryName(defaultDeliveryAddress?.country || '')}\n </div>\n ) : null}\n </div>\n ) : null}\n {!defaultDeliveryAddress ? (\n <p className=\"propeller-user-details__address-empty text-muted-foreground italic\">{getLabel(props.labels, 'noDeliveryAddress', 'No delivery address found')}</p>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n ) : null}\n </div>\n );\n}\n\nexport default UserDetails;\n"]}